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.

Change-Id: Iaff64ff4953adbfa830832da146343cef2734547
This commit is contained in:
László Németh
2015-06-04 18:15:12 +02:00
parent 76a9afc9da
commit 2f779fc046

View File

@@ -482,13 +482,10 @@ SwTwips SwAnchoredObjectPosition::_ImplAdjustVertRelPos( const SwTwips nTopOfAnc
{ {
// shrink textboxes to extend beyond the page bottom // shrink textboxes to extend beyond the page bottom
SwFrameFormat* pFrameFormat = ::FindFrameFormat(&GetObject()); SwFrameFormat* pFrameFormat = ::FindFrameFormat(&GetObject());
SfxItemSet aTextBoxSet(pFrameFormat->GetDoc()->GetAttrPool(), aFrameFormatSetRange);
SwFormatFrmSize aSize(pFormat->GetFrmSize()); SwFormatFrmSize aSize(pFormat->GetFrmSize());
SwTwips nShrinked = aSize.GetHeight() - (nProposedRelPosY - nAdjustedRelPosY); SwTwips nShrinked = aSize.GetHeight() - (nProposedRelPosY - nAdjustedRelPosY);
aSize.SetHeight( nShrinked > 0 ? nShrinked : 0 ); aSize.SetHeight( nShrinked > 0 ? nShrinked : 0 );
aTextBoxSet.Put(aSize); pFrameFormat->SetFormatAttr(aSize);
if (aTextBoxSet.Count())
pFrameFormat->GetDoc()->SetFlyFrmAttr(*pFrameFormat, aTextBoxSet);
nAdjustedRelPosY = nProposedRelPosY; nAdjustedRelPosY = nProposedRelPosY;
} else if ( SwTextBoxHelper::findTextBox(pFormat) ) } else if ( SwTextBoxHelper::findTextBox(pFormat) )
// when the shape has a textbox, use only the proposed vertical position // when the shape has a textbox, use only the proposed vertical position