Kaydet (Commit) 7ec3baef authored tarafından Xisco Fauli's avatar Xisco Fauli Kaydeden (comit) Xisco Faulí

Convert remaining SdrHint to static_cast

follow-up of 10c93414

Change-Id: I2085173dffd71dbbc68a0574400bebe132626dd9
Reviewed-on: https://gerrit.libreoffice.org/71284Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
Reviewed-by: 's avatarXisco Faulí <xiscofauli@libreoffice.org>
üst 98213754
......@@ -323,7 +323,7 @@ void DrawViewWrapper::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
if( pSdrModel && pSdrModel->isLocked() )
return;
const SdrHint* pSdrHint = dynamic_cast< const SdrHint* >( &rHint );
const SdrHint* pSdrHint = ( rHint.GetId() == SfxHintId::ThisIsAnSdrHint ? static_cast<const SdrHint*>(&rHint) : nullptr );
//#i76053# do nothing when only changes on the hidden draw page were made ( e.g. when the symbols for the dialogs are created )
SdrPageView* pSdrPageView = GetPageView();
......
......@@ -298,7 +298,7 @@ namespace accessibility
void AccessibleEmptyEditSource::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
{
const SdrHint* pSdrHint = dynamic_cast<const SdrHint*>( &rHint );
const SdrHint* pSdrHint = ( rHint.GetId() == SfxHintId::ThisIsAnSdrHint ? static_cast<const SdrHint*>(&rHint) : nullptr );
if( pSdrHint && pSdrHint->GetKind() == SdrHintKind::BeginEdit &&
&mrObj == pSdrHint->GetObject() && mpEditSource.get() )
......
......@@ -1132,17 +1132,49 @@ namespace accessibility
{
const SfxHint& rHint = *pHint;
// determine hint type
const SdrHint* pSdrHint = dynamic_cast<const SdrHint*>( &rHint );
const TextHint* pTextHint = dynamic_cast<const TextHint*>( &rHint );
const SvxViewChangedHint* pViewHint = dynamic_cast<const SvxViewChangedHint*>( &rHint );
const SvxEditSourceHint* pEditSourceHint = dynamic_cast<const SvxEditSourceHint*>( &rHint );
try
{
const sal_Int32 nParas = GetTextForwarder().GetParagraphCount();
if( pEditSourceHint )
if (rHint.GetId() == SfxHintId::ThisIsAnSdrHint)
{
const SdrHint* pSdrHint = static_cast< const SdrHint* >( &rHint );
switch( pSdrHint->GetKind() )
{
case SdrHintKind::BeginEdit:
{
if(!IsActive())
{
break;
}
// change children state
maParaManager.SetActive();
// per definition, edit mode text has the focus
SetFocus( true );
break;
}
case SdrHintKind::EndEdit:
{
// focused child now loses focus
ESelection aSelection;
if( GetEditViewForwarder().GetSelection( aSelection ) )
SetChildFocus( aSelection.nEndPara, false );
// change children state
maParaManager.SetActive( false );
maLastSelection = ESelection( EE_PARA_NOT_FOUND, EE_INDEX_NOT_FOUND,
EE_PARA_NOT_FOUND, EE_INDEX_NOT_FOUND);
break;
}
default:
break;
}
}
else if( const SvxEditSourceHint* pEditSourceHint = dynamic_cast<const SvxEditSourceHint*>( &rHint ) )
{
switch( pEditSourceHint->GetId() )
{
......@@ -1176,8 +1208,10 @@ namespace accessibility
default: break;
}
}
else if( pTextHint )
else if( const TextHint* pTextHint = dynamic_cast<const TextHint*>( &rHint ) )
{
const sal_Int32 nParas = GetTextForwarder().GetParagraphCount();
switch( pTextHint->GetId() )
{
case SfxHintId::TextModified:
......@@ -1226,48 +1260,12 @@ namespace accessibility
UpdateVisibleChildren();
UpdateBoundRect();
}
else if( pViewHint )
else if ( dynamic_cast<const SvxViewChangedHint*>( &rHint ) )
{
// just check visibility
UpdateVisibleChildren();
UpdateBoundRect();
}
else if( pSdrHint )
{
switch( pSdrHint->GetKind() )
{
case SdrHintKind::BeginEdit:
{
if(!IsActive())
{
break;
}
// change children state
maParaManager.SetActive();
// per definition, edit mode text has the focus
SetFocus( true );
break;
}
case SdrHintKind::EndEdit:
{
// focused child now loses focus
ESelection aSelection;
if( GetEditViewForwarder().GetSelection( aSelection ) )
SetChildFocus( aSelection.nEndPara, false );
// change children state
maParaManager.SetActive( false );
maLastSelection = ESelection( EE_PARA_NOT_FOUND, EE_INDEX_NOT_FOUND,
EE_PARA_NOT_FOUND, EE_INDEX_NOT_FOUND);
break;
}
default:
break;
}
}
// it's VITAL to keep the SfxSimpleHint last! It's the base of some classes above!
else if( rHint.GetId() == SfxHintId::Dying)
{
......@@ -1306,22 +1304,23 @@ namespace accessibility
// occurrence to avoid unnecessary dynamic_cast. Note that
// SvxEditSourceHint is derived from TextHint, so has to be checked
// before that.
if( const SvxViewChangedHint* pViewHint = dynamic_cast<const SvxViewChangedHint*>( &rHint ) )
{
// process visibility right away, if not within an
// open EE notification frame. Otherwise, event
// processing would be delayed until next EE
// notification sequence.
maEventQueue.Append( *pViewHint );
}
else if( const SdrHint* pSdrHint = dynamic_cast<const SdrHint*>( &rHint ) )
if (rHint.GetId() == SfxHintId::ThisIsAnSdrHint)
{
const SdrHint* pSdrHint = static_cast< const SdrHint* >( &rHint );
// process drawing layer events right away, if not
// within an open EE notification frame. Otherwise,
// event processing would be delayed until next EE
// notification sequence.
maEventQueue.Append( *pSdrHint );
}
else if( const SvxViewChangedHint* pViewHint = dynamic_cast<const SvxViewChangedHint*>( &rHint ) )
{
// process visibility right away, if not within an
// open EE notification frame. Otherwise, event
// processing would be delayed until next EE
// notification sequence.
maEventQueue.Append( *pViewHint );
}
else if( const SvxEditSourceHint* pEditSourceHint = dynamic_cast<const SvxEditSourceHint*>( &rHint ) )
{
// EditEngine should emit TEXT_SELECTION_CHANGED events (#i27299#)
......
......@@ -1609,7 +1609,8 @@ void SdrEdgeObj::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
SdrTextObj::Notify(rBC,rHint);
if (nNotifyingCount==0) { // a locking flag
nNotifyingCount++;
const SdrHint* pSdrHint = dynamic_cast<const SdrHint*>(&rHint);
const SdrHint* pSdrHint = ( rHint.GetId() == SfxHintId::ThisIsAnSdrHint ? static_cast<const SdrHint*>(&rHint) : nullptr );
if (bDataChg) { // StyleSheet changed
ImpSetAttrToEdgeInfo(); // when changing templates, copy values from Pool to aEdgeInfo
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment