const_cast: convert some C-style casts and remove some redundant ones

Change-Id: Icb14a036ea9d7636359b6bc5e0af17568c0d54cb
This commit is contained in:
Stephan Bergmann 2015-03-26 15:31:55 +01:00
parent 5429049e3b
commit 6f3c52bb37
184 changed files with 561 additions and 561 deletions

View File

@ -65,13 +65,13 @@ public:
inline const SwModify* GetDefinedIn() const { return pDefinedIn; } inline const SwModify* GetDefinedIn() const { return pDefinedIn; }
inline void ChgDefinedIn( const SwModify* pNew ) inline void ChgDefinedIn( const SwModify* pNew )
{ pDefinedIn = (SwModify*)pNew; } { pDefinedIn = const_cast<SwModify*>(pNew); }
// BoxAttribut -> BoxStartNode // BoxAttribut -> BoxStartNode
virtual const SwNode* GetNodeOfFormula() const SAL_OVERRIDE; virtual const SwNode* GetNodeOfFormula() const SAL_OVERRIDE;
SwTableBox* GetTableBox(); SwTableBox* GetTableBox();
const SwTableBox* GetTableBox() const const SwTableBox* GetTableBox() const
{ return ((SwTblBoxFormula*)this)->GetTableBox(); } { return const_cast<SwTblBoxFormula*>(this)->GetTableBox(); }
void ChangeState( const SfxPoolItem* pItem ); void ChangeState( const SfxPoolItem* pItem );
void Calc( SwTblCalcPara& rCalcPara, double& rValue ); void Calc( SwTblCalcPara& rCalcPara, double& rValue );

View File

@ -51,7 +51,7 @@ class SdrTextObj;
Implementation in dcontact.cxx. */ Implementation in dcontact.cxx. */
SW_DLLPUBLIC SwFrmFmt *FindFrmFmt( SdrObject *pObj ); SW_DLLPUBLIC SwFrmFmt *FindFrmFmt( SdrObject *pObj );
inline const SwFrmFmt *FindFrmFmt( const SdrObject *pObj ) inline const SwFrmFmt *FindFrmFmt( const SdrObject *pObj )
{ return ::FindFrmFmt( (SdrObject*)pObj ); } { return ::FindFrmFmt( const_cast<SdrObject*>(pObj) ); }
bool HasWrap( const SdrObject* pObj ); bool HasWrap( const SdrObject* pObj );
void setContextWritingMode( SdrObject* pObj, SwFrm* pAnchor ); void setContextWritingMode( SdrObject* pObj, SwFrm* pAnchor );

View File

@ -1686,7 +1686,7 @@ void ClrContourCache();
inline const SwTableNode* SwDoc::IsIdxInTbl( const SwNodeIndex& rIdx ) const inline const SwTableNode* SwDoc::IsIdxInTbl( const SwNodeIndex& rIdx ) const
{ {
return ((SwDoc*)this)->IsIdxInTbl( rIdx ); return const_cast<SwDoc*>(this)->IsIdxInTbl( rIdx );
} }
inline SvNumberFormatter* SwDoc::GetNumberFormatter( bool bCreate ) inline SvNumberFormatter* SwDoc::GetNumberFormatter( bool bCreate )
@ -1698,7 +1698,7 @@ inline SvNumberFormatter* SwDoc::GetNumberFormatter( bool bCreate )
inline const SvNumberFormatter* SwDoc::GetNumberFormatter( bool bCreate ) const inline const SvNumberFormatter* SwDoc::GetNumberFormatter( bool bCreate ) const
{ {
return ((SwDoc*)this)->GetNumberFormatter( bCreate ); return const_cast<SwDoc*>(this)->GetNumberFormatter( bCreate );
} }
inline void SwDoc::SetOLEPrtNotifyPending( bool bSet ) inline void SwDoc::SetOLEPrtNotifyPending( bool bSet )

View File

@ -225,7 +225,7 @@ public:
/// For Core - it knows the DocShell but not the WrtShell! /// For Core - it knows the DocShell but not the WrtShell!
SwFEShell *GetFEShell(); SwFEShell *GetFEShell();
const SwFEShell *GetFEShell() const const SwFEShell *GetFEShell() const
{ return ((SwDocShell*)this)->GetFEShell(); } { return const_cast<SwDocShell*>(this)->GetFEShell(); }
/// For inserting document. /// For inserting document.
Reader* StartConvertFrom(SfxMedium& rMedium, SwReader** ppRdr, Reader* StartConvertFrom(SfxMedium& rMedium, SwReader** ppRdr,

View File

@ -863,7 +863,7 @@ public:
/// Query NumberFormater from document. /// Query NumberFormater from document.
SvNumberFormatter* GetNumberFormatter(); SvNumberFormatter* GetNumberFormatter();
const SvNumberFormatter* GetNumberFormatter() const const SvNumberFormatter* GetNumberFormatter() const
{ return ((SwEditShell*)this)->GetNumberFormatter(); } { return const_cast<SwEditShell*>(this)->GetNumberFormatter(); }
/// Interfaces for GlobalDocument. /// Interfaces for GlobalDocument.
bool IsGlobalDoc() const; bool IsGlobalDoc() const;
@ -948,7 +948,7 @@ private:
}; };
inline const sfx2::LinkManager& SwEditShell::GetLinkManager() const inline const sfx2::LinkManager& SwEditShell::GetLinkManager() const
{ return ((SwEditShell*)this)->GetLinkManager(); } { return const_cast<SwEditShell*>(this)->GetLinkManager(); }
/// Class for automated call of Start- and EndAction(). /// Class for automated call of Start- and EndAction().
class SwActContext { class SwActContext {

View File

@ -272,7 +272,7 @@ public:
inline void SwFieldType::UpdateFlds() const inline void SwFieldType::UpdateFlds() const
{ {
((SwFieldType*)this)->ModifyNotification( 0, 0 ); const_cast<SwFieldType*>(this)->ModifyNotification( 0, 0 );
} }
/** Base class of all fields. /** Base class of all fields.
@ -414,7 +414,7 @@ public:
virtual SwFieldType* ChgTyp( SwFieldType* ) SAL_OVERRIDE; virtual SwFieldType* ChgTyp( SwFieldType* ) SAL_OVERRIDE;
virtual void SetLanguage(sal_uInt16 nLng) SAL_OVERRIDE; virtual void SetLanguage(sal_uInt16 nLng) SAL_OVERRIDE;
inline SwDoc* GetDoc() const { return const_cast<SwValueFieldType*>(static_cast<const SwValueFieldType*>(GetTyp()))->GetDoc(); } inline SwDoc* GetDoc() const { return static_cast<const SwValueFieldType*>(GetTyp())->GetDoc(); }
virtual double GetValue() const; virtual double GetValue() const;
virtual void SetValue( const double& rVal ); virtual void SetValue( const double& rVal );

View File

@ -77,7 +77,7 @@ public:
/// Query / set where attribute is anchored. /// Query / set where attribute is anchored.
inline const SwModify* GetDefinedIn() const { return pDefinedIn; } inline const SwModify* GetDefinedIn() const { return pDefinedIn; }
void ChgDefinedIn( const SwModify* pNew ) { pDefinedIn = (SwModify*)pNew; } void ChgDefinedIn( const SwModify* pNew ) { pDefinedIn = const_cast<SwModify*>(pNew); }
void RegisterToEndNotInfo( SwEndNoteInfo& ); void RegisterToEndNotInfo( SwEndNoteInfo& );
void RegisterToPageDesc( SwPageDesc& ); void RegisterToPageDesc( SwPageDesc& );
bool KnowsPageDesc() const; bool KnowsPageDesc() const;

View File

@ -97,7 +97,7 @@ public:
The UserCall knows its SdrObject. */ The UserCall knows its SdrObject. */
SwContact *FindContactObj(); SwContact *FindContactObj();
const SwContact *FindContactObj() const const SwContact *FindContactObj() const
{ return ((SwFrmFmt*)this)->FindContactObj(); } { return const_cast<SwFrmFmt*>(this)->FindContactObj(); }
/** @return the SdrObject, that is connected to the ContactObject. /** @return the SdrObject, that is connected to the ContactObject.
Only DrawFrmFmts are connected to the "real SdrObject". FlyFrmFmts Only DrawFrmFmts are connected to the "real SdrObject". FlyFrmFmts
@ -105,11 +105,11 @@ public:
"Real SdrObject" has position and a Z-order. */ "Real SdrObject" has position and a Z-order. */
SdrObject *FindSdrObject(); SdrObject *FindSdrObject();
const SdrObject *FindSdrObject() const const SdrObject *FindSdrObject() const
{ return ((SwFrmFmt*)this)->FindSdrObject(); } { return const_cast<SwFrmFmt*>(this)->FindSdrObject(); }
SdrObject *FindRealSdrObject(); SdrObject *FindRealSdrObject();
const SdrObject *FindRealSdrObject() const const SdrObject *FindRealSdrObject() const
{ return ((SwFrmFmt*)this)->FindRealSdrObject(); } { return const_cast<SwFrmFmt*>(this)->FindRealSdrObject(); }
bool IsLowerOf( const SwFrmFmt& rFmt ) const; bool IsLowerOf( const SwFrmFmt& rFmt ) const;

View File

@ -660,15 +660,15 @@ inline bool SwNode::IsGrfNode() const
inline const SwStartNode* SwNode::FindSttNodeByType( SwStartNodeType eTyp ) const inline const SwStartNode* SwNode::FindSttNodeByType( SwStartNodeType eTyp ) const
{ {
return ((SwNode*)this)->FindSttNodeByType( eTyp ); return const_cast<SwNode*>(this)->FindSttNodeByType( eTyp );
} }
inline const SwTableNode* SwNode::FindTableNode() const inline const SwTableNode* SwNode::FindTableNode() const
{ {
return ((SwNode*)this)->FindTableNode(); return const_cast<SwNode*>(this)->FindTableNode();
} }
inline const SwSectionNode* SwNode::FindSectionNode() const inline const SwSectionNode* SwNode::FindSectionNode() const
{ {
return ((SwNode*)this)->FindSectionNode(); return const_cast<SwNode*>(this)->FindSectionNode();
} }
inline sal_uLong SwNode::StartOfSectionIndex() const inline sal_uLong SwNode::StartOfSectionIndex() const
{ {

View File

@ -253,7 +253,7 @@ public:
inline void SwPageDesc::SetFollow( const SwPageDesc* pNew ) inline void SwPageDesc::SetFollow( const SwPageDesc* pNew )
{ {
pFollow = pNew ? (SwPageDesc*)pNew : this; pFollow = pNew ? const_cast<SwPageDesc*>(pNew) : this;
} }
inline bool SwPageDesc::IsHeaderShared() const inline bool SwPageDesc::IsHeaderShared() const

View File

@ -107,7 +107,7 @@ public:
/// Get and set Modify pointer. /// Get and set Modify pointer.
inline const SwModify* GetDefinedIn() const { return pDefinedIn; } inline const SwModify* GetDefinedIn() const { return pDefinedIn; }
inline void ChgDefinedIn( const SwModify* pNew ) inline void ChgDefinedIn( const SwModify* pNew )
{ pDefinedIn = (SwModify*)pNew; } { pDefinedIn = const_cast<SwModify*>(pNew); }
}; };
class SwRegisterItem : public SfxBoolItem class SwRegisterItem : public SfxBoolItem

View File

@ -47,7 +47,7 @@ protected:
inline const SwDDEFieldType* SwDDETable::GetDDEFldType() const inline const SwDDEFieldType* SwDDETable::GetDDEFldType() const
{ {
return ((SwDDETable*)this)->GetDDEFldType(); return const_cast<SwDDETable*>(this)->GetDDEFldType();
} }
#endif #endif

View File

@ -285,7 +285,7 @@ public:
// Get box, whose start index is set on nBoxStt. // Get box, whose start index is set on nBoxStt.
SwTableBox* GetTblBox( sal_uLong nSttIdx ); SwTableBox* GetTblBox( sal_uLong nSttIdx );
const SwTableBox* GetTblBox( sal_uLong nSttIdx ) const const SwTableBox* GetTblBox( sal_uLong nSttIdx ) const
{ return ((SwTable*)this)->GetTblBox( nSttIdx ); } { return const_cast<SwTable*>(this)->GetTblBox( nSttIdx ); }
// Returns true if table contains nestings. // Returns true if table contains nestings.
bool IsTblComplex() const; bool IsTblComplex() const;

View File

@ -476,7 +476,7 @@ public:
// DrawView may be used at UI. // DrawView may be used at UI.
SdrView *GetDrawView(); SdrView *GetDrawView();
const SdrView *GetDrawView() const { return ((SwViewShell*)this)->GetDrawView(); } const SdrView *GetDrawView() const { return const_cast<SwViewShell*>(this)->GetDrawView(); }
// Take care that MarkList is up-to-date in any case (Bug 57153). // Take care that MarkList is up-to-date in any case (Bug 57153).
SdrView *GetDrawViewWithValidMarkList(); SdrView *GetDrawViewWithValidMarkList();
@ -626,7 +626,7 @@ inline void SwViewShell::UnlockPaint( bool bVirDev )
} }
inline const SfxItemPool& SwViewShell::GetAttrPool() const inline const SfxItemPool& SwViewShell::GetAttrPool() const
{ {
return ((SwViewShell*)this)->GetAttrPool(); return const_cast<SwViewShell*>(this)->GetAttrPool();
} }
#endif // INCLUDED_SW_INC_VIEWSH_HXX #endif // INCLUDED_SW_INC_VIEWSH_HXX

View File

@ -3163,7 +3163,7 @@ uno::Reference< XAccessibleHyperlink > SAL_CALL
SwHyperlinkIter_Impl aHIter( pTxtFrm ); SwHyperlinkIter_Impl aHIter( pTxtFrm );
sal_Int32 nTIndex = -1; sal_Int32 nTIndex = -1;
SwTOXSortTabBase* pTBase = GetTOXSortTabBase(); SwTOXSortTabBase* pTBase = GetTOXSortTabBase();
SwTxtAttr* pHt = (SwTxtAttr*)(aHIter.next()); SwTxtAttr* pHt = const_cast<SwTxtAttr*>(aHIter.next());
while( (nLinkIndex < getHyperLinkCount()) && nTIndex < nLinkIndex) while( (nLinkIndex < getHyperLinkCount()) && nTIndex < nLinkIndex)
{ {
sal_Int32 nHStt = -1; sal_Int32 nHStt = -1;
@ -3227,7 +3227,7 @@ uno::Reference< XAccessibleHyperlink > SAL_CALL
// iterate next // iterate next
if( bH ) if( bH )
// iterate next hyperlink // iterate next hyperlink
pHt = (SwTxtAttr*)(aHIter.next()); pHt = const_cast<SwTxtAttr*>(aHIter.next());
else if(bTOC) else if(bTOC)
continue; continue;
else else

View File

@ -187,11 +187,11 @@ void SwFmt::CopyAttrs( const SwFmt& rFmt, bool bReplace )
SetInSwFntCache( false ); SetInSwFntCache( false );
// special treatments for some attributes // special treatments for some attributes
SwAttrSet* pChgSet = (SwAttrSet*)&rFmt.aSet; SwAttrSet* pChgSet = const_cast<SwAttrSet*>(&rFmt.aSet);
if( !bReplace ) // refresh only those that are not set? if( !bReplace ) // refresh only those that are not set?
{ {
if( pChgSet == (SwAttrSet*)&rFmt.aSet ) if( pChgSet == &rFmt.aSet )
pChgSet = new SwAttrSet( rFmt.aSet ); pChgSet = new SwAttrSet( rFmt.aSet );
pChgSet->Differentiate( aSet ); pChgSet->Differentiate( aSet );
} }
@ -215,7 +215,7 @@ void SwFmt::CopyAttrs( const SwFmt& rFmt, bool bReplace )
} }
} }
if( pChgSet != (SwAttrSet*)&rFmt.aSet ) // was a Set created? if( pChgSet != &rFmt.aSet ) // was a Set created?
delete pChgSet; delete pChgSet;
} }

View File

@ -831,7 +831,7 @@ SwField* SwCrsrShell::GetFieldAtCrsr(
: 1; : 1;
if ( ( pCrsr->End()->nContent.GetIndex() - pCrsr->Start()->nContent.GetIndex() ) <= nTxtFldLength ) if ( ( pCrsr->End()->nContent.GetIndex() - pCrsr->Start()->nContent.GetIndex() ) <= nTxtFldLength )
{ {
pFieldAtCrsr = (SwField*)pTxtFld->GetFmtFld().GetField(); pFieldAtCrsr = const_cast<SwField*>(pTxtFld->GetFmtFld().GetField());
} }
} }
@ -1783,7 +1783,7 @@ bool SwCrsrShell::GotoINetAttr( const SwTxtINetFmt& rAttr )
SwCrsrSaveState aSaveState( *pCrsr ); SwCrsrSaveState aSaveState( *pCrsr );
pCrsr->GetPoint()->nNode = *rAttr.GetpTxtNode(); pCrsr->GetPoint()->nNode = *rAttr.GetpTxtNode();
pCrsr->GetPoint()->nContent.Assign( (SwTxtNode*)rAttr.GetpTxtNode(), pCrsr->GetPoint()->nContent.Assign( const_cast<SwTxtNode*>(rAttr.GetpTxtNode()),
rAttr.GetStart() ); rAttr.GetStart() );
bRet = !pCrsr->IsSelOvr(); bRet = !pCrsr->IsSelOvr();
if( bRet ) if( bRet )

View File

@ -52,7 +52,7 @@ int SwFindParaFmtColl::Find( SwPaM* pCrsr, SwMoveFn fnMove, const SwPaM* pRegion
nRet = FIND_NOT_FOUND; nRet = FIND_NOT_FOUND;
else if( pReplColl ) else if( pReplColl )
{ {
pCrsr->GetDoc()->SetTxtFmtColl( *pCrsr, (SwTxtFmtColl*)pReplColl ); pCrsr->GetDoc()->SetTxtFmtColl( *pCrsr, const_cast<SwTxtFmtColl*>(pReplColl) );
nRet = FIND_NO_RING; nRet = FIND_NO_RING;
} }
return nRet; return nRet;

View File

@ -520,7 +520,7 @@ SwPaM* SwPaM::MakeRegion( SwMoveFn fnMove, const SwPaM * pOrigRg )
} }
else else
{ {
pPam = new SwPaM( *(SwPaM*)pOrigRg ); // given search area pPam = new SwPaM( *const_cast<SwPaM*>(pOrigRg) ); // given search area
// make sure that SPoint is on the "real" start position // make sure that SPoint is on the "real" start position
// FORWARD: SPoint always smaller than GetMark // FORWARD: SPoint always smaller than GetMark
// BACKWARD: SPoint always bigger than GetMark // BACKWARD: SPoint always bigger than GetMark

View File

@ -366,7 +366,7 @@ bool SwCursor::IsSelOvr( int eFlags )
} }
} }
SwCntntNode* pCNd = (pFrm != NULL) ? (SwCntntNode*)pFrm->GetNode() : NULL; SwCntntNode* pCNd = (pFrm != NULL) ? const_cast<SwCntntNode*>(pFrm->GetNode()) : NULL;
if ( pCNd != NULL ) if ( pCNd != NULL )
{ {
// set this CntntNode as new position // set this CntntNode as new position
@ -2250,7 +2250,7 @@ SwCursor* SwTableCursor::MakeBoxSels( SwCursor* pAktCrsr )
void SwTableCursor::InsertBox( const SwTableBox& rTblBox ) void SwTableCursor::InsertBox( const SwTableBox& rTblBox )
{ {
SwTableBox* pBox = (SwTableBox*)&rTblBox; SwTableBox* pBox = const_cast<SwTableBox*>(&rTblBox);
m_SelectedBoxes.insert(pBox); m_SelectedBoxes.insert(pBox);
m_bChanged = true; m_bChanged = true;
} }

View File

@ -29,7 +29,7 @@ SwLayoutFrm* GetCurrColumn( const SwLayoutFrm* pLayFrm )
{ {
while( pLayFrm && !pLayFrm->IsColumnFrm() ) while( pLayFrm && !pLayFrm->IsColumnFrm() )
pLayFrm = pLayFrm->GetUpper(); pLayFrm = pLayFrm->GetUpper();
return (SwLayoutFrm*)pLayFrm; return const_cast<SwLayoutFrm*>(pLayFrm);
} }
SwLayoutFrm* GetNextColumn( const SwLayoutFrm* pLayFrm ) SwLayoutFrm* GetNextColumn( const SwLayoutFrm* pLayFrm )
@ -46,7 +46,7 @@ SwLayoutFrm* GetPrevColumn( const SwLayoutFrm* pLayFrm )
SwCntntFrm* GetColumnStt( const SwLayoutFrm* pColFrm ) SwCntntFrm* GetColumnStt( const SwLayoutFrm* pColFrm )
{ {
return pColFrm ? (SwCntntFrm*)pColFrm->ContainsCntnt() : 0; return pColFrm ? const_cast<SwCntntFrm*>(pColFrm->ContainsCntnt()) : 0;
} }
SwCntntFrm* GetColumnEnd( const SwLayoutFrm* pColFrm ) SwCntntFrm* GetColumnEnd( const SwLayoutFrm* pColFrm )

View File

@ -423,7 +423,7 @@ void SwSelPaintRects::HighlightInputFld()
} }
else else
{ {
SdrView* pView = (SdrView*)GetShell()->GetDrawView(); SdrView* pView = const_cast<SdrView*>(GetShell()->GetDrawView());
SdrPaintWindow* pCandidate = pView->GetPaintWindow(0); SdrPaintWindow* pCandidate = pView->GetPaintWindow(0);
rtl::Reference<sdr::overlay::OverlayManager> xTargetOverlay = pCandidate->GetOverlayManager(); rtl::Reference<sdr::overlay::OverlayManager> xTargetOverlay = pCandidate->GetOverlayManager();

View File

@ -2289,7 +2289,7 @@ bool DocumentContentOperationsManager::MoveAndJoin( SwPaM& rPaM, SwPosition& rPo
bool DocumentContentOperationsManager::Overwrite( const SwPaM &rRg, const OUString &rStr ) bool DocumentContentOperationsManager::Overwrite( const SwPaM &rRg, const OUString &rStr )
{ {
SwPosition& rPt = *(SwPosition*)rRg.GetPoint(); SwPosition& rPt = *const_cast<SwPosition*>(rRg.GetPoint());
if( m_rDoc.GetAutoCorrExceptWord() ) // Add to AutoCorrect if( m_rDoc.GetAutoCorrExceptWord() ) // Add to AutoCorrect
{ {
if( 1 == rStr.getLength() ) if( 1 == rStr.getLength() )

View File

@ -475,7 +475,7 @@ bool DocumentFieldsManager::UpdateFld(SwTxtFld * pDstTxtFld, SwField & rSrcFld,
bool bTblSelBreak = false; bool bTblSelBreak = false;
SwFmtFld * pDstFmtFld = (SwFmtFld*)&pDstTxtFld->GetFmtFld(); SwFmtFld * pDstFmtFld = const_cast<SwFmtFld*>(&pDstTxtFld->GetFmtFld());
SwField * pDstFld = pDstFmtFld->GetField(); SwField * pDstFld = pDstFmtFld->GetField();
sal_uInt16 nFldWhich = rSrcFld.GetTyp()->Which(); sal_uInt16 nFldWhich = rSrcFld.GetTyp()->Which();
SwNodeIndex aTblNdIdx(pDstTxtFld->GetTxtNode()); SwNodeIndex aTblNdIdx(pDstTxtFld->GetTxtNode());
@ -906,7 +906,7 @@ void DocumentFieldsManager::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds
int nShownSections = 0; int nShownSections = 0;
for( _SetGetExpFlds::const_iterator it = mpUpdtFlds->GetSortLst()->begin(); it != mpUpdtFlds->GetSortLst()->end(); ++it ) for( _SetGetExpFlds::const_iterator it = mpUpdtFlds->GetSortLst()->begin(); it != mpUpdtFlds->GetSortLst()->end(); ++it )
{ {
SwSection* pSect = (SwSection*)(*it)->GetSection(); SwSection* pSect = const_cast<SwSection*>((*it)->GetSection());
if ( pSect && !pSect->IsCondHidden()) if ( pSect && !pSect->IsCondHidden())
nShownSections++; nShownSections++;
} }
@ -914,7 +914,7 @@ void DocumentFieldsManager::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds
OUString aNew; OUString aNew;
for( _SetGetExpFlds::const_iterator it = mpUpdtFlds->GetSortLst()->begin(); it != mpUpdtFlds->GetSortLst()->end(); ++it ) for( _SetGetExpFlds::const_iterator it = mpUpdtFlds->GetSortLst()->begin(); it != mpUpdtFlds->GetSortLst()->end(); ++it )
{ {
SwSection* pSect = (SwSection*)(*it)->GetSection(); SwSection* pSect = const_cast<SwSection*>((*it)->GetSection());
if( pSect ) if( pSect )
{ {
@ -947,14 +947,14 @@ void DocumentFieldsManager::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds
continue; continue;
} }
SwTxtFld* pTxtFld = (SwTxtFld*)(*it)->GetTxtFld(); SwTxtFld* pTxtFld = const_cast<SwTxtFld*>((*it)->GetTxtFld());
if( !pTxtFld ) if( !pTxtFld )
{ {
OSL_ENSURE( false, "what's wrong now'" ); OSL_ENSURE( false, "what's wrong now'" );
continue; continue;
} }
SwFmtFld* pFmtFld = (SwFmtFld*)&pTxtFld->GetFmtFld(); SwFmtFld* pFmtFld = const_cast<SwFmtFld*>(&pTxtFld->GetFmtFld());
const SwField* pFld = pFmtFld->GetField(); const SwField* pFld = pFmtFld->GetField();
switch( nWhich = pFld->GetTyp()->Which() ) switch( nWhich = pFld->GetTyp()->Which() )

View File

@ -340,7 +340,7 @@ SwFrmFmt *DocumentLayoutManager::CopyLayoutFmt(
const bool bDraw = RES_DRAWFRMFMT == rSource.Which(); const bool bDraw = RES_DRAWFRMFMT == rSource.Which();
OSL_ENSURE( bFly || bDraw, "this method only works for fly or draw" ); OSL_ENSURE( bFly || bDraw, "this method only works for fly or draw" );
SwDoc* pSrcDoc = (SwDoc*)rSource.GetDoc(); SwDoc* pSrcDoc = const_cast<SwDoc*>(rSource.GetDoc());
// May we copy this object? // May we copy this object?
// We may, unless it's 1) it's a control (and therfore a draw) // We may, unless it's 1) it's a control (and therfore a draw)

View File

@ -154,8 +154,8 @@ namespace
&pTableFmt->GetDoc()->GetNodes() == &pFBox->GetSttNd()->GetNodes() ) &pTableFmt->GetDoc()->GetNodes() == &pFBox->GetSttNd()->GetNodes() )
{ {
// a table in the normal NodesArr // a table in the normal NodesArr
pItem->pTblNd = (SwTableNode*) pItem->pTblNd = const_cast<SwTableNode*>(
pFBox->GetSttNd()->FindTableNode(); pFBox->GetSttNd()->FindTableNode());
return false; return false;
} }
// If the name is already correct, but not the rest then we don't have them. // If the name is already correct, but not the rest then we don't have them.
@ -471,7 +471,7 @@ bool DocumentLinksAdministrationManager::SelectServerObj( const OUString& rStr,
SwNode* pNd; SwNode* pNd;
const SwFlyFrmFmt* pFlyFmt = m_rDoc.FindFlyByName( sName ); const SwFlyFrmFmt* pFlyFmt = m_rDoc.FindFlyByName( sName );
if( pFlyFmt && if( pFlyFmt &&
0 != ( pIdx = (SwNodeIndex*)pFlyFmt->GetCntnt().GetCntntIdx() ) && 0 != ( pIdx = const_cast<SwNodeIndex*>(pFlyFmt->GetCntnt().GetCntntIdx()) ) &&
!( pNd = &pIdx->GetNode())->IsNoTxtNode() ) !( pNd = &pIdx->GetNode())->IsNoTxtNode() )
{ {
rpRange = new SwNodeRange( *pNd, 1, *pNd->EndOfSectionNode() ); rpRange = new SwNodeRange( *pNd, 1, *pNd->EndOfSectionNode() );

View File

@ -162,7 +162,7 @@ sal_uInt16 SwDoc::CallEvent( sal_uInt16 nEvent, const SwCallMouseEvent& rCallEve
case EVENT_OBJECT_URLITEM: case EVENT_OBJECT_URLITEM:
case EVENT_OBJECT_IMAGE: case EVENT_OBJECT_IMAGE:
{ {
const SwFrmFmt* pFmt = (SwFrmFmt*)rCallEvent.PTR.pFmt; const SwFrmFmt* pFmt = rCallEvent.PTR.pFmt;
if( bCheckPtr ) if( bCheckPtr )
{ {
if ( GetSpzFrmFmts()->Contains( pFmt ) ) if ( GetSpzFrmFmts()->Contains( pFmt ) )
@ -178,7 +178,7 @@ sal_uInt16 SwDoc::CallEvent( sal_uInt16 nEvent, const SwCallMouseEvent& rCallEve
const IMapObject* pIMapObj = rCallEvent.PTR.IMAP.pIMapObj; const IMapObject* pIMapObj = rCallEvent.PTR.IMAP.pIMapObj;
if( bCheckPtr ) if( bCheckPtr )
{ {
const SwFrmFmt* pFmt = (SwFrmFmt*)rCallEvent.PTR.IMAP.pFmt; const SwFrmFmt* pFmt = rCallEvent.PTR.IMAP.pFmt;
const ImageMap* pIMap; const ImageMap* pIMap;
if( GetSpzFrmFmts()->Contains( pFmt ) && if( GetSpzFrmFmts()->Contains( pFmt ) &&
0 != (pIMap = pFmt->GetURL().GetMap()) ) 0 != (pIMap = pFmt->GetURL().GetMap()) )

View File

@ -1291,7 +1291,7 @@ bool SwCompareLine::ChangesInLine( const SwCompareLine& rLine,
if( ND_TEXTNODE == rNode.GetNodeType() && if( ND_TEXTNODE == rNode.GetNodeType() &&
ND_TEXTNODE == rLine.GetNode().GetNodeType() ) ND_TEXTNODE == rLine.GetNode().GetNodeType() )
{ {
SwTxtNode& rDstNd = *(SwTxtNode*)rNode.GetTxtNode(); SwTxtNode& rDstNd = *const_cast<SwTxtNode*>(rNode.GetTxtNode());
const SwTxtNode& rSrcNd = *rLine.GetNode().GetTxtNode(); const SwTxtNode& rSrcNd = *rLine.GetNode().GetTxtNode();
SwDoc* pDstDoc = rDstNd.GetDoc(); SwDoc* pDstDoc = rDstNd.GetDoc();

View File

@ -299,7 +299,7 @@ void SwDoc::CopyMasterHeader(const SwPageDesc &rChged, const SwFmtHeader &rHead,
} }
else else
::lcl_DescSetAttr( *pRight, ::lcl_DescSetAttr( *pRight,
*(SwFrmFmt*)rFmtHead.GetHeaderFmt(), false ); *const_cast<SwFrmFmt*>(rFmtHead.GetHeaderFmt()), false );
} }
} }
} }
@ -371,7 +371,7 @@ void SwDoc::CopyMasterFooter(const SwPageDesc &rChged, const SwFmtFooter &rFoot,
} }
else else
::lcl_DescSetAttr( *pRight, ::lcl_DescSetAttr( *pRight,
*(SwFrmFmt*)rFmtFoot.GetFooterFmt(), false ); *const_cast<SwFrmFmt*>(rFmtFoot.GetFooterFmt()), false );
} }
} }
} }

View File

@ -248,7 +248,7 @@ _SaveRedlEndPosForRestore::_SaveRedlEndPosForRestore( const SwNodeIndex& rInsIdx
pSavArr = new std::vector<SwPosition*>; pSavArr = new std::vector<SwPosition*>;
pSavIdx = new SwNodeIndex( rInsIdx, -1 ); pSavIdx = new SwNodeIndex( rInsIdx, -1 );
} }
pSavArr->push_back( (SwPosition*)pEnd ); pSavArr->push_back( const_cast<SwPosition*>(pEnd) );
} }
} }
} }
@ -532,7 +532,7 @@ uno::Any SwDoc::Spell( SwPaM& rPaM,
nStat = nPageNr - *pPageSt + 1; nStat = nPageNr - *pPageSt + 1;
else else
nStat = nPageNr + *pPageCnt - *pPageSt + 1; nStat = nPageNr + *pPageCnt - *pPageSt + 1;
::SetProgressState( nStat, (SwDocShell*)GetDocShell() ); ::SetProgressState( nStat, const_cast<SwDocShell*>(GetDocShell()) );
} }
//Spell() changes the pSpellArgs in case an error is found //Spell() changes the pSpellArgs in case an error is found
sal_Int32 nBeginGrammarCheck = 0; sal_Int32 nBeginGrammarCheck = 0;

View File

@ -242,7 +242,7 @@ void SwDoc::ResetAttrs( const SwPaM &rRg,
const std::set<sal_uInt16> &rAttrs, const std::set<sal_uInt16> &rAttrs,
const bool bSendDataChangedEvents ) const bool bSendDataChangedEvents )
{ {
SwPaM* pPam = (SwPaM*)&rRg; SwPaM* pPam = const_cast<SwPaM*>(&rRg);
if( !bTxtAttr && !rAttrs.empty() && RES_TXTATR_END > *(rAttrs.begin()) ) if( !bTxtAttr && !rAttrs.empty() && RES_TXTATR_END > *(rAttrs.begin()) )
bTxtAttr = true; bTxtAttr = true;
@ -1119,7 +1119,7 @@ SwFmt* SwDoc::CopyFmt( const SwFmt& rFmt,
} }
// Search for the "parent" first // Search for the "parent" first
SwFmt* pParent = (SwFmt*)&rDfltFmt; SwFmt* pParent = const_cast<SwFmt*>(&rDfltFmt);
if( rFmt.DerivedFrom() && pParent != rFmt.DerivedFrom() ) if( rFmt.DerivedFrom() && pParent != rFmt.DerivedFrom() )
pParent = CopyFmt( *rFmt.DerivedFrom(), rFmtArr, pParent = CopyFmt( *rFmt.DerivedFrom(), rFmtArr,
fnCopyFmt, rDfltFmt ); fnCopyFmt, rDfltFmt );

View File

@ -161,7 +161,7 @@ bool SwDoc::SplitDoc( sal_uInt16 eDocType, const OUString& rPath, bool bOutline,
return false; return false;
sal_uInt16 nOutl = 0; sal_uInt16 nOutl = 0;
SwOutlineNodes* pOutlNds = (SwOutlineNodes*)&GetNodes().GetOutLineNds(); SwOutlineNodes* pOutlNds = const_cast<SwOutlineNodes*>(&GetNodes().GetOutLineNds());
boost::scoped_ptr<SwOutlineNodes> xTmpOutlNds; boost::scoped_ptr<SwOutlineNodes> xTmpOutlNds;
SwNodePtr pStartNd; SwNodePtr pStartNd;

View File

@ -172,8 +172,8 @@ bool SwDoc::InsertGlossary( SwTextBlocks& rBlock, const OUString& rEntry,
do { do {
SwPosition& rInsPos = *_pStartCrsr->GetPoint(); SwPosition& rInsPos = *_pStartCrsr->GetPoint();
SwStartNode* pBoxSttNd = (SwStartNode*)rInsPos.nNode.GetNode(). SwStartNode* pBoxSttNd = const_cast<SwStartNode*>(rInsPos.nNode.GetNode().
FindTableBoxStartNode(); FindTableBoxStartNode());
if( pBoxSttNd && 2 == pBoxSttNd->EndOfSectionIndex() - if( pBoxSttNd && 2 == pBoxSttNd->EndOfSectionIndex() -
pBoxSttNd->GetIndex() && pBoxSttNd->GetIndex() &&

View File

@ -384,8 +384,8 @@ SwFlyFrmFmt* SwDoc::MakeFlyAndMove( const SwPaM& rPam, const SfxItemSet& rSet,
// original one and move (copy and delete) the selected boxes. // original one and move (copy and delete) the selected boxes.
// The size is corrected on a percentage basis. // The size is corrected on a percentage basis.
SwTableNode* pTblNd = (SwTableNode*)(*pSelBoxes)[0]-> SwTableNode* pTblNd = const_cast<SwTableNode*>((*pSelBoxes)[0]->
GetSttNd()->FindTableNode(); GetSttNd()->FindTableNode());
if( !pTblNd ) if( !pTblNd )
break; break;
@ -1113,7 +1113,7 @@ lcl_InsertDrawLabel( SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl,
#if OSL_DEBUG_LEVEL > 0 #if OSL_DEBUG_LEVEL > 0
OSL_ENSURE( pHnt && pHnt->Which() == RES_TXTATR_FLYCNT, OSL_ENSURE( pHnt && pHnt->Which() == RES_TXTATR_FLYCNT,
"Missing FlyInCnt-Hint." ); "Missing FlyInCnt-Hint." );
OSL_ENSURE( pHnt && const_cast<SwFmtFlyCnt&>(pHnt->GetFlyCnt()). OSL_ENSURE( pHnt && pHnt->GetFlyCnt().
GetFrmFmt() == (SwFrmFmt*)pOldFmt, GetFrmFmt() == (SwFrmFmt*)pOldFmt,
"Wrong TxtFlyCnt-Hint." ); "Wrong TxtFlyCnt-Hint." );
#endif #endif

View File

@ -1452,7 +1452,7 @@ static bool lcl_GotoNextPrevNum( SwPosition& rPos, bool bNext,
static_cast<sal_uInt8>(pNd->GetActualListLevel()) )) static_cast<sal_uInt8>(pNd->GetActualListLevel()) ))
{ {
rPos.nNode = aIdx; rPos.nNode = aIdx;
rPos.nContent.Assign( (SwTxtNode*)pNd, 0 ); rPos.nContent.Assign( const_cast<SwTxtNode*>(pNd), 0 );
bRet = true; bRet = true;
break; break;
} }
@ -1482,7 +1482,7 @@ static bool lcl_GotoNextPrevNum( SwPosition& rPos, bool bNext,
else else
{ {
rPos.nNode.Assign( *pLast ); rPos.nNode.Assign( *pLast );
rPos.nContent.Assign( (SwTxtNode*)pLast, 0 ); rPos.nContent.Assign( const_cast<SwTxtNode*>(pLast), 0 );
} }
bRet = true; bRet = true;
} }

View File

@ -477,7 +477,7 @@ bool SwDoc::SortTbl(const SwSelBoxes& rBoxes, const SwSortOptions& rOpt)
{ {
// Via SwDoc for Undo! // Via SwDoc for Undo!
OSL_ENSURE( !rBoxes.empty(), "no valid Box list" ); OSL_ENSURE( !rBoxes.empty(), "no valid Box list" );
SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode(); SwTableNode* pTblNd = const_cast<SwTableNode*>(rBoxes[0]->GetSttNd()->FindTableNode());
if( !pTblNd ) if( !pTblNd )
return false; return false;

View File

@ -141,7 +141,7 @@ sal_uInt16 SwDoc::GetCurTOXMark( const SwPosition& rPos,
// the attributes are sorted by Start! // the attributes are sorted by Start!
break; break;
SwTOXMark* pTMark = (SwTOXMark*) &pHt->GetTOXMark(); SwTOXMark* pTMark = const_cast<SwTOXMark*>(&pHt->GetTOXMark());
rArr.push_back( pTMark ); rArr.push_back( pTMark );
} }
return rArr.size(); return rArr.size();
@ -773,7 +773,7 @@ void SwTOXBaseSection::Update(const SfxItemSet* pAttr,
maMSTOCExpression.clear(); maMSTOCExpression.clear();
} }
SwDoc* pDoc = (SwDoc*)pSectNd->GetDoc(); SwDoc* pDoc = const_cast<SwDoc*>(pSectNd->GetDoc());
assert(pDoc); //Where is the document? assert(pDoc); //Where is the document?
@ -853,7 +853,7 @@ void SwTOXBaseSection::Update(const SfxItemSet* pAttr,
: 0; : 0;
SwNode2Layout aN2L( *pSectNd ); SwNode2Layout aN2L( *pSectNd );
((SwSectionNode*)pSectNd)->DelFrms(); const_cast<SwSectionNode*>(pSectNd)->DelFrms();
// remove old content an insert one empty textnode (to hold the layout!) // remove old content an insert one empty textnode (to hold the layout!)
SwTxtNode* pFirstEmptyNd; SwTxtNode* pFirstEmptyNd;
@ -1649,7 +1649,7 @@ void SwTOXBaseSection::UpdatePageNum()
const SwTxtNode* pTxtNd = pBase->pTOXNd->GetTxtNode(); const SwTxtNode* pTxtNd = pBase->pTOXNd->GetTxtNode();
OSL_ENSURE( pTxtNd, "no TextNode, wrong TOC" ); OSL_ENSURE( pTxtNd, "no TextNode, wrong TOC" );
_UpdatePageNum( (SwTxtNode*)pTxtNd, aNums, aDescs, pMainNums, _UpdatePageNum( const_cast<SwTxtNode*>(pTxtNd), aNums, aDescs, pMainNums,
aIntl ); aIntl );
} }
DELETEZ(pMainNums); DELETEZ(pMainNums);

View File

@ -500,7 +500,7 @@ SwCollCondition::SwCollCondition( SwTxtFmtColl* pColl, sal_uLong nMasterCond,
} }
SwCollCondition::SwCollCondition( const SwCollCondition& rCopy ) SwCollCondition::SwCollCondition( const SwCollCondition& rCopy )
: SwClient( (SwModify*)rCopy.GetRegisteredIn() ), nCondition( rCopy.nCondition ) : SwClient( const_cast<SwModify*>(rCopy.GetRegisteredIn()) ), nCondition( rCopy.nCondition )
{ {
if( USRFLD_EXPRESSION & rCopy.nCondition ) if( USRFLD_EXPRESSION & rCopy.nCondition )
aSubCondition.pFldExpression = new OUString( *rCopy.GetFldExpression() ); aSubCondition.pFldExpression = new OUString( *rCopy.GetFldExpression() );

View File

@ -163,7 +163,7 @@ void SwFtnIdxs::UpdateAllFtn()
return; return;
// Get the NodesArray via the StartIndex of the first Footnote // Get the NodesArray via the StartIndex of the first Footnote
SwDoc* pDoc = (SwDoc*) (*this)[ 0 ]->GetTxtNode().GetDoc(); SwDoc* pDoc = const_cast<SwDoc*>((*this)[ 0 ]->GetTxtNode().GetDoc());
SwTxtFtn* pTxtFtn; SwTxtFtn* pTxtFtn;
const SwEndNoteInfo& rEndInfo = pDoc->GetEndNoteInfo(); const SwEndNoteInfo& rEndInfo = pDoc->GetEndNoteInfo();
const SwFtnInfo& rFtnInfo = pDoc->GetFtnInfo(); const SwFtnInfo& rFtnInfo = pDoc->GetFtnInfo();

View File

@ -87,7 +87,7 @@ static void lcl_GCBorder_GetLastBox_B( const SwTableBox* pBox, SwTableBoxes* pPa
lcl_GCBorder_GetLastBox_L( pLine, pPara ); lcl_GCBorder_GetLastBox_L( pLine, pPara );
} }
else else
pPara->push_back( (SwTableBox*)pBox ); pPara->push_back( const_cast<SwTableBox*>(pBox) );
} }
// Find the "end" of the passed BorderLine. Returns the "Layout"Pos! // Find the "end" of the passed BorderLine. Returns the "Layout"Pos!
@ -126,7 +126,7 @@ static void lcl_GCBorder_DelBorder( const SwCollectTblLineBoxes& rCollTLB,
sal_uInt16 nEndPos, sal_uInt16 nEndPos,
SwShareBoxFmts* pShareFmts ) SwShareBoxFmts* pShareFmts )
{ {
SwTableBox* pBox = (SwTableBox*)&rCollTLB.GetBox( rStt ); SwTableBox* pBox = const_cast<SwTableBox*>(&rCollTLB.GetBox( rStt ));
sal_uInt16 nNextPos; sal_uInt16 nNextPos;
const SvxBorderLine* pLn = &rLine; const SvxBorderLine* pLn = &rLine;
@ -148,7 +148,7 @@ static void lcl_GCBorder_DelBorder( const SwCollectTblLineBoxes& rCollTLB,
if( ++rStt >= rCollTLB.Count() ) if( ++rStt >= rCollTLB.Count() )
break; break;
pBox = (SwTableBox*)&rCollTLB.GetBox( rStt, &nNextPos ); pBox = const_cast<SwTableBox*>(&rCollTLB.GetBox( rStt, &nNextPos ));
if( nNextPos > nEndPos ) if( nNextPos > nEndPos )
break; break;

View File

@ -1669,14 +1669,14 @@ void SwHTMLTableLayout::SetWidths( bool bCallPass2, sal_uInt16 nAbsAvail,
// are altered again. // are altered again.
// Also, we need to preserve a percent setting if it exists. // Also, we need to preserve a percent setting if it exists.
SwFrmFmt *pFrmFmt = pSwTable->GetFrmFmt(); SwFrmFmt *pFrmFmt = pSwTable->GetFrmFmt();
((SwTable *)pSwTable)->LockModify(); const_cast<SwTable *>(pSwTable)->LockModify();
SwFmtFrmSize aFrmSize( pFrmFmt->GetFrmSize() ); SwFmtFrmSize aFrmSize( pFrmFmt->GetFrmSize() );
aFrmSize.SetWidth( nRelTabWidth ); aFrmSize.SetWidth( nRelTabWidth );
bool bRel = bUseRelWidth && bool bRel = bUseRelWidth &&
text::HoriOrientation::FULL!=pFrmFmt->GetHoriOrient().GetHoriOrient(); text::HoriOrientation::FULL!=pFrmFmt->GetHoriOrient().GetHoriOrient();
aFrmSize.SetWidthPercent( (sal_uInt8)(bRel ? nWidthOption : 0) ); aFrmSize.SetWidthPercent( (sal_uInt8)(bRel ? nWidthOption : 0) );
pFrmFmt->SetFmtAttr( aFrmSize ); pFrmFmt->SetFmtAttr( aFrmSize );
((SwTable *)pSwTable)->UnlockModify(); const_cast<SwTable *>(pSwTable)->UnlockModify();
// If the table is located in a frame, we also need to adapt the // If the table is located in a frame, we also need to adapt the
// frame's width. // frame's width.

View File

@ -116,7 +116,7 @@ static void lcl_PaintReplacement( const SwRect &rRect, const OUString &rText,
bool bVisited = false; bool bVisited = false;
if ( rURL.GetMap() ) if ( rURL.GetMap() )
{ {
ImageMap *pMap = (ImageMap*)rURL.GetMap(); ImageMap *pMap = const_cast<ImageMap*>(rURL.GetMap());
for( size_t i = 0; i < pMap->GetIMapObjectCount(); ++i ) for( size_t i = 0; i < pMap->GetIMapObjectCount(); ++i )
{ {
IMapObject *pObj = pMap->GetIMapObject( i ); IMapObject *pObj = pMap->GetIMapObject( i );
@ -533,7 +533,7 @@ bool SwNoTxtFrm::GetCharRect( SwRect &rRect, const SwPosition& rPos,
bool SwNoTxtFrm::GetCrsrOfst(SwPosition* pPos, Point& , bool SwNoTxtFrm::GetCrsrOfst(SwPosition* pPos, Point& ,
SwCrsrMoveState*, bool ) const SwCrsrMoveState*, bool ) const
{ {
SwCntntNode* pCNd = (SwCntntNode*)GetNode(); SwCntntNode* pCNd = const_cast<SwCntntNode*>(GetNode());
pPos->nNode = *pCNd; pPos->nNode = *pCNd;
pPos->nContent.Assign( pCNd, 0 ); pPos->nContent.Assign( pCNd, 0 );
return true; return true;

View File

@ -301,7 +301,7 @@ void SwNumFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
} }
if( pFmt && !pFmt->GetDoc()->IsInDtor() ) if( pFmt && !pFmt->GetDoc()->IsInDtor() )
UpdateNumNodes( (SwDoc*)pFmt->GetDoc() ); UpdateNumNodes( const_cast<SwDoc*>(pFmt->GetDoc()) );
else else
CheckRegistration( pOld, pNew ); CheckRegistration( pOld, pNew );
} }

View File

@ -734,7 +734,7 @@ void SwTableAutoFmt::UpdateFromSet( sal_uInt8 nPos,
if( SfxItemState::SET == rSet.GetItemState( RES_BOXATR_FORMAT, true, if( SfxItemState::SET == rSet.GetItemState( RES_BOXATR_FORMAT, true,
reinterpret_cast<const SfxPoolItem**>(&pNumFmtItem) ) && pNFmtr && reinterpret_cast<const SfxPoolItem**>(&pNumFmtItem) ) && pNFmtr &&
0 != (pNumFormat = pNFmtr->GetEntry( pNumFmtItem->GetValue() )) ) 0 != (pNumFormat = pNFmtr->GetEntry( pNumFmtItem->GetValue() )) )
pFmt->SetValueFormat( const_cast<SvNumberformat*>(pNumFormat)->GetFormatstring(), pFmt->SetValueFormat( pNumFormat->GetFormatstring(),
pNumFormat->GetLanguage(), pNumFormat->GetLanguage(),
::GetAppLanguage()); ::GetAppLanguage());
else else

View File

@ -777,7 +777,7 @@ bool SwTable::InsTable( const SwTable& rCpyTbl, const SwNodeIndex& rSttBox,
if( 0 == ( pTmp = pMyBox->FindNextBox( *this, pMyBox, false ))) if( 0 == ( pTmp = pMyBox->FindNextBox( *this, pMyBox, false )))
bDelCntnt = false; // No space left? bDelCntnt = false; // No space left?
else else
pMyBox = (SwTableBox*)pTmp; pMyBox = const_cast<SwTableBox*>(pTmp);
} while( true ); } while( true );
@ -1040,7 +1040,7 @@ static void _FndCntntBox( const SwTableBox* pBox, SwSelBoxes* pPara )
_FndCntntLine( pLine, pPara ); _FndCntntLine( pLine, pPara );
} }
else else
pPara->insert( (SwTableBox*)pBox ); pPara->insert( const_cast<SwTableBox*>(pBox) );
} }
static void _FndCntntLine( const SwTableLine* pLine, SwSelBoxes* pPara ) static void _FndCntntLine( const SwTableLine* pLine, SwSelBoxes* pPara )
@ -1053,7 +1053,7 @@ static void _FndCntntLine( const SwTableLine* pLine, SwSelBoxes* pPara )
SwSelBoxes& SwTable::SelLineFromBox( const SwTableBox* pBox, SwSelBoxes& SwTable::SelLineFromBox( const SwTableBox* pBox,
SwSelBoxes& rBoxes, bool bToTop ) const SwSelBoxes& rBoxes, bool bToTop ) const
{ {
SwTableLine* pLine = (SwTableLine*)pBox->GetUpper(); SwTableLine* pLine = const_cast<SwTableLine*>(pBox->GetUpper());
if( bToTop ) if( bToTop )
while( pLine->GetUpper() ) while( pLine->GetUpper() )
pLine = pLine->GetUpper()->GetUpper(); pLine = pLine->GetUpper()->GetUpper();

View File

@ -498,7 +498,7 @@ SwRowFrm* GetRowFrm( SwTableLine& rLine )
bool SwTable::InsertCol( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16 nCnt, bool bBehind ) bool SwTable::InsertCol( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16 nCnt, bool bBehind )
{ {
OSL_ENSURE( !rBoxes.empty() && nCnt, "No valid Box List" ); OSL_ENSURE( !rBoxes.empty() && nCnt, "No valid Box List" );
SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode(); SwTableNode* pTblNd = const_cast<SwTableNode*>(rBoxes[0]->GetSttNd()->FindTableNode());
if( !pTblNd ) if( !pTblNd )
return false; return false;
@ -554,7 +554,7 @@ bool SwTable::_InsertRow( SwDoc* pDoc, const SwSelBoxes& rBoxes,
sal_uInt16 nCnt, bool bBehind ) sal_uInt16 nCnt, bool bBehind )
{ {
OSL_ENSURE( pDoc && !rBoxes.empty() && nCnt, "No valid Box List" ); OSL_ENSURE( pDoc && !rBoxes.empty() && nCnt, "No valid Box List" );
SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode(); SwTableNode* pTblNd = const_cast<SwTableNode*>(rBoxes[0]->GetSttNd()->FindTableNode());
if( !pTblNd ) if( !pTblNd )
return false; return false;
@ -757,7 +757,7 @@ void _DeleteBox( SwTable& rTbl, SwTableBox* pBox, SwUndo* pUndo,
} }
// Delete the Box first, then the Nodes! // Delete the Box first, then the Nodes!
SwStartNode* pSttNd = (SwStartNode*)pBox->GetSttNd(); SwStartNode* pSttNd = const_cast<SwStartNode*>(pBox->GetSttNd());
if( pShareFmts ) if( pShareFmts )
pShareFmts->RemoveFormat( *rTblBoxes[ nDelPos ]->GetFrmFmt() ); pShareFmts->RemoveFormat( *rTblBoxes[ nDelPos ]->GetFrmFmt() );
@ -977,7 +977,7 @@ bool SwTable::DeleteSel(
SwTableNode* pTblNd = 0; SwTableNode* pTblNd = 0;
if( !rBoxes.empty() ) if( !rBoxes.empty() )
{ {
pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode(); pTblNd = const_cast<SwTableNode*>(rBoxes[0]->GetSttNd()->FindTableNode());
if( !pTblNd ) if( !pTblNd )
return false; return false;
} }
@ -1045,7 +1045,7 @@ bool SwTable::OldSplitRow( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16 nCn
bool bSameHeight ) bool bSameHeight )
{ {
OSL_ENSURE( pDoc && !rBoxes.empty() && nCnt, "No valid values" ); OSL_ENSURE( pDoc && !rBoxes.empty() && nCnt, "No valid values" );
SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode(); SwTableNode* pTblNd = const_cast<SwTableNode*>(rBoxes[0]->GetSttNd()->FindTableNode());
if( !pTblNd ) if( !pTblNd )
return false; return false;
@ -1187,7 +1187,7 @@ bool SwTable::OldSplitRow( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16 nCn
bool SwTable::SplitCol( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16 nCnt ) bool SwTable::SplitCol( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16 nCnt )
{ {
OSL_ENSURE( pDoc && !rBoxes.empty() && nCnt, "No valid values" ); OSL_ENSURE( pDoc && !rBoxes.empty() && nCnt, "No valid values" );
SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode(); SwTableNode* pTblNd = const_cast<SwTableNode*>(rBoxes[0]->GetSttNd()->FindTableNode());
if( !pTblNd ) if( !pTblNd )
return false; return false;
@ -1551,7 +1551,7 @@ bool SwTable::OldMerge( SwDoc* pDoc, const SwSelBoxes& rBoxes,
SwTableBox* pMergeBox, SwUndoTblMerge* pUndo ) SwTableBox* pMergeBox, SwUndoTblMerge* pUndo )
{ {
OSL_ENSURE( !rBoxes.empty() && pMergeBox, "no valid values" ); OSL_ENSURE( !rBoxes.empty() && pMergeBox, "no valid values" );
SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode(); SwTableNode* pTblNd = const_cast<SwTableNode*>(rBoxes[0]->GetSttNd()->FindTableNode());
if( !pTblNd ) if( !pTblNd )
return false; return false;
@ -2066,10 +2066,10 @@ bool SwTable::MakeCopy( SwDoc* pInsDoc, const SwPosition& rPos,
pInsDoc->CopyTxtColl( *pSrcDoc->getIDocumentStylePoolAccess().GetTxtCollFromPool( RES_POOLCOLL_TABLE_HDLN ) ); pInsDoc->CopyTxtColl( *pSrcDoc->getIDocumentStylePoolAccess().GetTxtCollFromPool( RES_POOLCOLL_TABLE_HDLN ) );
} }
SwTable* pNewTbl = (SwTable*)pInsDoc->InsertTable( SwTable* pNewTbl = const_cast<SwTable*>(pInsDoc->InsertTable(
SwInsertTableOptions( tabopts::HEADLINE_NO_BORDER, 1 ), SwInsertTableOptions( tabopts::HEADLINE_NO_BORDER, 1 ),
rPos, 1, 1, GetFrmFmt()->GetHoriOrient().GetHoriOrient(), rPos, 1, 1, GetFrmFmt()->GetHoriOrient().GetHoriOrient(),
0, 0, false, IsNewModel() ); 0, 0, false, IsNewModel() ));
if( !pNewTbl ) if( !pNewTbl )
return false; return false;
@ -2299,7 +2299,7 @@ SwTableBox* SwTableBox::FindNextBox( const SwTable& rTbl,
const SwTableBox* pSrchBox, bool bOvrTblLns ) const const SwTableBox* pSrchBox, bool bOvrTblLns ) const
{ {
if( !pSrchBox && GetTabLines().empty() ) if( !pSrchBox && GetTabLines().empty() )
return (SwTableBox*)this; return const_cast<SwTableBox*>(this);
return GetUpper()->FindNextBox( rTbl, pSrchBox ? pSrchBox : this, return GetUpper()->FindNextBox( rTbl, pSrchBox ? pSrchBox : this,
bOvrTblLns ); bOvrTblLns );
@ -2310,7 +2310,7 @@ SwTableBox* SwTableBox::FindPreviousBox( const SwTable& rTbl,
const SwTableBox* pSrchBox, bool bOvrTblLns ) const const SwTableBox* pSrchBox, bool bOvrTblLns ) const
{ {
if( !pSrchBox && GetTabLines().empty() ) if( !pSrchBox && GetTabLines().empty() )
return (SwTableBox*)this; return const_cast<SwTableBox*>(this);
return GetUpper()->FindPreviousBox( rTbl, pSrchBox ? pSrchBox : this, return GetUpper()->FindPreviousBox( rTbl, pSrchBox ? pSrchBox : this,
bOvrTblLns ); bOvrTblLns );
} }
@ -3399,7 +3399,7 @@ bool SwTable::SetColWidth( SwTableBox& rAktBox, sal_uInt16 eType,
SwTwips nDistStt = 0; SwTwips nDistStt = 0;
CR_SetBoxWidth aParam( eType, nRelDiff, nDist, rSz.GetWidth(), CR_SetBoxWidth aParam( eType, nRelDiff, nDist, rSz.GetWidth(),
bLeft ? nDist : rSz.GetWidth() - nDist, bLeft ? nDist : rSz.GetWidth() - nDist,
(SwTableNode*)rAktBox.GetSttNd()->FindTableNode() ); const_cast<SwTableNode*>(rAktBox.GetSttNd()->FindTableNode()) );
bBigger = aParam.bBigger; bBigger = aParam.bBigger;
FN_lcl_SetBoxWidth fnSelBox, fnOtherBox; FN_lcl_SetBoxWidth fnSelBox, fnOtherBox;
@ -4131,7 +4131,7 @@ bool SwTable::SetRowHeight( SwTableBox& rAktBox, sal_uInt16 eType,
sal_uLong nBoxIdx = rAktBox.GetSttIdx(); sal_uLong nBoxIdx = rAktBox.GetSttIdx();
CR_SetLineHeight aParam( eType, CR_SetLineHeight aParam( eType,
(SwTableNode*)rAktBox.GetSttNd()->FindTableNode() ); const_cast<SwTableNode*>(rAktBox.GetSttNd()->FindTableNode()) );
bBigger = aParam.bBigger; bBigger = aParam.bBigger;
FN_lcl_SetLineHeight fnSelLine, fnOtherLine = lcl_SetOtherLineHeight; FN_lcl_SetLineHeight fnSelLine, fnOtherLine = lcl_SetOtherLineHeight;

View File

@ -58,7 +58,7 @@ SwCntntNode* SwTxtNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const
// node with the collection and hard attributes. Normally is the same // node with the collection and hard attributes. Normally is the same
// node, but if insert a glossary without formatting, then the Attrnode // node, but if insert a glossary without formatting, then the Attrnode
// is the prev node of the destionation position in dest. document. // is the prev node of the destionation position in dest. document.
SwTxtNode* pCpyTxtNd = (SwTxtNode*)this; SwTxtNode* pCpyTxtNd = const_cast<SwTxtNode*>(this);
SwTxtNode* pCpyAttrNd = pCpyTxtNd; SwTxtNode* pCpyAttrNd = pCpyTxtNd;
// Copy the formats to the other document // Copy the formats to the other document

View File

@ -172,8 +172,8 @@ const tools::PolyPolygon *SwNoTxtNode::HasContour() const
} }
} }
} }
((SwNoTxtNode *)this)->bContourMapModeValid = true; const_cast<SwNoTxtNode *>(this)->bContourMapModeValid = true;
((SwNoTxtNode *)this)->bPixelContour = false; const_cast<SwNoTxtNode *>(this)->bPixelContour = false;
} }
return pContour; return pContour;

View File

@ -78,7 +78,7 @@ void SwNodes::UpdtOutlineIdx( const SwNode& rNd )
if( pOutlineNds->empty() ) // no OutlineNodes present ? if( pOutlineNds->empty() ) // no OutlineNodes present ?
return; return;
const SwNodePtr pSrch = (SwNodePtr)&rNd; const SwNodePtr pSrch = const_cast<SwNodePtr>(&rNd);
sal_uInt16 nPos; sal_uInt16 nPos;
if (!pOutlineNds->Seek_Entry(pSrch, &nPos)) if (!pOutlineNds->Seek_Entry(pSrch, &nPos))

View File

@ -203,8 +203,8 @@ SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & rNewData,
if( rRange.HasMark() ) if( rRange.HasMark() )
{ {
SwPosition *pSttPos = (SwPosition*)rRange.Start(), SwPosition *pSttPos = const_cast<SwPosition*>(rRange.Start()),
*pEndPos = (SwPosition*)rRange.End(); *pEndPos = const_cast<SwPosition*>(rRange.End());
if( pPrvNd && 3 == nRegionRet ) if( pPrvNd && 3 == nRegionRet )
{ {
OSL_ENSURE( pPrvNd, "The SectionNode is missing" ); OSL_ENSURE( pPrvNd, "The SectionNode is missing" );
@ -502,7 +502,7 @@ SwSection* SwDoc::GetCurrSection( const SwPosition& rPos ) const
{ {
const SwSectionNode* pSectNd = rPos.nNode.GetNode().FindSectionNode(); const SwSectionNode* pSectNd = rPos.nNode.GetNode().FindSectionNode();
if( pSectNd ) if( pSectNd )
return (SwSection*)&pSectNd->GetSection(); return const_cast<SwSection*>(&pSectNd->GetSection());
return 0; return 0;
} }

View File

@ -1680,7 +1680,7 @@ bool SwDoc::InsertCol( const SwCursor& rCursor, sal_uInt16 nCnt, bool bBehind )
bool SwDoc::InsertCol( const SwSelBoxes& rBoxes, sal_uInt16 nCnt, bool bBehind ) bool SwDoc::InsertCol( const SwSelBoxes& rBoxes, sal_uInt16 nCnt, bool bBehind )
{ {
OSL_ENSURE( !rBoxes.empty(), "No valid Box list" ); OSL_ENSURE( !rBoxes.empty(), "No valid Box list" );
SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode(); SwTableNode* pTblNd = const_cast<SwTableNode*>(rBoxes[0]->GetSttNd()->FindTableNode());
if( !pTblNd ) if( !pTblNd )
return false; return false;
@ -1742,7 +1742,7 @@ bool SwDoc::InsertRow( const SwCursor& rCursor, sal_uInt16 nCnt, bool bBehind )
bool SwDoc::InsertRow( const SwSelBoxes& rBoxes, sal_uInt16 nCnt, bool bBehind ) bool SwDoc::InsertRow( const SwSelBoxes& rBoxes, sal_uInt16 nCnt, bool bBehind )
{ {
OSL_ENSURE( !rBoxes.empty(), "No valid Box list" ); OSL_ENSURE( !rBoxes.empty(), "No valid Box list" );
SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode(); SwTableNode* pTblNd = const_cast<SwTableNode*>(rBoxes[0]->GetSttNd()->FindTableNode());
if( !pTblNd ) if( !pTblNd )
return false; return false;
@ -1927,7 +1927,7 @@ bool SwDoc::DeleteRowCol( const SwSelBoxes& rBoxes, bool bColumn )
return false; return false;
OSL_ENSURE( !rBoxes.empty(), "No valid Box list" ); OSL_ENSURE( !rBoxes.empty(), "No valid Box list" );
SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode(); SwTableNode* pTblNd = const_cast<SwTableNode*>(rBoxes[0]->GetSttNd()->FindTableNode());
if( !pTblNd ) if( !pTblNd )
return false; return false;
@ -2132,7 +2132,7 @@ bool SwDoc::SplitTbl( const SwSelBoxes& rBoxes, bool bVert, sal_uInt16 nCnt,
bool bSameHeight ) bool bSameHeight )
{ {
OSL_ENSURE( !rBoxes.empty() && nCnt, "No valid Box list" ); OSL_ENSURE( !rBoxes.empty() && nCnt, "No valid Box list" );
SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode(); SwTableNode* pTblNd = const_cast<SwTableNode*>(rBoxes[0]->GetSttNd()->FindTableNode());
if( !pTblNd ) if( !pTblNd )
return false; return false;
@ -2912,7 +2912,7 @@ void SwCollectTblLineBoxes::AddToUndoHistory( const SwCntntNode& rNd )
void SwCollectTblLineBoxes::AddBox( const SwTableBox& rBox ) void SwCollectTblLineBoxes::AddBox( const SwTableBox& rBox )
{ {
aPosArr.push_back(nWidth); aPosArr.push_back(nWidth);
SwTableBox* p = (SwTableBox*)&rBox; SwTableBox* p = const_cast<SwTableBox*>(&rBox);
m_Boxes.push_back(p); m_Boxes.push_back(p);
nWidth = nWidth + (sal_uInt16)rBox.GetFrmFmt()->GetFrmSize().GetWidth(); nWidth = nWidth + (sal_uInt16)rBox.GetFrmFmt()->GetFrmSize().GetWidth();
} }
@ -2986,12 +2986,12 @@ bool sw_Line_CollectBox( const SwTableLine*& rpLine, void* pPara )
{ {
SwCollectTblLineBoxes* pSplPara = (SwCollectTblLineBoxes*)pPara; SwCollectTblLineBoxes* pSplPara = (SwCollectTblLineBoxes*)pPara;
if( pSplPara->IsGetValues() ) if( pSplPara->IsGetValues() )
for( SwTableBoxes::iterator it = ((SwTableLine*)rpLine)->GetTabBoxes().begin(); for( SwTableBoxes::iterator it = const_cast<SwTableLine*>(rpLine)->GetTabBoxes().begin();
it != ((SwTableLine*)rpLine)->GetTabBoxes().end(); ++it) it != const_cast<SwTableLine*>(rpLine)->GetTabBoxes().end(); ++it)
sw_Box_CollectBox(*it, pSplPara ); sw_Box_CollectBox(*it, pSplPara );
else else
for( SwTableBoxes::iterator it = ((SwTableLine*)rpLine)->GetTabBoxes().begin(); for( SwTableBoxes::iterator it = const_cast<SwTableLine*>(rpLine)->GetTabBoxes().begin();
it != ((SwTableLine*)rpLine)->GetTabBoxes().end(); ++it) it != const_cast<SwTableLine*>(rpLine)->GetTabBoxes().end(); ++it)
sw_BoxSetSplitBoxFmts(*it, pSplPara ); sw_BoxSetSplitBoxFmts(*it, pSplPara );
return true; return true;
} }
@ -3699,7 +3699,7 @@ static bool lcl_SetAFmtBox( _FndBox & rBox, _SetAFmtTabPara *pSetPara )
bool SwDoc::SetTableAutoFmt( const SwSelBoxes& rBoxes, const SwTableAutoFmt& rNew ) bool SwDoc::SetTableAutoFmt( const SwSelBoxes& rBoxes, const SwTableAutoFmt& rNew )
{ {
OSL_ENSURE( !rBoxes.empty(), "No valid Box list" ); OSL_ENSURE( !rBoxes.empty(), "No valid Box list" );
SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode(); SwTableNode* pTblNd = const_cast<SwTableNode*>(rBoxes[0]->GetSttNd()->FindTableNode());
if( !pTblNd ) if( !pTblNd )
return false; return false;
@ -3786,7 +3786,7 @@ bool SwDoc::SetTableAutoFmt( const SwSelBoxes& rBoxes, const SwTableAutoFmt& rNe
bool SwDoc::GetTableAutoFmt( const SwSelBoxes& rBoxes, SwTableAutoFmt& rGet ) bool SwDoc::GetTableAutoFmt( const SwSelBoxes& rBoxes, SwTableAutoFmt& rGet )
{ {
OSL_ENSURE( !rBoxes.empty(), "No valid Box list" ); OSL_ENSURE( !rBoxes.empty(), "No valid Box list" );
SwTableNode* pTblNd = (SwTableNode*)rBoxes[0]->GetSttNd()->FindTableNode(); SwTableNode* pTblNd = const_cast<SwTableNode*>(rBoxes[0]->GetSttNd()->FindTableNode());
if( !pTblNd ) if( !pTblNd )
return false; return false;
@ -3930,7 +3930,7 @@ SwTableFmt* SwDoc::FindTblFmtByName( const OUString& rName, bool bAll ) const
bool SwDoc::SetColRowWidthHeight( SwTableBox& rAktBox, sal_uInt16 eType, bool SwDoc::SetColRowWidthHeight( SwTableBox& rAktBox, sal_uInt16 eType,
SwTwips nAbsDiff, SwTwips nRelDiff ) SwTwips nAbsDiff, SwTwips nRelDiff )
{ {
SwTableNode* pTblNd = (SwTableNode*)rAktBox.GetSttNd()->FindTableNode(); SwTableNode* pTblNd = const_cast<SwTableNode*>(rAktBox.GetSttNd()->FindTableNode());
SwUndo* pUndo = 0; SwUndo* pUndo = 0;
if( nsTblChgWidthHeightType::WH_FLAG_INSDEL & eType && pTblNd->GetTable().ISA( SwDDETable )) if( nsTblChgWidthHeightType::WH_FLAG_INSDEL & eType && pTblNd->GetTable().ISA( SwDDETable ))
@ -4292,7 +4292,7 @@ bool SwDoc::InsCopyOfTbl( SwPosition& rInsPos, const SwSelBoxes& rBoxes,
GetIDocumentUndoRedo().DoUndo(false); GetIDocumentUndoRedo().DoUndo(false);
} }
SwDoc* pCpyDoc = (SwDoc*)pSrcTblNd->GetDoc(); SwDoc* pCpyDoc = const_cast<SwDoc*>(pSrcTblNd->GetDoc());
bool bDelCpyDoc = pCpyDoc == this; bool bDelCpyDoc = pCpyDoc == this;
if( bDelCpyDoc ) if( bDelCpyDoc )
@ -4480,7 +4480,7 @@ bool SwDoc::UnProtectTbls( const SwPaM& rPam )
GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, NULL); GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, NULL);
bool bChgd = false, bHasSel = rPam.HasMark() || bool bChgd = false, bHasSel = rPam.HasMark() ||
rPam.GetNext() != (SwPaM*)&rPam; rPam.GetNext() != &rPam;
SwFrmFmts& rFmts = *GetTblFrmFmts(); SwFrmFmts& rFmts = *GetTblFrmFmts();
SwTable* pTbl; SwTable* pTbl;
const SwTableNode* pTblNd; const SwTableNode* pTblNd;
@ -4495,7 +4495,7 @@ bool SwDoc::UnProtectTbls( const SwPaM& rPam )
if( bHasSel ) if( bHasSel )
{ {
bool bFound = false; bool bFound = false;
SwPaM* pTmp = (SwPaM*)&rPam; SwPaM* pTmp = const_cast<SwPaM*>(&rPam);
do { do {
const SwPosition *pStt = pTmp->Start(), const SwPosition *pStt = pTmp->Start(),
*pEnd = pTmp->End(); *pEnd = pTmp->End();

View File

@ -133,8 +133,8 @@ static bool lcl_GetBoxSel( const SwCursor& rCursor, SwSelBoxes& rBoxes,
const SwNode* pNd = pCurPam->GetNode().FindTableBoxStartNode(); const SwNode* pNd = pCurPam->GetNode().FindTableBoxStartNode();
if( pNd ) if( pNd )
{ {
SwTableBox* pBox = (SwTableBox*)pNd->FindTableNode()->GetTable(). SwTableBox* pBox = const_cast<SwTableBox*>(pNd->FindTableNode()->GetTable().
GetTblBox( pNd->GetIndex() ); GetTblBox( pNd->GetIndex() ));
rBoxes.insert( pBox ); rBoxes.insert( pBox );
} }
} while( bAllCrsr && } while( bAllCrsr &&
@ -775,7 +775,7 @@ void SwDoc::SetTabBorders( const SwCursor& rCursor, const SfxItemSet& rSet )
aBox.SetDistance( pSetBox->GetDistance( *pBrd ), *pBrd ); aBox.SetDistance( pSetBox->GetDistance( *pBrd ), *pBrd );
} }
SwTableBox *pBox = (SwTableBox*)pCell->GetTabBox(); SwTableBox *pBox = const_cast<SwTableBox*>(pCell->GetTabBox());
SwFrmFmt *pNewFmt; SwFrmFmt *pNewFmt;
if ( 0 != (pNewFmt = SwTblFmtCmp::FindNewFmt( aFmtCmp, pBox->GetFrmFmt(), nType ))) if ( 0 != (pNewFmt = SwTblFmtCmp::FindNewFmt( aFmtCmp, pBox->GetFrmFmt(), nType )))
pBox->ChgFrmFmt( static_cast<SwTableBoxFmt*>(pNewFmt) ); pBox->ChgFrmFmt( static_cast<SwTableBoxFmt*>(pNewFmt) );
@ -872,16 +872,16 @@ void SwDoc::SetTabLineStyle( const SwCursor& rCursor,
else else
{ {
if ( aBox.GetTop() ) if ( aBox.GetTop() )
::lcl_SetLineStyle( (SvxBorderLine*)aBox.GetTop(), ::lcl_SetLineStyle( const_cast<SvxBorderLine*>(aBox.GetTop()),
pColor, pBorderLine ); pColor, pBorderLine );
if ( aBox.GetBottom() ) if ( aBox.GetBottom() )
::lcl_SetLineStyle( (SvxBorderLine*)aBox.GetBottom(), ::lcl_SetLineStyle( const_cast<SvxBorderLine*>(aBox.GetBottom()),
pColor, pBorderLine ); pColor, pBorderLine );
if ( aBox.GetLeft() ) if ( aBox.GetLeft() )
::lcl_SetLineStyle( (SvxBorderLine*)aBox.GetLeft(), ::lcl_SetLineStyle( const_cast<SvxBorderLine*>(aBox.GetLeft()),
pColor, pBorderLine ); pColor, pBorderLine );
if ( aBox.GetRight() ) if ( aBox.GetRight() )
::lcl_SetLineStyle( (SvxBorderLine*)aBox.GetRight(), ::lcl_SetLineStyle( const_cast<SvxBorderLine*>(aBox.GetRight()),
pColor, pBorderLine ); pColor, pBorderLine );
} }
pFmt->SetFmtAttr( aBox ); pFmt->SetFmtAttr( aBox );
@ -941,7 +941,7 @@ void SwDoc::GetTabBorders( const SwCursor& rCursor, SfxItemSet& rSet ) const
std::vector<SwCellFrm*> aCellArr; std::vector<SwCellFrm*> aCellArr;
aCellArr.reserve(255); aCellArr.reserve(255);
::lcl_CollectCells( aCellArr, rUnion, (SwTabFrm*)pTab ); ::lcl_CollectCells( aCellArr, rUnion, const_cast<SwTabFrm*>(pTab) );
for ( sal_uInt16 j = 0; j < aCellArr.size(); ++j ) for ( sal_uInt16 j = 0; j < aCellArr.size(); ++j )
{ {
@ -1474,7 +1474,7 @@ void SwDoc::AdjustCellWidth( const SwCursor& rCursor, bool bBalance )
// It's more robust if we calculate the minimum values for the whole Table // It's more robust if we calculate the minimum values for the whole Table
const SwTabFrm *pTab = pStart->ImplFindTabFrm(); const SwTabFrm *pTab = pStart->ImplFindTabFrm();
pStart = (SwLayoutFrm*)pTab->FirstCell(); pStart = (SwLayoutFrm*)pTab->FirstCell();
pEnd = (SwLayoutFrm*)pTab->FindLastCntnt()->GetUpper(); pEnd = const_cast<SwLayoutFrm*>(pTab->FindLastCntnt()->GetUpper());
while( !pEnd->IsCellFrm() ) while( !pEnd->IsCellFrm() )
pEnd = pEnd->GetUpper(); pEnd = pEnd->GetUpper();
::lcl_CalcColValues( aMins, aTabCols, pStart, pEnd, false ); ::lcl_CalcColValues( aMins, aTabCols, pStart, pEnd, false );

View File

@ -740,8 +740,8 @@ SwTableBox* SwNode::GetTblBox() const
SwTableBox* pBox = 0; SwTableBox* pBox = 0;
const SwNode* pSttNd = FindTableBoxStartNode(); const SwNode* pSttNd = FindTableBoxStartNode();
if( pSttNd ) if( pSttNd )
pBox = (SwTableBox*)pSttNd->FindTableNode()->GetTable().GetTblBox( pBox = const_cast<SwTableBox*>(pSttNd->FindTableNode()->GetTable().GetTblBox(
pSttNd->GetIndex() ); pSttNd->GetIndex() ));
return pBox; return pBox;
} }
@ -761,7 +761,7 @@ const SwTxtNode* SwNode::FindOutlineNodeOfLevel( sal_uInt8 nLvl ) const
if( MAXLEVEL > nLvl && !rONds.empty() ) if( MAXLEVEL > nLvl && !rONds.empty() )
{ {
sal_uInt16 nPos; sal_uInt16 nPos;
SwNode* pNd = (SwNode*)this; SwNode* pNd = const_cast<SwNode*>(this);
bool bCheckFirst = false; bool bCheckFirst = false;
if( !rONds.Seek_Entry( pNd, &nPos )) if( !rONds.Seek_Entry( pNd, &nPos ))
{ {
@ -1877,7 +1877,7 @@ bool SwCntntNode::IsAnyCondition( SwCollCondition& rTmp ) const
const SwOutlineNodes& rOutlNds = rNds.GetOutLineNds(); const SwOutlineNodes& rOutlNds = rNds.GetOutLineNds();
if( !rOutlNds.empty() ) if( !rOutlNds.empty() )
{ {
if( !rOutlNds.Seek_Entry( (SwCntntNode*)this, &nPos ) && nPos ) if( !rOutlNds.Seek_Entry( const_cast<SwCntntNode*>(this), &nPos ) && nPos )
--nPos; --nPos;
if( nPos < rOutlNds.size() && if( nPos < rOutlNds.size() &&
rOutlNds[ nPos ]->GetIndex() < GetIndex() ) rOutlNds[ nPos ]->GetIndex() < GetIndex() )

View File

@ -87,7 +87,7 @@ public:
inline SwSectionNode* GetSectNode() inline SwSectionNode* GetSectNode()
{ {
const SwNode* pSectNd( const_cast<SwIntrnlSectRefLink*>(this)->GetAnchor() ); const SwNode* pSectNd( GetAnchor() );
return const_cast<SwSectionNode*>( dynamic_cast<const SwSectionNode*>( pSectNd ) ); return const_cast<SwSectionNode*>( dynamic_cast<const SwSectionNode*>( pSectNd ) );
} }
}; };
@ -718,7 +718,7 @@ void SwSectionFmt::DelFrms()
if( pCNd ) if( pCNd )
{ {
const SfxPoolItem& rItem = pCNd->GetSwAttrSet().Get( RES_PAGEDESC ); const SfxPoolItem& rItem = pCNd->GetSwAttrSet().Get( RES_PAGEDESC );
pCNd->ModifyNotification( (SfxPoolItem*)&rItem, (SfxPoolItem*)&rItem ); pCNd->ModifyNotification( &rItem, &rItem );
} }
} }
} }
@ -752,7 +752,7 @@ void SwSectionFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
if( SfxItemState::SET == pNewSet->GetItemState( if( SfxItemState::SET == pNewSet->GetItemState(
RES_PROTECT, false, &pItem )) RES_PROTECT, false, &pItem ))
{ {
ModifyBroadcast( (SfxPoolItem*)pItem, (SfxPoolItem*)pItem ); ModifyBroadcast( pItem, pItem );
pNewSet->ClearItem( RES_PROTECT ); pNewSet->ClearItem( RES_PROTECT );
pOldSet->ClearItem( RES_PROTECT ); pOldSet->ClearItem( RES_PROTECT );
} }
@ -761,7 +761,7 @@ void SwSectionFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
if( SfxItemState::SET == pNewSet->GetItemState( if( SfxItemState::SET == pNewSet->GetItemState(
RES_EDIT_IN_READONLY, false, &pItem ) ) RES_EDIT_IN_READONLY, false, &pItem ) )
{ {
ModifyBroadcast( (SfxPoolItem*)pItem, (SfxPoolItem*)pItem ); ModifyBroadcast( pItem, pItem );
pNewSet->ClearItem( RES_EDIT_IN_READONLY ); pNewSet->ClearItem( RES_EDIT_IN_READONLY );
pOldSet->ClearItem( RES_EDIT_IN_READONLY ); pOldSet->ClearItem( RES_EDIT_IN_READONLY );
} }
@ -769,14 +769,14 @@ void SwSectionFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
if( SfxItemState::SET == pNewSet->GetItemState( if( SfxItemState::SET == pNewSet->GetItemState(
RES_FTN_AT_TXTEND, false, &pItem )) RES_FTN_AT_TXTEND, false, &pItem ))
{ {
ModifyBroadcast( (SfxPoolItem*)&pOldSet->Get( RES_FTN_AT_TXTEND ), (SfxPoolItem*)pItem ); ModifyBroadcast( &pOldSet->Get( RES_FTN_AT_TXTEND ), pItem );
pNewSet->ClearItem( RES_FTN_AT_TXTEND ); pNewSet->ClearItem( RES_FTN_AT_TXTEND );
pOldSet->ClearItem( RES_FTN_AT_TXTEND ); pOldSet->ClearItem( RES_FTN_AT_TXTEND );
} }
if( SfxItemState::SET == pNewSet->GetItemState( if( SfxItemState::SET == pNewSet->GetItemState(
RES_END_AT_TXTEND, false, &pItem )) RES_END_AT_TXTEND, false, &pItem ))
{ {
ModifyBroadcast( (SfxPoolItem*)&pOldSet->Get( RES_END_AT_TXTEND ), (SfxPoolItem*)pItem ); ModifyBroadcast( &pOldSet->Get( RES_END_AT_TXTEND ), pItem );
pNewSet->ClearItem( RES_END_AT_TXTEND ); pNewSet->ClearItem( RES_END_AT_TXTEND );
pOldSet->ClearItem( RES_END_AT_TXTEND ); pOldSet->ClearItem( RES_END_AT_TXTEND );
} }

View File

@ -418,7 +418,7 @@ const SwAnchoredObject* SwFlyDrawContact::GetAnchoredObj( const SdrObject* _pSdr
"<SwFlyDrawContact::GetAnchoredObj(..)> - no object provided" ); "<SwFlyDrawContact::GetAnchoredObj(..)> - no object provided" );
OSL_ENSURE( _pSdrObj->ISA(SwVirtFlyDrawObj), OSL_ENSURE( _pSdrObj->ISA(SwVirtFlyDrawObj),
"<SwFlyDrawContact::GetAnchoredObj(..)> - wrong object type object provided" ); "<SwFlyDrawContact::GetAnchoredObj(..)> - wrong object type object provided" );
OSL_ENSURE( GetUserCall( _pSdrObj ) == const_cast<SwFlyDrawContact*>(this), OSL_ENSURE( GetUserCall( _pSdrObj ) == this,
"<SwFlyDrawContact::GetAnchoredObj(..)> - provided object doesn't belongs to this contact" ); "<SwFlyDrawContact::GetAnchoredObj(..)> - provided object doesn't belongs to this contact" );
const SwAnchoredObject* pRetAnchoredObj = 0L; const SwAnchoredObject* pRetAnchoredObj = 0L;
@ -684,7 +684,7 @@ const SwAnchoredObject* SwDrawContact::GetAnchoredObj( const SdrObject* _pSdrObj
OSL_ENSURE( _pSdrObj->ISA(SwDrawVirtObj) || OSL_ENSURE( _pSdrObj->ISA(SwDrawVirtObj) ||
( !_pSdrObj->ISA(SdrVirtObj) && !_pSdrObj->ISA(SwDrawVirtObj) ), ( !_pSdrObj->ISA(SdrVirtObj) && !_pSdrObj->ISA(SwDrawVirtObj) ),
"<SwDrawContact::GetAnchoredObj(..)> - wrong object type object provided" ); "<SwDrawContact::GetAnchoredObj(..)> - wrong object type object provided" );
OSL_ENSURE( GetUserCall( _pSdrObj ) == const_cast<SwDrawContact*>(this) || OSL_ENSURE( GetUserCall( _pSdrObj ) == this ||
_pSdrObj == GetMaster(), _pSdrObj == GetMaster(),
"<SwDrawContact::GetAnchoredObj(..)> - provided object doesn't belongs to this contact" ); "<SwDrawContact::GetAnchoredObj(..)> - provided object doesn't belongs to this contact" );

View File

@ -318,7 +318,7 @@ void SwEditShell::UpdateFlds( SwField &rFld )
if( 0 != (pTxtFld = GetTxtFldAtPos( pCurStt, true )) ) if( 0 != (pTxtFld = GetTxtFldAtPos( pCurStt, true )) )
{ {
pFmtFld = (SwFmtFld*)&pTxtFld->GetFmtFld(); pFmtFld = const_cast<SwFmtFld*>(&pTxtFld->GetFmtFld());
SwField *pCurFld = pFmtFld->GetField(); SwField *pCurFld = pFmtFld->GetField();
// if there are mixed field types // if there are mixed field types

View File

@ -293,7 +293,7 @@ bool SwEditShell::DeleteGlobalDocContent( const SwGlblDocContents& rArr ,
case GLBLDOC_SECTION: case GLBLDOC_SECTION:
{ {
SwSectionFmt* pSectFmt = (SwSectionFmt*)rDelPos.GetSection()->GetFmt(); SwSectionFmt* pSectFmt = const_cast<SwSectionFmt*>(rDelPos.GetSection()->GetFmt());
pMyDoc->DelSectionFmt( pSectFmt, true ); pMyDoc->DelSectionFmt( pSectFmt, true );
} }
break; break;

View File

@ -188,8 +188,8 @@ bool SwEditShell::_CopySelToDoc( SwDoc* pInsDoc, SwNodeIndex* pSttNd )
SwTableNode* pTblNd; SwTableNode* pTblNd;
SwSelBoxes aBoxes; SwSelBoxes aBoxes;
GetTblSel( *this, aBoxes ); GetTblSel( *this, aBoxes );
if( !aBoxes.empty() && 0 != (pTblNd = (SwTableNode*)aBoxes[0] if( !aBoxes.empty() && 0 != (pTblNd = const_cast<SwTableNode*>(aBoxes[0]
->GetSttNd()->FindTableNode() )) ->GetSttNd()->FindTableNode()) ))
{ {
// check if the table name can be copied // check if the table name can be copied
bool bCpyTblNm = aBoxes.size() == pTblNd->GetTable().GetTabSortBoxes().size(); bool bCpyTblNm = aBoxes.size() == pTblNd->GetTable().GetTabSortBoxes().size();

View File

@ -321,7 +321,7 @@ void SwEditShell::SetGraphicPolygon( const tools::PolyPolygon *pPoly )
pNd->SetContour( pPoly ); pNd->SetContour( pPoly );
SwFlyFrm *pFly = static_cast<SwFlyFrm*>(pNd->getLayoutFrm(GetLayout())->GetUpper()); SwFlyFrm *pFly = static_cast<SwFlyFrm*>(pNd->getLayoutFrm(GetLayout())->GetUpper());
const SwFmtSurround &rSur = pFly->GetFmt()->GetSurround(); const SwFmtSurround &rSur = pFly->GetFmt()->GetSurround();
pFly->GetFmt()->NotifyClients( (SwFmtSurround*)&rSur, (SwFmtSurround*)&rSur ); pFly->GetFmt()->NotifyClients( const_cast<SwFmtSurround*>(&rSur), const_cast<SwFmtSurround*>(&rSur) );
GetDoc()->getIDocumentState().SetModified(); GetDoc()->getIDocumentState().SetModified();
EndAllAction(); EndAllAction();
} }
@ -336,7 +336,7 @@ void SwEditShell::ClearAutomaticContour()
pNd->SetContour( NULL, false ); pNd->SetContour( NULL, false );
SwFlyFrm *pFly = static_cast<SwFlyFrm*>(pNd->getLayoutFrm(GetLayout())->GetUpper()); SwFlyFrm *pFly = static_cast<SwFlyFrm*>(pNd->getLayoutFrm(GetLayout())->GetUpper());
const SwFmtSurround &rSur = pFly->GetFmt()->GetSurround(); const SwFmtSurround &rSur = pFly->GetFmt()->GetSurround();
pFly->GetFmt()->NotifyClients( (SwFmtSurround*)&rSur, (SwFmtSurround*)&rSur ); pFly->GetFmt()->NotifyClients( const_cast<SwFmtSurround*>(&rSur), const_cast<SwFmtSurround*>(&rSur) );
GetDoc()->getIDocumentState().SetModified(); GetDoc()->getIDocumentState().SetModified();
EndAllAction(); EndAllAction();
} }

View File

@ -441,7 +441,7 @@ void SwHyphIter::Start( SwEditShell *pShell, SwDocPositions eStart, SwDocPositio
// nothing to do (at least not in the way as in the "else" part) // nothing to do (at least not in the way as in the "else" part)
bOldIdle = pShell->GetViewOptions()->IsIdle(); bOldIdle = pShell->GetViewOptions()->IsIdle();
const_cast<SwViewOption*>(pShell->GetViewOptions())->SetIdle( false ); pShell->GetViewOptions()->SetIdle( false );
_Start( pShell, eStart, eEnd ); _Start( pShell, eStart, eEnd );
} }
@ -450,7 +450,7 @@ void SwHyphIter::End()
{ {
if( !GetSh() ) if( !GetSh() )
return; return;
const_cast<SwViewOption*>(GetSh()->GetViewOptions())->SetIdle( bOldIdle ); GetSh()->GetViewOptions()->SetIdle( bOldIdle );
_End(); _End();
} }

View File

@ -561,7 +561,7 @@ bool SwEditShell::IsProtectedOutlinePara() const
if( rNd.IsTxtNode() ) if( rNd.IsTxtNode() )
{ {
const SwOutlineNodes& rOutlNd = GetDoc()->GetNodes().GetOutLineNds(); const SwOutlineNodes& rOutlNd = GetDoc()->GetNodes().GetOutLineNds();
SwNodePtr pNd = (SwNodePtr)&rNd; SwNodePtr pNd = const_cast<SwNodePtr>(&rNd);
bool bFirst = true; bool bFirst = true;
sal_uInt16 nPos; sal_uInt16 nPos;
int nLvl(0); int nLvl(0);

View File

@ -142,7 +142,7 @@ bool SwEditShell::IsAnySectionInDoc( bool bChkReadOnly, bool bChkHidden, bool bC
sal_uInt16 SwEditShell::GetSectionFmtPos( const SwSectionFmt& rFmt ) const sal_uInt16 SwEditShell::GetSectionFmtPos( const SwSectionFmt& rFmt ) const
{ {
SwSectionFmt* pFmt = (SwSectionFmt*)&rFmt; SwSectionFmt* pFmt = const_cast<SwSectionFmt*>(&rFmt);
return GetDoc()->GetSections().GetPos( pFmt ); return GetDoc()->GetSections().GetPos( pFmt );
} }

View File

@ -230,11 +230,11 @@ void SwEditShell::InsertDDETable( const SwInsertTableOptions& rInsTblOpts,
const SwInsertTableOptions aInsTblOpts( rInsTblOpts.mnInsMode | tabopts::DEFAULT_BORDER, const SwInsertTableOptions aInsTblOpts( rInsTblOpts.mnInsMode | tabopts::DEFAULT_BORDER,
rInsTblOpts.mnRowsToRepeat ); rInsTblOpts.mnRowsToRepeat );
SwTable* pTbl = (SwTable*)GetDoc()->InsertTable( aInsTblOpts, *pPos, SwTable* pTbl = const_cast<SwTable*>(GetDoc()->InsertTable( aInsTblOpts, *pPos,
nRows, nCols, eAdj ); nRows, nCols, eAdj ));
SwTableNode* pTblNode = (SwTableNode*)pTbl->GetTabSortBoxes()[ 0 ]-> SwTableNode* pTblNode = const_cast<SwTableNode*>(pTbl->GetTabSortBoxes()[ 0 ]->
GetSttNd()->FindTableNode(); GetSttNd()->FindTableNode());
SwDDETable* pDDETbl = new SwDDETable( *pTbl, pDDEType ); SwDDETable* pDDETbl = new SwDDETable( *pTbl, pDDEType );
pTblNode->SetNewTable( pDDETbl ); // setze die DDE-Tabelle pTblNode->SetNewTable( pDDETbl ); // setze die DDE-Tabelle
@ -256,7 +256,7 @@ void SwEditShell::UpdateTable()
if( DoesUndo() ) if( DoesUndo() )
StartUndo(); StartUndo();
EndAllTblBoxEdit(); EndAllTblBoxEdit();
SwTableFmlUpdate aTblUpdate( (SwTable*)&pTblNd->GetTable() ); SwTableFmlUpdate aTblUpdate( &pTblNd->GetTable() );
GetDoc()->getIDocumentFieldsAccess().UpdateTblFlds( &aTblUpdate ); GetDoc()->getIDocumentFieldsAccess().UpdateTblFlds( &aTblUpdate );
if( DoesUndo() ) if( DoesUndo() )
EndUndo(); EndUndo();
@ -321,7 +321,7 @@ bool SwEditShell::GetTblBoxFormulaAttrs( SfxItemSet& rSet ) const
// Convert formulae into external presentation // Convert formulae into external presentation
const SwTable& rTbl = pSelBox->GetSttNd()->FindTableNode()->GetTable(); const SwTable& rTbl = pSelBox->GetSttNd()->FindTableNode()->GetTable();
SwTableFmlUpdate aTblUpdate( (SwTable*)&rTbl ); SwTableFmlUpdate aTblUpdate( &rTbl );
aTblUpdate.eFlags = TBL_BOXNAME; aTblUpdate.eFlags = TBL_BOXNAME;
static_cast<SwDoc*>(GetDoc())->getIDocumentFieldsAccess().UpdateTblFlds( &aTblUpdate ); static_cast<SwDoc*>(GetDoc())->getIDocumentFieldsAccess().UpdateTblFlds( &aTblUpdate );

View File

@ -284,7 +284,7 @@ sal_uInt16 SwAuthorityFieldType::GetSequencePos(sal_IntPtr nHandle)
} }
const SwTxtNode& rFldTxtNode = pTxtFld->GetTxtNode(); const SwTxtNode& rFldTxtNode = pTxtFld->GetTxtNode();
SwPosition aFldPos(rFldTxtNode); SwPosition aFldPos(rFldTxtNode);
SwDoc& rDoc = *(SwDoc*)rFldTxtNode.GetDoc(); SwDoc& rDoc = *const_cast<SwDoc*>(rFldTxtNode.GetDoc());
SwCntntFrm *pFrm = rFldTxtNode.getLayoutFrm( rDoc.getIDocumentLayoutAccess().GetCurrentLayout() ); SwCntntFrm *pFrm = rFldTxtNode.getLayoutFrm( rDoc.getIDocumentLayoutAccess().GetCurrentLayout() );
const SwTxtNode* pTxtNode = 0; const SwTxtNode* pTxtNode = 0;
if(pFrm && !pFrm->IsInDocBody()) if(pFrm && !pFrm->IsInDocBody())

View File

@ -90,7 +90,7 @@ double SwTableBox::GetValue( SwTblCalcPara& rCalcPara ) const
rCalcPara.SetLastTblBox( this ); rCalcPara.SetLastTblBox( this );
// Does it create a recursion? // Does it create a recursion?
SwTableBox* pBox = (SwTableBox*)this; SwTableBox* pBox = const_cast<SwTableBox*>(this);
if( rCalcPara.pBoxStk->find( pBox ) != rCalcPara.pBoxStk->end() ) if( rCalcPara.pBoxStk->find( pBox ) != rCalcPara.pBoxStk->end() )
return nRet; // already on the stack: error return nRet; // already on the stack: error
@ -271,7 +271,7 @@ bool SwTblCalcPara::CalcWithStackOverflow()
sal_uInt16 nCnt = 0; sal_uInt16 nCnt = 0;
SwTableBoxes aStackOverflows; SwTableBoxes aStackOverflows;
do { do {
SwTableBox* pBox = (SwTableBox*)pLastTblBox; SwTableBox* pBox = const_cast<SwTableBox*>(pLastTblBox);
nStackCnt = 0; nStackCnt = 0;
rCalc.SetCalcError( CALC_NOERR ); rCalc.SetCalcError( CALC_NOERR );
aStackOverflows.insert( aStackOverflows.begin() + nCnt++, pBox ); aStackOverflows.insert( aStackOverflows.begin() + nCnt++, pBox );
@ -381,7 +381,7 @@ void SwTableFormula::RelNmsToBoxNms( const SwTable& rTbl, OUString& rNewStr,
// relative name w.r.t. box name (external presentation) // relative name w.r.t. box name (external presentation)
SwNode* pNd = (SwNode*)pPara; SwNode* pNd = (SwNode*)pPara;
OSL_ENSURE( pNd, "Feld steht in keinem TextNode" ); OSL_ENSURE( pNd, "Feld steht in keinem TextNode" );
const SwTableBox *pBox = (SwTableBox *)rTbl.GetTblBox( const SwTableBox *pBox = rTbl.GetTblBox(
pNd->FindTableBoxStartNode()->GetIndex() ); pNd->FindTableBoxStartNode()->GetIndex() );
rNewStr += OUString(rFirstBox[0]); // get label for the box rNewStr += OUString(rFirstBox[0]); // get label for the box
@ -414,7 +414,7 @@ void SwTableFormula::RelBoxNmsToPtr( const SwTable& rTbl, OUString& rNewStr,
// relative name w.r.t. box name (internal presentation) // relative name w.r.t. box name (internal presentation)
SwNode* pNd = (SwNode*)pPara; SwNode* pNd = (SwNode*)pPara;
OSL_ENSURE( pNd, "Field not placed in any Node" ); OSL_ENSURE( pNd, "Field not placed in any Node" );
const SwTableBox *pBox = (SwTableBox*)rTbl.GetTblBox( const SwTableBox *pBox = rTbl.GetTblBox(
pNd->FindTableBoxStartNode()->GetIndex() ); pNd->FindTableBoxStartNode()->GetIndex() );
rNewStr += OUString(rFirstBox[0]); // get label for the box rNewStr += OUString(rFirstBox[0]); // get label for the box
@ -762,12 +762,12 @@ static const SwTableBox* lcl_RelToBox( const SwTable& rTbl,
sGetName = sGetName.copy( 1 ); sGetName = sGetName.copy( 1 );
const SwTableLines* pLines = (SwTableLines*)&rTbl.GetTabLines(); const SwTableLines* pLines = &rTbl.GetTabLines();
const SwTableBoxes* pBoxes; const SwTableBoxes* pBoxes;
const SwTableLine* pLine; const SwTableLine* pLine;
// determine starting values of the box,... // determine starting values of the box,...
pBox = (SwTableBox*)pRefBox; pBox = pRefBox;
pLine = pBox->GetUpper(); pLine = pBox->GetUpper();
while( pLine->GetUpper() ) while( pLine->GetUpper() )
{ {
@ -995,18 +995,18 @@ void SwTableFormula::_HasValidBoxes( const SwTable& rTbl, OUString& ,
{ {
const SwNode* pNd = GetNodeOfFormula(); const SwNode* pNd = GetNodeOfFormula();
const SwTableBox* pBox = !pNd ? 0 const SwTableBox* pBox = !pNd ? 0
: (SwTableBox *)rTbl.GetTblBox( : const_cast<SwTableBox *>(rTbl.GetTblBox(
pNd->FindTableBoxStartNode()->GetIndex() ); pNd->FindTableBoxStartNode()->GetIndex() ));
if( pLastBox ) if( pLastBox )
pEndBox = (SwTableBox*)lcl_RelToBox( rTbl, pBox, *pLastBox ); pEndBox = const_cast<SwTableBox*>(lcl_RelToBox( rTbl, pBox, *pLastBox ));
pSttBox = (SwTableBox*)lcl_RelToBox( rTbl, pBox, rFirstBox ); pSttBox = const_cast<SwTableBox*>(lcl_RelToBox( rTbl, pBox, rFirstBox ));
} }
break; break;
case EXTRNL_NAME: case EXTRNL_NAME:
if( pLastBox ) if( pLastBox )
pEndBox = (SwTableBox*)rTbl.GetTblBox( *pLastBox ); pEndBox = const_cast<SwTableBox*>(rTbl.GetTblBox( *pLastBox ));
pSttBox = (SwTableBox*)rTbl.GetTblBox( rFirstBox ); pSttBox = const_cast<SwTableBox*>(rTbl.GetTblBox( rFirstBox ));
break; break;
} }
@ -1104,15 +1104,15 @@ void SwTableFormula::_SplitMergeBoxNm( const SwTable& rTbl, OUString& rNewStr,
const SwTableBox* pBox = pNd ? pTbl->GetTblBox( const SwTableBox* pBox = pNd ? pTbl->GetTblBox(
pNd->FindTableBoxStartNode()->GetIndex() ) : 0; pNd->FindTableBoxStartNode()->GetIndex() ) : 0;
if( pLastBox ) if( pLastBox )
pEndBox = (SwTableBox*)lcl_RelToBox( *pTbl, pBox, *pLastBox ); pEndBox = const_cast<SwTableBox*>(lcl_RelToBox( *pTbl, pBox, *pLastBox ));
pSttBox = (SwTableBox*)lcl_RelToBox( *pTbl, pBox, rFirstBox ); pSttBox = const_cast<SwTableBox*>(lcl_RelToBox( *pTbl, pBox, rFirstBox ));
} }
break; break;
case EXTRNL_NAME: case EXTRNL_NAME:
if( pLastBox ) if( pLastBox )
pEndBox = (SwTableBox*)pTbl->GetTblBox( *pLastBox ); pEndBox = const_cast<SwTableBox*>(pTbl->GetTblBox( *pLastBox ));
pSttBox = (SwTableBox*)pTbl->GetTblBox( rFirstBox ); pSttBox = const_cast<SwTableBox*>(pTbl->GetTblBox( rFirstBox ));
break; break;
} }

View File

@ -103,7 +103,7 @@ void SwChapterField::ChangeExpansion(const SwFrm* pFrm,
bool bSrchNum ) bool bSrchNum )
{ {
OSL_ENSURE( pFrm, "In which frame am I?" ); OSL_ENSURE( pFrm, "In which frame am I?" );
SwDoc* pDoc = (SwDoc*)pCntntNode->GetDoc(); SwDoc* pDoc = const_cast<SwDoc*>(pCntntNode->GetDoc());
const SwTxtNode* pTxtNode = dynamic_cast<const SwTxtNode*>(pCntntNode); const SwTxtNode* pTxtNode = dynamic_cast<const SwTxtNode*>(pCntntNode);
if ( !pTxtNode || !pFrm->IsInDocBody() ) if ( !pTxtNode || !pFrm->IsInDocBody() )
@ -125,7 +125,7 @@ void SwChapterField::ChangeExpansion(const SwTxtNode &rTxtNd, bool bSrchNum)
sPost.clear(); sPost.clear();
sPre.clear(); sPre.clear();
SwDoc* pDoc = (SwDoc*)rTxtNd.GetDoc(); SwDoc* pDoc = const_cast<SwDoc*>(rTxtNd.GetDoc());
const SwTxtNode *pTxtNd = rTxtNd.FindOutlineNodeOfLevel( nLevel ); const SwTxtNode *pTxtNd = rTxtNd.FindOutlineNodeOfLevel( nLevel );
if( pTxtNd ) if( pTxtNd )
{ {

View File

@ -2211,7 +2211,7 @@ void SwRefPageGetField::ChangeExpansion( const SwFrm* pFrm,
// create index for determination of the TextNode // create index for determination of the TextNode
SwPosition aPos( SwNodeIndex( pDoc->GetNodes() ) ); SwPosition aPos( SwNodeIndex( pDoc->GetNodes() ) );
SwTxtNode* pTxtNode = (SwTxtNode*) GetBodyTxtNode( *pDoc, aPos, *pFrm ); SwTxtNode* pTxtNode = const_cast<SwTxtNode*>(GetBodyTxtNode( *pDoc, aPos, *pFrm ));
// If no layout exists, ChangeExpansion is called for header and // If no layout exists, ChangeExpansion is called for header and
// footer lines via layout formatting without existing TxtNode. // footer lines via layout formatting without existing TxtNode.

View File

@ -163,7 +163,7 @@ SwTxtNode* GetFirstTxtNode( const SwDoc& rDoc, SwPosition& rPos,
const SwTxtNode* GetBodyTxtNode( const SwDoc& rDoc, SwPosition& rPos, const SwTxtNode* GetBodyTxtNode( const SwDoc& rDoc, SwPosition& rPos,
const SwFrm& rFrm ) const SwFrm& rFrm )
{ {
const SwLayoutFrm* pLayout = (SwLayoutFrm*)rFrm.GetUpper(); const SwLayoutFrm* pLayout = rFrm.GetUpper();
const SwTxtNode* pTxtNode = 0; const SwTxtNode* pTxtNode = 0;
while( pLayout ) while( pLayout )
@ -328,7 +328,7 @@ void SwGetExpField::ChangeExpansion( const SwFrm& rFrm, const SwTxtFld& rFld )
// determine document (or is there an easier way?) // determine document (or is there an easier way?)
const SwTxtNode* pTxtNode = &rFld.GetTxtNode(); const SwTxtNode* pTxtNode = &rFld.GetTxtNode();
SwDoc& rDoc = *(SwDoc*)pTxtNode->GetDoc(); SwDoc& rDoc = *const_cast<SwDoc*>(pTxtNode->GetDoc());
// create index for determination of the TextNode // create index for determination of the TextNode
SwPosition aPos( SwNodeIndex( rDoc.GetNodes() ) ); SwPosition aPos( SwNodeIndex( rDoc.GetNodes() ) );

View File

@ -93,7 +93,7 @@ SwField* SwInputFieldList::GetField(size_t nId)
{ {
const SwTxtFld* pTxtFld = (*pSrtLst)[ nId ]->GetTxtFld(); const SwTxtFld* pTxtFld = (*pSrtLst)[ nId ]->GetTxtFld();
OSL_ENSURE( pTxtFld, "no TextFld" ); OSL_ENSURE( pTxtFld, "no TextFld" );
return (SwField*)pTxtFld->GetFmtFld().GetField(); return const_cast<SwField*>(pTxtFld->GetFmtFld().GetField());
} }
/// save cursor /// save cursor

View File

@ -97,9 +97,9 @@ bool IsFrameBehind( const SwTxtNode& rMyNd, sal_Int32 nMySttPos,
*pFrm = static_cast<SwTxtFrm*>(rBehindNd.getLayoutFrm( rBehindNd.GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout(), 0, 0, false) ); *pFrm = static_cast<SwTxtFrm*>(rBehindNd.getLayoutFrm( rBehindNd.GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout(), 0, 0, false) );
while( pFrm && !pFrm->IsInside( nSttPos ) ) while( pFrm && !pFrm->IsInside( nSttPos ) )
pFrm = (SwTxtFrm*)pFrm->GetFollow(); pFrm = pFrm->GetFollow();
while( pMyFrm && !pMyFrm->IsInside( nMySttPos ) ) while( pMyFrm && !pMyFrm->IsInside( nMySttPos ) )
pMyFrm = (SwTxtFrm*)pMyFrm->GetFollow(); pMyFrm = pMyFrm->GetFollow();
if( !pFrm || !pMyFrm || pFrm == pMyFrm ) if( !pFrm || !pMyFrm || pFrm == pMyFrm )
return false; return false;
@ -421,7 +421,7 @@ void SwGetRefField::UpdateField( const SwTxtFld* pFldTxtAttr )
const SwTxtFrm* pFrm = static_cast<SwTxtFrm*>(pTxtNd->getLayoutFrm( pDoc->getIDocumentLayoutAccess().GetCurrentLayout(), 0, 0, false)), const SwTxtFrm* pFrm = static_cast<SwTxtFrm*>(pTxtNd->getLayoutFrm( pDoc->getIDocumentLayoutAccess().GetCurrentLayout(), 0, 0, false)),
*pSave = pFrm; *pSave = pFrm;
while( pFrm && !pFrm->IsInside( nNumStart ) ) while( pFrm && !pFrm->IsInside( nNumStart ) )
pFrm = (SwTxtFrm*)pFrm->GetFollow(); pFrm = pFrm->GetFollow();
if( pFrm || 0 != ( pFrm = pSave )) if( pFrm || 0 != ( pFrm = pSave ))
{ {
@ -826,7 +826,7 @@ SwTxtNode* SwGetRefFieldType::FindAnchor( SwDoc* pDoc, const OUString& rRefMark,
const SwFmtRefMark *pRef = pDoc->GetRefMark( rRefMark ); const SwFmtRefMark *pRef = pDoc->GetRefMark( rRefMark );
if( pRef && pRef->GetTxtRefMark() ) if( pRef && pRef->GetTxtRefMark() )
{ {
pTxtNd = (SwTxtNode*)&pRef->GetTxtRefMark()->GetTxtNode(); pTxtNd = const_cast<SwTxtNode*>(&pRef->GetTxtRefMark()->GetTxtNode());
*pStt = pRef->GetTxtRefMark()->GetStart(); *pStt = pRef->GetTxtRefMark()->GetStart();
if( pEnd ) if( pEnd )
*pEnd = *pRef->GetTxtRefMark()->GetAnyEnd(); *pEnd = *pRef->GetTxtRefMark()->GetAnyEnd();

View File

@ -154,7 +154,7 @@ bool SwTblField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
case FIELD_PROP_PAR2: case FIELD_PROP_PAR2:
{ {
sal_uInt16 nOldSubType = nSubType; sal_uInt16 nOldSubType = nSubType;
SwTblField* pThis = (SwTblField*)this; SwTblField* pThis = const_cast<SwTblField*>(this);
pThis->nSubType |= nsSwExtendedSubType::SUB_CMD; pThis->nSubType |= nsSwExtendedSubType::SUB_CMD;
rAny <<= Expand(); rAny <<= Expand();
pThis->nSubType = nOldSubType; pThis->nSubType = nOldSubType;

View File

@ -209,7 +209,7 @@ bool sw_ChkAndSetNewAnchor(
if( nOld == nNew ) if( nOld == nNew )
return false; return false;
SwDoc* pDoc = (SwDoc*)rFmt.GetDoc(); SwDoc* pDoc = const_cast<SwDoc*>(rFmt.GetDoc());
#if OSL_DEBUG_LEVEL > 0 #if OSL_DEBUG_LEVEL > 0
OSL_ENSURE( !(nNew == FLY_AT_PAGE && OSL_ENSURE( !(nNew == FLY_AT_PAGE &&
@ -1468,7 +1468,7 @@ const SwFrmFmt* SwFEShell::IsURLGrfAtPos( const Point& rPt, OUString* pURL,
SdrObject* pObj; SdrObject* pObj;
SdrPageView* pPV; SdrPageView* pPV;
const SwFrmFmt* pRet = 0; const SwFrmFmt* pRet = 0;
SwDrawView *pDView = (SwDrawView*)Imp()->GetDrawView(); SwDrawView *pDView = const_cast<SwDrawView*>(Imp()->GetDrawView());
sal_uInt16 nOld = pDView->GetHitTolerancePixel(); sal_uInt16 nOld = pDView->GetHitTolerancePixel();
pDView->SetHitTolerancePixel( 2 ); pDView->SetHitTolerancePixel( 2 );
@ -1539,7 +1539,7 @@ const Graphic *SwFEShell::GetGrfAtPos( const Point &rPt,
SdrObject* pObj; SdrObject* pObj;
SdrPageView* pPV; SdrPageView* pPV;
SwDrawView *pDView = (SwDrawView*)Imp()->GetDrawView(); SwDrawView *pDView = const_cast<SwDrawView*>(Imp()->GetDrawView());
if( pDView->PickObj( rPt, pDView->getHitTolLog(), pObj, pPV ) && pObj->ISA(SwVirtFlyDrawObj) ) if( pDView->PickObj( rPt, pDView->getHitTolLog(), pObj, pPV ) && pObj->ISA(SwVirtFlyDrawObj) )
{ {
@ -1577,7 +1577,7 @@ const SwFrmFmt* SwFEShell::GetFmtFromObj( const Point& rPt, SwRect** pRectToFill
SdrObject* pObj; SdrObject* pObj;
SdrPageView* pPView; SdrPageView* pPView;
SwDrawView *pDView = (SwDrawView*)Imp()->GetDrawView(); SwDrawView *pDView = const_cast<SwDrawView*>(Imp()->GetDrawView());
sal_uInt16 nOld = pDView->GetHitTolerancePixel(); sal_uInt16 nOld = pDView->GetHitTolerancePixel();
// tolerance for Drawing-SS // tolerance for Drawing-SS
@ -1701,7 +1701,7 @@ ObjCntType SwFEShell::GetObjCntType( const Point &rPt, SdrObject *&rpObj ) const
SdrObject* pObj; SdrObject* pObj;
SdrPageView* pPView; SdrPageView* pPView;
SwDrawView *pDView = (SwDrawView*)Imp()->GetDrawView(); SwDrawView *pDView = const_cast<SwDrawView*>(Imp()->GetDrawView());
sal_uInt16 nOld = pDView->GetHitTolerancePixel(); sal_uInt16 nOld = pDView->GetHitTolerancePixel();
// tolerance for Drawing-SS // tolerance for Drawing-SS

View File

@ -1393,13 +1393,13 @@ bool SwFEShell::GotoObj( bool bNext, sal_uInt16 /*GOTOOBJ_...*/ eType )
{ {
const SwVirtFlyDrawObj *pO = static_cast<const SwVirtFlyDrawObj*>(pBest); const SwVirtFlyDrawObj *pO = static_cast<const SwVirtFlyDrawObj*>(pBest);
const SwRect& rFrm = pO->GetFlyFrm()->Frm(); const SwRect& rFrm = pO->GetFlyFrm()->Frm();
SelectObj( rFrm.Pos(), 0, (SdrObject*)pBest ); SelectObj( rFrm.Pos(), 0, const_cast<SdrObject*>(pBest) );
if( !ActionPend() ) if( !ActionPend() )
MakeVisible( rFrm ); MakeVisible( rFrm );
} }
else else
{ {
SelectObj( Point(), 0, (SdrObject*)pBest ); SelectObj( Point(), 0, const_cast<SdrObject*>(pBest) );
if( !ActionPend() ) if( !ActionPend() )
MakeVisible( pBest->GetCurrentBoundRect() ); MakeVisible( pBest->GetCurrentBoundRect() );
} }
@ -2511,7 +2511,7 @@ SwChainRet SwFEShell::Chainable( SwRect &rRect, const SwFrmFmt &rSource,
{ {
SdrObject* pObj; SdrObject* pObj;
SdrPageView* pPView; SdrPageView* pPView;
SwDrawView *pDView = (SwDrawView*)Imp()->GetDrawView(); SwDrawView *pDView = const_cast<SwDrawView*>(Imp()->GetDrawView());
const sal_uInt16 nOld = pDView->GetHitTolerancePixel(); const sal_uInt16 nOld = pDView->GetHitTolerancePixel();
pDView->SetHitTolerancePixel( 0 ); pDView->SetHitTolerancePixel( 0 );
if( pDView->PickObj( rPt, pDView->getHitTolLog(), pObj, pPView, SDRSEARCH_PICKMARKABLE ) && if( pDView->PickObj( rPt, pDView->getHitTolLog(), pObj, pPView, SDRSEARCH_PICKMARKABLE ) &&

View File

@ -1171,7 +1171,7 @@ bool SwFEShell::IsAdjustCellWidthAllowed( bool bBalance ) const
// AutoFormat for the table/table selection // AutoFormat for the table/table selection
bool SwFEShell::SetTableAutoFmt( const SwTableAutoFmt& rNew ) bool SwFEShell::SetTableAutoFmt( const SwTableAutoFmt& rNew )
{ {
SwTableNode *pTblNd = (SwTableNode*)IsCrsrInTbl(); SwTableNode *pTblNd = const_cast<SwTableNode*>(IsCrsrInTbl());
if( !pTblNd || pTblNd->GetTable().IsTblComplex() ) if( !pTblNd || pTblNd->GetTable().IsTblComplex() )
return false; return false;
@ -2332,7 +2332,7 @@ bool SwFEShell::IsTableRightToLeft() const
bool SwFEShell::IsMouseTableRightToLeft(const Point &rPt) const bool SwFEShell::IsMouseTableRightToLeft(const Point &rPt) const
{ {
SwFrm *pFrm = (SwFrm *)GetBox( rPt ); SwFrm *pFrm = const_cast<SwFrm *>(GetBox( rPt ));
const SwTabFrm* pTabFrm = pFrm ? pFrm->ImplFindTabFrm() : 0; const SwTabFrm* pTabFrm = pFrm ? pFrm->ImplFindTabFrm() : 0;
OSL_ENSURE( pTabFrm, "Table not found" ); OSL_ENSURE( pTabFrm, "Table not found" );
return pTabFrm && pTabFrm->IsRightToLeft(); return pTabFrm && pTabFrm->IsRightToLeft();

View File

@ -339,7 +339,7 @@ void SwFEShell::SetNewPageOffset( sal_uInt16 nOffset )
{ {
GetLayout()->SetVirtPageNum( true ); GetLayout()->SetVirtPageNum( true );
const SwPageFrm *pPage = GetCurrFrm( false )->FindPageFrm(); const SwPageFrm *pPage = GetCurrFrm( false )->FindPageFrm();
lcl_SetAPageOffset( nOffset, (SwPageFrm*)pPage, this ); lcl_SetAPageOffset( nOffset, const_cast<SwPageFrm*>(pPage), this );
} }
void SwFEShell::SetPageOffset( sal_uInt16 nOffset ) void SwFEShell::SetPageOffset( sal_uInt16 nOffset )
@ -357,7 +357,7 @@ void SwFEShell::SetPageOffset( sal_uInt16 nOffset )
if ( rPgDesc.GetNumOffset() ) if ( rPgDesc.GetNumOffset() )
{ {
pDocLayout->SetVirtPageNum( true ); pDocLayout->SetVirtPageNum( true );
lcl_SetAPageOffset( nOffset, (SwPageFrm*)pPage, this ); lcl_SetAPageOffset( nOffset, const_cast<SwPageFrm*>(pPage), this );
break; break;
} }
} }
@ -658,7 +658,7 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
bool bWrapThrough = false; bool bWrapThrough = false;
if ( pFly ) if ( pFly )
{ {
SwFlyFrmFmt* pFmt = (SwFlyFrmFmt*)pFly->GetFmt(); SwFlyFrmFmt* pFmt = const_cast<SwFlyFrmFmt*>(pFly->GetFmt());
const SwFmtSurround& rSurround = pFmt->GetSurround(); const SwFmtSurround& rSurround = pFmt->GetSurround();
bWrapThrough = rSurround.GetSurround() == SURROUND_THROUGHT; bWrapThrough = rSurround.GetSurround() == SURROUND_THROUGHT;
} }

View File

@ -131,7 +131,7 @@ void GetTblSelCrs( const SwTableCursor& rTblCrsr, SwSelBoxes& rBoxes )
if (rTblCrsr.IsChgd() || !rTblCrsr.GetSelectedBoxesCount()) if (rTblCrsr.IsChgd() || !rTblCrsr.GetSelectedBoxesCount())
{ {
SwTableCursor* pTCrsr = (SwTableCursor*)&rTblCrsr; SwTableCursor* pTCrsr = const_cast<SwTableCursor*>(&rTblCrsr);
pTCrsr->GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout()->MakeTblCrsrs( *pTCrsr ); pTCrsr->GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout()->MakeTblCrsrs( *pTCrsr );
} }
@ -308,8 +308,8 @@ void GetTblSel( const SwLayoutFrm* pStart, const SwLayoutFrm* pEnd,
OSL_ENSURE( pCell->IsCellFrm(), "Frame ohne Celle" ); OSL_ENSURE( pCell->IsCellFrm(), "Frame ohne Celle" );
if( ::IsFrmInTblSel( pUnion->GetUnion(), pCell ) ) if( ::IsFrmInTblSel( pUnion->GetUnion(), pCell ) )
{ {
SwTableBox* pBox = (SwTableBox*) SwTableBox* pBox = const_cast<SwTableBox*>(
static_cast<const SwCellFrm*>(pCell)->GetTabBox(); static_cast<const SwCellFrm*>(pCell)->GetTabBox());
// check for cell protection?? // check for cell protection??
if( !bChkProtected || if( !bChkProtected ||
!pBox->GetFrmFmt()->GetProtect().IsCntntProtected() ) !pBox->GetFrmFmt()->GetProtect().IsCntntProtected() )
@ -924,9 +924,9 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
return; return;
const SwTable *pTable = aUnions.front().GetTable()->GetTable(); const SwTable *pTable = aUnions.front().GetTable()->GetTable();
SwDoc* pDoc = (SwDoc*)pStart->GetFmt()->GetDoc(); SwDoc* pDoc = const_cast<SwDoc*>(pStart->GetFmt()->GetDoc());
SwTableNode* pTblNd = (SwTableNode*)pTable->GetTabSortBoxes()[ 0 ]-> SwTableNode* pTblNd = const_cast<SwTableNode*>(pTable->GetTabSortBoxes()[ 0 ]->
GetSttNd()->FindTableNode(); GetSttNd()->FindTableNode());
_MergePos aPosArr; // Sort-Array with the frame positions _MergePos aPosArr; // Sort-Array with the frame positions
long nWidth; long nWidth;
@ -1922,7 +1922,7 @@ void MakeSelUnions( SwSelUnions& rUnions, const SwLayoutFrm *pStart,
if( (aUnion.*fnRect->fnGetWidth)() ) if( (aUnion.*fnRect->fnGetWidth)() )
{ {
SwSelUnion *pTmp = new SwSelUnion( aUnion, (SwTabFrm*)pTable ); SwSelUnion *pTmp = new SwSelUnion( aUnion, const_cast<SwTabFrm*>(pTable) );
rUnions.push_back( pTmp ); rUnions.push_back( pTmp );
} }

View File

@ -947,7 +947,7 @@ SwCntntNode* SwGrfNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const
SwGrfNode* pGrfNd = pDoc->GetNodes().MakeGrfNode( rIdx, sFile, sFilter, SwGrfNode* pGrfNd = pDoc->GetNodes().MakeGrfNode( rIdx, sFile, sFilter,
&aTmpGrf, pColl, &aTmpGrf, pColl,
(SwAttrSet*)GetpSwAttrSet() ); const_cast<SwAttrSet*>(GetpSwAttrSet()) );
pGrfNd->SetTitle( GetTitle() ); pGrfNd->SetTitle( GetTitle() );
pGrfNd->SetDescription( GetDescription() ); pGrfNd->SetDescription( GetDescription() );
pGrfNd->SetContour( HasContour(), HasAutomaticContour() ); pGrfNd->SetContour( HasContour(), HasAutomaticContour() );

View File

@ -112,7 +112,7 @@ inline SwCntntFrm* SwCntntFrm::GetNextCntntFrm() const
if ( GetNext() && GetNext()->IsCntntFrm() ) if ( GetNext() && GetNext()->IsCntntFrm() )
return const_cast<SwCntntFrm*>(static_cast<const SwCntntFrm*>(GetNext())); return const_cast<SwCntntFrm*>(static_cast<const SwCntntFrm*>(GetNext()));
else else
return (SwCntntFrm*)ImplGetNextCntntFrm( true ); return const_cast<SwCntntFrm*>(ImplGetNextCntntFrm( true ));
} }
inline SwCntntFrm* SwCntntFrm::GetPrevCntntFrm() const inline SwCntntFrm* SwCntntFrm::GetPrevCntntFrm() const
@ -120,7 +120,7 @@ inline SwCntntFrm* SwCntntFrm::GetPrevCntntFrm() const
if ( GetPrev() && GetPrev()->IsCntntFrm() ) if ( GetPrev() && GetPrev()->IsCntntFrm() )
return const_cast<SwCntntFrm*>(static_cast<const SwCntntFrm*>(GetPrev())); return const_cast<SwCntntFrm*>(static_cast<const SwCntntFrm*>(GetPrev()));
else else
return (SwCntntFrm*)ImplGetNextCntntFrm( false ); return const_cast<SwCntntFrm*>(ImplGetNextCntntFrm( false ));
} }
inline SwCntntNode *SwCntntFrm::GetNode() inline SwCntntNode *SwCntntFrm::GetNode()

View File

@ -935,11 +935,11 @@ inline void SwFrm::ResetRetouche() const
inline SwLayoutFrm *SwFrm::GetNextLayoutLeaf() inline SwLayoutFrm *SwFrm::GetNextLayoutLeaf()
{ {
return (SwLayoutFrm*)static_cast<const SwFrm*>(this)->GetNextLayoutLeaf(); return const_cast<SwLayoutFrm*>(static_cast<const SwFrm*>(this)->GetNextLayoutLeaf());
} }
inline SwLayoutFrm *SwFrm::GetPrevLayoutLeaf() inline SwLayoutFrm *SwFrm::GetPrevLayoutLeaf()
{ {
return (SwLayoutFrm*)static_cast<const SwFrm*>(this)->GetPrevLayoutLeaf(); return const_cast<SwLayoutFrm*>(static_cast<const SwFrm*>(this)->GetPrevLayoutLeaf());
} }
inline const SwLayoutFrm *SwFrm::GetNextLayoutLeaf() const inline const SwLayoutFrm *SwFrm::GetNextLayoutLeaf() const
{ {

View File

@ -196,17 +196,17 @@ public:
*/ */
inline SwCntntFrm* SwLayoutFrm::ContainsCntnt() inline SwCntntFrm* SwLayoutFrm::ContainsCntnt()
{ {
return (SwCntntFrm*)(static_cast<const SwLayoutFrm*>(this)->ContainsCntnt()); return const_cast<SwCntntFrm*>(static_cast<const SwLayoutFrm*>(this)->ContainsCntnt());
} }
inline SwCellFrm* SwLayoutFrm::FirstCell() inline SwCellFrm* SwLayoutFrm::FirstCell()
{ {
return (SwCellFrm*)(static_cast<const SwLayoutFrm*>(this)->FirstCell()); return const_cast<SwCellFrm*>(static_cast<const SwLayoutFrm*>(this)->FirstCell());
} }
inline SwFrm* SwLayoutFrm::ContainsAny( const bool _bInvestigateFtnForSections ) inline SwFrm* SwLayoutFrm::ContainsAny( const bool _bInvestigateFtnForSections )
{ {
return (SwFrm*)(static_cast<const SwLayoutFrm*>(this)->ContainsAny( _bInvestigateFtnForSections )); return const_cast<SwFrm*>(static_cast<const SwLayoutFrm*>(this)->ContainsAny( _bInvestigateFtnForSections ));
} }
/** /**

View File

@ -397,7 +397,7 @@ public:
inline void ResetBlinkPor() const; inline void ResetBlinkPor() const;
inline bool HasBlinkPor() const { return bBlinkPor; } inline bool HasBlinkPor() const { return bBlinkPor; }
inline void SetAnimation() const inline void SetAnimation() const
{ ( (SwTxtFrm*)this )->bHasAnimation = true; } { const_cast<SwTxtFrm*>(this)->bHasAnimation = true; }
inline bool HasAnimation() const { return bHasAnimation; } inline bool HasAnimation() const { return bHasAnimation; }
inline bool IsSwapped() const { return bIsSwapped; } inline bool IsSwapped() const { return bIsSwapped; }

View File

@ -451,7 +451,7 @@ SwFmtHeader::SwFmtHeader( SwFrmFmt *pHeaderFmt )
SwFmtHeader::SwFmtHeader( const SwFmtHeader &rCpy ) SwFmtHeader::SwFmtHeader( const SwFmtHeader &rCpy )
: SfxPoolItem( RES_HEADER ), : SfxPoolItem( RES_HEADER ),
SwClient( (SwModify*)rCpy.GetRegisteredIn() ), SwClient( const_cast<SwModify*>(rCpy.GetRegisteredIn()) ),
bActive( rCpy.IsActive() ) bActive( rCpy.IsActive() )
{ {
} }
@ -496,7 +496,7 @@ SwFmtFooter::SwFmtFooter( SwFrmFmt *pFooterFmt )
SwFmtFooter::SwFmtFooter( const SwFmtFooter &rCpy ) SwFmtFooter::SwFmtFooter( const SwFmtFooter &rCpy )
: SfxPoolItem( RES_FOOTER ), : SfxPoolItem( RES_FOOTER ),
SwClient( (SwModify*)rCpy.GetRegisteredIn() ), SwClient( const_cast<SwModify*>(rCpy.GetRegisteredIn()) ),
bActive( rCpy.IsActive() ) bActive( rCpy.IsActive() )
{ {
} }
@ -582,7 +582,7 @@ void SwFmtCntnt::dumpAsXml(xmlTextWriterPtr pWriter) const
// Partially implemented inline in hxx // Partially implemented inline in hxx
SwFmtPageDesc::SwFmtPageDesc( const SwFmtPageDesc &rCpy ) SwFmtPageDesc::SwFmtPageDesc( const SwFmtPageDesc &rCpy )
: SfxPoolItem( RES_PAGEDESC ), : SfxPoolItem( RES_PAGEDESC ),
SwClient( (SwPageDesc*)rCpy.GetPageDesc() ), SwClient( const_cast<SwPageDesc*>(rCpy.GetPageDesc()) ),
oNumOffset( rCpy.oNumOffset ), oNumOffset( rCpy.oNumOffset ),
nDescNameIdx( rCpy.nDescNameIdx ), nDescNameIdx( rCpy.nDescNameIdx ),
pDefinedIn( 0 ) pDefinedIn( 0 )
@ -591,7 +591,7 @@ SwFmtPageDesc::SwFmtPageDesc( const SwFmtPageDesc &rCpy )
SwFmtPageDesc::SwFmtPageDesc( const SwPageDesc *pDesc ) SwFmtPageDesc::SwFmtPageDesc( const SwPageDesc *pDesc )
: SfxPoolItem( RES_PAGEDESC ), : SfxPoolItem( RES_PAGEDESC ),
SwClient( (SwPageDesc*)pDesc ), SwClient( const_cast<SwPageDesc*>(pDesc) ),
nDescNameIdx( 0xFFFF ), // IDX_NO_VALUE nDescNameIdx( 0xFFFF ), // IDX_NO_VALUE
pDefinedIn( 0 ) pDefinedIn( 0 )
{ {
@ -2583,9 +2583,9 @@ void SwFrmFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
} }
} }
else if( RES_HEADER == nWhich ) else if( RES_HEADER == nWhich )
pH = const_cast<SwFmtHeader*>(static_cast<const SwFmtHeader*>(pNew)); pH = static_cast<const SwFmtHeader*>(pNew);
else if( RES_FOOTER == nWhich ) else if( RES_FOOTER == nWhich )
pF = const_cast<SwFmtFooter*>(static_cast<const SwFmtFooter*>(pNew)); pF = static_cast<const SwFmtFooter*>(pNew);
if( pH && pH->IsActive() && !pH->GetHeaderFmt() ) if( pH && pH->IsActive() && !pH->GetHeaderFmt() )
{ //If he doesn't have one, I'll add one { //If he doesn't have one, I'll add one

View File

@ -916,7 +916,7 @@ bool SwCntntFrm::MakePrtArea( const SwBorderAttrs &rAttrs )
// At the FixSize, the surrounding Frame enforces the size; // At the FixSize, the surrounding Frame enforces the size;
// the borders are simply subtracted. // the borders are simply subtracted.
const long nLeft = rAttrs.CalcLeft( this ); const long nLeft = rAttrs.CalcLeft( this );
const long nRight = const_cast<SwBorderAttrs&>(rAttrs).CalcRight( this ); const long nRight = rAttrs.CalcRight( this );
(this->*fnRect->fnSetXMargins)( nLeft, nRight ); (this->*fnRect->fnSetXMargins)( nLeft, nRight );
SwViewShell *pSh = getRootFrm()->GetCurrShell(); SwViewShell *pSh = getRootFrm()->GetCurrShell();

View File

@ -823,7 +823,7 @@ bool SwFrm::WrongPageDesc( SwPageFrm* pNew )
SwFlowFrm *pFlow = SwFlowFrm::CastFlowFrm( this ); SwFlowFrm *pFlow = SwFlowFrm::CastFlowFrm( this );
if ( !pFlow || !pFlow->IsFollow() ) if ( !pFlow || !pFlow->IsFollow() )
{ {
pDesc = (SwPageDesc*)rFmtDesc.GetPageDesc(); pDesc = const_cast<SwPageDesc*>(rFmtDesc.GetPageDesc());
if( pDesc ) if( pDesc )
{ {
if( !pDesc->GetRightFmt() ) if( !pDesc->GetRightFmt() )

View File

@ -690,8 +690,8 @@ void SwFlyFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
SwAttrSetChg aNewSet( *static_cast<const SwAttrSetChg*>(pNew) ); SwAttrSetChg aNewSet( *static_cast<const SwAttrSetChg*>(pNew) );
while( true ) while( true )
{ {
_UpdateAttr( (SfxPoolItem*)aOIter.GetCurItem(), _UpdateAttr( aOIter.GetCurItem(),
(SfxPoolItem*)aNIter.GetCurItem(), nInvFlags, aNIter.GetCurItem(), nInvFlags,
&aOldSet, &aNewSet ); &aOldSet, &aNewSet );
if( aNIter.IsAtEnd() ) if( aNIter.IsAtEnd() )
break; break;

View File

@ -730,7 +730,7 @@ static const SwFrm * lcl_CalcDownDist( SwDistance &rRet,
{ {
if ( !static_cast<const SwLayoutFrm*>(pLay)->Lower() ) if ( !static_cast<const SwLayoutFrm*>(pLay)->Lower() )
{ {
SwFrm *pDel = (SwFrm*)pLay; SwFrm *pDel = const_cast<SwFrm*>(pLay);
pDel->Cut(); pDel->Cut();
delete pDel; delete pDel;
return pPre; return pPre;
@ -839,7 +839,7 @@ static const SwFrm * lcl_CalcDownDist( SwDistance &rRet,
} }
if ( pLay->IsFtnContFrm() && !static_cast<const SwLayoutFrm*>(pLay)->Lower() ) if ( pLay->IsFtnContFrm() && !static_cast<const SwLayoutFrm*>(pLay)->Lower() )
{ {
SwFrm *pDel = (SwFrm*)pLay; SwFrm *pDel = const_cast<SwFrm*>(pLay);
pDel->Cut(); pDel->Cut();
delete pDel; delete pDel;
return 0; return 0;
@ -1175,7 +1175,7 @@ void SwFlyAtCntFrm::SetAbsPos( const Point &rNew )
if( ( GetAnchorFrm()->IsVertical() && !GetAnchorFrm()->IsVertLR() ) || GetAnchorFrm()->IsRightToLeft() ) if( ( GetAnchorFrm()->IsVertical() && !GetAnchorFrm()->IsVertLR() ) || GetAnchorFrm()->IsRightToLeft() )
aNew.setX(aNew.getX() + Frm().Width()); aNew.setX(aNew.getX() + Frm().Width());
SwCntntFrm *pCnt = (SwCntntFrm*)::FindAnchor( GetAnchorFrm(), aNew ); SwCntntFrm *pCnt = const_cast<SwCntntFrm*>(::FindAnchor( GetAnchorFrm(), aNew ));
if( pCnt->IsProtected() ) if( pCnt->IsProtected() )
pCnt = const_cast<SwCntntFrm*>(static_cast<const SwCntntFrm*>(GetAnchorFrm())); pCnt = const_cast<SwCntntFrm*>(static_cast<const SwCntntFrm*>(GetAnchorFrm()));

View File

@ -559,7 +559,7 @@ void SwPageFrm::AppendFlyToPage( SwFlyFrm *pNew )
SdrObject* pObj = pNew->GetVirtDrawObj(); SdrObject* pObj = pNew->GetVirtDrawObj();
OSL_ENSURE( pNew->GetAnchorFrm(), "Fly without Anchor" ); OSL_ENSURE( pNew->GetAnchorFrm(), "Fly without Anchor" );
SwFlyFrm* pFly = (SwFlyFrm*)pNew->GetAnchorFrm()->FindFlyFrm(); SwFlyFrm* pFly = const_cast<SwFlyFrm*>(pNew->GetAnchorFrm()->FindFlyFrm());
if ( pFly && pObj->GetOrdNum() < pFly->GetVirtDrawObj()->GetOrdNum() ) if ( pFly && pObj->GetOrdNum() < pFly->GetVirtDrawObj()->GetOrdNum() )
{ {
//#i119945# set pFly's OrdNum to _rNewObj's. So when pFly is removed by Undo, the original OrdNum will not be changed. //#i119945# set pFly's OrdNum to _rNewObj's. So when pFly is removed by Undo, the original OrdNum will not be changed.
@ -796,7 +796,7 @@ void SwPageFrm::AppendDrawObjToPage( SwAnchoredObject& _rNewObj )
} }
OSL_ENSURE( _rNewObj.GetAnchorFrm(), "anchored draw object without anchor" ); OSL_ENSURE( _rNewObj.GetAnchorFrm(), "anchored draw object without anchor" );
SwFlyFrm* pFlyFrm = (SwFlyFrm*)_rNewObj.GetAnchorFrm()->FindFlyFrm(); SwFlyFrm* pFlyFrm = const_cast<SwFlyFrm*>(_rNewObj.GetAnchorFrm()->FindFlyFrm());
if ( pFlyFrm && if ( pFlyFrm &&
_rNewObj.GetDrawObj()->GetOrdNum() < pFlyFrm->GetVirtDrawObj()->GetOrdNum() ) _rNewObj.GetDrawObj()->GetOrdNum() < pFlyFrm->GetVirtDrawObj()->GetOrdNum() )
{ {

View File

@ -38,7 +38,7 @@ bool SwPosFlyFrmCmp::operator()(const SwPosFlyFrmPtr& rA, const SwPosFlyFrmPtr&
SwPosFlyFrm::SwPosFlyFrm( const SwNodeIndex& rIdx, const SwFrmFmt* pFmt, SwPosFlyFrm::SwPosFlyFrm( const SwNodeIndex& rIdx, const SwFrmFmt* pFmt,
sal_uInt16 nArrPos ) sal_uInt16 nArrPos )
: pFrmFmt( pFmt ), pNdIdx( (SwNodeIndex*) &rIdx ) : pFrmFmt( pFmt ), pNdIdx( const_cast<SwNodeIndex*>(&rIdx) )
{ {
bool bFnd = false; bool bFnd = false;
const SwFmtAnchor& rAnchor = pFmt->GetAnchor(); const SwFmtAnchor& rAnchor = pFmt->GetAnchor();

View File

@ -2715,7 +2715,7 @@ SwPageFrm * InsertNewPage( SwPageDesc &rDesc, SwFrm *pUpper,
static void lcl_Regist( SwPageFrm *pPage, const SwFrm *pAnch ) static void lcl_Regist( SwPageFrm *pPage, const SwFrm *pAnch )
{ {
SwSortedObjs *pObjs = (SwSortedObjs*)pAnch->GetDrawObjs(); SwSortedObjs *pObjs = const_cast<SwSortedObjs*>(pAnch->GetDrawObjs());
for ( size_t i = 0; i < pObjs->size(); ++i ) for ( size_t i = 0; i < pObjs->size(); ++i )
{ {
SwAnchoredObject* pObj = (*pObjs)[i]; SwAnchoredObject* pObj = (*pObjs)[i];
@ -3086,7 +3086,7 @@ const SwFrm* GetVirtualUpper( const SwFrm* pFrm, const Point& rPos )
} }
else else
{ {
SwFlyFrm* pTmp = (SwFlyFrm*)pFrm->FindFlyFrm(); SwFlyFrm* pTmp = const_cast<SwFlyFrm*>(pFrm->FindFlyFrm());
while( pTmp ) while( pTmp )
{ {
if( pTmp->Frm().IsInside( rPos ) ) if( pTmp->Frm().IsInside( rPos ) )

View File

@ -42,7 +42,7 @@ static sal_uLong lcl_FindFtnPos( const SwDoc *pDoc, const SwTxtFtn *pAttr )
{ {
const SwFtnIdxs &rFtnIdxs = pDoc->GetFtnIdxs(); const SwFtnIdxs &rFtnIdxs = pDoc->GetFtnIdxs();
SwTxtFtn* pBla = (SwTxtFtn*)pAttr; SwTxtFtn* pBla = const_cast<SwTxtFtn*>(pAttr);
SwFtnIdxs::const_iterator it = rFtnIdxs.find( pBla ); SwFtnIdxs::const_iterator it = rFtnIdxs.find( pBla );
if ( it != rFtnIdxs.end() ) if ( it != rFtnIdxs.end() )
{ {
@ -1085,7 +1085,7 @@ const SwFtnFrm *SwFtnBossFrm::FindFirstFtn( SwCntntFrm *pCnt ) const
if ( pRet->GetNext() ) if ( pRet->GetNext() )
pRet = static_cast<const SwFtnFrm*>(pRet->GetNext()); pRet = static_cast<const SwFtnFrm*>(pRet->GetNext());
else else
{ SwFtnBossFrm *pBoss = (SwFtnBossFrm*)pRet->FindFtnBossFrm(); { SwFtnBossFrm *pBoss = const_cast<SwFtnBossFrm*>(pRet->FindFtnBossFrm());
SwPageFrm *pPage = pBoss->FindPageFrm(); SwPageFrm *pPage = pBoss->FindPageFrm();
lcl_NextFtnBoss( pBoss, pPage, false ); // next FtnBoss lcl_NextFtnBoss( pBoss, pPage, false ); // next FtnBoss
SwFtnContFrm *pCont = pBoss ? pBoss->FindNearestFtnCont() : 0; SwFtnContFrm *pCont = pBoss ? pBoss->FindNearestFtnCont() : 0;
@ -2346,7 +2346,7 @@ void SwPageFrm::UpdateFtnNum()
pCntnt = static_cast<SwSectionFrm*>(pBoss->GetUpper())->FindLastCntnt(); pCntnt = static_cast<SwSectionFrm*>(pBoss->GetUpper())->FindLastCntnt();
else else
{ {
SwFtnFrm* pFtn = (SwFtnFrm*)pBoss->FindFirstFtn( pCntnt ); SwFtnFrm* pFtn = const_cast<SwFtnFrm*>(pBoss->FindFirstFtn( pCntnt ));
while( pFtn ) while( pFtn )
{ {
SwTxtFtn* pTxtFtn = pFtn->GetAttr(); SwTxtFtn* pTxtFtn = pFtn->GetAttr();
@ -2803,7 +2803,7 @@ SwCntntFrm* SwFtnFrm::GetRef()
const SwCntntFrm* SwFtnFrm::GetRefFromAttr() const const SwCntntFrm* SwFtnFrm::GetRefFromAttr() const
{ {
SwFtnFrm* pThis = (SwFtnFrm*)this; SwFtnFrm* pThis = const_cast<SwFtnFrm*>(this);
return pThis->GetRefFromAttr(); return pThis->GetRefFromAttr();
} }

View File

@ -679,7 +679,7 @@ void SwPageFrm::PrepareHeader()
{ //Implant header, but remove first, if already present { //Implant header, but remove first, if already present
OSL_ENSURE( rH.GetHeaderFmt(), "FrmFmt for Header not found." ); OSL_ENSURE( rH.GetHeaderFmt(), "FrmFmt for Header not found." );
if ( pLay->GetFmt() == (SwFrmFmt*)rH.GetHeaderFmt() ) if ( pLay->GetFmt() == rH.GetHeaderFmt() )
return; // Header is already the correct one. return; // Header is already the correct one.
if ( pLay->IsHeaderFrm() ) if ( pLay->IsHeaderFrm() )
@ -690,7 +690,7 @@ void SwPageFrm::PrepareHeader()
delete pDel; delete pDel;
} }
OSL_ENSURE( pLay, "Where to with the Header?" ); OSL_ENSURE( pLay, "Where to with the Header?" );
SwHeaderFrm *pH = new SwHeaderFrm( (SwFrmFmt*)rH.GetHeaderFmt(), this ); SwHeaderFrm *pH = new SwHeaderFrm( const_cast<SwFrmFmt*>(rH.GetHeaderFmt()), this );
pH->Paste( this, pLay ); pH->Paste( this, pLay );
if ( GetUpper() ) if ( GetUpper() )
::RegistFlys( this, pH ); ::RegistFlys( this, pH );
@ -721,7 +721,7 @@ void SwPageFrm::PrepareFooter()
{ //Implant footer, but remove first, if already present { //Implant footer, but remove first, if already present
OSL_ENSURE( rF.GetFooterFmt(), "FrmFmt for Footer not found." ); OSL_ENSURE( rF.GetFooterFmt(), "FrmFmt for Footer not found." );
if ( pLay->GetFmt() == (SwFrmFmt*)rF.GetFooterFmt() ) if ( pLay->GetFmt() == rF.GetFooterFmt() )
return; // Footer is already the correct one. return; // Footer is already the correct one.
if ( pLay->IsFooterFrm() ) if ( pLay->IsFooterFrm() )
@ -729,7 +729,7 @@ void SwPageFrm::PrepareFooter()
pLay->Cut(); pLay->Cut();
delete pLay; delete pLay;
} }
SwFooterFrm *pF = new SwFooterFrm( (SwFrmFmt*)rF.GetFooterFmt(), this ); SwFooterFrm *pF = new SwFooterFrm( const_cast<SwFrmFmt*>(rF.GetFooterFmt()), this );
pF->Paste( this ); pF->Paste( this );
if ( GetUpper() ) if ( GetUpper() )
::RegistFlys( this, pF ); ::RegistFlys( this, pF );

View File

@ -1156,7 +1156,7 @@ bool SwLayAction::IsShortCut( SwPageFrm *&prPage )
if ( pTmp->GetPhyPageNum() < prPage->GetPhyPageNum() && if ( pTmp->GetPhyPageNum() < prPage->GetPhyPageNum() &&
pTmp->IsInvalid() ) pTmp->IsInvalid() )
{ {
prPage = (SwPageFrm*)pTmp; prPage = const_cast<SwPageFrm*>(pTmp);
} }
else else
{ {

View File

@ -522,7 +522,7 @@ void SwRootFrm::Init( SwFrmFmt* pFmt )
if ( pTblNd ) if ( pTblNd )
{ {
const SwFmtPageDesc &rDesc = pTblNd->GetTable().GetFrmFmt()->GetPageDesc(); const SwFmtPageDesc &rDesc = pTblNd->GetTable().GetFrmFmt()->GetPageDesc();
pDesc = (SwPageDesc*)rDesc.GetPageDesc(); pDesc = const_cast<SwPageDesc*>(rDesc.GetPageDesc());
//#19104# respect the page number offset!! //#19104# respect the page number offset!!
oPgNum = rDesc.GetNumOffset(); oPgNum = rDesc.GetNumOffset();
if (oPgNum) if (oPgNum)
@ -531,7 +531,7 @@ void SwRootFrm::Init( SwFrmFmt* pFmt )
else if ( pNode ) else if ( pNode )
{ {
const SwFmtPageDesc &rDesc = pNode->GetSwAttrSet().GetPageDesc(); const SwFmtPageDesc &rDesc = pNode->GetSwAttrSet().GetPageDesc();
pDesc = (SwPageDesc*)rDesc.GetPageDesc(); pDesc = const_cast<SwPageDesc*>(rDesc.GetPageDesc());
//#19104# respect the page number offset!! //#19104# respect the page number offset!!
oPgNum = rDesc.GetNumOffset(); oPgNum = rDesc.GetNumOffset();
if (oPgNum) if (oPgNum)

View File

@ -493,8 +493,8 @@ void SwPageFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
SwAttrSetChg aNewSet( *static_cast<const SwAttrSetChg*>(pNew) ); SwAttrSetChg aNewSet( *static_cast<const SwAttrSetChg*>(pNew) );
while( true ) while( true )
{ {
_UpdateAttr( (SfxPoolItem*)aOIter.GetCurItem(), _UpdateAttr( aOIter.GetCurItem(),
(SfxPoolItem*)aNIter.GetCurItem(), nInvFlags, aNIter.GetCurItem(), nInvFlags,
&aOldSet, &aNewSet ); &aOldSet, &aNewSet );
if( aNIter.IsAtEnd() ) if( aNIter.IsAtEnd() )
break; break;
@ -724,7 +724,7 @@ SwPageDesc *SwPageFrm::FindPageDesc()
SwFrm *pFlow = pFrm; SwFrm *pFlow = pFrm;
if ( pFlow->IsInTab() ) if ( pFlow->IsInTab() )
pFlow = pFlow->FindTabFrm(); pFlow = pFlow->FindTabFrm();
pRet = (SwPageDesc*)pFlow->GetAttrSet()->GetPageDesc().GetPageDesc(); pRet = const_cast<SwPageDesc*>(pFlow->GetAttrSet()->GetPageDesc().GetPageDesc());
} }
if ( !pRet ) if ( !pRet )
pRet = &GetFmt()->GetDoc()->GetPageDesc( 0 ); pRet = &GetFmt()->GetDoc()->GetPageDesc( 0 );
@ -740,7 +740,7 @@ SwPageDesc *SwPageFrm::FindPageDesc()
{ {
SwFlowFrm *pTmp = SwFlowFrm::CastFlowFrm( pFlow ); SwFlowFrm *pTmp = SwFlowFrm::CastFlowFrm( pFlow );
if ( !pTmp->IsFollow() ) if ( !pTmp->IsFollow() )
pRet = (SwPageDesc*)pFlow->GetAttrSet()->GetPageDesc().GetPageDesc(); pRet = const_cast<SwPageDesc*>(pFlow->GetAttrSet()->GetPageDesc().GetPageDesc());
} }
//3. und 3.1 //3. und 3.1
@ -1479,7 +1479,7 @@ void SwRootFrm::AssertPageFlys( SwPageFrm *pPage )
nCnt != pPage->GetSortedObjs()->size(), nCnt != pPage->GetSortedObjs()->size(),
"Object couldn't be reattached!" ); "Object couldn't be reattached!" );
#else #else
rFmt.NotifyClients( 0, (SwFmtAnchor*)&rAnch ); rFmt.NotifyClients( 0, const_cast<SwFmtAnchor*>(&rAnch) );
#endif #endif
// Do not increment index, in this case // Do not increment index, in this case
continue; continue;

View File

@ -64,7 +64,7 @@ SwPageDesc::SwPageDesc( const SwPageDesc &rCpy ) :
aLeft( rCpy.GetLeft() ), aLeft( rCpy.GetLeft() ),
m_FirstMaster( rCpy.GetFirstMaster() ), m_FirstMaster( rCpy.GetFirstMaster() ),
m_FirstLeft( rCpy.GetFirstLeft() ), m_FirstLeft( rCpy.GetFirstLeft() ),
aDepend( this, (SwModify*)rCpy.aDepend.GetRegisteredIn() ), aDepend( this, const_cast<SwModify*>(rCpy.aDepend.GetRegisteredIn()) ),
pFollow( rCpy.pFollow ), pFollow( rCpy.pFollow ),
nRegHeight( rCpy.GetRegHeight() ), nRegHeight( rCpy.GetRegHeight() ),
nRegAscent( rCpy.GetRegAscent() ), nRegAscent( rCpy.GetRegAscent() ),

View File

@ -1840,7 +1840,7 @@ static void lcl_DrawGraphic( const SvxBrushItem& rBrush, OutputDevice *pOut,
// No Link here, we want to load the graphic synchronously! // No Link here, we want to load the graphic synchronously!
const_cast<SvxBrushItem&>(rBrush).SetDoneLink( Link() ); const_cast<SvxBrushItem&>(rBrush).SetDoneLink( Link() );
GraphicObject *pGrf = (GraphicObject*)rBrush.GetGraphicObject(); GraphicObject *pGrf = const_cast<GraphicObject*>(rBrush.GetGraphicObject());
// Outsource drawing of background with a background color // Outsource drawing of background with a background color
::lcl_DrawGraphicBackgrd( rBrush, pOut, aAlignedGrfRect, *pGrf, bGrfNum, properties, bBackgrdAlreadyDrawn ); ::lcl_DrawGraphicBackgrd( rBrush, pOut, aAlignedGrfRect, *pGrf, bGrfNum, properties, bBackgrdAlreadyDrawn );
@ -1965,7 +1965,7 @@ void DrawGraphic(
if ( (rSh).GetViewOptions()->IsPDFExport() || if ( (rSh).GetViewOptions()->IsPDFExport() ||
rSh.GetOut()->GetOutDevType() == OUTDEV_PRINTER ) rSh.GetOut()->GetOutDevType() == OUTDEV_PRINTER )
{ {
const_cast<SvxBrushItem*>(pBrush)->PurgeMedium(); pBrush->PurgeMedium();
const_cast<SvxBrushItem*>(pBrush)->SetDoneLink( Link() ); const_cast<SvxBrushItem*>(pBrush)->SetDoneLink( Link() );
} }
else else
@ -2140,7 +2140,7 @@ void DrawGraphic(
(ePos != GPOS_TILED) && (ePos != GPOS_AREA) (ePos != GPOS_TILED) && (ePos != GPOS_AREA)
) )
{ {
GraphicObject *pGrf = (GraphicObject*)pBrush->GetGraphicObject(); GraphicObject *pGrf = const_cast<GraphicObject*>(pBrush->GetGraphicObject());
if ( bConsiderBackgroundTransparency ) if ( bConsiderBackgroundTransparency )
{ {
GraphicAttr pGrfAttr = pGrf->GetAttr(); GraphicAttr pGrfAttr = pGrf->GetAttr();
@ -3214,12 +3214,12 @@ void SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) c
if ( bPerformLayoutAction ) if ( bPerformLayoutAction )
{ {
const_cast<SwRootFrm*>(this)->ResetTurbo(); const_cast<SwRootFrm*>(this)->ResetTurbo();
SwLayAction aAction( (SwRootFrm*)this, pSh->Imp() ); SwLayAction aAction( const_cast<SwRootFrm*>(this), pSh->Imp() );
aAction.SetPaint( false ); aAction.SetPaint( false );
aAction.SetComplete( false ); aAction.SetComplete( false );
aAction.SetReschedule( gProp.pSProgress != nullptr ); aAction.SetReschedule( gProp.pSProgress != nullptr );
aAction.Action(); aAction.Action();
const_cast<SwRootFrm*>(this)->ResetTurboFlag(); ResetTurboFlag();
if ( !pSh->ActionPend() ) if ( !pSh->ActionPend() )
pSh->Imp()->DelRegion(); pSh->Imp()->DelRegion();
} }
@ -6413,7 +6413,7 @@ void SwFrm::PaintBaBo( const SwRect& rRect, const SwPageFrm *pPage,
pOut->Push( PushFlags::FILLCOLOR|PushFlags::LINECOLOR ); pOut->Push( PushFlags::FILLCOLOR|PushFlags::LINECOLOR );
pOut->SetLineColor(); pOut->SetLineColor();
SwBorderAttrAccess aAccess( SwFrm::GetCache(), (SwFrm*)this ); SwBorderAttrAccess aAccess( SwFrm::GetCache(), this );
const SwBorderAttrs &rAttrs = *aAccess.Get(); const SwBorderAttrs &rAttrs = *aAccess.Get();
// OD 20.11.2002 #104598# - take care of page margin area // OD 20.11.2002 #104598# - take care of page margin area
@ -6671,7 +6671,7 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage,
aFrmRect = pFrm->PaintArea(); aFrmRect = pFrm->PaintArea();
if ( aFrmRect.IsOver( aBorderRect ) ) if ( aFrmRect.IsOver( aBorderRect ) )
{ {
SwBorderAttrAccess aAccess( SwFrm::GetCache(), (SwFrm*)pFrm ); SwBorderAttrAccess aAccess( SwFrm::GetCache(), pFrm );
const SwBorderAttrs &rTmpAttrs = *aAccess.Get(); const SwBorderAttrs &rTmpAttrs = *aAccess.Get();
if ( ( pFrm->IsLayoutFrm() && bLowerBorder ) || if ( ( pFrm->IsLayoutFrm() && bLowerBorder ) ||
aFrmRect.IsOver( aRect ) ) aFrmRect.IsOver( aRect ) )
@ -7255,7 +7255,7 @@ void SwLayoutFrm::RefreshExtraData( const SwRect &rRect ) const
pCnt->Frm().Top() <= rRect.Bottom() && pCnt->Frm().Top() <= rRect.Bottom() &&
pCnt->Frm().Bottom() >= rRect.Top() ) pCnt->Frm().Bottom() >= rRect.Top() )
{ {
const_cast<SwTxtFrm*>(static_cast<const SwTxtFrm*>(pCnt))->PaintExtraData( rRect ); static_cast<const SwTxtFrm*>(pCnt)->PaintExtraData( rRect );
} }
if ( bLineInFly && pCnt->GetDrawObjs() ) if ( bLineInFly && pCnt->GetDrawObjs() )
for ( size_t i = 0; i < pCnt->GetDrawObjs()->size(); ++i ) for ( size_t i = 0; i < pCnt->GetDrawObjs()->size(); ++i )

View File

@ -2258,8 +2258,8 @@ void SwSectionFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
SwAttrSetChg aNewSet( *static_cast<const SwAttrSetChg*>(pNew) ); SwAttrSetChg aNewSet( *static_cast<const SwAttrSetChg*>(pNew) );
while( true ) while( true )
{ {
_UpdateAttr( (SfxPoolItem*)aOIter.GetCurItem(), _UpdateAttr( aOIter.GetCurItem(),
(SfxPoolItem*)aNIter.GetCurItem(), nInvFlags, aNIter.GetCurItem(), nInvFlags,
&aOldSet, &aNewSet ); &aOldSet, &aNewSet );
if( aNIter.IsAtEnd() ) if( aNIter.IsAtEnd() )
break; break;

View File

@ -213,7 +213,7 @@ void SwFrm::CheckDirChange()
MIN_VERT_CELL_HEIGHT = 1135 MIN_VERT_CELL_HEIGHT = 1135
}; };
SwTableLine* pLine = (SwTableLine*)static_cast<SwCellFrm*>(this)->GetTabBox()->GetUpper(); SwTableLine* pLine = const_cast<SwTableLine*>(static_cast<SwCellFrm*>(this)->GetTabBox()->GetUpper());
SwFrmFmt* pFrmFmt = pLine->GetFrmFmt(); SwFrmFmt* pFrmFmt = pLine->GetFrmFmt();
SwFmtFrmSize aNew( pFrmFmt->GetFrmSize() ); SwFmtFrmSize aNew( pFrmFmt->GetFrmSize() );
if ( ATT_FIX_SIZE != aNew.GetHeightSizeType() ) if ( ATT_FIX_SIZE != aNew.GetHeightSizeType() )

View File

@ -3000,8 +3000,8 @@ void SwTabFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
SwAttrSetChg aNewSet( *static_cast<const SwAttrSetChg*>(pNew) ); SwAttrSetChg aNewSet( *static_cast<const SwAttrSetChg*>(pNew) );
while( true ) while( true )
{ {
_UpdateAttr( (SfxPoolItem*)aOIter.GetCurItem(), _UpdateAttr( aOIter.GetCurItem(),
(SfxPoolItem*)aNIter.GetCurItem(), nInvFlags, aNIter.GetCurItem(), nInvFlags,
&aOldSet, &aNewSet ); &aOldSet, &aNewSet );
if( aNIter.IsAtEnd() ) if( aNIter.IsAtEnd() )
break; break;
@ -3836,7 +3836,7 @@ static sal_uInt16 lcl_GetTopSpace( const SwRowFrm& rRow )
nTmpTopSpace = lcl_GetTopSpace( *static_cast<const SwRowFrm*>(pCurrLower->Lower()) ); nTmpTopSpace = lcl_GetTopSpace( *static_cast<const SwRowFrm*>(pCurrLower->Lower()) );
else else
{ {
const SwAttrSet& rSet = ((SwCellFrm*)pCurrLower)->GetFmt()->GetAttrSet(); const SwAttrSet& rSet = const_cast<SwCellFrm*>(pCurrLower)->GetFmt()->GetAttrSet();
const SvxBoxItem& rBoxItem = rSet.GetBox(); const SvxBoxItem& rBoxItem = rSet.GetBox();
nTmpTopSpace = rBoxItem.CalcLineSpace( BOX_LINE_TOP, true ); nTmpTopSpace = rBoxItem.CalcLineSpace( BOX_LINE_TOP, true );
} }
@ -3857,7 +3857,7 @@ static sal_uInt16 lcl_GetTopLineDist( const SwRowFrm& rRow )
nTmpTopLineDist = lcl_GetTopLineDist( *static_cast<const SwRowFrm*>(pCurrLower->Lower()) ); nTmpTopLineDist = lcl_GetTopLineDist( *static_cast<const SwRowFrm*>(pCurrLower->Lower()) );
else else
{ {
const SwAttrSet& rSet = ((SwCellFrm*)pCurrLower)->GetFmt()->GetAttrSet(); const SwAttrSet& rSet = const_cast<SwCellFrm*>(pCurrLower)->GetFmt()->GetAttrSet();
const SvxBoxItem& rBoxItem = rSet.GetBox(); const SvxBoxItem& rBoxItem = rSet.GetBox();
nTmpTopLineDist = rBoxItem.GetDistance( BOX_LINE_TOP ); nTmpTopLineDist = rBoxItem.GetDistance( BOX_LINE_TOP );
} }
@ -3881,7 +3881,7 @@ static sal_uInt16 lcl_GetBottomLineSize( const SwRowFrm& rRow )
} }
else else
{ {
const SwAttrSet& rSet = ((SwCellFrm*)pCurrLower)->GetFmt()->GetAttrSet(); const SwAttrSet& rSet = const_cast<SwCellFrm*>(pCurrLower)->GetFmt()->GetAttrSet();
const SvxBoxItem& rBoxItem = rSet.GetBox(); const SvxBoxItem& rBoxItem = rSet.GetBox();
nTmpBottomLineSize = rBoxItem.CalcLineSpace( BOX_LINE_BOTTOM, true ) - nTmpBottomLineSize = rBoxItem.CalcLineSpace( BOX_LINE_BOTTOM, true ) -
rBoxItem.GetDistance( BOX_LINE_BOTTOM ); rBoxItem.GetDistance( BOX_LINE_BOTTOM );
@ -3906,7 +3906,7 @@ static sal_uInt16 lcl_GetBottomLineDist( const SwRowFrm& rRow )
} }
else else
{ {
const SwAttrSet& rSet = ((SwCellFrm*)pCurrLower)->GetFmt()->GetAttrSet(); const SwAttrSet& rSet = const_cast<SwCellFrm*>(pCurrLower)->GetFmt()->GetAttrSet();
const SvxBoxItem& rBoxItem = rSet.GetBox(); const SvxBoxItem& rBoxItem = rSet.GetBox();
nTmpBottomLineDist = rBoxItem.GetDistance( BOX_LINE_BOTTOM ); nTmpBottomLineDist = rBoxItem.GetDistance( BOX_LINE_BOTTOM );
} }
@ -5321,7 +5321,7 @@ SwTwips SwTabFrm::CalcHeightOfFirstContentLine() const
else if ( 0 != nFirstLineHeight ) else if ( 0 != nFirstLineHeight )
{ {
const bool bOldJoinLock = IsJoinLocked(); const bool bOldJoinLock = IsJoinLocked();
((SwTabFrm*)this)->LockJoin(); const_cast<SwTabFrm*>(this)->LockJoin();
const SwTwips nHeightOfFirstContentLine = lcl_CalcHeightOfFirstContentLine( *(SwRowFrm*)pFirstRow ); const SwTwips nHeightOfFirstContentLine = lcl_CalcHeightOfFirstContentLine( *(SwRowFrm*)pFirstRow );
// Consider minimum row height: // Consider minimum row height:
@ -5332,7 +5332,7 @@ SwTwips SwTabFrm::CalcHeightOfFirstContentLine() const
nTmpHeight += std::max( nHeightOfFirstContentLine, nMinRowHeight ); nTmpHeight += std::max( nHeightOfFirstContentLine, nMinRowHeight );
if ( !bOldJoinLock ) if ( !bOldJoinLock )
((SwTabFrm*)this)->UnlockJoin(); const_cast<SwTabFrm*>(this)->UnlockJoin();
} }
} }

View File

@ -606,7 +606,7 @@ bool SwFlyFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
/** Layout dependent cursor travelling */ /** Layout dependent cursor travelling */
bool SwCntntFrm::LeftMargin(SwPaM *pPam) const bool SwCntntFrm::LeftMargin(SwPaM *pPam) const
{ {
if( &pPam->GetNode() != (SwCntntNode*)GetNode() ) if( &pPam->GetNode() != GetNode() )
return false; return false;
const_cast<SwCntntNode*>(GetNode())-> const_cast<SwCntntNode*>(GetNode())->
MakeStartIndex((SwIndex *) &pPam->GetPoint()->nContent); MakeStartIndex((SwIndex *) &pPam->GetPoint()->nContent);
@ -615,7 +615,7 @@ bool SwCntntFrm::LeftMargin(SwPaM *pPam) const
bool SwCntntFrm::RightMargin(SwPaM *pPam, bool) const bool SwCntntFrm::RightMargin(SwPaM *pPam, bool) const
{ {
if( &pPam->GetNode() != (SwCntntNode*)GetNode() ) if( &pPam->GetNode() != GetNode() )
return false; return false;
const_cast<SwCntntNode*>(GetNode())-> const_cast<SwCntntNode*>(GetNode())->
MakeEndIndex((SwIndex *) &pPam->GetPoint()->nContent); MakeEndIndex((SwIndex *) &pPam->GetPoint()->nContent);
@ -681,7 +681,7 @@ static const SwCntntFrm * lcl_MissProtectedFrames( const SwCntntFrm *pCnt,
static bool lcl_UpDown( SwPaM *pPam, const SwCntntFrm *pStart, static bool lcl_UpDown( SwPaM *pPam, const SwCntntFrm *pStart,
GetNxtPrvCnt fnNxtPrv, bool bInReadOnly ) GetNxtPrvCnt fnNxtPrv, bool bInReadOnly )
{ {
OSL_ENSURE( &pPam->GetNode() == (SwCntntNode*)pStart->GetNode(), OSL_ENSURE( &pPam->GetNode() == pStart->GetNode(),
"lcl_UpDown doesn't work for others." ); "lcl_UpDown doesn't work for others." );
const SwCntntFrm *pCnt = 0; const SwCntntFrm *pCnt = 0;
@ -930,7 +930,7 @@ static bool lcl_UpDown( SwPaM *pPam, const SwCntntFrm *pStart,
if( pCnt ) if( pCnt )
{ // set the Point on the Content-Node { // set the Point on the Content-Node
SwCntntNode *pCNd = (SwCntntNode*)pCnt->GetNode(); SwCntntNode *pCNd = const_cast<SwCntntNode*>(pCnt->GetNode());
pPam->GetPoint()->nNode = *pCNd; pPam->GetPoint()->nNode = *pCNd;
if ( fnNxtPrv == lcl_GetPrvCnt ) if ( fnNxtPrv == lcl_GetPrvCnt )
pCNd->MakeEndIndex( (SwIndex*)&pPam->GetPoint()->nContent ); pCNd->MakeEndIndex( (SwIndex*)&pPam->GetPoint()->nContent );
@ -1010,7 +1010,7 @@ sal_uInt16 SwRootFrm::SetCurrPage( SwCursor* pToSet, sal_uInt16 nPageNum )
pCntnt = pCntnt->GetNextCntntFrm(); pCntnt = pCntnt->GetNextCntntFrm();
if ( pCntnt ) if ( pCntnt )
{ {
SwCntntNode* pCNd = (SwCntntNode*)pCntnt->GetNode(); SwCntntNode* pCNd = const_cast<SwCntntNode*>(pCntnt->GetNode());
pToSet->GetPoint()->nNode = *pCNd; pToSet->GetPoint()->nNode = *pCNd;
pCNd->MakeStartIndex( (SwIndex*)&pToSet->GetPoint()->nContent ); pCNd->MakeStartIndex( (SwIndex*)&pToSet->GetPoint()->nContent );
pToSet->GetPoint()->nContent = static_cast<const SwTxtFrm*>(pCntnt)->GetOfst(); pToSet->GetPoint()->nContent = static_cast<const SwTxtFrm*>(pCntnt)->GetOfst();
@ -1051,7 +1051,7 @@ SwLayoutFrm *GetNextFrm( const SwLayoutFrm *pFrm )
SwLayoutFrm *GetThisFrm( const SwLayoutFrm *pFrm ) SwLayoutFrm *GetThisFrm( const SwLayoutFrm *pFrm )
{ {
return (SwLayoutFrm*)pFrm; return const_cast<SwLayoutFrm*>(pFrm);
} }
SwLayoutFrm *GetPrevFrm( const SwLayoutFrm *pFrm ) SwLayoutFrm *GetPrevFrm( const SwLayoutFrm *pFrm )
@ -1115,7 +1115,7 @@ bool GetFrmInPage( const SwCntntFrm *pCnt, SwWhichPage fnWhichPage,
} }
} }
SwCntntNode *pCNd = (SwCntntNode*)pCnt->GetNode(); SwCntntNode *pCNd = const_cast<SwCntntNode*>(pCnt->GetNode());
pPam->GetPoint()->nNode = *pCNd; pPam->GetPoint()->nNode = *pCNd;
sal_Int32 nIdx; sal_Int32 nIdx;
if( fnPosPage == GetFirstSub ) if( fnPosPage == GetFirstSub )
@ -1447,7 +1447,7 @@ void SwPageFrm::GetCntntPosition( const Point &rPt, SwPosition &rPos ) const
if( !pAct->IsValid() ) if( !pAct->IsValid() )
{ {
// CntntFrm not formatted -> always on node-beginning // CntntFrm not formatted -> always on node-beginning
SwCntntNode* pCNd = (SwCntntNode*)pAct->GetNode(); SwCntntNode* pCNd = const_cast<SwCntntNode*>(pAct->GetNode());
OSL_ENSURE( pCNd, "Where is my CntntNode?" ); OSL_ENSURE( pCNd, "Where is my CntntNode?" );
rPos.nNode = *pCNd; rPos.nNode = *pCNd;
rPos.nContent.Assign( pCNd, 0 ); rPos.nContent.Assign( pCNd, 0 );
@ -1923,8 +1923,8 @@ bool SwRootFrm::MakeTblCrsrs( SwTableCursor& rTblCrsr )
(bReadOnlyAvailable || (bReadOnlyAvailable ||
!pCell->GetFmt()->GetProtect().IsCntntProtected())) !pCell->GetFmt()->GetProtect().IsCntntProtected()))
{ {
SwTableBox* pInsBox = (SwTableBox*) SwTableBox* pInsBox = const_cast<SwTableBox*>(
static_cast<const SwCellFrm*>(pCell)->GetTabBox(); static_cast<const SwCellFrm*>(pCell)->GetTabBox());
aNew.insert( pInsBox ); aNew.insert( pInsBox );
} }
if ( pCell->GetNext() ) if ( pCell->GetNext() )

Some files were not shown because too many files have changed in this diff Show More