Kaydet (Commit) 9381ca57 authored tarafından Caolán McNamara's avatar Caolán McNamara

Related: tdf#94814 some cleanup of static_cast following dynamic_cast

to the same type

Change-Id: I4d125b7669a89b96785cb60f967352dce5e2e720
üst 74615356
...@@ -241,13 +241,14 @@ void SwUndoDrawGroup::UndoImpl(::sw::UndoRedoContext &) ...@@ -241,13 +241,14 @@ void SwUndoDrawGroup::UndoImpl(::sw::UndoRedoContext &)
pContact->ConnectToLayout(); pContact->ConnectToLayout();
// #i45718# - follow-up of #i35635# move object to visible layer // #i45718# - follow-up of #i35635# move object to visible layer
pContact->MoveObjToVisibleLayer( pObj ); pContact->MoveObjToVisibleLayer( pObj );
SwDrawFrameFormat* pDrawFrameFormat = dynamic_cast<SwDrawFrameFormat*>(rSave.pFormat);
// #i45952# - notify that position attributes are already set // #i45952# - notify that position attributes are already set
OSL_ENSURE( dynamic_cast< const SwDrawFrameFormat *>( rSave.pFormat ) != nullptr, OSL_ENSURE(pDrawFrameFormat,
"<SwUndoDrawGroup::Undo(..)> - wrong type of frame format for drawing object" ); "<SwUndoDrawGroup::Undo(..)> - wrong type of frame format for drawing object");
if ( dynamic_cast< const SwDrawFrameFormat *>( rSave.pFormat ) != nullptr ) if (pDrawFrameFormat)
{ pDrawFrameFormat->PosAttrSet();
static_cast<SwDrawFrameFormat*>(rSave.pFormat)->PosAttrSet();
}
} }
} }
...@@ -288,13 +289,14 @@ void SwUndoDrawGroup::RedoImpl(::sw::UndoRedoContext &) ...@@ -288,13 +289,14 @@ void SwUndoDrawGroup::RedoImpl(::sw::UndoRedoContext &)
pContact->ConnectToLayout(); pContact->ConnectToLayout();
// #i45718# - follow-up of #i35635# move object to visible layer // #i45718# - follow-up of #i35635# move object to visible layer
pContact->MoveObjToVisibleLayer( pObjArr->pObj ); pContact->MoveObjToVisibleLayer( pObjArr->pObj );
SwDrawFrameFormat* pDrawFrameFormat = dynamic_cast<SwDrawFrameFormat*>(pObjArr->pFormat);
// #i45952# - notify that position attributes are already set // #i45952# - notify that position attributes are already set
OSL_ENSURE( dynamic_cast< const SwDrawFrameFormat *>( pObjArr->pFormat ) != nullptr, OSL_ENSURE(pDrawFrameFormat,
"<SwUndoDrawGroup::Undo(..)> - wrong type of frame format for drawing object" ); "<SwUndoDrawGroup::Undo(..)> - wrong type of frame format for drawing object");
if ( dynamic_cast< const SwDrawFrameFormat *>( pObjArr->pFormat ) != nullptr ) if (pDrawFrameFormat)
{ pDrawFrameFormat->PosAttrSet();
static_cast<SwDrawFrameFormat*>(pObjArr->pFormat)->PosAttrSet();
}
} }
void SwUndoDrawGroup::AddObj( sal_uInt16 nPos, SwDrawFrameFormat* pFormat, SdrObject* pObj ) void SwUndoDrawGroup::AddObj( sal_uInt16 nPos, SwDrawFrameFormat* pFormat, SdrObject* pObj )
...@@ -386,13 +388,14 @@ void SwUndoDrawUnGroup::UndoImpl(::sw::UndoRedoContext & rContext) ...@@ -386,13 +388,14 @@ void SwUndoDrawUnGroup::UndoImpl(::sw::UndoRedoContext & rContext)
pContact->ConnectToLayout(); pContact->ConnectToLayout();
// #i45718# - follow-up of #i35635# move object to visible layer // #i45718# - follow-up of #i35635# move object to visible layer
pContact->MoveObjToVisibleLayer( pObjArr->pObj ); pContact->MoveObjToVisibleLayer( pObjArr->pObj );
SwDrawFrameFormat* pDrawFrameFormat = dynamic_cast<SwDrawFrameFormat*>(pObjArr->pFormat);
// #i45952# - notify that position attributes are already set // #i45952# - notify that position attributes are already set
OSL_ENSURE( dynamic_cast< const SwDrawFrameFormat *>( pObjArr->pFormat ) != nullptr, OSL_ENSURE(pDrawFrameFormat,
"<SwUndoDrawGroup::Undo(..)> - wrong type of frame format for drawing object" ); "<SwUndoDrawGroup::Undo(..)> - wrong type of frame format for drawing object");
if ( dynamic_cast< const SwDrawFrameFormat *>( pObjArr->pFormat ) != nullptr ) if (pDrawFrameFormat)
{ pDrawFrameFormat->PosAttrSet();
static_cast<SwDrawFrameFormat*>(pObjArr->pFormat)->PosAttrSet();
}
} }
void SwUndoDrawUnGroup::RedoImpl(::sw::UndoRedoContext &) void SwUndoDrawUnGroup::RedoImpl(::sw::UndoRedoContext &)
...@@ -425,13 +428,13 @@ void SwUndoDrawUnGroup::RedoImpl(::sw::UndoRedoContext &) ...@@ -425,13 +428,13 @@ void SwUndoDrawUnGroup::RedoImpl(::sw::UndoRedoContext &)
::lcl_RestoreAnchor( rSave.pFormat, rSave.nNodeIdx ); ::lcl_RestoreAnchor( rSave.pFormat, rSave.nNodeIdx );
rFlyFormats.push_back( rSave.pFormat ); rFlyFormats.push_back( rSave.pFormat );
SwDrawFrameFormat* pDrawFrameFormat = dynamic_cast<SwDrawFrameFormat*>(rSave.pFormat);
// #i45952# - notify that position attributes are already set // #i45952# - notify that position attributes are already set
OSL_ENSURE( dynamic_cast< const SwDrawFrameFormat *>( rSave.pFormat ) != nullptr, OSL_ENSURE(pDrawFrameFormat,
"<SwUndoDrawGroup::Undo(..)> - wrong type of frame format for drawing object" ); "<SwUndoDrawGroup::Undo(..)> - wrong type of frame format for drawing object" );
if ( dynamic_cast< const SwDrawFrameFormat *>( rSave.pFormat ) != nullptr ) if (pDrawFrameFormat)
{ pDrawFrameFormat->PosAttrSet();
static_cast<SwDrawFrameFormat*>(rSave.pFormat)->PosAttrSet();
}
} }
} }
...@@ -525,13 +528,14 @@ void SwUndoDrawDelete::UndoImpl(::sw::UndoRedoContext & rContext) ...@@ -525,13 +528,14 @@ void SwUndoDrawDelete::UndoImpl(::sw::UndoRedoContext & rContext)
pContact->_Changed( *pObj, SDRUSERCALL_INSERTED, NULL ); pContact->_Changed( *pObj, SDRUSERCALL_INSERTED, NULL );
// #i45718# - follow-up of #i35635# move object to visible layer // #i45718# - follow-up of #i35635# move object to visible layer
pContact->MoveObjToVisibleLayer( pObj ); pContact->MoveObjToVisibleLayer( pObj );
SwDrawFrameFormat* pDrawFrameFormat = dynamic_cast<SwDrawFrameFormat*>(rSave.pFormat);
// #i45952# - notify that position attributes are already set // #i45952# - notify that position attributes are already set
OSL_ENSURE( dynamic_cast< const SwDrawFrameFormat *>( rSave.pFormat ) != nullptr, OSL_ENSURE(pDrawFrameFormat,
"<SwUndoDrawGroup::Undo(..)> - wrong type of frame format for drawing object" ); "<SwUndoDrawGroup::Undo(..)> - wrong type of frame format for drawing object");
if ( dynamic_cast< const SwDrawFrameFormat *>( rSave.pFormat ) != nullptr ) if (pDrawFrameFormat)
{ pDrawFrameFormat->PosAttrSet();
static_cast<SwDrawFrameFormat*>(rSave.pFormat)->PosAttrSet();
}
} }
rContext.SetSelections(0, pMarkLst); rContext.SetSelections(0, pMarkLst);
} }
......
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