diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2020-08-19 17:05:20 +0200 |
---|---|---|
committer | Michael Stahl <michael.stahl@cib.de> | 2020-08-20 10:55:33 +0200 |
commit | 6c55d0ea3952c87aebec7fce76e1cdea1ff981f8 (patch) | |
tree | 7d2f9413031bcbde2accc80d71cb8052beb3089e | |
parent | db10942f021026e67ab146da1b625e534f58cf34 (diff) |
sw: remove misleading initialisation from SwUndoInsLayFormat
Change-Id: I5577b388b565cdab6dcf60721f0f90d2987dac05
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101005
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
-rw-r--r-- | sw/source/core/undo/undobj1.cxx | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/sw/source/core/undo/undobj1.cxx b/sw/source/core/undo/undobj1.cxx index 3f20a2e9c67a..3feab0a10c74 100644 --- a/sw/source/core/undo/undobj1.cxx +++ b/sw/source/core/undo/undobj1.cxx @@ -269,26 +269,10 @@ SwUndoInsLayFormat::SwUndoInsLayFormat( SwFrameFormat* pFormat, sal_uLong nNodeI const SwFormatAnchor& rAnchor = m_pFrameFormat->GetAnchor(); m_nRndId = rAnchor.GetAnchorId(); m_bDelFormat = false; - switch( m_nRndId ) - { - case RndStdIds::FLY_AT_PAGE: - m_nNodePagePos = rAnchor.GetPageNum(); - break; - case RndStdIds::FLY_AT_PARA: - case RndStdIds::FLY_AT_FLY: - m_nNodePagePos = rAnchor.GetContentAnchor()->nNode.GetIndex(); - break; - case RndStdIds::FLY_AS_CHAR: - case RndStdIds::FLY_AT_CHAR: - { - const SwPosition* pPos = rAnchor.GetContentAnchor(); - m_nContentPos = pPos->nContent.GetIndex(); - m_nNodePagePos = pPos->nNode.GetIndex(); - } - break; - default: - OSL_FAIL( "Which FlyFrame?" ); - } + // note: SwUndoInsLayFormat is called with the content being fully inserted + // from most places but with only an empty content section from + // CopyLayoutFormat(); it's not necessary here to init m_nNodePagePos + // because Undo will do it. } SwUndoInsLayFormat::~SwUndoInsLayFormat() |