LCOV - code coverage report
Current view: top level - sw/source/core/crsr - crstrvl.cxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 45 1211 3.7 %
Date: 2014-04-11 Functions: 7 46 15.2 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : #include <hintids.hxx>
      21             : #include <comphelper/string.hxx>
      22             : #include <svl/itemiter.hxx>
      23             : #include <editeng/lrspitem.hxx>
      24             : #include <editeng/adjustitem.hxx>
      25             : #include <editeng/formatbreakitem.hxx>
      26             : #include <svx/svdobj.hxx>
      27             : #include <crsrsh.hxx>
      28             : #include <doc.hxx>
      29             : #include <IDocumentUndoRedo.hxx>
      30             : #include <pagefrm.hxx>
      31             : #include <cntfrm.hxx>
      32             : #include <rootfrm.hxx>
      33             : #include <pam.hxx>
      34             : #include <ndtxt.hxx>
      35             : #include <fldbas.hxx>
      36             : #include <swtable.hxx>
      37             : #include <docary.hxx>
      38             : #include <txtfld.hxx>
      39             : #include <fmtfld.hxx>
      40             : #include <txtftn.hxx>
      41             : #include <txtinet.hxx>
      42             : #include <fmtinfmt.hxx>
      43             : #include <txttxmrk.hxx>
      44             : #include <frmfmt.hxx>
      45             : #include <flyfrm.hxx>
      46             : #include <viscrs.hxx>
      47             : #include <callnk.hxx>
      48             : #include <doctxm.hxx>
      49             : #include <docfld.hxx>
      50             : #include <expfld.hxx>
      51             : #include <reffld.hxx>
      52             : #include <flddat.hxx>
      53             : #include <cellatr.hxx>
      54             : #include <swundo.hxx>
      55             : #include <redline.hxx>
      56             : #include <fmtcntnt.hxx>
      57             : #include <fmthdft.hxx>
      58             : #include <pagedesc.hxx>
      59             : #include <fesh.hxx>
      60             : #include <charfmt.hxx>
      61             : #include <fmturl.hxx>
      62             : #include "txtfrm.hxx"
      63             : #include <wrong.hxx>
      64             : #include <switerator.hxx>
      65             : #include <vcl/window.hxx>
      66             : #include <docufld.hxx>
      67             : 
      68             : using namespace ::com::sun::star;
      69             : 
      70           0 : void SwCrsrShell::MoveCrsrToNum()
      71             : {
      72           0 :     SwCallLink aLk( *this ); // watch Crsr-Moves
      73           0 :     SwCrsrSaveState aSaveState( *m_pCurCrsr );
      74           0 :     if( ActionPend() )
      75           0 :         return;
      76           0 :     SET_CURR_SHELL( this );
      77             :     // try to set cursor onto this position, at half of the char-
      78             :     // SRectangle's height
      79           0 :     Point aPt( m_pCurCrsr->GetPtPos() );
      80           0 :     SwCntntFrm * pFrm = m_pCurCrsr->GetCntntNode()->getLayoutFrm( GetLayout(), &aPt,
      81           0 :                                                 m_pCurCrsr->GetPoint() );
      82           0 :     pFrm->GetCharRect( m_aCharRect, *m_pCurCrsr->GetPoint() );
      83           0 :     pFrm->Calc();
      84           0 :     if( pFrm->IsVertical() )
      85             :     {
      86           0 :         aPt.setX(m_aCharRect.Center().getX());
      87           0 :         aPt.setY(pFrm->Frm().Top() + m_nUpDownX);
      88             :     }
      89             :     else
      90             :     {
      91           0 :         aPt.setY(m_aCharRect.Center().getY());
      92           0 :         aPt.setX(pFrm->Frm().Left() + m_nUpDownX);
      93             :     }
      94           0 :     pFrm->GetCrsrOfst( m_pCurCrsr->GetPoint(), aPt );
      95           0 :     if ( !m_pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE |
      96           0 :                                 nsSwCursorSelOverFlags::SELOVER_CHANGEPOS ))
      97             :     {
      98             :         UpdateCrsr(SwCrsrShell::UPDOWN |
      99             :                 SwCrsrShell::SCROLLWIN | SwCrsrShell::CHKRANGE |
     100           0 :                 SwCrsrShell::READONLY );
     101           0 :     }
     102             : }
     103             : 
     104             : /// go to next/previous point on the same level
     105           0 : bool SwCrsrShell::GotoNextNum()
     106             : {
     107           0 :     if (!GetDoc()->GotoNextNum( *m_pCurCrsr->GetPoint() ))
     108           0 :         return false;
     109           0 :     MoveCrsrToNum();
     110           0 :     return true;
     111             : }
     112             : 
     113           0 : bool SwCrsrShell::GotoPrevNum()
     114             : {
     115           0 :     if (!GetDoc()->GotoPrevNum( *m_pCurCrsr->GetPoint() ))
     116           0 :         return false;
     117           0 :     MoveCrsrToNum();
     118           0 :     return true;
     119             : }
     120             : 
     121             : /// jump from content to header
     122           0 : sal_Bool SwCrsrShell::GotoHeaderTxt()
     123             : {
     124           0 :     const SwFrm* pFrm = GetCurrFrm()->FindPageFrm();
     125           0 :     while( pFrm && !pFrm->IsHeaderFrm() )
     126           0 :         pFrm = pFrm->GetLower();
     127             :     // found header, search 1. content frame
     128           0 :     while( pFrm && !pFrm->IsCntntFrm() )
     129           0 :         pFrm = pFrm->GetLower();
     130             : 
     131           0 :     if( pFrm )
     132             :     {
     133           0 :         SET_CURR_SHELL( this );
     134             :         // get header frame
     135           0 :         SwCallLink aLk( *this ); // watch Crsr-Moves
     136           0 :         SwCursor *pTmpCrsr = getShellCrsr( true );
     137           0 :         SwCrsrSaveState aSaveState( *pTmpCrsr );
     138           0 :         pFrm->Calc();
     139           0 :         Point aPt( pFrm->Frm().Pos() + pFrm->Prt().Pos() );
     140           0 :         pFrm->GetCrsrOfst( pTmpCrsr->GetPoint(), aPt );
     141           0 :         if( !pTmpCrsr->IsSelOvr() )
     142           0 :             UpdateCrsr();
     143             :         else
     144           0 :             pFrm = 0;
     145             :     }
     146           0 :     return 0 != pFrm;
     147             : }
     148             : 
     149             : /// jump from content to footer
     150           0 : sal_Bool SwCrsrShell::GotoFooterTxt()
     151             : {
     152           0 :     const SwPageFrm* pFrm = GetCurrFrm()->FindPageFrm();
     153           0 :     if( pFrm )
     154             :     {
     155           0 :         const SwFrm* pLower = pFrm->GetLastLower();
     156             : 
     157           0 :         while( pLower && !pLower->IsFooterFrm() )
     158           0 :             pLower = pLower->GetLower();
     159             :         // found footer, search 1. content frame
     160           0 :         while( pLower && !pLower->IsCntntFrm() )
     161           0 :             pLower = pLower->GetLower();
     162             : 
     163           0 :         if( pLower )
     164             :         {
     165           0 :             SwCursor *pTmpCrsr = getShellCrsr( true );
     166           0 :             SET_CURR_SHELL( this );
     167             :             // get position in footer
     168           0 :             SwCallLink aLk( *this ); // watch Crsr-Moves
     169           0 :             SwCrsrSaveState aSaveState( *pTmpCrsr );
     170           0 :             pLower->Calc();
     171           0 :             Point aPt( pLower->Frm().Pos() + pLower->Prt().Pos() );
     172           0 :             pLower->GetCrsrOfst( pTmpCrsr->GetPoint(), aPt );
     173           0 :             if( !pTmpCrsr->IsSelOvr() )
     174           0 :                 UpdateCrsr();
     175             :             else
     176           0 :                 pFrm = 0;
     177             :         }
     178             :         else
     179           0 :             pFrm = 0;
     180             :     }
     181             :     else
     182           0 :         pFrm = 0;
     183           0 :     return 0 != pFrm;
     184             : }
     185             : 
     186           0 : sal_Bool SwCrsrShell::SetCrsrInHdFt( sal_uInt16 nDescNo, sal_Bool bInHeader )
     187             : {
     188           0 :     sal_Bool bRet = sal_False;
     189           0 :     SwDoc *pMyDoc = GetDoc();
     190             : 
     191           0 :     SET_CURR_SHELL( this );
     192             : 
     193           0 :     if( USHRT_MAX == nDescNo )
     194             :     {
     195             :         // take the current one
     196           0 :         const SwPageFrm* pPage = GetCurrFrm()->FindPageFrm();
     197           0 :         if( pPage )
     198           0 :             for( sal_uInt16 i = 0; i < pMyDoc->GetPageDescCnt(); ++i )
     199           0 :                 if( pPage->GetPageDesc() == &pMyDoc->GetPageDesc( i ) )
     200             :                 {
     201           0 :                     nDescNo = i;
     202           0 :                     break;
     203             :                 }
     204             :     }
     205             : 
     206           0 :     if( USHRT_MAX != nDescNo && nDescNo < pMyDoc->GetPageDescCnt() )
     207             :     {
     208             :         // check if the attribute exists
     209             :         const SwPageDesc& rDesc = const_cast<const SwDoc *>(pMyDoc)
     210           0 :             ->GetPageDesc( nDescNo );
     211           0 :         const SwFmtCntnt* pCnt = 0;
     212           0 :         if( bInHeader )
     213             :         {
     214             :             // mirrored pages? ignore for now
     215           0 :             const SwFmtHeader& rHd = rDesc.GetMaster().GetHeader();
     216           0 :             if( rHd.GetHeaderFmt() )
     217           0 :                 pCnt = &rHd.GetHeaderFmt()->GetCntnt();
     218             :         }
     219             :         else
     220             :         {
     221           0 :             const SwFmtFooter& rFt = rDesc.GetMaster().GetFooter();
     222           0 :             if( rFt.GetFooterFmt() )
     223           0 :                 pCnt = &rFt.GetFooterFmt()->GetCntnt();
     224             :         }
     225             : 
     226           0 :         if( pCnt && pCnt->GetCntntIdx() )
     227             :         {
     228           0 :             SwNodeIndex aIdx( *pCnt->GetCntntIdx(), 1 );
     229           0 :             SwCntntNode* pCNd = aIdx.GetNode().GetCntntNode();
     230           0 :             if( !pCNd )
     231           0 :                 pCNd = pMyDoc->GetNodes().GoNext( &aIdx );
     232             : 
     233           0 :             Point aPt( m_pCurCrsr->GetPtPos() );
     234             : 
     235           0 :             if( pCNd && 0 != pCNd->getLayoutFrm( GetLayout(), &aPt, 0, false ) )
     236             :             {
     237             :                 // then we can set the cursor in here
     238           0 :                 SwCallLink aLk( *this ); // watch Crsr-Moves
     239           0 :                 SwCrsrSaveState aSaveState( *m_pCurCrsr );
     240             : 
     241           0 :                 ClearMark();
     242             : 
     243           0 :                 SwPosition& rPos = *m_pCurCrsr->GetPoint();
     244           0 :                 rPos.nNode = *pCNd;
     245           0 :                 rPos.nContent.Assign( pCNd, 0 );
     246             : 
     247           0 :                 bRet = !m_pCurCrsr->IsSelOvr();
     248           0 :                 if( bRet )
     249             :                     UpdateCrsr( SwCrsrShell::SCROLLWIN | SwCrsrShell::CHKRANGE |
     250           0 :                                 SwCrsrShell::READONLY );
     251           0 :             }
     252             :         }
     253             :     }
     254           0 :     return bRet;
     255             : }
     256             : 
     257             : /// jump to the next index
     258           0 : sal_Bool SwCrsrShell::GotoNextTOXBase( const OUString* pName )
     259             : {
     260           0 :     sal_Bool bRet = sal_False;
     261             : 
     262           0 :     const SwSectionFmts& rFmts = GetDoc()->GetSections();
     263           0 :     SwCntntNode* pFnd = 0;
     264           0 :     for( sal_uInt16 n = rFmts.size(); n; )
     265             :     {
     266           0 :         const SwSection* pSect = rFmts[ --n ]->GetSection();
     267           0 :         if (TOX_CONTENT_SECTION == pSect->GetType())
     268             :         {
     269             :             SwSectionNode const*const pSectNd(
     270           0 :                     pSect->GetFmt()->GetSectionNode());
     271           0 :             if (   pSectNd
     272           0 :                 && m_pCurCrsr->GetPoint()->nNode < pSectNd->GetIndex()
     273           0 :                 && (!pFnd  || pFnd->GetIndex() > pSectNd->GetIndex())
     274           0 :                 && (!pName || *pName ==
     275           0 :                     static_cast<SwTOXBaseSection const*>(pSect)->GetTOXName()))
     276             :             {
     277           0 :                 SwNodeIndex aIdx(*pSectNd, 1);
     278           0 :                 SwCntntNode* pCNd = aIdx.GetNode().GetCntntNode();
     279           0 :                 if (!pCNd)
     280           0 :                     pCNd = GetDoc()->GetNodes().GoNext( &aIdx );
     281           0 :                 if (pCNd &&
     282           0 :                     pCNd->EndOfSectionIndex() <= pSectNd->EndOfSectionIndex())
     283             :                 {
     284             :                     SwCntntFrm const*const pCFrm(
     285           0 :                             pCNd->getLayoutFrm(GetLayout()));
     286           0 :                     if (pCFrm &&
     287           0 :                         (IsReadOnlyAvailable() || !pCFrm->IsProtected()))
     288             :                     {
     289           0 :                         pFnd = pCNd;
     290             :                     }
     291           0 :                 }
     292             :             }
     293             :         }
     294             :     }
     295           0 :     if( pFnd )
     296             :     {
     297           0 :         SwCallLink aLk( *this ); // watch Crsr-Moves
     298           0 :         SwCrsrSaveState aSaveState( *m_pCurCrsr );
     299           0 :         m_pCurCrsr->GetPoint()->nNode = *pFnd;
     300           0 :         m_pCurCrsr->GetPoint()->nContent.Assign( pFnd, 0 );
     301           0 :         bRet = !m_pCurCrsr->IsSelOvr();
     302           0 :         if( bRet )
     303           0 :             UpdateCrsr(SwCrsrShell::SCROLLWIN|SwCrsrShell::CHKRANGE|SwCrsrShell::READONLY);
     304             :     }
     305           0 :     return bRet;
     306             : }
     307             : 
     308             : /// jump to previous index
     309           0 : sal_Bool SwCrsrShell::GotoPrevTOXBase( const OUString* pName )
     310             : {
     311           0 :     sal_Bool bRet = sal_False;
     312             : 
     313           0 :     const SwSectionFmts& rFmts = GetDoc()->GetSections();
     314           0 :     SwCntntNode* pFnd = 0;
     315           0 :     for( sal_uInt16 n = rFmts.size(); n; )
     316             :     {
     317           0 :         const SwSection* pSect = rFmts[ --n ]->GetSection();
     318           0 :         if (TOX_CONTENT_SECTION == pSect->GetType())
     319             :         {
     320             :             SwSectionNode const*const pSectNd(
     321           0 :                     pSect->GetFmt()->GetSectionNode());
     322           0 :             if (   pSectNd
     323           0 :                 && m_pCurCrsr->GetPoint()->nNode > pSectNd->EndOfSectionIndex()
     324           0 :                 && (!pFnd  || pFnd->GetIndex() < pSectNd->GetIndex())
     325           0 :                 && (!pName || *pName ==
     326           0 :                     static_cast<SwTOXBaseSection const*>(pSect)->GetTOXName()))
     327             :             {
     328           0 :                 SwNodeIndex aIdx(*pSectNd, 1);
     329           0 :                 SwCntntNode* pCNd = aIdx.GetNode().GetCntntNode();
     330           0 :                 if (!pCNd)
     331           0 :                     pCNd = GetDoc()->GetNodes().GoNext( &aIdx );
     332           0 :                 if (pCNd &&
     333           0 :                     pCNd->EndOfSectionIndex() <= pSectNd->EndOfSectionIndex())
     334             :                 {
     335             :                     SwCntntFrm const*const pCFrm(
     336           0 :                             pCNd->getLayoutFrm(GetLayout()));
     337           0 :                     if (pCFrm &&
     338           0 :                         (IsReadOnlyAvailable() || !pCFrm->IsProtected()))
     339             :                     {
     340           0 :                         pFnd = pCNd;
     341             :                     }
     342           0 :                 }
     343             :             }
     344             :         }
     345             :     }
     346             : 
     347           0 :     if( pFnd )
     348             :     {
     349           0 :         SwCallLink aLk( *this ); // watch Crsr-Moves
     350           0 :         SwCrsrSaveState aSaveState( *m_pCurCrsr );
     351           0 :         m_pCurCrsr->GetPoint()->nNode = *pFnd;
     352           0 :         m_pCurCrsr->GetPoint()->nContent.Assign( pFnd, 0 );
     353           0 :         bRet = !m_pCurCrsr->IsSelOvr();
     354           0 :         if( bRet )
     355           0 :             UpdateCrsr(SwCrsrShell::SCROLLWIN|SwCrsrShell::CHKRANGE|SwCrsrShell::READONLY);
     356             :     }
     357           0 :     return bRet;
     358             : }
     359             : 
     360             : /// jump to index of TOXMark
     361           0 : sal_Bool SwCrsrShell::GotoTOXMarkBase()
     362             : {
     363           0 :     sal_Bool bRet = sal_False;
     364             : 
     365           0 :     SwTOXMarks aMarks;
     366           0 :     sal_uInt16 nCnt = GetDoc()->GetCurTOXMark( *m_pCurCrsr->GetPoint(), aMarks );
     367           0 :     if( nCnt )
     368             :     {
     369             :         // Take the 1. and get the index type. Search in its dependency list
     370             :         // for the actual index
     371           0 :         const SwTOXType* pType = aMarks[0]->GetTOXType();
     372           0 :         SwIterator<SwTOXBase,SwTOXType> aIter( *pType );
     373             :         const SwSectionNode* pSectNd;
     374             :         const SwSectionFmt* pSectFmt;
     375             : 
     376           0 :         for( SwTOXBase* pTOX = aIter.First(); pTOX; pTOX = aIter.Next() )
     377             :         {
     378           0 :             if( pTOX->ISA( SwTOXBaseSection ) &&
     379           0 :                 0 != ( pSectFmt = ((SwTOXBaseSection*)pTOX)->GetFmt() ) &&
     380             :                 0 != ( pSectNd = pSectFmt->GetSectionNode() ))
     381             :             {
     382           0 :                 SwNodeIndex aIdx( *pSectNd, 1 );
     383           0 :                 SwCntntNode* pCNd = aIdx.GetNode().GetCntntNode();
     384           0 :                 if( !pCNd )
     385           0 :                     pCNd = GetDoc()->GetNodes().GoNext( &aIdx );
     386             :                 const SwCntntFrm* pCFrm;
     387           0 :                 if( pCNd &&
     388           0 :                     pCNd->EndOfSectionIndex() < pSectNd->EndOfSectionIndex() &&
     389           0 :                     0 != ( pCFrm = pCNd->getLayoutFrm( GetLayout() ) ) &&
     390           0 :                     ( IsReadOnlyAvailable() || !pCFrm->IsProtected() ))
     391             :                 {
     392           0 :                     SwCallLink aLk( *this ); // watch Crsr-Moves
     393           0 :                     SwCrsrSaveState aSaveState( *m_pCurCrsr );
     394           0 :                     m_pCurCrsr->GetPoint()->nNode = *pCNd;
     395           0 :                     m_pCurCrsr->GetPoint()->nContent.Assign( pCNd, 0 );
     396           0 :                     bRet = !m_pCurCrsr->IsInProtectTable() &&
     397           0 :                             !m_pCurCrsr->IsSelOvr();
     398           0 :                     if( bRet )
     399           0 :                         UpdateCrsr(SwCrsrShell::SCROLLWIN|SwCrsrShell::CHKRANGE|SwCrsrShell::READONLY);
     400           0 :                     break;
     401           0 :                 }
     402             :             }
     403           0 :     }
     404             :     }
     405           0 :     return bRet;
     406             : }
     407             : 
     408             : /// Jump to next/previous table formula
     409             : /// Optionally it is possible to also jump to broken formulas
     410           0 : sal_Bool SwCrsrShell::GotoNxtPrvTblFormula( sal_Bool bNext, sal_Bool bOnlyErrors )
     411             : {
     412           0 :     if( IsTableMode() )
     413           0 :         return sal_False;
     414             : 
     415           0 :     sal_Bool bFnd = sal_False;
     416           0 :     SwPosition& rPos = *m_pCurCrsr->GetPoint();
     417             : 
     418           0 :     Point aPt;
     419           0 :     SwPosition aFndPos( GetDoc()->GetNodes().GetEndOfContent() );
     420           0 :     if( !bNext )
     421           0 :         aFndPos.nNode = 0;
     422           0 :     _SetGetExpFld aFndGEF( aFndPos ), aCurGEF( rPos );
     423             : 
     424             :     {
     425           0 :         const SwNode* pSttNd = rPos.nNode.GetNode().FindTableBoxStartNode();
     426           0 :         if( pSttNd )
     427             :         {
     428           0 :             const SwTableBox* pTBox = pSttNd->FindTableNode()->GetTable().
     429           0 :                                         GetTblBox( pSttNd->GetIndex() );
     430           0 :             if( pTBox )
     431           0 :                 aCurGEF = _SetGetExpFld( *pTBox );
     432             :         }
     433             :     }
     434             : 
     435           0 :     if( rPos.nNode < GetDoc()->GetNodes().GetEndOfExtras() )
     436             :         // also at collection use only the first frame
     437           0 :         aCurGEF.SetBodyPos( *rPos.nNode.GetNode().GetCntntNode()->getLayoutFrm( GetLayout(),
     438           0 :                                 &aPt, &rPos, false ) );
     439             :     {
     440             :         const SfxPoolItem* pItem;
     441             :         const SwTableBox* pTBox;
     442           0 :         sal_uInt32 n, nMaxItems = GetDoc()->GetAttrPool().GetItemCount2( RES_BOXATR_FORMULA );
     443             : 
     444           0 :         for( n = 0; n < nMaxItems; ++n )
     445           0 :             if( 0 != (pItem = GetDoc()->GetAttrPool().GetItem2(
     446           0 :                                         RES_BOXATR_FORMULA, n ) ) &&
     447           0 :                 0 != (pTBox = ((SwTblBoxFormula*)pItem)->GetTableBox() ) &&
     448           0 :                 pTBox->GetSttNd() &&
     449           0 :                 pTBox->GetSttNd()->GetNodes().IsDocNodes() &&
     450           0 :                 ( !bOnlyErrors ||
     451           0 :                   !((SwTblBoxFormula*)pItem)->HasValidBoxes() ) )
     452             :             {
     453             :                 const SwCntntFrm* pCFrm;
     454           0 :                 SwNodeIndex aIdx( *pTBox->GetSttNd() );
     455           0 :                 const SwCntntNode* pCNd = GetDoc()->GetNodes().GoNext( &aIdx );
     456           0 :                 if( pCNd && 0 != ( pCFrm = pCNd->getLayoutFrm( GetLayout(), &aPt, 0, false ) ) &&
     457           0 :                     (IsReadOnlyAvailable() || !pCFrm->IsProtected() ))
     458             :                 {
     459           0 :                     _SetGetExpFld aCmp( *pTBox );
     460           0 :                     aCmp.SetBodyPos( *pCFrm );
     461             : 
     462           0 :                     if( bNext ? ( aCurGEF < aCmp && aCmp < aFndGEF )
     463           0 :                               : ( aCmp < aCurGEF && aFndGEF < aCmp ))
     464             :                     {
     465           0 :                         aFndGEF = aCmp;
     466           0 :                         bFnd = sal_True;
     467             :                     }
     468           0 :                 }
     469             :             }
     470             :     }
     471             : 
     472           0 :     if( bFnd )
     473             :     {
     474           0 :         SET_CURR_SHELL( this );
     475           0 :         SwCallLink aLk( *this ); // watch Crsr-Moves
     476           0 :         SwCrsrSaveState aSaveState( *m_pCurCrsr );
     477             : 
     478           0 :         aFndGEF.GetPosOfContent( rPos );
     479           0 :         m_pCurCrsr->DeleteMark();
     480             : 
     481           0 :         bFnd = !m_pCurCrsr->IsSelOvr();
     482           0 :         if( bFnd )
     483             :             UpdateCrsr( SwCrsrShell::SCROLLWIN | SwCrsrShell::CHKRANGE |
     484           0 :                         SwCrsrShell::READONLY );
     485             :     }
     486           0 :     return bFnd;
     487             : }
     488             : 
     489             : /// jump to next/previous index marker
     490           0 : sal_Bool SwCrsrShell::GotoNxtPrvTOXMark( sal_Bool bNext )
     491             : {
     492           0 :     if( IsTableMode() )
     493           0 :         return sal_False;
     494             : 
     495           0 :     sal_Bool bFnd = sal_False;
     496           0 :     SwPosition& rPos = *m_pCurCrsr->GetPoint();
     497             : 
     498           0 :     Point aPt;
     499           0 :     SwPosition aFndPos( GetDoc()->GetNodes().GetEndOfContent() );
     500           0 :     if( !bNext )
     501           0 :         aFndPos.nNode = 0;
     502           0 :     _SetGetExpFld aFndGEF( aFndPos ), aCurGEF( rPos );
     503             : 
     504           0 :     if( rPos.nNode.GetIndex() < GetDoc()->GetNodes().GetEndOfExtras().GetIndex() )
     505             :         // also at collection use only the first frame
     506           0 :         aCurGEF.SetBodyPos( *rPos.nNode.GetNode().
     507           0 :                         GetCntntNode()->getLayoutFrm( GetLayout(), &aPt, &rPos, false ) );
     508             : 
     509             :     {
     510             :         const SfxPoolItem* pItem;
     511             :         const SwCntntFrm* pCFrm;
     512             :         const SwTxtNode* pTxtNd;
     513             :         const SwTxtTOXMark* pTxtTOX;
     514           0 :         sal_uInt32 n, nMaxItems = GetDoc()->GetAttrPool().GetItemCount2( RES_TXTATR_TOXMARK );
     515             : 
     516           0 :         for( n = 0; n < nMaxItems; ++n )
     517           0 :             if( 0 != (pItem = GetDoc()->GetAttrPool().GetItem2(
     518           0 :                                         RES_TXTATR_TOXMARK, n ) ) &&
     519           0 :                 0 != (pTxtTOX = ((SwTOXMark*)pItem)->GetTxtTOXMark() ) &&
     520           0 :                 ( pTxtNd = &pTxtTOX->GetTxtNode())->GetNodes().IsDocNodes() &&
     521           0 :                 0 != ( pCFrm = pTxtNd->getLayoutFrm( GetLayout(), &aPt, 0, false )) &&
     522           0 :                 ( IsReadOnlyAvailable() || !pCFrm->IsProtected() ))
     523             :             {
     524           0 :                 SwNodeIndex aNdIndex( *pTxtNd ); // UNIX needs this object
     525           0 :                 _SetGetExpFld aCmp( aNdIndex, *pTxtTOX, 0 );
     526           0 :                 aCmp.SetBodyPos( *pCFrm );
     527             : 
     528           0 :                 if( bNext ? ( aCurGEF < aCmp && aCmp < aFndGEF )
     529           0 :                           : ( aCmp < aCurGEF && aFndGEF < aCmp ))
     530             :                 {
     531           0 :                     aFndGEF = aCmp;
     532           0 :                     bFnd = sal_True;
     533           0 :                 }
     534             :             }
     535             :     }
     536             : 
     537           0 :     if( bFnd )
     538             :     {
     539           0 :         SET_CURR_SHELL( this );
     540           0 :         SwCallLink aLk( *this ); // watch Crsr-Moves
     541           0 :         SwCrsrSaveState aSaveState( *m_pCurCrsr );
     542             : 
     543           0 :         aFndGEF.GetPosOfContent( rPos );
     544             : 
     545           0 :         bFnd = !m_pCurCrsr->IsSelOvr();
     546           0 :         if( bFnd )
     547             :             UpdateCrsr( SwCrsrShell::SCROLLWIN | SwCrsrShell::CHKRANGE |
     548           0 :                         SwCrsrShell::READONLY );
     549             :     }
     550           0 :     return bFnd;
     551             : }
     552             : 
     553             : /// traveling between marks
     554           0 : const SwTOXMark& SwCrsrShell::GotoTOXMark( const SwTOXMark& rStart,
     555             :                                             SwTOXSearch eDir )
     556             : {
     557           0 :     SET_CURR_SHELL( this );
     558           0 :     SwCallLink aLk( *this ); // watch Crsr-Moves
     559           0 :     SwCrsrSaveState aSaveState( *m_pCurCrsr );
     560             : 
     561             :     const SwTOXMark& rNewMark = GetDoc()->GotoTOXMark( rStart, eDir,
     562           0 :                                                     IsReadOnlyAvailable() );
     563             :     // set position
     564           0 :     SwPosition& rPos = *GetCrsr()->GetPoint();
     565           0 :     rPos.nNode = rNewMark.GetTxtTOXMark()->GetTxtNode();
     566           0 :     rPos.nContent.Assign( rPos.nNode.GetNode().GetCntntNode(),
     567           0 :                          *rNewMark.GetTxtTOXMark()->GetStart() );
     568             : 
     569           0 :     if( !m_pCurCrsr->IsSelOvr() )
     570             :         UpdateCrsr( SwCrsrShell::SCROLLWIN | SwCrsrShell::CHKRANGE |
     571           0 :                     SwCrsrShell::READONLY );
     572             : 
     573           0 :     return rNewMark;
     574             : }
     575             : 
     576             : /// jump to next/previous field type
     577           0 : void lcl_MakeFldLst(
     578             :     _SetGetExpFlds& rLst,
     579             :     const SwFieldType& rFldType,
     580             :     const bool bInReadOnly,
     581             :     const bool bChkInpFlag = false )
     582             : {
     583             :     // always search the 1. frame
     584           0 :     Point aPt;
     585           0 :     SwTxtFld* pTxtFld = NULL;
     586           0 :     SwIterator<SwFmtFld,SwFieldType> aIter(rFldType);
     587           0 :     for( SwFmtFld* pFmtFld = aIter.First(); pFmtFld; pFmtFld = aIter.Next() )
     588             :     {
     589           0 :         pTxtFld = pFmtFld->GetTxtFld();
     590           0 :         if ( pTxtFld != NULL
     591           0 :              && ( !bChkInpFlag
     592           0 :                   || ((SwSetExpField*)pTxtFld->GetFmtFld().GetField())->GetInputFlag() ) )
     593             :         {
     594           0 :             const SwTxtNode& rTxtNode = pTxtFld->GetTxtNode();
     595             :             const SwCntntFrm* pCFrm =
     596           0 :                 rTxtNode.getLayoutFrm( rTxtNode.GetDoc()->GetCurrentLayout(), &aPt, 0, false );
     597           0 :             if ( pCFrm != NULL
     598           0 :                  && ( bInReadOnly || !pCFrm->IsProtected() ) )
     599             :             {
     600           0 :                 _SetGetExpFld* pNew = new _SetGetExpFld( SwNodeIndex( rTxtNode ), pTxtFld );
     601           0 :                 pNew->SetBodyPos( *pCFrm );
     602           0 :                 rLst.insert( pNew );
     603             :             }
     604             :         }
     605           0 :     }
     606           0 : }
     607             : 
     608           0 : sal_Bool SwCrsrShell::MoveFldType(
     609             :     const SwFieldType* pFldType,
     610             :     const bool bNext,
     611             :     const sal_uInt16 nResType,
     612             :     const bool bAddSetExpressionFldsToInputFlds )
     613             : {
     614             :     // sorted list of all fields
     615           0 :     _SetGetExpFlds aSrtLst;
     616             : 
     617           0 :     if ( pFldType )
     618             :     {
     619           0 :         if( RES_INPUTFLD != pFldType->Which() && !pFldType->GetDepends() )
     620             :         {
     621           0 :             return sal_False;
     622             :         }
     623             : 
     624             :         // found Modify object, add all fields to array
     625           0 :         ::lcl_MakeFldLst( aSrtLst, *pFldType, ( IsReadOnlyAvailable() ? true : false ) );
     626             : 
     627           0 :         if( RES_INPUTFLD == pFldType->Which() && bAddSetExpressionFldsToInputFlds )
     628             :         {
     629             :             // there are hidden input fields in the set exp. fields
     630           0 :             const SwFldTypes& rFldTypes = *mpDoc->GetFldTypes();
     631           0 :             const size_t nSize = rFldTypes.size();
     632           0 :             for( size_t i=0; i < nSize; ++i )
     633             :             {
     634           0 :                 pFldType = rFldTypes[ i ];
     635           0 :                 if ( RES_SETEXPFLD == pFldType->Which() )
     636             :                 {
     637           0 :                     ::lcl_MakeFldLst( aSrtLst, *pFldType, ( IsReadOnlyAvailable() ? true : false ), true );
     638             :                 }
     639             :             }
     640             :         }
     641             :     }
     642             :     else
     643             :     {
     644           0 :         const SwFldTypes& rFldTypes = *mpDoc->GetFldTypes();
     645           0 :         const size_t nSize = rFldTypes.size();
     646           0 :         for( size_t i=0; i < nSize; ++i )
     647             :         {
     648           0 :             pFldType = rFldTypes[ i ];
     649           0 :             if( nResType == pFldType->Which() )
     650             :             {
     651           0 :                 ::lcl_MakeFldLst( aSrtLst, *pFldType, ( IsReadOnlyAvailable() ? true : false ) );
     652             :             }
     653             :         }
     654             :     }
     655             : 
     656             :     // found no fields?
     657           0 :     if( aSrtLst.empty() )
     658           0 :         return sal_False;
     659             : 
     660           0 :     _SetGetExpFlds::const_iterator it;
     661           0 :     SwCursor* pCrsr = getShellCrsr( true );
     662             :     {
     663             :         // (1998): Always use field for search so that the right one is found as
     664             :         // well some are in frames that are anchored to a paragraph that has a
     665             :         // field
     666           0 :         const SwPosition& rPos = *pCrsr->GetPoint();
     667             : 
     668           0 :         SwTxtNode* pTNd = rPos.nNode.GetNode().GetTxtNode();
     669             :         OSL_ENSURE( pTNd, "No CntntNode" );
     670             : 
     671           0 :         SwTxtFld * pTxtFld = pTNd->GetFldTxtAttrAt( rPos.nContent.GetIndex(), true );
     672           0 :         const bool bDelFld = ( pTxtFld == NULL );
     673           0 :         if( bDelFld )
     674             :         {
     675             :             // create dummy for the search
     676             :             SwFmtFld* pFmtFld = new SwFmtFld( SwDateTimeField(
     677           0 :                 (SwDateTimeFieldType*)mpDoc->GetSysFldType( RES_DATETIMEFLD ) ) );
     678             : 
     679           0 :             pTxtFld = new SwTxtFld( *pFmtFld, rPos.nContent.GetIndex(),
     680           0 :                         mpDoc->IsClipBoard() );
     681           0 :             pTxtFld->ChgTxtNode( pTNd );
     682             :         }
     683             : 
     684           0 :         _SetGetExpFld aSrch( rPos.nNode, pTxtFld, &rPos.nContent );
     685           0 :         if( rPos.nNode.GetIndex() < mpDoc->GetNodes().GetEndOfExtras().GetIndex() )
     686             :         {
     687             :             // also at collection use only the first frame
     688           0 :             Point aPt;
     689           0 :             aSrch.SetBodyPos( *pTNd->getLayoutFrm( GetLayout(), &aPt, &rPos, false ) );
     690             :         }
     691             : 
     692           0 :         it = aSrtLst.lower_bound( &aSrch );
     693           0 :         if( bDelFld )
     694             :         {
     695           0 :             delete (SwFmtFld*)&pTxtFld->GetAttr();
     696           0 :             delete pTxtFld;
     697             :         }
     698             : 
     699           0 :         if( it != aSrtLst.end() && **it == aSrch ) // found
     700             :         {
     701           0 :             if( bNext )
     702             :             {
     703           0 :                 if( ++it == aSrtLst.end() )
     704           0 :                     return sal_False; // already at the end
     705             :             }
     706             :             else
     707             :             {
     708           0 :                 if( it == aSrtLst.begin() )
     709           0 :                     return sal_False; // no more steps backward possible
     710           0 :                 --it;
     711             :             }
     712             :         }
     713             :         else // not found
     714             :         {
     715           0 :             if( bNext )
     716             :             {
     717           0 :                 if( it == aSrtLst.end() )
     718           0 :                     return sal_False;
     719             :             }
     720             :             else
     721             :             {
     722           0 :                 if( it == aSrtLst.begin() )
     723           0 :                     return sal_False; // no more steps backward possible
     724           0 :                 --it;
     725             :             }
     726             :         }
     727             :     }
     728           0 :     const _SetGetExpFld& rFnd = **it;
     729             : 
     730           0 :     SET_CURR_SHELL( this );
     731           0 :     SwCallLink aLk( *this ); // watch Crsr-Moves
     732           0 :     SwCrsrSaveState aSaveState( *pCrsr );
     733             : 
     734           0 :     rFnd.GetPosOfContent( *pCrsr->GetPoint() );
     735             :     sal_Bool bRet = !m_pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION |
     736           0 :                                      nsSwCursorSelOverFlags::SELOVER_TOGGLE );
     737           0 :     if( bRet )
     738           0 :         UpdateCrsr(SwCrsrShell::SCROLLWIN|SwCrsrShell::CHKRANGE|SwCrsrShell::READONLY);
     739           0 :     return bRet;
     740             : }
     741             : 
     742           0 : sal_Bool SwCrsrShell::GotoFld( const SwFmtFld& rFld )
     743             : {
     744           0 :     sal_Bool bRet = sal_False;
     745           0 :     if( rFld.GetTxtFld() )
     746             :     {
     747           0 :         SET_CURR_SHELL( this );
     748           0 :         SwCallLink aLk( *this ); // watch Crsr-Moves
     749             : 
     750           0 :         SwCursor* pCrsr = getShellCrsr( true );
     751           0 :         SwCrsrSaveState aSaveState( *pCrsr );
     752             : 
     753           0 :         SwTxtNode* pTNd = (SwTxtNode*)rFld.GetTxtFld()->GetpTxtNode();
     754           0 :         pCrsr->GetPoint()->nNode = *pTNd;
     755           0 :         pCrsr->GetPoint()->nContent.Assign( pTNd, *rFld.GetTxtFld()->GetStart() );
     756             : 
     757           0 :         bRet = !pCrsr->IsSelOvr();
     758           0 :         if( bRet )
     759           0 :             UpdateCrsr(SwCrsrShell::SCROLLWIN|SwCrsrShell::CHKRANGE|SwCrsrShell::READONLY);
     760             :     }
     761           0 :     return bRet;
     762             : }
     763             : 
     764       59791 : SwTxtFld * SwCrsrShell::GetTxtFldAtPos(
     765             :     const SwPosition* pPos,
     766             :     const bool bIncludeInputFldAtStart ) const
     767             : {
     768       59791 :     SwTxtFld* pTxtFld = NULL;
     769             : 
     770       59791 :     SwTxtNode * const pNode = pPos->nNode.GetNode().GetTxtNode();
     771       59791 :     if ( pNode != NULL )
     772             :     {
     773       59791 :         pTxtFld = pNode->GetFldTxtAttrAt( pPos->nContent.GetIndex(), bIncludeInputFldAtStart );
     774             :     }
     775             : 
     776       59791 :     return pTxtFld;
     777             : }
     778             : 
     779        1435 : SwField* SwCrsrShell::GetFieldAtCrsr(
     780             :     const SwPaM* pCrsr,
     781             :     const bool bIncludeInputFldAtStart ) const
     782             : {
     783        1435 :     SwField* pFieldAtCrsr = NULL;
     784             : 
     785        1435 :     SwTxtFld* pTxtFld = GetTxtFldAtPos( pCrsr->Start(), bIncludeInputFldAtStart );
     786        1435 :     if ( pTxtFld != NULL
     787        1435 :         && pCrsr->Start()->nNode == pCrsr->End()->nNode )
     788             :     {
     789             :         const sal_Int32 nTxtFldLength =
     790           0 :             pTxtFld->End() != NULL
     791           0 :             ? *(pTxtFld->End()) - *(pTxtFld->GetStart())
     792           0 :             : 1;
     793           0 :         if ( ( pCrsr->End()->nContent.GetIndex() - pCrsr->Start()->nContent.GetIndex() ) <= nTxtFldLength )
     794             :         {
     795           0 :             pFieldAtCrsr = (SwField*)pTxtFld->GetFmtFld().GetField();
     796             :         }
     797             :     }
     798             : 
     799        1435 :     return pFieldAtCrsr;
     800             : }
     801             : 
     802          19 : SwField* SwCrsrShell::GetCurFld( const bool bIncludeInputFldAtStart ) const
     803             : {
     804          19 :     SwPaM* pCrsr = GetCrsr();
     805          19 :     if ( pCrsr->GetNext() != pCrsr )
     806             :     {
     807             :         // multi selection not handled.
     808           0 :         return NULL;
     809             :     }
     810             : 
     811          19 :     SwField* pCurFld = GetFieldAtCrsr( pCrsr, bIncludeInputFldAtStart );;
     812          19 :     if ( pCurFld != NULL
     813          19 :          && RES_TABLEFLD == pCurFld->GetTyp()->Which() )
     814             :     {
     815             :         // TabellenFormel ? wandel internen in externen Namen um
     816           0 :         const SwTableNode* pTblNd = IsCrsrInTbl();
     817           0 :         ((SwTblField*)pCurFld)->PtrToBoxNm( pTblNd ? &pTblNd->GetTable() : 0 );
     818             :     }
     819             : 
     820          19 :     return pCurFld;
     821             : }
     822             : 
     823        1398 : bool SwCrsrShell::CrsrInsideInputFld() const
     824             : {
     825        1398 :     bool bCrsrInsideInputFld = false;
     826             : 
     827        1398 :     const SwPaM* pCrsr = GetCrsr();
     828        1398 :     const SwPaM* pFirst = pCrsr;
     829        1416 :     do
     830             :     {
     831        1416 :         bCrsrInsideInputFld = dynamic_cast<const SwInputField*>(GetFieldAtCrsr( pCrsr, false )) != NULL;
     832             : 
     833        1416 :         pCrsr = static_cast<SwPaM*>(pCrsr->GetNext());
     834        1416 :     } while ( !bCrsrInsideInputFld
     835        1416 :               && pCrsr != pFirst );
     836             : 
     837        1398 :     return bCrsrInsideInputFld;
     838             : }
     839             : 
     840           8 : bool SwCrsrShell::PosInsideInputFld( const SwPosition& rPos ) const
     841             : {
     842           8 :     return dynamic_cast<const SwTxtInputFld*>(GetTxtFldAtPos( &rPos, false )) != NULL;
     843             : }
     844             : 
     845           0 : bool SwCrsrShell::DocPtInsideInputFld( const Point& rDocPt ) const
     846             : {
     847           0 :     SwPosition aPos( *(GetCrsr()->Start()) );
     848           0 :     Point aDocPt( rDocPt );
     849           0 :     if ( GetLayout()->GetCrsrOfst( &aPos, aDocPt ) )
     850             :     {
     851           0 :         return PosInsideInputFld( aPos );
     852             :     }
     853           0 :     return false;
     854             : }
     855             : 
     856           0 : sal_Int32 SwCrsrShell::StartOfInputFldAtPos( const SwPosition& rPos ) const
     857             : {
     858           0 :     const SwTxtInputFld* pTxtInputFld = dynamic_cast<const SwTxtInputFld*>(GetTxtFldAtPos( &rPos, true ));
     859           0 :     if ( pTxtInputFld == NULL )
     860             :     {
     861             :         OSL_ENSURE( false, "<SwEditShell::StartOfInputFldAtPos(..)> - no Input Field at given position" );
     862           0 :         return 0;
     863             :     }
     864           0 :     return *(pTxtInputFld->GetStart());
     865             : }
     866             : 
     867           0 : sal_Int32 SwCrsrShell::EndOfInputFldAtPos( const SwPosition& rPos ) const
     868             : {
     869           0 :     const SwTxtInputFld* pTxtInputFld = dynamic_cast<const SwTxtInputFld*>(GetTxtFldAtPos( &rPos, true ));
     870           0 :     if ( pTxtInputFld == NULL )
     871             :     {
     872             :         OSL_ENSURE( false, "<SwEditShell::EndOfInputFldAtPos(..)> - no Input Field at given position" );
     873           0 :         return 0;
     874             :     }
     875           0 :     return *(pTxtInputFld->End());
     876             : }
     877             : 
     878           0 : void SwCrsrShell::GotoOutline( sal_uInt16 nIdx )
     879             : {
     880           0 :     SwCursor* pCrsr = getShellCrsr( true );
     881             : 
     882           0 :     SET_CURR_SHELL( this );
     883           0 :     SwCallLink aLk( *this ); // watch Crsr-Moves
     884           0 :     SwCrsrSaveState aSaveState( *pCrsr );
     885             : 
     886           0 :     const SwNodes& rNds = GetDoc()->GetNodes();
     887           0 :     SwTxtNode* pTxtNd = (SwTxtNode*)rNds.GetOutLineNds()[ nIdx ]->GetTxtNode();
     888           0 :     pCrsr->GetPoint()->nNode = *pTxtNd;
     889           0 :     pCrsr->GetPoint()->nContent.Assign( pTxtNd, 0 );
     890             : 
     891           0 :     if( !pCrsr->IsSelOvr() )
     892           0 :         UpdateCrsr(SwCrsrShell::SCROLLWIN|SwCrsrShell::CHKRANGE|SwCrsrShell::READONLY);
     893           0 : }
     894             : 
     895           0 : bool SwCrsrShell::GotoOutline( const OUString& rName )
     896             : {
     897           0 :     SwCursor* pCrsr = getShellCrsr( true );
     898             : 
     899           0 :     SET_CURR_SHELL( this );
     900           0 :     SwCallLink aLk( *this ); // watch Crsr-Moves
     901           0 :     SwCrsrSaveState aSaveState( *pCrsr );
     902             : 
     903           0 :     bool bRet = false;
     904           0 :     if( mpDoc->GotoOutline( *pCrsr->GetPoint(), rName ) && !pCrsr->IsSelOvr() )
     905             :     {
     906           0 :         UpdateCrsr(SwCrsrShell::SCROLLWIN|SwCrsrShell::CHKRANGE|SwCrsrShell::READONLY);
     907           0 :         bRet = true;
     908             :     }
     909           0 :     return bRet;
     910             : }
     911             : 
     912             : /// jump to next node with outline num.
     913           0 : sal_Bool SwCrsrShell::GotoNextOutline()
     914             : {
     915           0 :     SwCursor* pCrsr = getShellCrsr( true );
     916           0 :     const SwNodes& rNds = GetDoc()->GetNodes();
     917             : 
     918           0 :     SwNode* pNd = pCrsr->GetNode();
     919             :     sal_uInt16 nPos;
     920           0 :     if( rNds.GetOutLineNds().Seek_Entry( pNd, &nPos ))
     921           0 :         ++nPos;
     922             : 
     923           0 :     if( nPos == rNds.GetOutLineNds().size() )
     924           0 :         return sal_False;
     925             : 
     926           0 :     pNd = rNds.GetOutLineNds()[ nPos ];
     927             : 
     928           0 :     SET_CURR_SHELL( this );
     929           0 :     SwCallLink aLk( *this ); // watch Crsr-Moves
     930           0 :     SwCrsrSaveState aSaveState( *pCrsr );
     931           0 :     pCrsr->GetPoint()->nNode = *pNd;
     932           0 :     pCrsr->GetPoint()->nContent.Assign( (SwTxtNode*)pNd, 0 );
     933             : 
     934           0 :     sal_Bool bRet = !pCrsr->IsSelOvr();
     935           0 :     if( bRet )
     936           0 :         UpdateCrsr(SwCrsrShell::SCROLLWIN|SwCrsrShell::CHKRANGE|SwCrsrShell::READONLY);
     937           0 :     return bRet;
     938             : }
     939             : 
     940             : /// jump to previous node with outline num.
     941           0 : sal_Bool SwCrsrShell::GotoPrevOutline()
     942             : {
     943           0 :     SwCursor* pCrsr = getShellCrsr( true );
     944           0 :     const SwNodes& rNds = GetDoc()->GetNodes();
     945             : 
     946           0 :     SwNode* pNd = pCrsr->GetNode();
     947             :     sal_uInt16 nPos;
     948           0 :     rNds.GetOutLineNds().Seek_Entry( pNd, &nPos );
     949             : 
     950           0 :     sal_Bool bRet = sal_False;
     951           0 :     if( nPos )
     952             :     {
     953           0 :         --nPos; // before
     954             : 
     955           0 :         pNd = rNds.GetOutLineNds()[ nPos ];
     956           0 :         if( pNd->GetIndex() > pCrsr->GetPoint()->nNode.GetIndex() )
     957           0 :             return sal_False;
     958             : 
     959           0 :         SET_CURR_SHELL( this );
     960           0 :         SwCallLink aLk( *this ); // watch Crsr-Moves
     961           0 :         SwCrsrSaveState aSaveState( *pCrsr );
     962           0 :         pCrsr->GetPoint()->nNode = *pNd;
     963           0 :         pCrsr->GetPoint()->nContent.Assign( (SwTxtNode*)pNd, 0 );
     964             : 
     965           0 :         bRet = !pCrsr->IsSelOvr();
     966           0 :         if( bRet )
     967           0 :             UpdateCrsr(SwCrsrShell::SCROLLWIN|SwCrsrShell::CHKRANGE|SwCrsrShell::READONLY);
     968             :     }
     969           0 :     return bRet;
     970             : }
     971             : 
     972             : /// search "outline position" before previous outline node at given level
     973           0 : sal_uInt16 SwCrsrShell::GetOutlinePos( sal_uInt8 nLevel )
     974             : {
     975           0 :     SwPaM* pCrsr = getShellCrsr( true );
     976           0 :     const SwNodes& rNds = GetDoc()->GetNodes();
     977             : 
     978           0 :     SwNode* pNd = pCrsr->GetNode();
     979             :     sal_uInt16 nPos;
     980           0 :     if( rNds.GetOutLineNds().Seek_Entry( pNd, &nPos ))
     981           0 :         nPos++; // is at correct position; take next for while
     982             : 
     983           0 :     while( nPos-- ) // check the one in front of the current
     984             :     {
     985           0 :         pNd = rNds.GetOutLineNds()[ nPos ];
     986             : 
     987           0 :         if( ((SwTxtNode*)pNd)->GetAttrOutlineLevel()-1 <= nLevel )
     988           0 :             return nPos;
     989             : 
     990             :     }
     991           0 :     return USHRT_MAX; // no more left
     992             : }
     993             : 
     994           0 : sal_Bool SwCrsrShell::MakeOutlineSel( sal_uInt16 nSttPos, sal_uInt16 nEndPos,
     995             :                                     sal_Bool bWithChildren )
     996             : {
     997           0 :     const SwNodes& rNds = GetDoc()->GetNodes();
     998           0 :     const SwOutlineNodes& rOutlNds = rNds.GetOutLineNds();
     999           0 :     if( rOutlNds.empty() )
    1000           0 :         return sal_False;
    1001             : 
    1002           0 :     SET_CURR_SHELL( this );
    1003           0 :     SwCallLink aLk( *this ); // watch Crsr-Moves
    1004             : 
    1005           0 :     if( nSttPos > nEndPos ) // parameters switched?
    1006             :     {
    1007             :         OSL_ENSURE( !this, "Start > End for array access" );
    1008           0 :         sal_uInt16 nTmp = nSttPos;
    1009           0 :         nSttPos = nEndPos;
    1010           0 :         nEndPos = nTmp;
    1011             :     }
    1012             : 
    1013           0 :     SwNode* pSttNd = rOutlNds[ nSttPos ];
    1014           0 :     SwNode* pEndNd = rOutlNds[ nEndPos ];
    1015             : 
    1016           0 :     if( bWithChildren )
    1017             :     {
    1018           0 :         const int nLevel = pEndNd->GetTxtNode()->GetAttrOutlineLevel()-1;
    1019           0 :         for( ++nEndPos; nEndPos < rOutlNds.size(); ++nEndPos )
    1020             :         {
    1021           0 :             pEndNd = rOutlNds[ nEndPos ];
    1022           0 :             const int nNxtLevel = pEndNd->GetTxtNode()->GetAttrOutlineLevel()-1;
    1023           0 :             if( nNxtLevel <= nLevel )
    1024           0 :                 break; // EndPos is now on the next one
    1025             :         }
    1026             :     }
    1027             :     // if without children then set onto next one
    1028           0 :     else if( ++nEndPos < rOutlNds.size() )
    1029           0 :         pEndNd = rOutlNds[ nEndPos ];
    1030             : 
    1031           0 :     if( nEndPos == rOutlNds.size() ) // no end found
    1032           0 :         pEndNd = &rNds.GetEndOfContent();
    1033             : 
    1034           0 :     KillPams();
    1035             : 
    1036           0 :     SwCrsrSaveState aSaveState( *m_pCurCrsr );
    1037             : 
    1038             :     // set end to the end of the previous content node
    1039           0 :     m_pCurCrsr->GetPoint()->nNode = *pSttNd;
    1040           0 :     m_pCurCrsr->GetPoint()->nContent.Assign( pSttNd->GetCntntNode(), 0 );
    1041           0 :     m_pCurCrsr->SetMark();
    1042           0 :     m_pCurCrsr->GetPoint()->nNode = *pEndNd;
    1043           0 :     m_pCurCrsr->Move( fnMoveBackward, fnGoNode ); // end of predecessor
    1044             : 
    1045             :     // and everything is already selected
    1046           0 :     sal_Bool bRet = !m_pCurCrsr->IsSelOvr();
    1047           0 :     if( bRet )
    1048           0 :         UpdateCrsr(SwCrsrShell::SCROLLWIN|SwCrsrShell::CHKRANGE|SwCrsrShell::READONLY);
    1049           0 :     return bRet;
    1050             : }
    1051             : 
    1052             : /// jump to reference marker
    1053           0 : sal_Bool SwCrsrShell::GotoRefMark( const OUString& rRefMark, sal_uInt16 nSubType,
    1054             :                                     sal_uInt16 nSeqNo )
    1055             : {
    1056           0 :     SET_CURR_SHELL( this );
    1057           0 :     SwCallLink aLk( *this ); // watch Crsr-Moves
    1058           0 :     SwCrsrSaveState aSaveState( *m_pCurCrsr );
    1059             : 
    1060           0 :     sal_Int32 nPos = -1;
    1061             :     SwTxtNode* pTxtNd = SwGetRefFieldType::FindAnchor( GetDoc(), rRefMark,
    1062           0 :                                                     nSubType, nSeqNo, &nPos );
    1063           0 :     if( pTxtNd && pTxtNd->GetNodes().IsDocNodes() )
    1064             :     {
    1065           0 :         m_pCurCrsr->GetPoint()->nNode = *pTxtNd;
    1066           0 :         m_pCurCrsr->GetPoint()->nContent.Assign( pTxtNd, nPos );
    1067             : 
    1068           0 :         if( !m_pCurCrsr->IsSelOvr() )
    1069             :         {
    1070           0 :             UpdateCrsr(SwCrsrShell::SCROLLWIN|SwCrsrShell::CHKRANGE|SwCrsrShell::READONLY);
    1071           0 :             return sal_True;
    1072             :         }
    1073             :     }
    1074           0 :     return sal_False;
    1075             : }
    1076             : 
    1077        1224 : sal_Bool SwCrsrShell::IsPageAtPos( const Point &rPt ) const
    1078             : {
    1079        1224 :     if( GetLayout() )
    1080        1224 :         return 0 != GetLayout()->GetPageAtPos( rPt );
    1081           0 :     return sal_False;
    1082             : }
    1083             : 
    1084           0 : sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
    1085             :                                    SwContentAtPos& rCntntAtPos,
    1086             :                                    sal_Bool bSetCrsr,
    1087             :                                    SwRect* pFldRect )
    1088             : {
    1089           0 :     SET_CURR_SHELL( this );
    1090           0 :     sal_Bool bRet = sal_False;
    1091             : 
    1092           0 :     if( !IsTableMode() )
    1093             :     {
    1094           0 :         Point aPt( rPt );
    1095           0 :         SwPosition aPos( *m_pCurCrsr->GetPoint() );
    1096             : 
    1097             :         SwTxtNode* pTxtNd;
    1098           0 :         SwCntntFrm *pFrm(0);
    1099             :         SwTxtAttr* pTxtAttr;
    1100           0 :         SwCrsrMoveState aTmpState;
    1101           0 :         aTmpState.bFieldInfo = sal_True;
    1102           0 :         aTmpState.bExactOnly = !( SwContentAtPos::SW_OUTLINE & rCntntAtPos.eCntntAtPos );
    1103           0 :         aTmpState.bCntntCheck = (SwContentAtPos::SW_CONTENT_CHECK & rCntntAtPos.eCntntAtPos) ?  sal_True : sal_False;
    1104           0 :         aTmpState.bSetInReadOnly = IsReadOnlyAvailable();
    1105             : 
    1106           0 :         SwSpecialPos aSpecialPos;
    1107           0 :         aTmpState.pSpecialPos = ( SwContentAtPos::SW_SMARTTAG & rCntntAtPos.eCntntAtPos ) ?
    1108           0 :                                 &aSpecialPos : 0;
    1109             : 
    1110           0 :         const bool bCrsrFoundExact = GetLayout()->GetCrsrOfst( &aPos, aPt, &aTmpState );
    1111           0 :         pTxtNd = aPos.nNode.GetNode().GetTxtNode();
    1112             : 
    1113           0 :         const SwNodes& rNds = GetDoc()->GetNodes();
    1114           0 :         if( pTxtNd
    1115           0 :             && SwContentAtPos::SW_OUTLINE & rCntntAtPos.eCntntAtPos
    1116           0 :             && !rNds.GetOutLineNds().empty() )
    1117             :         {
    1118           0 :             const SwTxtNode* pONd = pTxtNd->FindOutlineNodeOfLevel( MAXLEVEL-1);
    1119           0 :             if( pONd )
    1120             :             {
    1121           0 :                 rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_OUTLINE;
    1122           0 :                 rCntntAtPos.sStr = pONd->GetExpandTxt( 0, -1, true, true );
    1123           0 :                 bRet = sal_True;
    1124             :             }
    1125             :         }
    1126           0 :         else if ( SwContentAtPos::SW_CONTENT_CHECK & rCntntAtPos.eCntntAtPos
    1127           0 :                   && bCrsrFoundExact )
    1128             :         {
    1129           0 :             bRet = sal_True;
    1130             :         }
    1131           0 :         else if( pTxtNd
    1132           0 :                  && SwContentAtPos::SW_NUMLABEL & rCntntAtPos.eCntntAtPos)
    1133             :         {
    1134           0 :             bRet = aTmpState.bInNumPortion;
    1135           0 :             rCntntAtPos.aFnd.pNode = pTxtNd;
    1136             : 
    1137           0 :             Size aSizeLogic(aTmpState.nInNumPostionOffset, 0);
    1138           0 :             Size aSizePixel = GetWin()->LogicToPixel(aSizeLogic);
    1139           0 :             rCntntAtPos.nDist = aSizePixel.Width();
    1140             :         }
    1141           0 :         else if( bCrsrFoundExact && pTxtNd )
    1142             :         {
    1143           0 :             if( !aTmpState.bPosCorr )
    1144             :             {
    1145           0 :                 if ( !bRet
    1146           0 :                      && SwContentAtPos::SW_SMARTTAG & rCntntAtPos.eCntntAtPos
    1147           0 :                      && !aTmpState.bFtnNoInfo )
    1148             :                 {
    1149           0 :                     const SwWrongList* pSmartTagList = pTxtNd->GetSmartTags();
    1150           0 :                     sal_Int32 nCurrent = aPos.nContent.GetIndex();
    1151           0 :                     const sal_Int32 nBegin = nCurrent;
    1152           0 :                     sal_Int32 nLen = 1;
    1153             : 
    1154           0 :                     if ( pSmartTagList && pSmartTagList->InWrongWord( nCurrent, nLen ) && !pTxtNd->IsSymbol(nBegin) )
    1155             :                     {
    1156           0 :                         const sal_uInt16 nIndex = pSmartTagList->GetWrongPos( nBegin );
    1157           0 :                         const SwWrongList* pSubList = pSmartTagList->SubList( nIndex );
    1158           0 :                         if ( pSubList )
    1159             :                         {
    1160           0 :                             nCurrent = aTmpState.pSpecialPos->nCharOfst;
    1161             : 
    1162           0 :                             if ( pSubList->InWrongWord( nCurrent, nLen ) )
    1163           0 :                                 bRet = sal_True;
    1164             :                         }
    1165             :                         else
    1166           0 :                             bRet = sal_True;
    1167             : 
    1168           0 :                         if( bRet && bSetCrsr )
    1169             :                         {
    1170           0 :                             SwCrsrSaveState aSaveState( *m_pCurCrsr );
    1171           0 :                             SwCallLink aLk( *this ); // watch Crsr-Moves
    1172           0 :                             m_pCurCrsr->DeleteMark();
    1173           0 :                             *m_pCurCrsr->GetPoint() = aPos;
    1174           0 :                             if( m_pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION | nsSwCursorSelOverFlags::SELOVER_TOGGLE) )
    1175           0 :                                 bRet = sal_False;
    1176             :                             else
    1177           0 :                                 UpdateCrsr();
    1178             :                         }
    1179           0 :                         if( bRet )
    1180             :                         {
    1181           0 :                             rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_SMARTTAG;
    1182             : 
    1183           0 :                             if( pFldRect && 0 != ( pFrm = pTxtNd->getLayoutFrm( GetLayout(), &aPt ) ) )
    1184           0 :                                 pFrm->GetCharRect( *pFldRect, aPos, &aTmpState );
    1185             :                         }
    1186             :                     }
    1187             :                 }
    1188             : 
    1189           0 :                 if ( !bRet
    1190           0 :                      && ( SwContentAtPos::SW_FIELD | SwContentAtPos::SW_CLICKFIELD ) & rCntntAtPos.eCntntAtPos
    1191           0 :                      && !aTmpState.bFtnNoInfo )
    1192             :                 {
    1193           0 :                     pTxtAttr = pTxtNd->GetFldTxtAttrAt( aPos.nContent.GetIndex() );
    1194             :                     const SwField* pFld = pTxtAttr != NULL
    1195           0 :                                           ? pTxtAttr->GetFmtFld().GetField()
    1196           0 :                                           : 0;
    1197           0 :                     if ( SwContentAtPos::SW_CLICKFIELD & rCntntAtPos.eCntntAtPos
    1198           0 :                          && pFld && !pFld->HasClickHdl() )
    1199             :                     {
    1200           0 :                         pFld = 0;
    1201             :                     }
    1202             : 
    1203           0 :                     if ( pFld )
    1204             :                     {
    1205           0 :                         if( pFldRect && 0 != ( pFrm = pTxtNd->getLayoutFrm( GetLayout(), &aPt ) ) )
    1206           0 :                             pFrm->GetCharRect( *pFldRect, aPos, &aTmpState );
    1207             : 
    1208           0 :                         if( bSetCrsr )
    1209             :                         {
    1210           0 :                             SwCallLink aLk( *this ); // watch Crsr-Moves
    1211           0 :                             SwCrsrSaveState aSaveState( *m_pCurCrsr );
    1212           0 :                             m_pCurCrsr->DeleteMark();
    1213           0 :                             *m_pCurCrsr->GetPoint() = aPos;
    1214           0 :                             if( m_pCurCrsr->IsSelOvr() )
    1215             :                             {
    1216             :                                 // allow click fields in protected sections
    1217             :                                 // only placeholder is not possible
    1218           0 :                                 if( SwContentAtPos::SW_FIELD & rCntntAtPos.eCntntAtPos
    1219           0 :                                     || RES_JUMPEDITFLD == pFld->Which() )
    1220           0 :                                     pFld = 0;
    1221             :                             }
    1222             :                             else
    1223           0 :                                 UpdateCrsr();
    1224             :                         }
    1225           0 :                         else if( RES_TABLEFLD == pFld->Which() &&
    1226           0 :                             ((SwTblField*)pFld)->IsIntrnlName() )
    1227             :                         {
    1228             :                             // create from internal (for CORE) the external
    1229             :                             // (for UI) formula
    1230           0 :                             const SwTableNode* pTblNd = pTxtNd->FindTableNode();
    1231           0 :                             if( pTblNd )        // steht in einer Tabelle
    1232           0 :                                 ((SwTblField*)pFld)->PtrToBoxNm( &pTblNd->GetTable() );
    1233             :                         }
    1234             :                     }
    1235             : 
    1236           0 :                     if( pFld )
    1237             :                     {
    1238           0 :                         rCntntAtPos.aFnd.pFld = pFld;
    1239           0 :                         rCntntAtPos.pFndTxtAttr = pTxtAttr;
    1240           0 :                         rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_FIELD;
    1241           0 :                         bRet = sal_True;
    1242             :                     }
    1243             :                 }
    1244             : 
    1245           0 :                 if( !bRet && SwContentAtPos::SW_FORMCTRL & rCntntAtPos.eCntntAtPos )
    1246             :                 {
    1247           0 :                     IDocumentMarkAccess* pMarksAccess = GetDoc()->getIDocumentMarkAccess( );
    1248           0 :                     sw::mark::IFieldmark* pFldBookmark = pMarksAccess->getFieldmarkFor( aPos );
    1249           0 :                     if( bCrsrFoundExact && pTxtNd && pFldBookmark) {
    1250           0 :                         rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_FORMCTRL;
    1251           0 :                         rCntntAtPos.aFnd.pFldmark = pFldBookmark;
    1252           0 :                         bRet=sal_True;
    1253             :                     }
    1254             :                 }
    1255             : 
    1256           0 :                 if( !bRet && SwContentAtPos::SW_FTN & rCntntAtPos.eCntntAtPos )
    1257             :                 {
    1258           0 :                     if( aTmpState.bFtnNoInfo )
    1259             :                     {
    1260             :                         // over the footnote's char
    1261           0 :                         bRet = sal_True;
    1262           0 :                         if( bSetCrsr )
    1263             :                         {
    1264           0 :                             *m_pCurCrsr->GetPoint() = aPos;
    1265           0 :                             if( !GotoFtnAnchor() )
    1266           0 :                                 bRet = sal_False;
    1267             :                         }
    1268           0 :                         if( bRet )
    1269           0 :                             rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_FTN;
    1270             :                     }
    1271           0 :                     else if ( 0 != ( pTxtAttr = pTxtNd->GetTxtAttrForCharAt(
    1272           0 :                         aPos.nContent.GetIndex(), RES_TXTATR_FTN )) )
    1273             :                     {
    1274           0 :                         bRet = sal_True;
    1275           0 :                         if( bSetCrsr )
    1276             :                         {
    1277           0 :                             SwCallLink aLk( *this ); // watch Crsr-Moves
    1278           0 :                             SwCrsrSaveState aSaveState( *m_pCurCrsr );
    1279           0 :                             m_pCurCrsr->GetPoint()->nNode = *((SwTxtFtn*)pTxtAttr)->GetStartNode();
    1280           0 :                             SwCntntNode* pCNd = GetDoc()->GetNodes().GoNextSection(
    1281           0 :                                 &m_pCurCrsr->GetPoint()->nNode,
    1282           0 :                                 true, !IsReadOnlyAvailable() );
    1283             : 
    1284           0 :                             if( pCNd )
    1285             :                             {
    1286           0 :                                 m_pCurCrsr->GetPoint()->nContent.Assign( pCNd, 0 );
    1287           0 :                                 if( m_pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION |
    1288           0 :                                     nsSwCursorSelOverFlags::SELOVER_TOGGLE ))
    1289           0 :                                     bRet = sal_False;
    1290             :                                 else
    1291           0 :                                     UpdateCrsr();
    1292             :                             }
    1293             :                             else
    1294           0 :                                 bRet = sal_False;
    1295             :                         }
    1296             : 
    1297           0 :                         if( bRet )
    1298             :                         {
    1299           0 :                             rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_FTN;
    1300           0 :                             rCntntAtPos.pFndTxtAttr = pTxtAttr;
    1301           0 :                             rCntntAtPos.aFnd.pAttr = &pTxtAttr->GetAttr();
    1302             : 
    1303           0 :                             if( pFldRect && 0 != ( pFrm = pTxtNd->getLayoutFrm( GetLayout(), &aPt ) ) )
    1304           0 :                                 pFrm->GetCharRect( *pFldRect, aPos, &aTmpState );
    1305             :                         }
    1306             :                     }
    1307             :                 }
    1308             : 
    1309           0 :                 if( !bRet
    1310           0 :                     && ( SwContentAtPos::SW_TOXMARK | SwContentAtPos::SW_REFMARK ) & rCntntAtPos.eCntntAtPos
    1311           0 :                     && !aTmpState.bFtnNoInfo )
    1312             :                 {
    1313           0 :                     pTxtAttr = 0;
    1314           0 :                     if( SwContentAtPos::SW_TOXMARK & rCntntAtPos.eCntntAtPos )
    1315             :                     {
    1316             :                         ::std::vector<SwTxtAttr *> const marks(
    1317             :                             pTxtNd->GetTxtAttrsAt(
    1318           0 :                                aPos.nContent.GetIndex(), RES_TXTATR_TOXMARK));
    1319           0 :                         if (marks.size())
    1320             :                         {   // hmm... can only return 1 here
    1321           0 :                             pTxtAttr = *marks.begin();
    1322           0 :                         }
    1323             :                     }
    1324             : 
    1325           0 :                     if( !pTxtAttr &&
    1326           0 :                         SwContentAtPos::SW_REFMARK & rCntntAtPos.eCntntAtPos )
    1327             :                     {
    1328             :                         ::std::vector<SwTxtAttr *> const marks(
    1329             :                             pTxtNd->GetTxtAttrsAt(
    1330           0 :                                aPos.nContent.GetIndex(), RES_TXTATR_REFMARK));
    1331           0 :                         if (marks.size())
    1332             :                         {   // hmm... can only return 1 here
    1333           0 :                             pTxtAttr = *marks.begin();
    1334           0 :                         }
    1335             :                     }
    1336             : 
    1337           0 :                     if( pTxtAttr )
    1338             :                     {
    1339           0 :                         bRet = sal_True;
    1340           0 :                         if( bSetCrsr )
    1341             :                         {
    1342           0 :                             SwCallLink aLk( *this ); // watch Crsr-Moves
    1343           0 :                             SwCrsrSaveState aSaveState( *m_pCurCrsr );
    1344           0 :                             m_pCurCrsr->DeleteMark();
    1345           0 :                             *m_pCurCrsr->GetPoint() = aPos;
    1346           0 :                             if( m_pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION | nsSwCursorSelOverFlags::SELOVER_TOGGLE ) )
    1347           0 :                                 bRet = sal_False;
    1348             :                             else
    1349           0 :                                 UpdateCrsr();
    1350             :                         }
    1351             : 
    1352           0 :                         if( bRet )
    1353             :                         {
    1354           0 :                             const sal_Int32* pEnd = pTxtAttr->GetEnd();
    1355           0 :                             if( pEnd )
    1356           0 :                                 rCntntAtPos.sStr =
    1357           0 :                                     pTxtNd->GetExpandTxt( *pTxtAttr->GetStart(), *pEnd - *pTxtAttr->GetStart() );
    1358           0 :                             else if( RES_TXTATR_TOXMARK == pTxtAttr->Which())
    1359           0 :                                 rCntntAtPos.sStr =
    1360           0 :                                     pTxtAttr->GetTOXMark().GetAlternativeText();
    1361             : 
    1362             :                             rCntntAtPos.eCntntAtPos =
    1363           0 :                                 RES_TXTATR_TOXMARK == pTxtAttr->Which()
    1364             :                                 ? SwContentAtPos::SW_TOXMARK
    1365           0 :                                 : SwContentAtPos::SW_REFMARK;
    1366           0 :                             rCntntAtPos.pFndTxtAttr = pTxtAttr;
    1367           0 :                             rCntntAtPos.aFnd.pAttr = &pTxtAttr->GetAttr();
    1368             : 
    1369           0 :                             if( pFldRect && 0 != ( pFrm = pTxtNd->getLayoutFrm( GetLayout(), &aPt ) ) )
    1370           0 :                                 pFrm->GetCharRect( *pFldRect, aPos, &aTmpState );
    1371             :                         }
    1372             :                     }
    1373             :                 }
    1374             : 
    1375           0 :                 if ( !bRet
    1376           0 :                      && SwContentAtPos::SW_INETATTR & rCntntAtPos.eCntntAtPos
    1377           0 :                      && !aTmpState.bFtnNoInfo )
    1378             :                 {
    1379             :                     pTxtAttr = pTxtNd->GetTxtAttrAt(
    1380           0 :                             aPos.nContent.GetIndex(), RES_TXTATR_INETFMT);
    1381             :                     // "detect" only INetAttrs with URLs
    1382           0 :                     if( pTxtAttr && !pTxtAttr->GetINetFmt().GetValue().isEmpty() )
    1383             :                     {
    1384           0 :                         bRet = sal_True;
    1385           0 :                         if( bSetCrsr )
    1386             :                         {
    1387           0 :                             SwCrsrSaveState aSaveState( *m_pCurCrsr );
    1388           0 :                             SwCallLink aLk( *this ); // watch Crsr-Moves
    1389           0 :                             m_pCurCrsr->DeleteMark();
    1390           0 :                             *m_pCurCrsr->GetPoint() = aPos;
    1391           0 :                             if( m_pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION |
    1392           0 :                                 nsSwCursorSelOverFlags::SELOVER_TOGGLE) )
    1393           0 :                                 bRet = sal_False;
    1394             :                             else
    1395           0 :                                 UpdateCrsr();
    1396             :                         }
    1397           0 :                         if( bRet )
    1398             :                         {
    1399           0 :                             rCntntAtPos.sStr = pTxtNd->GetExpandTxt(
    1400           0 :                                 *pTxtAttr->GetStart(),
    1401           0 :                                 *pTxtAttr->GetEnd() - *pTxtAttr->GetStart() );
    1402             : 
    1403           0 :                             rCntntAtPos.aFnd.pAttr = &pTxtAttr->GetAttr();
    1404           0 :                             rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_INETATTR;
    1405           0 :                             rCntntAtPos.pFndTxtAttr = pTxtAttr;
    1406             : 
    1407           0 :                             if( pFldRect && 0 != ( pFrm = pTxtNd->getLayoutFrm( GetLayout(), &aPt ) ) )
    1408           0 :                                 pFrm->GetCharRect( *pFldRect, aPos, &aTmpState );
    1409             :                         }
    1410             :                     }
    1411             :                 }
    1412             : 
    1413           0 :                 if( !bRet && SwContentAtPos::SW_REDLINE & rCntntAtPos.eCntntAtPos )
    1414             :                 {
    1415           0 :                     const SwRangeRedline* pRedl = GetDoc()->GetRedline(aPos, NULL);
    1416           0 :                     if( pRedl )
    1417             :                     {
    1418           0 :                         rCntntAtPos.aFnd.pRedl = pRedl;
    1419           0 :                         rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_REDLINE;
    1420           0 :                         rCntntAtPos.pFndTxtAttr = 0;
    1421           0 :                         bRet = sal_True;
    1422             : 
    1423           0 :                         if( pFldRect && 0 != ( pFrm = pTxtNd->getLayoutFrm( GetLayout(), &aPt ) ) )
    1424           0 :                             pFrm->GetCharRect( *pFldRect, aPos, &aTmpState );
    1425             :                     }
    1426             :                 }
    1427             :             }
    1428             : 
    1429           0 :             if( !bRet
    1430           0 :                  && ( SwContentAtPos::SW_TABLEBOXFML & rCntntAtPos.eCntntAtPos
    1431             : #ifdef DBG_UTIL
    1432             :                       || SwContentAtPos::SW_TABLEBOXVALUE & rCntntAtPos.eCntntAtPos
    1433             : #endif
    1434             :                 ) )
    1435             :             {
    1436             :                 const SwTableNode* pTblNd;
    1437             :                 const SwTableBox* pBox;
    1438           0 :                 const SwStartNode* pSttNd = pTxtNd->FindTableBoxStartNode();
    1439             :                 const SfxPoolItem* pItem;
    1440           0 :                 if( pSttNd && 0 != ( pTblNd = pTxtNd->FindTableNode()) &&
    1441           0 :                     0 != ( pBox = pTblNd->GetTable().GetTblBox(
    1442           0 :                     pSttNd->GetIndex() )) &&
    1443             : #ifdef DBG_UTIL
    1444             :                     ( SFX_ITEM_SET == pBox->GetFrmFmt()->GetItemState(
    1445             :                     RES_BOXATR_FORMULA, sal_False, &pItem ) ||
    1446             :                     SFX_ITEM_SET == pBox->GetFrmFmt()->GetItemState(
    1447             :                     RES_BOXATR_VALUE, sal_False, &pItem ))
    1448             : #else
    1449           0 :                     SFX_ITEM_SET == pBox->GetFrmFmt()->GetItemState(
    1450           0 :                     RES_BOXATR_FORMULA, sal_False, &pItem )
    1451             : #endif
    1452             :                     )
    1453             :                 {
    1454           0 :                     SwFrm* pF = pTxtNd->getLayoutFrm( GetLayout(), &aPt );
    1455           0 :                     if( pF )
    1456             :                     {
    1457             :                         // then the CellFrame
    1458           0 :                         pFrm = (SwCntntFrm*)pF;
    1459           0 :                         while( pF && !pF->IsCellFrm() )
    1460           0 :                             pF = pF->GetUpper();
    1461             :                     }
    1462             : 
    1463           0 :                     if( aTmpState.bPosCorr )
    1464             :                     {
    1465           0 :                         if( pF && !pF->Frm().IsInside( aPt ))
    1466           0 :                             pF = 0;
    1467             :                     }
    1468           0 :                     else if( !pF )
    1469           0 :                         pF = pFrm;
    1470             : 
    1471           0 :                     if( pF ) // only then it is valid
    1472             :                     {
    1473             :                         // create from internal (for CORE) the external
    1474             :                         // (for UI) formula
    1475           0 :                         rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_TABLEBOXFML;
    1476             : #ifdef DBG_UTIL
    1477             :                         if( RES_BOXATR_VALUE == pItem->Which() )
    1478             :                             rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_TABLEBOXVALUE;
    1479             :                         else
    1480             : #endif
    1481           0 :                             ((SwTblBoxFormula*)pItem)->PtrToBoxNm( &pTblNd->GetTable() );
    1482             : 
    1483           0 :                         bRet = sal_True;
    1484           0 :                         if( bSetCrsr )
    1485             :                         {
    1486           0 :                             SwCallLink aLk( *this ); // watch Crsr-Moves
    1487           0 :                             SwCrsrSaveState aSaveState( *m_pCurCrsr );
    1488           0 :                             *m_pCurCrsr->GetPoint() = aPos;
    1489           0 :                             if( m_pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION |
    1490           0 :                                 nsSwCursorSelOverFlags::SELOVER_TOGGLE) )
    1491           0 :                                 bRet = sal_False;
    1492             :                             else
    1493           0 :                                 UpdateCrsr();
    1494             :                         }
    1495             : 
    1496           0 :                         if( bRet )
    1497             :                         {
    1498           0 :                             if( pFldRect )
    1499             :                             {
    1500           0 :                                 *pFldRect = pF->Prt();
    1501           0 :                                 *pFldRect += pF->Frm().Pos();
    1502             :                             }
    1503           0 :                             rCntntAtPos.pFndTxtAttr = 0;
    1504           0 :                             rCntntAtPos.aFnd.pAttr = pItem;
    1505             :                         }
    1506             :                     }
    1507             :                 }
    1508             :             }
    1509             : 
    1510             : #ifdef DBG_UTIL
    1511             :             if( !bRet && SwContentAtPos::SW_CURR_ATTRS & rCntntAtPos.eCntntAtPos )
    1512             :             {
    1513             :                 const sal_Int32 n = aPos.nContent.GetIndex();
    1514             :                 SfxItemSet aSet( GetDoc()->GetAttrPool(), POOLATTR_BEGIN,
    1515             :                     POOLATTR_END - 1 );
    1516             :                 if( pTxtNd->GetpSwpHints() )
    1517             :                 {
    1518             :                     for( sal_uInt16 i = 0; i < pTxtNd->GetSwpHints().Count(); ++i )
    1519             :                     {
    1520             :                         const SwTxtAttr* pHt = pTxtNd->GetSwpHints()[i];
    1521             :                         const sal_Int32 nAttrStart = *pHt->GetStart();
    1522             :                         if( nAttrStart > n ) // over the section
    1523             :                             break;
    1524             : 
    1525             :                         if( 0 != pHt->End() && (
    1526             :                             ( nAttrStart < n &&
    1527             :                             ( pHt->DontExpand() ? n < *pHt->End()
    1528             :                             : n <= *pHt->End() )) ||
    1529             :                             ( n == nAttrStart &&
    1530             :                             ( nAttrStart == *pHt->End() || !n ))) )
    1531             :                         {
    1532             :                             aSet.Put( pHt->GetAttr() );
    1533             :                         }
    1534             :                     }
    1535             :                     if( pTxtNd->HasSwAttrSet() &&
    1536             :                         pTxtNd->GetpSwAttrSet()->Count() )
    1537             :                     {
    1538             :                         SfxItemSet aFmtSet( pTxtNd->GetSwAttrSet() );
    1539             :                         // remove all from format set that are also in TextSet
    1540             :                         aFmtSet.Differentiate( aSet );
    1541             :                         // now merge all together
    1542             :                         aSet.Put( aFmtSet );
    1543             :                     }
    1544             :                 }
    1545             :                 else
    1546             :                     pTxtNd->SwCntntNode::GetAttr( aSet );
    1547             : 
    1548             :                 rCntntAtPos.sStr = "Pos: (";
    1549             :                 rCntntAtPos.sStr += OUString::number( aPos.nNode.GetIndex());
    1550             :                 rCntntAtPos.sStr += ":";
    1551             :                 rCntntAtPos.sStr += OUString::number( aPos.nContent.GetIndex());
    1552             :                 rCntntAtPos.sStr += ")";
    1553             :                 rCntntAtPos.sStr += "\nAbs.Vorl.: "; // translation *might be* "paragraph template"
    1554             :                 rCntntAtPos.sStr += pTxtNd->GetFmtColl()->GetName();
    1555             :                 if( pTxtNd->GetCondFmtColl() )
    1556             :                 {
    1557             :                      // translation *might be* "conditional template"
    1558             :                     rCntntAtPos.sStr += "\nBed.Vorl.: " + pTxtNd->GetCondFmtColl()->GetName();
    1559             :                 }
    1560             : 
    1561             :                 if( aSet.Count() )
    1562             :                 {
    1563             :                     OUString sAttrs;
    1564             :                     SfxItemIter aIter( aSet );
    1565             :                     const SfxPoolItem* pItem = aIter.FirstItem();
    1566             :                     while( true )
    1567             :                     {
    1568             :                         if( !IsInvalidItem( pItem ))
    1569             :                         {
    1570             :                             OUString aStr;
    1571             :                             GetDoc()->GetAttrPool().GetPresentation( *pItem,
    1572             :                                 SFX_ITEM_PRESENTATION_COMPLETE,
    1573             :                                 SFX_MAPUNIT_CM, aStr );
    1574             :                             if (!sAttrs.isEmpty())
    1575             :                                 sAttrs += ", ";
    1576             :                             sAttrs += aStr;
    1577             :                         }
    1578             :                         if( aIter.IsAtEnd() )
    1579             :                             break;
    1580             :                         pItem = aIter.NextItem();
    1581             :                     }
    1582             :                     if (!sAttrs.isEmpty())
    1583             :                     {
    1584             :                         if( !rCntntAtPos.sStr.isEmpty() )
    1585             :                             rCntntAtPos.sStr += "\n";
    1586             :                         rCntntAtPos.sStr += "Attr: " + sAttrs;
    1587             :                     }
    1588             :                 }
    1589             :                 bRet = sal_True;
    1590             :                 rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_CURR_ATTRS;
    1591             :             }
    1592             : #endif
    1593           0 :         }
    1594             :     }
    1595             : 
    1596           0 :     if( !bRet )
    1597             :     {
    1598           0 :         rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_NOTHING;
    1599           0 :         rCntntAtPos.aFnd.pFld = 0;
    1600             :     }
    1601           0 :     return bRet;
    1602             : }
    1603             : 
    1604             : // #i90516#
    1605       11473 : const SwPostItField* SwCrsrShell::GetPostItFieldAtCursor() const
    1606             : {
    1607       11473 :     const SwPostItField* pPostItFld = 0;
    1608             : 
    1609       11473 :     if ( !IsTableMode() )
    1610             :     {
    1611       11461 :         const SwPosition* pCursorPos = _GetCrsr()->GetPoint();
    1612       11461 :         const SwTxtNode* pTxtNd = pCursorPos->nNode.GetNode().GetTxtNode();
    1613       11461 :         if ( pTxtNd )
    1614             :         {
    1615       11461 :             SwTxtAttr* pTxtAttr = pTxtNd->GetFldTxtAttrAt( pCursorPos->nContent.GetIndex() );
    1616       11461 :             const SwField* pFld = pTxtAttr != NULL ? pTxtAttr->GetFmtFld().GetField() : 0;
    1617       11461 :             if ( pFld && pFld->Which()== RES_POSTITFLD )
    1618             :             {
    1619           1 :                 pPostItFld = static_cast<const SwPostItField*>(pFld);
    1620             :             }
    1621             :         }
    1622             :     }
    1623             : 
    1624       11473 :     return pPostItFld;
    1625             : }
    1626             : 
    1627             : /// is the node in a protected section?
    1628           0 : bool SwContentAtPos::IsInProtectSect() const
    1629             : {
    1630           0 :     const SwTxtNode* pNd = 0;
    1631           0 :     if( pFndTxtAttr )
    1632             :     {
    1633           0 :         switch( eCntntAtPos )
    1634             :         {
    1635             :         case SW_FIELD:
    1636             :         case SW_CLICKFIELD:
    1637           0 :             pNd = ((SwTxtFld*)pFndTxtAttr)->GetpTxtNode();
    1638           0 :             break;
    1639             : 
    1640             :         case SW_FTN:
    1641           0 :             pNd = &((SwTxtFtn*)pFndTxtAttr)->GetTxtNode();
    1642           0 :             break;
    1643             : 
    1644             :         case SW_INETATTR:
    1645           0 :             pNd = ((SwTxtINetFmt*)pFndTxtAttr)->GetpTxtNode();
    1646           0 :             break;
    1647             : 
    1648             :         default:
    1649           0 :             break;
    1650             :         }
    1651             :     }
    1652             : 
    1653             :     const SwCntntFrm* pFrm;
    1654           0 :     return pNd && ( pNd->IsInProtectSect() ||
    1655           0 :                     ( 0 != ( pFrm = pNd->getLayoutFrm( pNd->GetDoc()->GetCurrentLayout(), 0, 0, false)) &&
    1656           0 :                         pFrm->IsProtected() ));
    1657             : }
    1658             : 
    1659           0 : bool SwContentAtPos::IsInRTLText()const
    1660             : {
    1661           0 :     bool bRet = false;
    1662           0 :     const SwTxtNode* pNd = 0;
    1663           0 :     if (pFndTxtAttr && (eCntntAtPos == SW_FTN))
    1664             :     {
    1665           0 :         const SwTxtFtn* pTxtFtn = static_cast<const SwTxtFtn*>(pFndTxtAttr);
    1666           0 :         if(pTxtFtn->GetStartNode())
    1667             :         {
    1668           0 :             SwStartNode* pSttNd = pTxtFtn->GetStartNode()->GetNode().GetStartNode();
    1669           0 :             SwPaM aTemp( *pSttNd );
    1670           0 :             aTemp.Move(fnMoveForward, fnGoNode);
    1671           0 :             SwCntntNode* pCntntNode = aTemp.GetCntntNode();
    1672           0 :             if(pCntntNode && pCntntNode->IsTxtNode())
    1673           0 :                 pNd = static_cast<SwTxtNode*>(pCntntNode);
    1674             :         }
    1675             :     }
    1676           0 :     if(pNd)
    1677             :     {
    1678           0 :         SwIterator<SwTxtFrm,SwTxtNode> aIter(*pNd);
    1679           0 :         SwTxtFrm* pTmpFrm = aIter.First();
    1680           0 :         while( pTmpFrm )
    1681             :         {
    1682           0 :                 if ( !pTmpFrm->IsFollow())
    1683             :                 {
    1684           0 :                     bRet = pTmpFrm->IsRightToLeft();
    1685           0 :                     break;
    1686             :                 }
    1687           0 :             pTmpFrm = aIter.Next();
    1688           0 :         }
    1689             :     }
    1690           0 :     return bRet;
    1691             : }
    1692             : 
    1693           0 : sal_Bool SwCrsrShell::SelectTxt( const sal_Int32 nStart,
    1694             :                                  const sal_Int32 nEnd )
    1695             : {
    1696           0 :     SET_CURR_SHELL( this );
    1697           0 :     sal_Bool bRet = sal_False;
    1698             : 
    1699           0 :     SwCallLink aLk( *this );
    1700           0 :     SwCrsrSaveState aSaveState( *m_pCurCrsr );
    1701             : 
    1702           0 :     SwPosition& rPos = *m_pCurCrsr->GetPoint();
    1703           0 :     m_pCurCrsr->DeleteMark();
    1704           0 :     rPos.nContent = nStart;
    1705           0 :     m_pCurCrsr->SetMark();
    1706           0 :     rPos.nContent = nEnd;
    1707             : 
    1708           0 :     if( !m_pCurCrsr->IsSelOvr() )
    1709             :     {
    1710           0 :         UpdateCrsr();
    1711           0 :         bRet = sal_True;
    1712             :     }
    1713             : 
    1714           0 :     return bRet;
    1715             : }
    1716             : 
    1717           0 : sal_Bool SwCrsrShell::SelectTxtAttr( sal_uInt16 nWhich,
    1718             :                                      sal_Bool bExpand,
    1719             :                                      const SwTxtAttr* pTxtAttr )
    1720             : {
    1721           0 :     SET_CURR_SHELL( this );
    1722           0 :     sal_Bool bRet = sal_False;
    1723             : 
    1724           0 :     if( !IsTableMode() )
    1725             :     {
    1726           0 :         if( !pTxtAttr )
    1727             :         {
    1728           0 :             SwPosition& rPos = *m_pCurCrsr->GetPoint();
    1729           0 :             SwTxtNode* pTxtNd = rPos.nNode.GetNode().GetTxtNode();
    1730             :             pTxtAttr = (pTxtNd)
    1731             :                 ? pTxtNd->GetTxtAttrAt(rPos.nContent.GetIndex(),
    1732             :                         static_cast<RES_TXTATR>(nWhich),
    1733           0 :                         (bExpand) ? SwTxtNode::EXPAND : SwTxtNode::DEFAULT)
    1734           0 :                 : 0;
    1735             :         }
    1736             : 
    1737           0 :         if( pTxtAttr )
    1738             :         {
    1739           0 :             const sal_Int32* pEnd = pTxtAttr->End();
    1740           0 :             bRet = SelectTxt( *pTxtAttr->GetStart(), ( pEnd ? *pEnd : *pTxtAttr->GetStart() + 1 ) );
    1741             :         }
    1742             :     }
    1743           0 :     return bRet;
    1744             : }
    1745             : 
    1746           0 : bool SwCrsrShell::GotoINetAttr( const SwTxtINetFmt& rAttr )
    1747             : {
    1748           0 :     bool bRet = false;
    1749           0 :     if( rAttr.GetpTxtNode() )
    1750             :     {
    1751           0 :         SwCursor* pCrsr = getShellCrsr( true );
    1752             : 
    1753           0 :         SET_CURR_SHELL( this );
    1754           0 :         SwCallLink aLk( *this ); // watch Crsr-Moves
    1755           0 :         SwCrsrSaveState aSaveState( *pCrsr );
    1756             : 
    1757           0 :         pCrsr->GetPoint()->nNode = *rAttr.GetpTxtNode();
    1758           0 :         pCrsr->GetPoint()->nContent.Assign( (SwTxtNode*)rAttr.GetpTxtNode(),
    1759           0 :                                             *rAttr.GetStart() );
    1760           0 :         bRet = !pCrsr->IsSelOvr();
    1761           0 :         if( bRet )
    1762           0 :             UpdateCrsr(SwCrsrShell::SCROLLWIN|SwCrsrShell::CHKRANGE|SwCrsrShell::READONLY);
    1763             :     }
    1764           0 :     return bRet;
    1765             : }
    1766             : 
    1767           0 : const SwFmtINetFmt* SwCrsrShell::FindINetAttr( const OUString& rName ) const
    1768             : {
    1769           0 :     return mpDoc->FindINetAttr( rName );
    1770             : }
    1771             : 
    1772           0 : sal_Bool SwCrsrShell::GetShadowCrsrPos( const Point& rPt, SwFillMode eFillMode,
    1773             :                                 SwRect& rRect, sal_Int16& rOrient )
    1774             : {
    1775             : 
    1776           0 :     SET_CURR_SHELL( this );
    1777           0 :     sal_Bool bRet = sal_False;
    1778             : 
    1779           0 :     if (!IsTableMode() && !HasSelection()
    1780           0 :         && GetDoc()->GetIDocumentUndoRedo().DoesUndo())
    1781             :     {
    1782           0 :         Point aPt( rPt );
    1783           0 :         SwPosition aPos( *m_pCurCrsr->GetPoint() );
    1784             : 
    1785           0 :         SwFillCrsrPos aFPos( eFillMode );
    1786           0 :         SwCrsrMoveState aTmpState( &aFPos );
    1787             : 
    1788           0 :         if( GetLayout()->GetCrsrOfst( &aPos, aPt, &aTmpState ) &&
    1789           0 :             !aPos.nNode.GetNode().IsProtect())
    1790             :         {
    1791             :             // start position in protected section?
    1792           0 :             rRect = aFPos.aCrsr;
    1793           0 :             rOrient = aFPos.eOrient;
    1794           0 :             bRet = sal_True;
    1795           0 :         }
    1796             :     }
    1797           0 :     return bRet;
    1798             : }
    1799             : 
    1800           0 : sal_Bool SwCrsrShell::SetShadowCrsrPos( const Point& rPt, SwFillMode eFillMode )
    1801             : {
    1802           0 :     SET_CURR_SHELL( this );
    1803           0 :     sal_Bool bRet = sal_False;
    1804             : 
    1805           0 :     if (!IsTableMode() && !HasSelection()
    1806           0 :         && GetDoc()->GetIDocumentUndoRedo().DoesUndo())
    1807             :     {
    1808           0 :         Point aPt( rPt );
    1809           0 :         SwPosition aPos( *m_pCurCrsr->GetPoint() );
    1810             : 
    1811           0 :         SwFillCrsrPos aFPos( eFillMode );
    1812           0 :         SwCrsrMoveState aTmpState( &aFPos );
    1813             : 
    1814           0 :         if( GetLayout()->GetCrsrOfst( &aPos, aPt, &aTmpState ) )
    1815             :         {
    1816           0 :             SwCallLink aLk( *this ); // watch Crsr-Moves
    1817           0 :             StartAction();
    1818             : 
    1819           0 :             SwCntntNode* pCNd = aPos.nNode.GetNode().GetCntntNode();
    1820           0 :             SwUndoId nUndoId = UNDO_INS_FROM_SHADOWCRSR;
    1821             :             // If only the paragraph attributes "Adjust" or "LRSpace" are set,
    1822             :             // then the following should not delete those again.
    1823           0 :             if( 0 == aFPos.nParaCnt + aFPos.nColumnCnt &&
    1824           0 :                 ( FILL_INDENT == aFPos.eMode ||
    1825           0 :                   ( text::HoriOrientation::NONE != aFPos.eOrient &&
    1826           0 :                     0 == aFPos.nTabCnt + aFPos.nSpaceCnt )) &&
    1827           0 :                 pCNd && pCNd->Len() )
    1828           0 :                 nUndoId = UNDO_EMPTY;
    1829             : 
    1830           0 :             GetDoc()->GetIDocumentUndoRedo().StartUndo( nUndoId, NULL );
    1831             : 
    1832           0 :             SwTxtFmtColl* pNextFmt = 0;
    1833           0 :             SwTxtNode* pTNd = pCNd ? pCNd->GetTxtNode() : NULL;
    1834           0 :             if( pTNd )
    1835           0 :                 pNextFmt = &pTNd->GetTxtColl()->GetNextTxtFmtColl();
    1836             : 
    1837           0 :             const SwSectionNode* pSectNd = pCNd ? pCNd->FindSectionNode() : NULL;
    1838           0 :             if( pSectNd && aFPos.nParaCnt )
    1839             :             {
    1840           0 :                 SwNodeIndex aEnd( aPos.nNode, 1 );
    1841           0 :                 while( aEnd.GetNode().IsEndNode() &&
    1842           0 :                         (const SwNode*)&aEnd.GetNode() !=
    1843           0 :                         pSectNd->EndOfSectionNode() )
    1844           0 :                     ++aEnd;
    1845             : 
    1846           0 :                 if( aEnd.GetNode().IsEndNode() &&
    1847           0 :                     pCNd->Len() == aPos.nContent.GetIndex() )
    1848           0 :                     aPos.nNode = *pSectNd->EndOfSectionNode();
    1849             :             }
    1850             : 
    1851           0 :             for( sal_uInt16 n = 0; n < aFPos.nParaCnt + aFPos.nColumnCnt; ++n )
    1852             :             {
    1853           0 :                 GetDoc()->AppendTxtNode( aPos );
    1854           0 :                 if( !n && pNextFmt )
    1855             :                 {
    1856           0 :                     *m_pCurCrsr->GetPoint() = aPos;
    1857           0 :                     GetDoc()->SetTxtFmtColl( *m_pCurCrsr, pNextFmt, false );
    1858             :                 }
    1859           0 :                 if( n < aFPos.nColumnCnt )
    1860             :                 {
    1861           0 :                     *m_pCurCrsr->GetPoint() = aPos;
    1862           0 :                     GetDoc()->InsertPoolItem( *m_pCurCrsr,
    1863           0 :                             SvxFmtBreakItem( SVX_BREAK_COLUMN_BEFORE, RES_BREAK ), 0);
    1864             :                 }
    1865             :             }
    1866             : 
    1867           0 :             *m_pCurCrsr->GetPoint() = aPos;
    1868           0 :             switch( aFPos.eMode )
    1869             :             {
    1870             :             case FILL_INDENT:
    1871           0 :                 if( 0 != (pCNd = aPos.nNode.GetNode().GetCntntNode() ))
    1872             :                 {
    1873           0 :                     SfxItemSet aSet( GetDoc()->GetAttrPool(),
    1874             :                                     RES_LR_SPACE, RES_LR_SPACE,
    1875             :                                     RES_PARATR_ADJUST, RES_PARATR_ADJUST,
    1876           0 :                                     0 );
    1877             :                     SvxLRSpaceItem aLR( (SvxLRSpaceItem&)
    1878           0 :                                         pCNd->GetAttr( RES_LR_SPACE ) );
    1879           0 :                     aLR.SetTxtLeft( aFPos.nTabCnt );
    1880           0 :                     aLR.SetTxtFirstLineOfst( 0 );
    1881           0 :                     aSet.Put( aLR );
    1882             : 
    1883             :                     const SvxAdjustItem& rAdj = (SvxAdjustItem&)pCNd->
    1884           0 :                                         GetAttr( RES_PARATR_ADJUST );
    1885           0 :                     if( SVX_ADJUST_LEFT != rAdj.GetAdjust() )
    1886           0 :                         aSet.Put( SvxAdjustItem( SVX_ADJUST_LEFT, RES_PARATR_ADJUST ) );
    1887             : 
    1888           0 :                     GetDoc()->InsertItemSet( *m_pCurCrsr, aSet, 0 );
    1889             :                 }
    1890             :                 else {
    1891             :                     OSL_ENSURE( !this, "No CntntNode" );
    1892             :                 }
    1893           0 :                 break;
    1894             : 
    1895             :             case FILL_TAB:
    1896             :             case FILL_SPACE:
    1897             :                 {
    1898           0 :                     OUStringBuffer sInsert;
    1899           0 :                     if (aFPos.nTabCnt)
    1900           0 :                         comphelper::string::padToLength(sInsert, aFPos.nTabCnt, '\t');
    1901           0 :                     if (aFPos.nSpaceCnt)
    1902           0 :                         comphelper::string::padToLength(sInsert, sInsert.getLength() + aFPos.nSpaceCnt, ' ');
    1903           0 :                     if (!sInsert.isEmpty())
    1904           0 :                         GetDoc()->InsertString( *m_pCurCrsr, sInsert.makeStringAndClear());
    1905             :                 }
    1906             :                 // no break - still need to set orientation
    1907             :             case FILL_MARGIN:
    1908           0 :                 if( text::HoriOrientation::NONE != aFPos.eOrient )
    1909             :                 {
    1910           0 :                     SvxAdjustItem aAdj( SVX_ADJUST_LEFT, RES_PARATR_ADJUST );
    1911           0 :                     switch( aFPos.eOrient )
    1912             :                     {
    1913             :                     case text::HoriOrientation::CENTER:
    1914           0 :                         aAdj.SetAdjust( SVX_ADJUST_CENTER );
    1915           0 :                         break;
    1916             :                     case text::HoriOrientation::RIGHT:
    1917           0 :                         aAdj.SetAdjust( SVX_ADJUST_RIGHT );
    1918           0 :                         break;
    1919             :                     default:
    1920           0 :                         break;
    1921             :                     }
    1922           0 :                     GetDoc()->InsertPoolItem( *m_pCurCrsr, aAdj, 0 );
    1923             :                 }
    1924           0 :                 break;
    1925             :             }
    1926             : 
    1927           0 :             GetDoc()->GetIDocumentUndoRedo().EndUndo( nUndoId, NULL );
    1928           0 :             EndAction();
    1929             : 
    1930           0 :             bRet = sal_True;
    1931           0 :         }
    1932             :     }
    1933           0 :     return bRet;
    1934             : }
    1935             : 
    1936           0 : const SwRangeRedline* SwCrsrShell::SelNextRedline()
    1937             : {
    1938           0 :     const SwRangeRedline* pFnd = 0;
    1939           0 :     if( !IsTableMode() )
    1940             :     {
    1941           0 :         SET_CURR_SHELL( this );
    1942           0 :         SwCallLink aLk( *this ); // watch Crsr-Moves
    1943           0 :         SwCrsrSaveState aSaveState( *m_pCurCrsr );
    1944             : 
    1945           0 :         pFnd = GetDoc()->SelNextRedline( *m_pCurCrsr );
    1946           0 :         if( pFnd && !m_pCurCrsr->IsInProtectTable() && !m_pCurCrsr->IsSelOvr() )
    1947           0 :             UpdateCrsr( SwCrsrShell::SCROLLWIN|SwCrsrShell::CHKRANGE|SwCrsrShell::READONLY);
    1948             :         else
    1949           0 :             pFnd = 0;
    1950             :     }
    1951           0 :     return pFnd;
    1952             : }
    1953             : 
    1954           0 : const SwRangeRedline* SwCrsrShell::SelPrevRedline()
    1955             : {
    1956           0 :     const SwRangeRedline* pFnd = 0;
    1957           0 :     if( !IsTableMode() )
    1958             :     {
    1959           0 :         SET_CURR_SHELL( this );
    1960           0 :         SwCallLink aLk( *this ); // watch Crsr-Moves
    1961           0 :         SwCrsrSaveState aSaveState( *m_pCurCrsr );
    1962             : 
    1963           0 :         pFnd = GetDoc()->SelPrevRedline( *m_pCurCrsr );
    1964           0 :         if( pFnd && !m_pCurCrsr->IsInProtectTable() && !m_pCurCrsr->IsSelOvr() )
    1965           0 :             UpdateCrsr( SwCrsrShell::SCROLLWIN|SwCrsrShell::CHKRANGE|SwCrsrShell::READONLY);
    1966             :         else
    1967           0 :             pFnd = 0;
    1968             :     }
    1969           0 :     return pFnd;
    1970             : }
    1971             : 
    1972           0 : const SwRangeRedline* SwCrsrShell::_GotoRedline( sal_uInt16 nArrPos, sal_Bool bSelect )
    1973             : {
    1974           0 :     const SwRangeRedline* pFnd = 0;
    1975           0 :     SwCallLink aLk( *this ); // watch Crsr-Moves
    1976           0 :     SwCrsrSaveState aSaveState( *m_pCurCrsr );
    1977             : 
    1978           0 :     pFnd = GetDoc()->GetRedlineTbl()[ nArrPos ];
    1979           0 :     if( pFnd )
    1980             :     {
    1981           0 :         *m_pCurCrsr->GetPoint() = *pFnd->Start();
    1982             : 
    1983             :         SwCntntNode* pCNd;
    1984           0 :         SwNodeIndex* pIdx = &m_pCurCrsr->GetPoint()->nNode;
    1985           0 :         if( !pIdx->GetNode().IsCntntNode() &&
    1986           0 :             0 != ( pCNd = GetDoc()->GetNodes().GoNextSection( pIdx,
    1987           0 :                                     true, IsReadOnlyAvailable() )) )
    1988             :         {
    1989           0 :             if( *pIdx <= pFnd->End()->nNode )
    1990           0 :                 m_pCurCrsr->GetPoint()->nContent.Assign( pCNd, 0 );
    1991             :             else
    1992           0 :                 pFnd = 0;
    1993             :         }
    1994             : 
    1995           0 :         if( pFnd && bSelect )
    1996             :         {
    1997           0 :             m_pCurCrsr->SetMark();
    1998           0 :             if( nsRedlineType_t::REDLINE_FMTCOLL == pFnd->GetType() )
    1999             :             {
    2000           0 :                 pCNd = pIdx->GetNode().GetCntntNode();
    2001           0 :                 m_pCurCrsr->GetPoint()->nContent.Assign( pCNd, pCNd->Len() );
    2002           0 :                 m_pCurCrsr->GetMark()->nContent.Assign( pCNd, 0 );
    2003             :             }
    2004             :             else
    2005           0 :                 *m_pCurCrsr->GetPoint() = *pFnd->End();
    2006             : 
    2007           0 :             pIdx = &m_pCurCrsr->GetPoint()->nNode;
    2008           0 :             if( !pIdx->GetNode().IsCntntNode() &&
    2009           0 :                 0 != ( pCNd = GetDoc()->GetNodes().GoPrevSection( pIdx,
    2010           0 :                                             true, IsReadOnlyAvailable() )) )
    2011             :             {
    2012           0 :                 if( *pIdx >= m_pCurCrsr->GetMark()->nNode )
    2013           0 :                     m_pCurCrsr->GetPoint()->nContent.Assign( pCNd, pCNd->Len() );
    2014             :                 else
    2015           0 :                     pFnd = 0;
    2016             :             }
    2017             :         }
    2018             : 
    2019           0 :         if( !pFnd )
    2020             :         {
    2021           0 :             m_pCurCrsr->DeleteMark();
    2022           0 :             m_pCurCrsr->RestoreSavePos();
    2023             :         }
    2024           0 :         else if( bSelect && *m_pCurCrsr->GetMark() == *m_pCurCrsr->GetPoint() )
    2025           0 :             m_pCurCrsr->DeleteMark();
    2026             : 
    2027           0 :         if( pFnd && !m_pCurCrsr->IsInProtectTable() && !m_pCurCrsr->IsSelOvr() )
    2028             :             UpdateCrsr( SwCrsrShell::SCROLLWIN | SwCrsrShell::CHKRANGE
    2029           0 :                         | SwCrsrShell::READONLY );
    2030             :         else
    2031             :         {
    2032           0 :             pFnd = 0;
    2033           0 :             if( bSelect )
    2034           0 :                 m_pCurCrsr->DeleteMark();
    2035             :         }
    2036             :     }
    2037           0 :     return pFnd;
    2038             : }
    2039             : 
    2040           0 : const SwRangeRedline* SwCrsrShell::GotoRedline( sal_uInt16 nArrPos, sal_Bool bSelect )
    2041             : {
    2042           0 :     const SwRangeRedline* pFnd = 0;
    2043           0 :     if( !IsTableMode() )
    2044             :     {
    2045           0 :         SET_CURR_SHELL( this );
    2046             : 
    2047           0 :         const SwRedlineTbl& rTbl = GetDoc()->GetRedlineTbl();
    2048           0 :         const SwRangeRedline* pTmp = rTbl[ nArrPos ];
    2049           0 :         sal_uInt16 nSeqNo = pTmp->GetSeqNo();
    2050           0 :         if( nSeqNo && bSelect )
    2051             :         {
    2052           0 :             bool bCheck = false;
    2053           0 :             int nLoopCnt = 2;
    2054           0 :             sal_uInt16 nArrSavPos = nArrPos;
    2055             : 
    2056           0 :             do {
    2057           0 :                 pTmp = _GotoRedline( nArrPos, sal_True );
    2058             : 
    2059           0 :                 if( !pFnd )
    2060           0 :                     pFnd = pTmp;
    2061             : 
    2062           0 :                 if( pTmp && bCheck )
    2063             :                 {
    2064             :                     // Check for overlaps. These can happen when FmtColl-
    2065             :                     // Redlines were streched over a whole paragraph
    2066           0 :                     SwPaM* pCur = m_pCurCrsr;
    2067           0 :                     SwPaM* pNextPam = (SwPaM*)pCur->GetNext();
    2068           0 :                     SwPosition* pCStt = pCur->Start(), *pCEnd = pCur->End();
    2069           0 :                     while( pCur != pNextPam )
    2070             :                     {
    2071           0 :                         const SwPosition *pNStt = pNextPam->Start(),
    2072           0 :                                          *pNEnd = pNextPam->End();
    2073             : 
    2074           0 :                         bool bDel = true;
    2075           0 :                         switch( ::ComparePosition( *pCStt, *pCEnd,
    2076           0 :                                                    *pNStt, *pNEnd ))
    2077             :                         {
    2078             :                         case POS_INSIDE:         // Pos1 is completely in Pos2
    2079           0 :                             if( !pCur->HasMark() )
    2080             :                             {
    2081           0 :                                 pCur->SetMark();
    2082           0 :                                 *pCur->GetMark() = *pNStt;
    2083             :                             }
    2084             :                             else
    2085           0 :                                 *pCStt = *pNStt;
    2086           0 :                             *pCEnd = *pNEnd;
    2087           0 :                             break;
    2088             : 
    2089             :                         case POS_OUTSIDE:        // Pos2 is completely in Pos1
    2090             :                         case POS_EQUAL:          // Pos1 has same size as Pos2
    2091           0 :                             break;
    2092             : 
    2093             :                         case POS_OVERLAP_BEFORE: // Pos1 overlaps Pos2 at beginning
    2094           0 :                             if( !pCur->HasMark() )
    2095           0 :                                 pCur->SetMark();
    2096           0 :                             *pCEnd = *pNEnd;
    2097           0 :                             break;
    2098             :                         case POS_OVERLAP_BEHIND: // Pos1 overlaps Pos2 at end
    2099           0 :                             if( !pCur->HasMark() )
    2100             :                             {
    2101           0 :                                 pCur->SetMark();
    2102           0 :                                 *pCur->GetMark() = *pNStt;
    2103             :                             }
    2104             :                             else
    2105           0 :                                 *pCStt = *pNStt;
    2106           0 :                             break;
    2107             : 
    2108             :                         default:
    2109           0 :                             bDel = false;
    2110             :                         }
    2111             : 
    2112           0 :                         if( bDel )
    2113             :                         {
    2114             :                             // not needed anymore
    2115           0 :                             SwPaM* pPrevPam = (SwPaM*)pNextPam->GetPrev();
    2116           0 :                             delete pNextPam;
    2117           0 :                             pNextPam = pPrevPam;
    2118             :                         }
    2119           0 :                         pNextPam = (SwPaM*)pNextPam->GetNext();
    2120             :                     }
    2121             :                 }
    2122             : 
    2123             :                 sal_uInt16 nFndPos = 2 == nLoopCnt
    2124           0 :                                     ? rTbl.FindNextOfSeqNo( nArrPos )
    2125           0 :                                     : rTbl.FindPrevOfSeqNo( nArrPos );
    2126           0 :                 if( USHRT_MAX != nFndPos ||
    2127           0 :                     ( 0 != ( --nLoopCnt ) && USHRT_MAX != (
    2128           0 :                             nFndPos = rTbl.FindPrevOfSeqNo( nArrSavPos ))) )
    2129             :                 {
    2130           0 :                     if( pTmp )
    2131             :                     {
    2132             :                         // create new cursor
    2133           0 :                         CreateCrsr();
    2134           0 :                         bCheck = true;
    2135             :                     }
    2136           0 :                     nArrPos = nFndPos;
    2137             :                 }
    2138             :                 else
    2139           0 :                     nLoopCnt = 0;
    2140             : 
    2141           0 :             } while( nLoopCnt );
    2142             :         }
    2143             :         else
    2144           0 :             pFnd = _GotoRedline( nArrPos, bSelect );
    2145             :     }
    2146           0 :     return pFnd;
    2147             : }
    2148             : 
    2149           0 : bool SwCrsrShell::SelectNxtPrvHyperlink( bool bNext )
    2150             : {
    2151           0 :     SwNodes& rNds = GetDoc()->GetNodes();
    2152           0 :     const SwNode* pBodyEndNd = &rNds.GetEndOfContent();
    2153           0 :     const SwNode* pBodySttNd = pBodyEndNd->StartOfSectionNode();
    2154           0 :     sal_uLong nBodySttNdIdx = pBodySttNd->GetIndex();
    2155           0 :     Point aPt;
    2156             : 
    2157           0 :     _SetGetExpFld aCmpPos( SwPosition( bNext ? *pBodyEndNd : *pBodySttNd ) );
    2158           0 :     _SetGetExpFld aCurPos( bNext ? *m_pCurCrsr->End() : *m_pCurCrsr->Start() );
    2159           0 :     if( aCurPos.GetNode() < nBodySttNdIdx )
    2160             :     {
    2161           0 :         const SwCntntNode* pCNd = aCurPos.GetNodeFromCntnt()->GetCntntNode();
    2162             :         SwCntntFrm* pFrm;
    2163           0 :         if( pCNd && 0 != ( pFrm = pCNd->getLayoutFrm( GetLayout(), &aPt )) )
    2164           0 :             aCurPos.SetBodyPos( *pFrm );
    2165             :     }
    2166             : 
    2167             :     // check first all the hyperlink fields
    2168             :     {
    2169             :         const SwTxtNode* pTxtNd;
    2170           0 :         const SwCharFmts* pFmts = GetDoc()->GetCharFmts();
    2171           0 :         for( sal_uInt16 n = pFmts->size(); 1 < n; )
    2172             :         {
    2173           0 :             SwIterator<SwTxtINetFmt,SwCharFmt> aIter(*(*pFmts)[--n]);
    2174             : 
    2175           0 :             for( SwTxtINetFmt* pFnd = aIter.First(); pFnd; pFnd = aIter.Next() )
    2176           0 :                 if( 0 != ( pTxtNd = pFnd->GetpTxtNode()) &&
    2177           0 :                     pTxtNd->GetNodes().IsDocNodes() )
    2178             :                 {
    2179           0 :                     SwTxtINetFmt& rAttr = *pFnd;
    2180           0 :                     SwPosition aTmpPos( *pTxtNd );
    2181           0 :                     _SetGetExpFld aPos( aTmpPos.nNode, rAttr );
    2182             :                     SwCntntFrm* pFrm;
    2183           0 :                     if( pTxtNd->GetIndex() < nBodySttNdIdx &&
    2184           0 :                         0 != ( pFrm = pTxtNd->getLayoutFrm( GetLayout(), &aPt )) )
    2185           0 :                         aPos.SetBodyPos( *pFrm );
    2186             : 
    2187           0 :                     if( bNext
    2188           0 :                         ? ( aPos < aCmpPos && aCurPos < aPos )
    2189           0 :                         : ( aCmpPos < aPos && aPos < aCurPos ))
    2190             :                     {
    2191           0 :                         OUString sTxt( pTxtNd->GetExpandTxt( *rAttr.GetStart(),
    2192           0 :                                         *rAttr.GetEnd() - *rAttr.GetStart() ) );
    2193             : 
    2194           0 :                         sTxt = comphelper::string::remove(sTxt, 0x0a);
    2195           0 :                         sTxt = comphelper::string::strip(sTxt, ' ');
    2196             : 
    2197           0 :                         if( !sTxt.isEmpty() )
    2198           0 :                             aCmpPos = aPos;
    2199           0 :                     }
    2200             :                 }
    2201           0 :         }
    2202             :     }
    2203             : 
    2204             :     // then check all the Flys with a URL or imapge map
    2205             :     {
    2206           0 :         const SwFrmFmts* pFmts = GetDoc()->GetSpzFrmFmts();
    2207           0 :         for( sal_uInt16 n = 0, nEnd = pFmts->size(); n < nEnd; ++n )
    2208             :         {
    2209           0 :             SwFlyFrmFmt* pFmt = (SwFlyFrmFmt*)(*pFmts)[ n ];
    2210           0 :             const SwFmtURL& rURLItem = pFmt->GetURL();
    2211           0 :             if( rURLItem.GetMap() || !rURLItem.GetURL().isEmpty() )
    2212             :             {
    2213           0 :                 SwFlyFrm* pFly = pFmt->GetFrm( &aPt, sal_False );
    2214           0 :                 SwPosition aTmpPos( *pBodySttNd );
    2215           0 :                 if( pFly &&
    2216           0 :                     GetBodyTxtNode( *GetDoc(), aTmpPos, *pFly->GetLower() ) )
    2217             :                 {
    2218           0 :                     _SetGetExpFld aPos( *pFmt, &aTmpPos );
    2219             : 
    2220           0 :                     if( bNext
    2221           0 :                             ? ( aPos < aCmpPos && aCurPos < aPos )
    2222           0 :                             : ( aCmpPos < aPos && aPos < aCurPos ))
    2223           0 :                         aCmpPos = aPos;
    2224           0 :                 }
    2225             :             }
    2226             :         }
    2227             :     }
    2228             : 
    2229             :     // found any URL ?
    2230           0 :     bool bRet = false;
    2231           0 :     const SwTxtINetFmt* pFndAttr = aCmpPos.GetINetFmt();
    2232           0 :     const SwFlyFrmFmt* pFndFmt = aCmpPos.GetFlyFmt();
    2233           0 :     if( pFndAttr || pFndFmt )
    2234             :     {
    2235           0 :         SET_CURR_SHELL( this );
    2236           0 :         SwCallLink aLk( *this );
    2237             : 
    2238             :         // found a text attribute ?
    2239           0 :         if( pFndAttr )
    2240             :         {
    2241           0 :             SwCrsrSaveState aSaveState( *m_pCurCrsr );
    2242             : 
    2243           0 :             aCmpPos.GetPosOfContent( *m_pCurCrsr->GetPoint() );
    2244           0 :             m_pCurCrsr->DeleteMark();
    2245           0 :             m_pCurCrsr->SetMark();
    2246           0 :             m_pCurCrsr->GetPoint()->nContent = *pFndAttr->End();
    2247             : 
    2248           0 :             if( !m_pCurCrsr->IsInProtectTable() && !m_pCurCrsr->IsSelOvr() )
    2249             :             {
    2250             :                 UpdateCrsr( SwCrsrShell::SCROLLWIN|SwCrsrShell::CHKRANGE|
    2251           0 :                                     SwCrsrShell::READONLY );
    2252           0 :                 bRet = true;
    2253           0 :             }
    2254             :         }
    2255             :         // found a draw object ?
    2256           0 :         else if( RES_DRAWFRMFMT == pFndFmt->Which() )
    2257             :         {
    2258           0 :             const SdrObject* pSObj = pFndFmt->FindSdrObject();
    2259           0 :             ((SwFEShell*)this)->SelectObj( pSObj->GetCurrentBoundRect().Center() );
    2260           0 :             MakeSelVisible();
    2261           0 :             bRet = true;
    2262             :         }
    2263             :         else // then is it a fly
    2264             :         {
    2265           0 :             SwFlyFrm* pFly = pFndFmt->GetFrm(&aPt, sal_False );
    2266           0 :             if( pFly )
    2267             :             {
    2268           0 :                 ((SwFEShell*)this)->SelectFlyFrm( *pFly, sal_True );
    2269           0 :                 MakeSelVisible();
    2270           0 :                 bRet = true;
    2271             :             }
    2272           0 :         }
    2273             :     }
    2274           0 :     return bRet;
    2275             : }
    2276             : 
    2277             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10