Kaydet (Commit) 9e83083f authored tarafından Bjoern Michaelsen's avatar Bjoern Michaelsen

kill a typed Modify use

Change-Id: I2d526ecb0f11281ad695d6ce158fcb5a3ef739cb
üst d6775990
......@@ -306,7 +306,6 @@ RES_MSG_BEGIN = RES_FMT_END,
RES_DEL_CHR,
RES_DEL_TXT,
RES_UPDATE_ATTR,
RES_PAGEDESC_FTNINFO,
RES_REFMARKFLD_UPDATE,
RES_DOCPOS_UPDATE,
RES_TABLEFML_UPDATE,
......
......@@ -341,6 +341,10 @@ public:
operator SwPageDesc() const; // #i7983#
};
namespace sw {
class PageFootnoteHint SAL_FINAL : public SfxHint {};
}
#endif // INCLUDED_SW_INC_PAGEDESC_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -509,19 +509,11 @@ void SwDoc::ChgPageDesc( sal_uInt16 i, const SwPageDesc &rChged )
if( !(rDesc.GetFtnInfo() == rChged.GetFtnInfo()) )
{
rDesc.SetFtnInfo( rChged.GetFtnInfo() );
SwMsgPoolItem aInfo( RES_PAGEDESC_FTNINFO );
{
rDesc.GetMaster().ModifyBroadcast( &aInfo, 0, TYPE(SwFrm) );
}
{
rDesc.GetLeft().ModifyBroadcast( &aInfo, 0, TYPE(SwFrm) );
}
{
rDesc.GetFirstMaster().ModifyBroadcast( &aInfo, 0, TYPE(SwFrm) );
}
{
rDesc.GetFirstLeft().ModifyBroadcast( &aInfo, 0, TYPE(SwFrm) );
}
sw::PageFootnoteHint aHint;
rDesc.GetMaster().CallSwClientNotify(aHint);
rDesc.GetLeft().CallSwClientNotify(aHint);
rDesc.GetFirstMaster().CallSwClientNotify(aHint);
rDesc.GetFirstLeft().CallSwClientNotify(aHint);
}
getIDocumentState().SetModified();
......
......@@ -1507,20 +1507,12 @@ void SwDoc::CopyPageDesc( const SwPageDesc& rSrcDesc, SwPageDesc& rDstDesc,
// If foot notes change the pages have to be triggered
if( !(rDstDesc.GetFtnInfo() == rSrcDesc.GetFtnInfo()) )
{
sw::PageFootnoteHint aHint;
rDstDesc.SetFtnInfo( rSrcDesc.GetFtnInfo() );
SwMsgPoolItem aInfo( RES_PAGEDESC_FTNINFO );
{
rDstDesc.GetMaster().ModifyBroadcast( &aInfo, 0, TYPE(SwFrm) );
}
{
rDstDesc.GetLeft().ModifyBroadcast( &aInfo, 0, TYPE(SwFrm) );
}
{
rDstDesc.GetFirstMaster().ModifyBroadcast( &aInfo, 0, TYPE(SwFrm) );
}
{
rDstDesc.GetFirstLeft().ModifyBroadcast( &aInfo, 0, TYPE(SwFrm) );
}
rDstDesc.GetMaster().CallSwClientNotify(aHint);
rDstDesc.GetLeft().CallSwClientNotify(aHint);
rDstDesc.GetFirstMaster().CallSwClientNotify(aHint);
rDstDesc.GetFirstLeft().CallSwClientNotify(aHint);
}
}
......
......@@ -104,6 +104,7 @@ class SwPageFrm: public SwFtnBossFrm
protected:
virtual void MakeAll() SAL_OVERRIDE;
virtual void Modify( const SfxPoolItem*, const SfxPoolItem* ) SAL_OVERRIDE;
virtual void SwClientNotify(const SwModify&, const SfxHint&) SAL_OVERRIDE;
public:
DECL_FIXEDMEMPOOL_NEWDEL(SwPageFrm)
......
......@@ -525,6 +525,24 @@ void SwPageFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
}
}
void SwPageFrm::SwClientNotify(const SwModify& rModify, const SfxHint& rHint)
{
if(typeid(sw::PageFootnoteHint) == typeid(rHint))
{
// currently the savest way:
static_cast<SwRootFrm*>(GetUpper())->SetSuperfluous();
SetMaxFtnHeight(pDesc->GetFtnInfo().GetHeight());
if(!GetMaxFtnHeight())
SetMaxFtnHeight(LONG_MAX);
SetColMaxFtnHeight();
// here, the page might be destroyed:
static_cast<SwRootFrm*>(GetUpper())->RemoveFtns(0, false, true);
}
else
SwClient::SwClientNotify(rModify, rHint);
}
void SwPageFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
sal_uInt8 &rInvFlags,
SwAttrSetChg *pOldSet, SwAttrSetChg *pNewSet )
......@@ -632,17 +650,6 @@ void SwPageFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
case RES_TEXTGRID:
rInvFlags |= 0x60;
break;
case RES_PAGEDESC_FTNINFO:
// currently the savest way:
static_cast<SwRootFrm*>(GetUpper())->SetSuperfluous();
SetMaxFtnHeight( pDesc->GetFtnInfo().GetHeight() );
if ( !GetMaxFtnHeight() )
SetMaxFtnHeight( LONG_MAX );
SetColMaxFtnHeight();
// here, the page might be destroyed:
static_cast<SwRootFrm*>(GetUpper())->RemoveFtns( 0, false, true );
break;
case RES_FRAMEDIR :
CheckDirChange();
break;
......
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