Kaydet (Commit) 133d6d8d authored tarafından Oliver-Rainer Wittmann's avatar Oliver-Rainer Wittmann Kaydeden (comit) Caolán McNamara

Resolves: #i121443# register text frames and graphics...

on the correct page frame

- trigger formatting of selected object when moving view to the selected object
or when graphical horizontal line has been inserted.

(cherry picked from commit 82fafc47)

Conflicts:
	sw/source/core/frmedt/feshview.cxx
	sw/source/core/layout/fly.cxx
	sw/source/ui/shells/textsh.cxx

Change-Id: I4b4b523ff445f2ce20d9b81ad1187db7b44bd145
üst 7dd5f930
...@@ -2253,9 +2253,10 @@ const SwFrmFmt* SwFEShell::GetFlyNum(sal_uInt16 nIdx, FlyCntType eType, bool bI ...@@ -2253,9 +2253,10 @@ const SwFrmFmt* SwFEShell::GetFlyNum(sal_uInt16 nIdx, FlyCntType eType, bool bI
// show the current selected object // show the current selected object
void SwFEShell::MakeSelVisible() void SwFEShell::MakeSelVisible()
{ {
if( Imp()->HasDrawView() && if ( Imp()->HasDrawView() &&
Imp()->GetDrawView()->GetMarkedObjectList().GetMarkCount() ) Imp()->GetDrawView()->GetMarkedObjectList().GetMarkCount() )
{ {
GetCurrFrm(); // just to trigger formatting in case the selected object is not formatted.
MakeVisible( Imp()->GetDrawView()->GetAllMarkedRect() ); MakeVisible( Imp()->GetDrawView()->GetAllMarkedRect() );
} }
else else
......
...@@ -2007,37 +2007,10 @@ void SwFrm::AppendFly( SwFlyFrm *pNew ) ...@@ -2007,37 +2007,10 @@ void SwFrm::AppendFly( SwFlyFrm *pNew )
// Register at the page // Register at the page
// If there's none present, register via SwPageFrm::PreparePage // If there's none present, register via SwPageFrm::PreparePage
SwPageFrm *pPage = FindPageFrm(); SwPageFrm* pPage = FindPageFrm();
if ( pPage ) if ( pPage != NULL )
{ {
if ( pNew->IsFlyAtCntFrm() && pNew->Frm().Top() == FAR_AWAY ) pPage->AppendFlyToPage( pNew );
{
// Try to make the page formatting of new documents a bit handier:
// In the beginning we add the Flys to the back, so that the Anchors
// do not have to be reformatted unnecessarily often.
// However, we do not add them all the way at the end, so that we
// can still jump to the document's end in a meaningful way.
SwRootFrm *pRoot = (SwRootFrm*)pPage->GetUpper();
if( !SwLayHelper::CheckPageFlyCache( pPage, pNew ) )
{
SwPageFrm *pTmp = pRoot->GetLastPage();
if ( pTmp->GetPhyPageNum() > 30 )
{
for ( sal_uInt16 i = 0; i < 10; ++i )
{
pTmp = (SwPageFrm*)pTmp->GetPrev();
if( pTmp->GetPhyPageNum() <= pPage->GetPhyPageNum() )
break; // So that we don't end up before the Anchor
}
if ( pTmp->IsEmptyPage() )
pTmp = (SwPageFrm*)pTmp->GetPrev();
pPage = pTmp;
}
}
pPage->AppendFlyToPage( pNew );
}
else
pPage->AppendFlyToPage( pNew );
} }
} }
......
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