Kaydet (Commit) 5c3f46cc authored tarafından Stephan Bergmann's avatar Stephan Bergmann

loplugin:cstylecast, involving pointer to incomplete type

Change-Id: I2c97ddaac8e2f9a69816b6b0caf6b48a79cdd07e
üst 674e4b0c
...@@ -629,7 +629,7 @@ public: ...@@ -629,7 +629,7 @@ public:
inline SwSectionFrm *FindSctFrm(); inline SwSectionFrm *FindSctFrm();
inline SwFrm *FindNext(); inline SwFrm *FindNext();
// #i27138# - add parameter <_bInSameFtn> // #i27138# - add parameter <_bInSameFtn>
inline SwCntntFrm* FindNextCnt( const bool _bInSameFtn = false ); SwCntntFrm* FindNextCnt( const bool _bInSameFtn = false );
inline SwFrm *FindPrev(); inline SwFrm *FindPrev();
inline const SwPageFrm *FindPageFrm() const; inline const SwPageFrm *FindPageFrm() const;
inline const SwFtnBossFrm *FindFtnBossFrm( bool bFtn = false ) const; inline const SwFtnBossFrm *FindFtnBossFrm( bool bFtn = false ) const;
...@@ -641,31 +641,13 @@ public: ...@@ -641,31 +641,13 @@ public:
inline const SwSectionFrm *FindSctFrm() const; inline const SwSectionFrm *FindSctFrm() const;
inline const SwFrm *FindNext() const; inline const SwFrm *FindNext() const;
// #i27138# - add parameter <_bInSameFtn> // #i27138# - add parameter <_bInSameFtn>
inline const SwCntntFrm* FindNextCnt( const bool _bInSameFtn = false ) const; const SwCntntFrm* FindNextCnt( const bool _bInSameFtn = false ) const;
inline const SwFrm *FindPrev() const; inline const SwFrm *FindPrev() const;
const SwFrm *GetLower() const; const SwFrm *GetLower() const;
/** inline wrapper method for <_FindPrevCnt(..)> SwCntntFrm* FindPrevCnt( const bool _bInSameFtn = false );
#i27138#
*/
inline SwCntntFrm* FindPrevCnt( const bool _bInSameFtn = false )
{
if ( GetPrev() && GetPrev()->IsCntntFrm() )
return (SwCntntFrm*)(GetPrev());
else
return _FindPrevCnt( _bInSameFtn );
}
/** inline const wrapper method for <_FindPrevCnt(..)> const SwCntntFrm* FindPrevCnt( const bool _bInSameFtn = false ) const;
#i27138#
*/
inline const SwCntntFrm* FindPrevCnt( const bool _bInSameFtn = false ) const
{
if ( GetPrev() && GetPrev()->IsCntntFrm() )
return (const SwCntntFrm*)(GetPrev());
else
return const_cast<SwFrm*>(this)->_FindPrevCnt( _bInSameFtn );
}
// #i79774# // #i79774#
SwFrm* _GetIndPrev() const; SwFrm* _GetIndPrev() const;
...@@ -691,7 +673,7 @@ public: ...@@ -691,7 +673,7 @@ public:
inline void OptCalc() const; // here we assume (for optimization) that inline void OptCalc() const; // here we assume (for optimization) that
// the predecessors are already formatted // the predecessors are already formatted
inline Point GetRelPos() const; Point GetRelPos() const;
const SwRect &Frm() const { return maFrm; } const SwRect &Frm() const { return maFrm; }
const SwRect &Prt() const { return maPrt; } const SwRect &Prt() const { return maPrt; }
...@@ -1038,16 +1020,6 @@ inline void SwFrm::OptCalc() const ...@@ -1038,16 +1020,6 @@ inline void SwFrm::OptCalc() const
if ( !mbValidPos || !mbValidPrtArea || !mbValidSize ) if ( !mbValidPos || !mbValidPrtArea || !mbValidSize )
const_cast<SwFrm*>(this)->OptPrepareMake(); const_cast<SwFrm*>(this)->OptPrepareMake();
} }
inline Point SwFrm::GetRelPos() const
{
Point aRet( maFrm.Pos() );
// here we cast since SwLayoutFrm is declared only as forwarded
aRet -= ((SwFrm*)GetUpper())->Prt().Pos();
aRet -= ((SwFrm*)GetUpper())->Frm().Pos();
return aRet;
}
inline const SwPageFrm *SwFrm::FindPageFrm() const inline const SwPageFrm *SwFrm::FindPageFrm() const
{ {
return const_cast<SwFrm*>(this)->FindPageFrm(); return const_cast<SwFrm*>(this)->FindPageFrm();
...@@ -1111,22 +1083,6 @@ inline const SwFrm *SwFrm::FindNext() const ...@@ -1111,22 +1083,6 @@ inline const SwFrm *SwFrm::FindNext() const
else else
return const_cast<SwFrm*>(this)->_FindNext(); return const_cast<SwFrm*>(this)->_FindNext();
} }
// #i27138# - add parameter <_bInSameFtn>
inline SwCntntFrm *SwFrm::FindNextCnt( const bool _bInSameFtn )
{
if ( mpNext && mpNext->IsCntntFrm() )
return (SwCntntFrm*)mpNext;
else
return _FindNextCnt( _bInSameFtn );
}
// #i27138# - add parameter <_bInSameFtn>
inline const SwCntntFrm *SwFrm::FindNextCnt( const bool _bInSameFtn ) const
{
if ( mpNext && mpNext->IsCntntFrm() )
return (SwCntntFrm*)mpNext;
else
return const_cast<SwFrm*>(this)->_FindNextCnt( _bInSameFtn );
}
inline SwFrm *SwFrm::FindPrev() inline SwFrm *SwFrm::FindPrev()
{ {
if ( mpPrev && !mpPrev->IsSctFrm() ) if ( mpPrev && !mpPrev->IsSctFrm() )
......
...@@ -166,6 +166,38 @@ SwFrm* SwFrm::GetLower() ...@@ -166,6 +166,38 @@ SwFrm* SwFrm::GetLower()
return IsLayoutFrm() ? static_cast<SwLayoutFrm*>(this)->Lower() : 0; return IsLayoutFrm() ? static_cast<SwLayoutFrm*>(this)->Lower() : 0;
} }
SwCntntFrm* SwFrm::FindPrevCnt( const bool _bInSameFtn )
{
if ( GetPrev() && GetPrev()->IsCntntFrm() )
return static_cast<SwCntntFrm*>(GetPrev());
else
return _FindPrevCnt( _bInSameFtn );
}
const SwCntntFrm* SwFrm::FindPrevCnt( const bool _bInSameFtn ) const
{
if ( GetPrev() && GetPrev()->IsCntntFrm() )
return static_cast<const SwCntntFrm*>(GetPrev());
else
return const_cast<SwFrm*>(this)->_FindPrevCnt( _bInSameFtn );
}
SwCntntFrm *SwFrm::FindNextCnt( const bool _bInSameFtn )
{
if ( mpNext && mpNext->IsCntntFrm() )
return static_cast<SwCntntFrm*>(mpNext);
else
return _FindNextCnt( _bInSameFtn );
}
const SwCntntFrm *SwFrm::FindNextCnt( const bool _bInSameFtn ) const
{
if ( mpNext && mpNext->IsCntntFrm() )
return static_cast<SwCntntFrm*>(mpNext);
else
return const_cast<SwFrm*>(this)->_FindNextCnt( _bInSameFtn );
}
bool SwLayoutFrm::IsAnLower( const SwFrm *pAssumed ) const bool SwLayoutFrm::IsAnLower( const SwFrm *pAssumed ) const
{ {
const SwFrm *pUp = pAssumed; const SwFrm *pUp = pAssumed;
......
...@@ -1786,6 +1786,15 @@ bool SwFrm::OnFirstPage() const ...@@ -1786,6 +1786,15 @@ bool SwFrm::OnFirstPage() const
return bRet; return bRet;
} }
Point SwFrm::GetRelPos() const
{
Point aRet( maFrm.Pos() );
// here we cast since SwLayoutFrm is declared only as forwarded
aRet -= GetUpper()->Prt().Pos();
aRet -= GetUpper()->Frm().Pos();
return aRet;
}
/** @return the virtual page number with the offset. */ /** @return the virtual page number with the offset. */
sal_uInt16 SwFrm::GetVirtPageNum() const sal_uInt16 SwFrm::GetVirtPageNum() const
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment