summaryrefslogtreecommitdiff
path: root/sw/source/core/layout/trvlfrm.cxx
diff options
context:
space:
mode:
authorRüdiger Timm <rt@openoffice.org>2007-04-25 08:09:05 +0000
committerRüdiger Timm <rt@openoffice.org>2007-04-25 08:09:05 +0000
commitcff14e2ea38e433100accb827d49bc1d1c032441 (patch)
tree5b00320a79d5f7e1f9e1e2c3d02142c8507aacaf /sw/source/core/layout/trvlfrm.cxx
parent60ea2adf00a706ee45b9cc026161023079cc8c67 (diff)
INTEGRATION: CWS os94 (1.53.14); FILE MERGED
2007/03/12 08:10:43 os 1.53.14.1: #i75235# unused methods removed
Diffstat (limited to 'sw/source/core/layout/trvlfrm.cxx')
-rw-r--r--sw/source/core/layout/trvlfrm.cxx123
1 files changed, 2 insertions, 121 deletions
diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx
index 55e5e9fb05a0..5bb55596cb4a 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: trvlfrm.cxx,v $
*
- * $Revision: 1.53 $
+ * $Revision: 1.54 $
*
- * last change: $Author: vg $ $Date: 2007-02-28 15:49:57 $
+ * last change: $Author: rt $ $Date: 2007-04-25 09:09:05 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -1585,125 +1585,6 @@ Point SwRootFrm::GetNextPrevCntntPos( const Point& rPoint, BOOL bNext ) const
return Point( 0, 0 );
}
-// MB 22.11.2004
-Point SwRootFrm::GetContentFromPos( const Point &rPoint, int offset ) const {
-
- // First of all we search for the page which
- // corrosponds to the given position
- SwLayoutFrm *pPage = (SwLayoutFrm*)Lower();
- if( pPage )
- while( pPage->GetNext() && pPage->Frm().Bottom() < rPoint.Y() )
- pPage = (SwLayoutFrm*)pPage->GetNext();
-
- // Retrieve the first content frame on the page in question
- const SwCntntFrm *pCnt = pPage ? pPage->ContainsCntnt() : ContainsCntnt();
- if(!pCnt)
- return Point( 0, 0 );
-
- ViewShell *pSh = GetShell();
- const SwRect &visArea = pSh->VisArea();
-
- // Initial search distance
- float fDistance = FLT_MAX;
- const SwCntntFrm *pGuess = pCnt;
-
- // Now search for the content frame which is located
- // as close as possible to the given postion.
- do {
-
- // Found if the position is contained in this frame
- pCnt->Calc();
- SwRect aCntFrm(pCnt->UnionFrm());
- if(aCntFrm.IsInside(rPoint))
- break;
-
- // Step to the next frame.
- const SwCntntFrm *pNxt = pCnt->GetNextCntntFrm();
- while(pNxt && !pNxt->IsInDocBody())
- pNxt = pNxt->GetNextCntntFrm();
- if(pNxt) {
-
- // stop if the next content frame
- // is on a page that is not visible...
- const SwPageFrm *pPageFrm = pNxt->FindPageFrm();
- if(visArea.GetIntersection(pPageFrm->UnionFrm()).IsEmpty())
- break;
-
- Point pkClosest;
- float fCurrentDistance = aCntFrm.GetDistance(rPoint,pkClosest);
- if(fCurrentDistance < fDistance) {
- pGuess = pCnt;
- fDistance = fCurrentDistance;
- }
- }
-
- pCnt = pNxt;
-
- } while(pCnt);
-
- // In case we found the "closest frame",
- // step one frame back (if possible)
- if(pCnt = pGuess) {
-
- // step right?
- if(offset & 1) {
- const SwCntntFrm *pNext = pCnt->GetNextCntntFrm();
- if(pNext) {
- SwRect aNextCntFrm(pNext->UnionFrm());
- if(pNext->IsInDocBody())
- if(aNextCntFrm.Left() > rPoint.X())
- pCnt=pNext;
- }
- }
-
- // step left?
- else if(offset & 2) {
- const SwCntntFrm *pPrev = pCnt->GetPrevCntntFrm();
- if(pPrev) {
- SwRect aPrevCntFrm(pPrev->UnionFrm());
- if(pPrev->IsInDocBody())
- if(aPrevCntFrm.Right() < rPoint.X())
- pCnt=pPrev;
- }
- }
-
- // step up?
- if(offset & 8) {
- const SwCntntFrm *pPrev = pCnt->GetPrevCntntFrm();
- while(pPrev) {
- SwRect aPrevCntFrm(pPrev->UnionFrm());
- if(pPrev->IsInDocBody()) {
- if(aPrevCntFrm.Top() < rPoint.Y()) {
- pCnt=pPrev;
- break;
- }
- }
- pPrev = pPrev->GetPrevCntntFrm();
- }
- }
-
- // step down?
- else if(offset & 4) {
- const SwCntntFrm *pNext = pCnt->GetNextCntntFrm();
- while(pNext) {
- SwRect aNextCntFrm(pNext->UnionFrm());
- if(pNext->IsInDocBody()) {
- if(aNextCntFrm.Bottom() > rPoint.Y()) {
- pCnt=pNext;
- break;
- }
- }
- pNext = pNext->GetNextCntntFrm();
- }
- }
-
- SwRect aCntFrm(pCnt->UnionFrm());
- return aCntFrm.Pos();
- }
-
- return rPoint;
-}
-
/*************************************************************************
|*
|* SwRootFrm::GetPagePos()