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

These SwTxtFrm calls shall apparently be done via pOwn, not m_rThis

...given the initialization of pOwn based on m_rThis at the start of
CalcUpperSpace and the pOwn->IsTxtFrm() checks preceeding these casts.

At least CppunitTest_sw_odfimport via

SwFlowFrm::CalcUpperSpace
SwSectionFrm::Format
SwLayoutFrm::MakeAll
SwSectionFrm::MakeAll
SwFrm::PrepareMake
SwFrm::Calc
SwLayAction::FormatLayout
SwLayAction::FormatLayout
SwLayAction::FormatLayout
SwLayAction::InternalAction
SwLayAction::Action
SwViewShell::ImplEndAction
SwViewShell::EndAction
SwCrsrShell::EndAction
SwView::OuterResizePixel
SfxViewFrame::DoAdjustPosSizePixel
SfxViewFrame::Resize
SfxFrameViewWindow_Impl::Resize
Window::ImplCallResize
Window::Show
SfxBaseController::ConnectSfxFrame_Impl
SfxBaseController::attachFrame
(anonymous namespace)::SfxFrameLoader_Impl::impl
(anonymous namespace)::SfxFrameLoader_Impl::load
framework::LoadEnv::impl_loadContent
framework::LoadEnv::startLoading
framework::LoadEnv::loadComponentFromURL
unotest::MacrosTest::loadFromDesktop
SwModelTestBase::load
SwModelTestBase::executeImportTest
testFdo55814::Import

leads to calls where m_rThis is not a SwTxtFrm.

As this mixed usage of m_rThis and pOwn is in there since
84a3db80 "initial import" it is hard to tell
whether further uses of m_rThis should be replace with uses of pOwn, too.

Change-Id: I6a59aa3aec2d28b8aec13cd4b9528fdbe4ab093a
üst 91bfacea
...@@ -1382,7 +1382,7 @@ SwTwips SwFlowFrm::CalcUpperSpace( const SwBorderAttrs *pAttrs, ...@@ -1382,7 +1382,7 @@ SwTwips SwFlowFrm::CalcUpperSpace( const SwBorderAttrs *pAttrs,
// former consideration // former consideration
if ( pOwn->IsTxtFrm() ) if ( pOwn->IsTxtFrm() )
{ {
nAdd = std::max( nAdd, static_cast<SwTxtFrm&>(m_rThis).GetLineSpace() ); nAdd = std::max( nAdd, static_cast<SwTxtFrm*>(pOwn)->GetLineSpace() );
} }
nUpper += nAdd; nUpper += nAdd;
} }
...@@ -1404,11 +1404,11 @@ SwTwips SwFlowFrm::CalcUpperSpace( const SwBorderAttrs *pAttrs, ...@@ -1404,11 +1404,11 @@ SwTwips SwFlowFrm::CalcUpperSpace( const SwBorderAttrs *pAttrs,
// spacing is built. // spacing is built.
if ( bPrevLineSpacingPorportional ) if ( bPrevLineSpacingPorportional )
{ {
nAdd += static_cast<SwTxtFrm&>(m_rThis).GetLineSpace( true ); nAdd += static_cast<SwTxtFrm*>(pOwn)->GetLineSpace( true );
} }
else else
{ {
nAdd = std::max( nAdd, static_cast<SwTxtFrm&>(m_rThis).GetLineSpace( true ) ); nAdd = std::max( nAdd, static_cast<SwTxtFrm*>(pOwn)->GetLineSpace( true ) );
} }
} }
nUpper += nAdd; nUpper += nAdd;
...@@ -1450,11 +1450,11 @@ SwTwips SwFlowFrm::CalcUpperSpace( const SwBorderAttrs *pAttrs, ...@@ -1450,11 +1450,11 @@ SwTwips SwFlowFrm::CalcUpperSpace( const SwBorderAttrs *pAttrs,
// spacing is built. // spacing is built.
if ( bPrevLineSpacingPorportional ) if ( bPrevLineSpacingPorportional )
{ {
nAdd += static_cast<SwTxtFrm&>(m_rThis).GetLineSpace( true ); nAdd += static_cast<SwTxtFrm*>(pOwn)->GetLineSpace( true );
} }
else else
{ {
nAdd = std::max( nAdd, static_cast<SwTxtFrm&>(m_rThis).GetLineSpace( true ) ); nAdd = std::max( nAdd, static_cast<SwTxtFrm*>(pOwn)->GetLineSpace( true ) );
} }
} }
nUpper += nAdd; nUpper += nAdd;
......
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