summaryrefslogtreecommitdiff
path: root/sw/source/core/layout/flyincnt.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-07-30 10:35:22 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-08-01 11:43:08 +0200
commita0ec43251e8b8a0805306ca5ad86794550916fce (patch)
tree4ed3dd954b43a2ea1946473edba9f6963350d25c /sw/source/core/layout/flyincnt.cxx
parentda64ad86e9f2dd66fbcecb46dcc22626e9f5a6a6 (diff)
loplugin:flatten in sw/core/layout
Change-Id: I67fd1a269d960174b88c57da4a0588f5d9252660 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99885 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/core/layout/flyincnt.cxx')
-rw-r--r--sw/source/core/layout/flyincnt.cxx34
1 files changed, 17 insertions, 17 deletions
diff --git a/sw/source/core/layout/flyincnt.cxx b/sw/source/core/layout/flyincnt.cxx
index 4823aab29230..fed15e27e672 100644
--- a/sw/source/core/layout/flyincnt.cxx
+++ b/sw/source/core/layout/flyincnt.cxx
@@ -154,24 +154,24 @@ void SwFlyInContentFrame::Format( vcl::RenderContext* pRenderContext, const SwBo
**/
void SwFlyInContentFrame::MakeObjPos()
{
- if ( !isFrameAreaPositionValid() )
+ if ( isFrameAreaPositionValid() )
+ return;
+
+ setFrameAreaPositionValid(true);
+ SwFlyFrameFormat *pFormat = GetFormat();
+ const SwFormatVertOrient &rVert = pFormat->GetVertOrient();
+ //Update the current values in the format if needed, during this we of
+ //course must not send any Modify.
+ const bool bVert = GetAnchorFrame()->IsVertical();
+ SwTwips nOld = rVert.GetPos();
+ SwTwips nAct = bVert ? -GetCurrRelPos().X() : GetCurrRelPos().Y();
+ if( nAct != nOld )
{
- setFrameAreaPositionValid(true);
- SwFlyFrameFormat *pFormat = GetFormat();
- const SwFormatVertOrient &rVert = pFormat->GetVertOrient();
- //Update the current values in the format if needed, during this we of
- //course must not send any Modify.
- const bool bVert = GetAnchorFrame()->IsVertical();
- SwTwips nOld = rVert.GetPos();
- SwTwips nAct = bVert ? -GetCurrRelPos().X() : GetCurrRelPos().Y();
- if( nAct != nOld )
- {
- SwFormatVertOrient aVert( rVert );
- aVert.SetPos( nAct );
- pFormat->LockModify();
- pFormat->SetFormatAttr( aVert );
- pFormat->UnlockModify();
- }
+ SwFormatVertOrient aVert( rVert );
+ aVert.SetPos( nAct );
+ pFormat->LockModify();
+ pFormat->SetFormatAttr( aVert );
+ pFormat->UnlockModify();
}
}