diff options
author | Oliver Bolte <obo@openoffice.org> | 2004-08-16 07:01:52 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2004-08-16 07:01:52 +0000 |
commit | 9078cdbcb5190fd7fdde3095386f46156c18c52a (patch) | |
tree | 5f2926484a95b952ef6b8bdc82d84f87c13bdeea /sw/source | |
parent | a32e83f0bf758cdbd1d52b3d3cdd533450ebec83 (diff) |
#i10000# SelTblBox still used
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/crsr/trvltbl.cxx | 79 |
1 files changed, 77 insertions, 2 deletions
diff --git a/sw/source/core/crsr/trvltbl.cxx b/sw/source/core/crsr/trvltbl.cxx index f6e5467f0e69..8e9268f20c2a 100644 --- a/sw/source/core/crsr/trvltbl.cxx +++ b/sw/source/core/crsr/trvltbl.cxx @@ -2,9 +2,9 @@ * * $RCSfile: trvltbl.cxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: obo $ $Date: 2004-08-12 12:14:24 $ + * last change: $Author: obo $ $Date: 2004-08-16 08:01:52 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -185,6 +185,25 @@ FASTBOOL SwCrsrShell::GoPrevCell() return bRet; } + +FASTBOOL SwCrsrShell::GotoTblBox( const String& rName ) +{ + SwShellCrsr* pCrsr = pTblCrsr ? pTblCrsr : pCurCrsr; + SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, + + FASTBOOL bRet = pCrsr->GotoTblBox( rName ); + if( bRet ) + { + //JP 28.10.97: Bug 45028 - die "oberste" Position setzen fuer + // wiederholte Kopfzeilen + pCrsr->GetPtPos() = Point(); + UpdateCrsr( SwCrsrShell::SCROLLWIN | SwCrsrShell::CHKRANGE | + SwCrsrShell::READONLY ); // und den akt. Updaten + } + return bRet; +} + + FASTBOOL SwCrsrShell::SelTblRow() { // pruefe ob vom aktuellen Crsr der SPoint/Mark in einer Tabelle stehen @@ -268,6 +287,62 @@ FASTBOOL SwCrsrShell::SelTblCol() return TRUE; } + +FASTBOOL SwCrsrShell::SelTblBox() +{ + // if we're in a table, create a table cursor, and select the cell + // that the current cursor's point resides in + + // search for start node of our table box. If not found, exit realy + const SwStartNode* pStartNode = + pCurCrsr->GetPoint()->nNode.GetNode().FindTableBoxStartNode(); + +#ifndef PRODUCT + // the old code checks whether we're in a table by asking the + // frame. This should yield the same result as searching for the + // table box start node, right? + SwFrm *pFrm = GetCurrFrm(); + DBG_ASSERT( !pFrm->IsInTab() == !(pStartNode != NULL), + "Schroedinger's table: We're in a box, and also we aren't." ) +#endif + + if( pStartNode == NULL ) + return FALSE; + + + SET_CURR_SHELL( this ); + + // create a table cursor, if there isn't one already + if( !pTblCrsr ) + { + pTblCrsr = new SwShellTableCrsr( *this, *pCurCrsr->GetPoint() ); + pCurCrsr->DeleteMark(); + pCurCrsr->SwSelPaintRects::Hide(); + } + + // select the complete box with our shiny new pTblCrsr + // 1. delete mark, and move point to first content node in box + // 2. set mark, and move point to last content node in box + // 3. exchange + + pTblCrsr->DeleteMark(); + *(pTblCrsr->GetPoint()) = SwPosition( *pStartNode ); + pTblCrsr->Move( fnMoveForward, fnGoNode ); + + pTblCrsr->SetMark(); + *(pTblCrsr->GetPoint()) = SwPosition( *(pStartNode->EndOfSectionNode()) ); + pTblCrsr->Move( fnMoveBackward, fnGoNode ); + + pTblCrsr->Exchange(); + + // with some luck, UpdateCrsr() will now update everything that + // needs updateing + UpdateCrsr(); + + return TRUE; +} + + // suche die naechste nicht geschuetzte Zelle innerhalb der Tabelle // Parameter: // rIdx - steht auf dem TabellenNode |