Kaydet (Commit) caa7867a authored tarafından László Németh's avatar László Németh Kaydeden (comit) Andras Timar

tdf#91260: cleanup - textboxes extending beyond the page

Storing Undo data is unnecessary here, because shrinking is applied
only on the  text frame of the textbox. The shape component of the
textbox isn't modified.

(cherry-picked from 2f779fc0)

Change-Id: Iaff64ff4953adbfa830832da146343cef2734547
Reviewed-on: https://gerrit.libreoffice.org/16088Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>
üst b47c6075
......@@ -482,13 +482,10 @@ SwTwips SwAnchoredObjectPosition::_ImplAdjustVertRelPos( const SwTwips nTopOfAnc
{
// shrink textboxes to extend beyond the page bottom
SwFrameFormat* pFrameFormat = ::FindFrameFormat(&GetObject());
SfxItemSet aTextBoxSet(pFrameFormat->GetDoc()->GetAttrPool(), aFrameFormatSetRange);
SwFormatFrmSize aSize(pFormat->GetFrmSize());
SwTwips nShrinked = aSize.GetHeight() - (nProposedRelPosY - nAdjustedRelPosY);
aSize.SetHeight( nShrinked > 0 ? nShrinked : 0 );
aTextBoxSet.Put(aSize);
if (aTextBoxSet.Count())
pFrameFormat->GetDoc()->SetFlyFrmAttr(*pFrameFormat, aTextBoxSet);
pFrameFormat->SetFormatAttr(aSize);
nAdjustedRelPosY = nProposedRelPosY;
} else if ( SwTextBoxHelper::findTextBox(pFormat) )
// when the shape has a textbox, use only the proposed vertical position
......
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