diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-01-22 17:03:22 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-01-22 17:03:22 +0000 |
commit | 15faeb4f9f111f7ea8d04fd64b3d065971cd4570 (patch) | |
tree | e6eb0aa7047c23b0429849af10bb2921976af863 | |
parent | ef3b6fa0cf3e4f2c7b29e9373a8afc8c2c7c7ca0 (diff) |
Resolves: fdo#87760 if we can't anchor at hidden text then...
anchor to the page instead
Change-Id: Ib7931fdd1c70e809ec442aeac125879980e20ec9
-rw-r--r-- | sw/source/core/frmedt/feshview.cxx | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index 6923a71296ee..b75bdae064c0 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -1585,12 +1585,20 @@ bool SwFEShell::ImpEndCreate() GetLayout()->GetCrsrOfst( &aPos, aPoint, &aState ); // do not set in ReadnOnly-content - if( aPos.nNode.GetNode().IsProtect() ) + if (aPos.nNode.GetNode().IsProtect()) + { // then only page bound. Or should we // search the next not-readonly position? bAtPage = true; + } - pAnch = aPos.nNode.GetNode().GetCntntNode()->getLayoutFrm( GetLayout(), &aPoint, 0, false ); + SwCntntNode* pCNode = aPos.nNode.GetNode().GetCntntNode(); + pAnch = pCNode ? pCNode->getLayoutFrm( GetLayout(), &aPoint, 0, false ) : NULL; + if (!pAnch) + { + // Hidden content. Anchor to the page instead + bAtPage = true; + } if( !bAtPage ) { @@ -1636,7 +1644,7 @@ bool SwFEShell::ImpEndCreate() if( bAtPage ) { - pPage = pAnch->FindPageFrm(); + pPage = pAnch ? pAnch->FindPageFrm() : GetLayout()->GetPageAtPos(aPoint); aAnch.SetType( FLY_AT_PAGE ); aAnch.SetPageNum( pPage->GetPhyPageNum() ); |