LCOV - code coverage report
Current view: top level - sw/source/ui/docvw - edtwin2.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 15 232 6.5 %
Date: 2012-08-25 Functions: 2 4 50.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 7 528 1.3 %

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*************************************************************************
       3                 :            :  *
       4                 :            :  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       5                 :            :  *
       6                 :            :  * Copyright 2000, 2010 Oracle and/or its affiliates.
       7                 :            :  *
       8                 :            :  * OpenOffice.org - a multi-platform office productivity suite
       9                 :            :  *
      10                 :            :  * This file is part of OpenOffice.org.
      11                 :            :  *
      12                 :            :  * OpenOffice.org is free software: you can redistribute it and/or modify
      13                 :            :  * it under the terms of the GNU Lesser General Public License version 3
      14                 :            :  * only, as published by the Free Software Foundation.
      15                 :            :  *
      16                 :            :  * OpenOffice.org is distributed in the hope that it will be useful,
      17                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      18                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      19                 :            :  * GNU Lesser General Public License version 3 for more details
      20                 :            :  * (a copy is included in the LICENSE file that accompanied this code).
      21                 :            :  *
      22                 :            :  * You should have received a copy of the GNU Lesser General Public License
      23                 :            :  * version 3 along with OpenOffice.org.  If not, see
      24                 :            :  * <http://www.openoffice.org/license.html>
      25                 :            :  * for a copy of the LGPLv3 License.
      26                 :            :  *
      27                 :            :  ************************************************************************/
      28                 :            : 
      29                 :            : #include <comphelper/string.hxx>
      30                 :            : #include <hintids.hxx>
      31                 :            : 
      32                 :            : #include <doc.hxx>
      33                 :            : #if OSL_DEBUG_LEVEL > 1
      34                 :            : #include <stdio.h>
      35                 :            : #endif
      36                 :            : 
      37                 :            : #include <vcl/help.hxx>
      38                 :            : #include <svl/stritem.hxx>
      39                 :            : #include <unotools/securityoptions.hxx>
      40                 :            : #include <tools/urlobj.hxx>
      41                 :            : #include <txtrfmrk.hxx>
      42                 :            : #include <fmtrfmrk.hxx>
      43                 :            : #include <editeng/flditem.hxx>
      44                 :            : #include <svl/urihelper.hxx>
      45                 :            : #include <svx/svdotext.hxx>
      46                 :            : #include <editeng/outliner.hxx>
      47                 :            : #include <svl/itemiter.hxx>
      48                 :            : #include <svx/svdview.hxx>
      49                 :            : #include <svx/svdpagv.hxx>
      50                 :            : #include <swmodule.hxx>
      51                 :            : #include <modcfg.hxx>
      52                 :            : #include <view.hxx>
      53                 :            : #include <wrtsh.hxx>
      54                 :            : #include <docsh.hxx>
      55                 :            : #include <edtwin.hxx>
      56                 :            : #include <dpage.hxx>
      57                 :            : #include <shellres.hxx>
      58                 :            : #include <docufld.hxx>
      59                 :            : #include <dbfld.hxx>
      60                 :            : #include <reffld.hxx>
      61                 :            : #include <cellatr.hxx>
      62                 :            : #include <shdwcrsr.hxx>
      63                 :            : #include <fmtcol.hxx>
      64                 :            : #include <charfmt.hxx>
      65                 :            : #include <fmtftn.hxx>
      66                 :            : #include <redline.hxx>
      67                 :            : #include <tox.hxx>
      68                 :            : #include <txttxmrk.hxx>
      69                 :            : #include <uitool.hxx>
      70                 :            : #include <viewopt.hxx>
      71                 :            : #include <docvw.hrc>
      72                 :            : #include <utlui.hrc>
      73                 :            : 
      74                 :            : #include <PostItMgr.hxx>
      75                 :            : #include <fmtfld.hxx>
      76                 :            : 
      77                 :            : // #i104300#
      78                 :            : #include <IDocumentMarkAccess.hxx>
      79                 :            : #include <ndtxt.hxx>
      80                 :            : 
      81                 :            : /*--------------------------------------------------------------------
      82                 :            :     Description:    KeyEvents
      83                 :            :  --------------------------------------------------------------------*/
      84                 :          0 : static void lcl_GetRedlineHelp( const SwRedline& rRedl, String& rTxt, sal_Bool bBalloon )
      85                 :            : {
      86                 :          0 :     sal_uInt16 nResId = 0;
      87   [ #  #  #  #  :          0 :     switch( rRedl.GetType() )
                   #  # ]
      88                 :            :     {
      89                 :          0 :     case nsRedlineType_t::REDLINE_INSERT:   nResId = STR_REDLINE_INSERT; break;
      90                 :          0 :     case nsRedlineType_t::REDLINE_DELETE:   nResId = STR_REDLINE_DELETE; break;
      91                 :          0 :     case nsRedlineType_t::REDLINE_FORMAT:   nResId = STR_REDLINE_FORMAT; break;
      92                 :          0 :     case nsRedlineType_t::REDLINE_TABLE:        nResId = STR_REDLINE_TABLE; break;
      93                 :          0 :     case nsRedlineType_t::REDLINE_FMTCOLL:  nResId = STR_REDLINE_FMTCOLL; break;
      94                 :            :     }
      95                 :            : 
      96         [ #  # ]:          0 :     if( nResId )
      97                 :            :     {
      98 [ #  # ][ #  # ]:          0 :         rTxt = SW_RESSTR( nResId );
      99                 :          0 :         rTxt.AppendAscii( RTL_CONSTASCII_STRINGPARAM(": " ));
     100                 :          0 :         rTxt += rRedl.GetAuthorString();
     101                 :          0 :         rTxt.AppendAscii( RTL_CONSTASCII_STRINGPARAM( " - " ));
     102         [ #  # ]:          0 :         rTxt += GetAppLangDateTimeString( rRedl.GetTimeStamp() );
     103 [ #  # ][ #  # ]:          0 :         if( bBalloon && rRedl.GetComment().Len() )
                 [ #  # ]
     104                 :          0 :             ( rTxt += '\n' ) += rRedl.GetComment();
     105                 :            :     }
     106                 :          0 : }
     107                 :            : 
     108                 :            : 
     109                 :          0 : void SwEditWin::RequestHelp(const HelpEvent &rEvt)
     110                 :            : {
     111                 :          0 :     SwWrtShell &rSh = rView.GetWrtShell();
     112                 :          0 :     sal_Bool bQuickBalloon = 0 != (rEvt.GetMode() & ( HELPMODE_QUICK | HELPMODE_BALLOON ));
     113 [ #  # ][ #  # ]:          0 :     if(bQuickBalloon && rSh.GetViewOptions()->IsPreventTips())
                 [ #  # ]
     114                 :          0 :         return;
     115                 :          0 :     sal_Bool bWeiter = sal_True;
     116         [ #  # ]:          0 :     SET_CURR_SHELL(&rSh);
     117         [ #  # ]:          0 :     String sTxt;
     118 [ #  # ][ #  # ]:          0 :     Point aPos( PixelToLogic( ScreenToOutputPixel( rEvt.GetMousePosPixel() ) ));
                 [ #  # ]
     119                 :          0 :     sal_Bool bBalloon = static_cast< sal_Bool >(rEvt.GetMode() & HELPMODE_BALLOON);
     120                 :            : 
     121         [ #  # ]:          0 :     SdrView *pSdrView = rSh.GetDrawView();
     122                 :            : 
     123         [ #  # ]:          0 :     if( bQuickBalloon )
     124                 :            :     {
     125         [ #  # ]:          0 :         if( pSdrView )
     126                 :            :         {
     127                 :          0 :             SdrPageView* pPV = pSdrView->GetSdrPageView();
     128         [ #  # ]:          0 :             SwDPage* pPage = pPV ? ((SwDPage*)pPV->GetPage()) : 0;
     129 [ #  # ][ #  # ]:          0 :             bWeiter = pPage && pPage->RequestHelp(this, pSdrView, rEvt);
                 [ #  # ]
     130                 :            :         }
     131                 :            :     }
     132                 :            : 
     133 [ #  # ][ #  # ]:          0 :     if( bWeiter && bQuickBalloon)
     134                 :            :     {
     135                 :          0 :         SwRect aFldRect;
     136                 :            :         SwContentAtPos aCntntAtPos( SwContentAtPos::SW_FIELD |
     137                 :            :                                     SwContentAtPos::SW_INETATTR |
     138                 :            :                                     SwContentAtPos::SW_FTN |
     139                 :            :                                     SwContentAtPos::SW_REDLINE |
     140                 :            :                                     SwContentAtPos::SW_TOXMARK |
     141                 :            :                                     SwContentAtPos::SW_REFMARK |
     142                 :            :                                     SwContentAtPos::SW_SMARTTAG |
     143                 :            : #ifdef DBG_UTIL
     144                 :            :                                     SwContentAtPos::SW_TABLEBOXVALUE |
     145                 :            :                         ( bBalloon ? SwContentAtPos::SW_CURR_ATTRS : 0) |
     146                 :            : #endif
     147         [ #  # ]:          0 :                                     SwContentAtPos::SW_TABLEBOXFML );
     148                 :            : 
     149 [ #  # ][ #  # ]:          0 :         if( rSh.GetContentAtPos( aPos, aCntntAtPos, sal_False, &aFldRect ) )
     150                 :            :         {
     151                 :          0 :             sal_uInt16 nStyle = 0; // style of quick help
     152   [ #  #  #  #  :          0 :             switch( aCntntAtPos.eCntntAtPos )
             #  #  #  # ]
     153                 :            :             {
     154                 :            :             case SwContentAtPos::SW_TABLEBOXFML:
     155         [ #  # ]:          0 :                 sTxt.AssignAscii( RTL_CONSTASCII_STRINGPARAM( "= " ));
     156         [ #  # ]:          0 :                 sTxt += ((SwTblBoxFormula*)aCntntAtPos.aFnd.pAttr)->GetFormula();
     157                 :          0 :                 break;
     158                 :            : #ifdef DBG_UTIL
     159                 :            :             case SwContentAtPos::SW_TABLEBOXVALUE:
     160                 :            :             {
     161                 :            :                 sTxt = rtl::OStringToOUString(rtl::OString::valueOf(
     162                 :            :                             ((SwTblBoxValue*)aCntntAtPos.aFnd.pAttr)->GetValue()),
     163                 :            :                             osl_getThreadTextEncoding());
     164                 :            :             }
     165                 :            :             break;
     166                 :            :             case SwContentAtPos::SW_CURR_ATTRS:
     167                 :            :                 sTxt = aCntntAtPos.sStr;
     168                 :            :                 break;
     169                 :            : #endif
     170                 :            : 
     171                 :            :             case SwContentAtPos::SW_INETATTR:
     172                 :            :             {
     173         [ #  # ]:          0 :                 sTxt = ((SfxStringItem*)aCntntAtPos.aFnd.pAttr)->GetValue();
     174                 :            :                 sTxt = URIHelper::removePassword( sTxt,
     175                 :            :                                         INetURLObject::WAS_ENCODED,
     176 [ #  # ][ #  # ]:          0 :                                            INetURLObject::DECODE_UNAMBIGUOUS);
                 [ #  # ]
     177                 :            :                 //#i63832# remove the link target type
     178         [ #  # ]:          0 :                 xub_StrLen nFound = sTxt.Search(cMarkSeperator);
     179 [ #  # ][ #  # ]:          0 :                 if( nFound != STRING_NOTFOUND && (++nFound) < sTxt.Len() )
                 [ #  # ]
     180                 :            :                 {
     181         [ #  # ]:          0 :                     String sSuffix( sTxt.Copy(nFound) );
     182 [ #  # ][ #  # ]:          0 :                     if( sSuffix.EqualsAscii( pMarkToTable ) ||
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     183         [ #  # ]:          0 :                         sSuffix.EqualsAscii( pMarkToFrame ) ||
     184         [ #  # ]:          0 :                         sSuffix.EqualsAscii( pMarkToRegion ) ||
     185         [ #  # ]:          0 :                         sSuffix.EqualsAscii( pMarkToOutline ) ||
     186         [ #  # ]:          0 :                         sSuffix.EqualsAscii( pMarkToText ) ||
     187         [ #  # ]:          0 :                         sSuffix.EqualsAscii( pMarkToGraphic ) ||
     188         [ #  # ]:          0 :                         sSuffix.EqualsAscii( pMarkToOLE ))
     189 [ #  # ][ #  # ]:          0 :                     sTxt = sTxt.Copy( 0, nFound - 1);
         [ #  # ][ #  # ]
     190                 :            :                 }
     191                 :            :                 // #i104300#
     192                 :            :                 // special handling if target is a cross-reference bookmark
     193                 :            :                 {
     194         [ #  # ]:          0 :                     String sTmpSearchStr = sTxt.Copy( 1, sTxt.Len() );
     195                 :            :                     IDocumentMarkAccess* const pMarkAccess =
     196         [ #  # ]:          0 :                                                 rSh.getIDocumentMarkAccess();
     197                 :            :                     IDocumentMarkAccess::const_iterator_t ppBkmk =
     198 [ #  # ][ #  # ]:          0 :                                     pMarkAccess->findBookmark( sTmpSearchStr );
     199 [ #  # ][ #  # ]:          0 :                     if ( ppBkmk != pMarkAccess->getBookmarksEnd() &&
         [ #  # ][ #  # ]
           [ #  #  #  # ]
                 [ #  # ]
     200         [ #  # ]:          0 :                          IDocumentMarkAccess::GetType( *(ppBkmk->get()) )
     201                 :            :                             == IDocumentMarkAccess::CROSSREF_HEADING_BOOKMARK )
     202                 :            :                     {
     203         [ #  # ]:          0 :                         SwTxtNode* pTxtNode = ppBkmk->get()->GetMarkStart().nNode.GetNode().GetTxtNode();
     204         [ #  # ]:          0 :                         if ( pTxtNode )
     205                 :            :                         {
     206 [ #  # ][ #  # ]:          0 :                             sTxt = pTxtNode->GetExpandTxt( 0, pTxtNode->Len(), true, true );
         [ #  # ][ #  # ]
     207                 :            : 
     208         [ #  # ]:          0 :                             if( sTxt.Len() )
     209                 :            :                             {
     210 [ #  # ][ #  # ]:          0 :                                 sTxt = comphelper::string::remove(sTxt, 0xad);
     211 [ #  # ][ #  # ]:          0 :                                 for( sal_Unicode* p = sTxt.GetBufferAccess(); *p; ++p )
     212                 :            :                                 {
     213         [ #  # ]:          0 :                                     if( *p < 0x20 )
     214                 :          0 :                                         *p = 0x20;
     215         [ #  # ]:          0 :                                     else if(*p == 0x2011)
     216                 :          0 :                                         *p = '-';
     217                 :            :                                 }
     218                 :            :                             }
     219                 :            :                         }
     220         [ #  # ]:          0 :                     }
     221                 :            :                 }
     222                 :            :                 // #i80029#
     223 [ #  # ][ #  # ]:          0 :                 sal_Bool bExecHyperlinks = rView.GetDocShell()->IsReadOnly();
     224         [ #  # ]:          0 :                 if ( !bExecHyperlinks )
     225                 :            :                 {
     226         [ #  # ]:          0 :                     SvtSecurityOptions aSecOpts;
     227         [ #  # ]:          0 :                     bExecHyperlinks = !aSecOpts.IsOptionSet( SvtSecurityOptions::E_CTRLCLICK_HYPERLINK );
     228                 :            : 
     229         [ #  # ]:          0 :                     if ( !bExecHyperlinks )
     230                 :            :                     {
     231         [ #  # ]:          0 :                         sTxt.InsertAscii( ": ", 0 );
     232 [ #  # ][ #  # ]:          0 :                         sTxt.Insert( ViewShell::GetShellRes()->aHyperlinkClick, 0 );
     233         [ #  # ]:          0 :                     }
     234                 :            :                 }
     235                 :          0 :                 break;
     236                 :            :             }
     237                 :            :             case SwContentAtPos::SW_SMARTTAG:
     238                 :            :             {
     239 [ #  # ][ #  # ]:          0 :                 sTxt = SW_RESSTR(STR_SMARTTAG_CLICK);
     240                 :            : 
     241                 :          0 :                 KeyCode aCode( KEY_SPACE );
     242                 :          0 :                 KeyCode aModifiedCode( KEY_SPACE, KEY_MOD1 );
     243         [ #  # ]:          0 :                 String aModStr( aModifiedCode.GetName() );
     244 [ #  # ][ #  # ]:          0 :                 aModStr.SearchAndReplace( aCode.GetName(), String() );
         [ #  # ][ #  # ]
                 [ #  # ]
     245 [ #  # ][ #  # ]:          0 :                 aModStr.SearchAndReplaceAllAscii( "+", String() );
                 [ #  # ]
     246 [ #  # ][ #  # ]:          0 :                 sTxt.SearchAndReplaceAllAscii( "%s", aModStr );
     247                 :            :             }
     248                 :          0 :             break;
     249                 :            : 
     250                 :            :             case SwContentAtPos::SW_FTN:
     251 [ #  # ][ #  # ]:          0 :                 if( aCntntAtPos.pFndTxtAttr && aCntntAtPos.aFnd.pAttr )
     252                 :            :                 {
     253                 :          0 :                     const SwFmtFtn* pFtn = (SwFmtFtn*)aCntntAtPos.aFnd.pAttr;
     254         [ #  # ]:          0 :                     pFtn->GetFtnText( sTxt );
     255                 :          0 :                     sTxt.Insert( SW_RESSTR( pFtn->IsEndNote()
     256 [ #  # ][ #  # ]:          0 :                                     ? STR_ENDNOTE : STR_FTNNOTE ), 0 );
         [ #  # ][ #  # ]
                 [ #  # ]
     257 [ #  # ][ #  # ]:          0 :                     if( aCntntAtPos.IsInRTLText() )
     258                 :          0 :                         nStyle |= QUICKHELP_BIDI_RTL;
     259                 :            :                 }
     260                 :          0 :                 break;
     261                 :            : 
     262                 :            :             case SwContentAtPos::SW_REDLINE:
     263         [ #  # ]:          0 :                 lcl_GetRedlineHelp( *aCntntAtPos.aFnd.pRedl, sTxt, bBalloon );
     264                 :          0 :                 break;
     265                 :            : 
     266                 :            :             case SwContentAtPos::SW_TOXMARK:
     267         [ #  # ]:          0 :                 sTxt = aCntntAtPos.sStr;
     268 [ #  # ][ #  # ]:          0 :                 if( sTxt.Len() && aCntntAtPos.pFndTxtAttr )
                 [ #  # ]
     269                 :            :                 {
     270                 :            :                     const SwTOXType* pTType = aCntntAtPos.pFndTxtAttr->
     271                 :          0 :                                         GetTOXMark().GetTOXType();
     272 [ #  # ][ #  # ]:          0 :                     if( pTType && pTType->GetTypeName().Len() )
                 [ #  # ]
     273                 :            :                     {
     274         [ #  # ]:          0 :                         sTxt.InsertAscii( ": ", 0 );
     275         [ #  # ]:          0 :                         sTxt.Insert( pTType->GetTypeName(), 0 );
     276                 :            :                     }
     277                 :            :                 }
     278                 :          0 :                 break;
     279                 :            :             case SwContentAtPos::SW_REFMARK:
     280         [ #  # ]:          0 :                 if(aCntntAtPos.aFnd.pAttr)
     281                 :            :                 {
     282 [ #  # ][ #  # ]:          0 :                     sTxt = SW_RESSTR(STR_CONTENT_TYPE_SINGLE_REFERENCE);
     283         [ #  # ]:          0 :                     sTxt.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": "));
     284         [ #  # ]:          0 :                     sTxt += ((const SwFmtRefMark*)aCntntAtPos.aFnd.pAttr)->GetRefName();
     285                 :            :                 }
     286                 :          0 :             break;
     287                 :            : 
     288                 :            :             default:
     289                 :            :                 {
     290         [ #  # ]:          0 :                     SwModuleOptions* pModOpt = SW_MOD()->GetModuleConfig();
     291         [ #  # ]:          0 :                     if(!pModOpt->IsHideFieldTips())
     292                 :            :                     {
     293                 :          0 :                         const SwField* pFld = aCntntAtPos.aFnd.pFld;
     294   [ #  #  #  #  :          0 :                         switch( pFld->Which() )
          #  #  #  #  #  
                      # ]
     295                 :            :                         {
     296                 :            :                         case RES_SETEXPFLD:
     297                 :            :                         case RES_TABLEFLD:
     298                 :            :                         case RES_GETEXPFLD:
     299                 :            :                         {
     300         [ #  # ]:          0 :                             sal_uInt16 nOldSubType = pFld->GetSubType();
     301         [ #  # ]:          0 :                             ((SwField*)pFld)->SetSubType(nsSwExtendedSubType::SUB_CMD);
     302 [ #  # ][ #  # ]:          0 :                             sTxt = pFld->ExpandField(true);
                 [ #  # ]
     303         [ #  # ]:          0 :                             ((SwField*)pFld)->SetSubType(nOldSubType);
     304                 :            :                         }
     305                 :          0 :                         break;
     306                 :            : 
     307                 :            :                         case RES_POSTITFLD:
     308                 :            :                             {
     309                 :          0 :                                 break;
     310                 :            :                             }
     311                 :            :                         case RES_INPUTFLD:  // BubbleHelp, because the suggestion could be quite long
     312                 :          0 :                             bBalloon = sal_True;
     313                 :            :                             /* no break */
     314                 :            :                         case RES_JUMPEDITFLD:
     315 [ #  # ][ #  # ]:          0 :                             sTxt = pFld->GetPar2();
     316                 :          0 :                             break;
     317                 :            : 
     318                 :            :                         case RES_DBFLD:
     319 [ #  # ][ #  # ]:          0 :                             sTxt = pFld->GetFieldName();
                 [ #  # ]
     320                 :          0 :                             break;
     321                 :            : 
     322                 :            :                         case RES_USERFLD:
     323                 :            :                         case RES_HIDDENTXTFLD:
     324 [ #  # ][ #  # ]:          0 :                             sTxt = pFld->GetPar1();
     325                 :          0 :                             break;
     326                 :            : 
     327                 :            :                         case RES_DOCSTATFLD:
     328                 :          0 :                             break;
     329                 :            : 
     330                 :            :                         case RES_MACROFLD:
     331         [ #  # ]:          0 :                             sTxt = ((const SwMacroField*)pFld)->GetMacro();
     332                 :          0 :                             break;
     333                 :            : 
     334                 :            :                         case RES_GETREFFLD:
     335                 :            :                         {
     336                 :            :                             // #i85090#
     337         [ #  # ]:          0 :                             const SwGetRefField* pRefFld( dynamic_cast<const SwGetRefField*>(pFld) );
     338                 :            :                             OSL_ENSURE( pRefFld,
     339                 :            :                                     "<SwEditWin::RequestHelp(..)> - unexpected type of <pFld>" );
     340         [ #  # ]:          0 :                             if ( pRefFld )
     341                 :            :                             {
     342 [ #  # ][ #  # ]:          0 :                                 if ( pRefFld->IsRefToHeadingCrossRefBookmark() ||
         [ #  # ][ #  # ]
     343         [ #  # ]:          0 :                                      pRefFld->IsRefToNumItemCrossRefBookmark() )
     344                 :            :                                 {
     345 [ #  # ][ #  # ]:          0 :                                     sTxt = pRefFld->GetExpandedTxtOfReferencedTxtNode();
                 [ #  # ]
     346         [ #  # ]:          0 :                                     if ( sTxt.Len() > 80  )
     347                 :            :                                     {
     348         [ #  # ]:          0 :                                         sTxt.Erase( 80 );
     349         [ #  # ]:          0 :                                         sTxt += '.';
     350         [ #  # ]:          0 :                                         sTxt += '.';
     351         [ #  # ]:          0 :                                         sTxt += '.';
     352                 :            :                                     }
     353                 :            :                                 }
     354                 :            :                                 else
     355                 :            :                                 {
     356         [ #  # ]:          0 :                                     sTxt = ((SwGetRefField*)pFld)->GetSetRefName();
     357                 :            :                                 }
     358                 :            :                             }
     359                 :            :                         }
     360                 :          0 :                         break;
     361                 :            :                         }
     362                 :            :                     }
     363                 :            : 
     364         [ #  # ]:          0 :                     if( !sTxt.Len() )
     365                 :            :                     {
     366                 :          0 :                         aCntntAtPos.eCntntAtPos = SwContentAtPos::SW_REDLINE;
     367 [ #  # ][ #  # ]:          0 :                         if( rSh.GetContentAtPos( aPos, aCntntAtPos, sal_False, &aFldRect ) )
     368                 :            :                             lcl_GetRedlineHelp( *aCntntAtPos.aFnd.pRedl,
     369         [ #  # ]:          0 :                                                     sTxt, bBalloon );
     370                 :            :                     }
     371                 :            :                 }
     372                 :            :             }
     373         [ #  # ]:          0 :             if (sTxt.Len() )
     374                 :            :             {
     375         [ #  # ]:          0 :                 if( bBalloon )
     376 [ #  # ][ #  # ]:          0 :                     Help::ShowBalloon( this, rEvt.GetMousePosPixel(), sTxt );
     377                 :            :                 else
     378                 :            :                 {
     379                 :            :                     // the show the help
     380         [ #  # ]:          0 :                     Rectangle aRect( aFldRect.SVRect() );
     381 [ #  # ][ #  # ]:          0 :                     Point aPt( OutputToScreenPixel( LogicToPixel( aRect.TopLeft() )));
     382                 :          0 :                     aRect.Left()   = aPt.X();
     383                 :          0 :                     aRect.Top()    = aPt.Y();
     384 [ #  # ][ #  # ]:          0 :                     aPt = OutputToScreenPixel( LogicToPixel( aRect.BottomRight() ));
                 [ #  # ]
     385                 :          0 :                     aRect.Right()  = aPt.X();
     386                 :          0 :                     aRect.Bottom() = aPt.Y();
     387         [ #  # ]:          0 :                     Help::ShowQuickHelp( this, aRect, sTxt, nStyle );
     388                 :            :                 }
     389                 :            :             }
     390                 :            : 
     391                 :          0 :             bWeiter = sal_False;
     392                 :            :         }
     393         [ #  # ]:          0 :         if( bWeiter )
     394                 :            :         {
     395         [ #  # ]:          0 :             sal_uInt8 nTabCols = rSh.WhichMouseTabCol(aPos);
     396                 :          0 :             sal_uInt16 nTabRes = 0;
     397   [ #  #  #  #  :          0 :             switch(nTabCols)
                   #  # ]
     398                 :            :             {
     399                 :            :                 case SW_TABCOL_HORI:
     400                 :            :                 case SW_TABCOL_VERT:
     401                 :          0 :                     nTabRes = STR_TABLE_COL_ADJUST;
     402                 :          0 :                     break;
     403                 :            :                 case SW_TABROW_HORI:
     404                 :            :                 case SW_TABROW_VERT:
     405                 :          0 :                     nTabRes = STR_TABLE_ROW_ADJUST;
     406                 :          0 :                     break;
     407                 :            :                 // #i32329# Enhanced table selection
     408                 :            :                 case SW_TABSEL_HORI:
     409                 :            :                 case SW_TABSEL_HORI_RTL:
     410                 :            :                 case SW_TABSEL_VERT:
     411                 :          0 :                     nTabRes = STR_TABLE_SELECT_ALL;
     412                 :          0 :                     break;
     413                 :            :                 case SW_TABROWSEL_HORI:
     414                 :            :                 case SW_TABROWSEL_HORI_RTL:
     415                 :            :                 case SW_TABROWSEL_VERT:
     416                 :          0 :                     nTabRes = STR_TABLE_SELECT_ROW;
     417                 :          0 :                     break;
     418                 :            :                 case SW_TABCOLSEL_HORI:
     419                 :            :                 case SW_TABCOLSEL_VERT:
     420                 :          0 :                     nTabRes = STR_TABLE_SELECT_COL;
     421                 :          0 :                     break;
     422                 :            :             }
     423         [ #  # ]:          0 :             if(nTabRes)
     424                 :            :             {
     425 [ #  # ][ #  # ]:          0 :                 sTxt = SW_RESSTR(nTabRes);
     426 [ #  # ][ #  # ]:          0 :                 Size aTxtSize( GetTextWidth(sTxt), GetTextHeight());
     427 [ #  # ][ #  # ]:          0 :                 Rectangle aRect(rEvt.GetMousePosPixel(), aTxtSize);
     428         [ #  # ]:          0 :                 Help::ShowQuickHelp(this, aRect, sTxt);
     429                 :            :             }
     430                 :          0 :             bWeiter = sal_False;
     431         [ #  # ]:          0 :         }
     432                 :            :     }
     433                 :            : 
     434 [ #  # ][ #  # ]:          0 :     if( bWeiter && pSdrView && bQuickBalloon)
                 [ #  # ]
     435                 :            :     {
     436         [ #  # ]:          0 :         SdrViewEvent aVEvt;
     437         [ #  # ]:          0 :         SdrHitKind eHit = pSdrView->PickAnything(aPos, aVEvt);
     438                 :            :         const SvxURLField *pField;
     439                 :          0 :         SdrObject* pObj = NULL;
     440                 :            : 
     441         [ #  # ]:          0 :         if ((pField = aVEvt.pURLField) != 0)
     442                 :            :         {
     443                 :            :             // hit an URL field
     444         [ #  # ]:          0 :             if (pField)
     445                 :            :             {
     446                 :          0 :                 pObj = aVEvt.pObj;
     447         [ #  # ]:          0 :                 sTxt = pField->GetURL();
     448                 :            : 
     449                 :          0 :                 bWeiter = sal_False;
     450                 :            :             }
     451                 :            :         }
     452 [ #  # ][ #  # ]:          0 :         if (bWeiter && eHit == SDRHIT_TEXTEDIT)
     453                 :            :         {
     454                 :            :             // look for URL field in DrawText object that is opened for editing
     455                 :          0 :             OutlinerView* pOLV = pSdrView->GetTextEditOutlinerView();
     456                 :            :             const SvxFieldItem* pFieldItem;
     457                 :            : 
     458         [ #  # ]:          0 :             if (pSdrView->AreObjectsMarked())
     459                 :            :             {
     460                 :          0 :                 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
     461                 :            : 
     462         [ #  # ]:          0 :                 if (rMarkList.GetMarkCount() == 1)
     463 [ #  # ][ #  # ]:          0 :                     pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
     464                 :            :             }
     465                 :            : 
     466 [ #  # ][ #  # ]:          0 :             if (pObj && pObj->ISA(SdrTextObj) && pOLV &&
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     467                 :            :                     (pFieldItem = pOLV->GetFieldUnderMousePointer()) != 0)
     468                 :            :             {
     469         [ #  # ]:          0 :                 pField = dynamic_cast<const SvxURLField*>(pFieldItem->GetField());
     470                 :            : 
     471         [ #  # ]:          0 :                 if (pField )
     472                 :            :                 {
     473         [ #  # ]:          0 :                     sTxt = ((const SvxURLField*) pField)->GetURL();
     474                 :          0 :                     bWeiter = sal_False;
     475                 :            :                 }
     476                 :            :             }
     477                 :            :         }
     478 [ #  # ][ #  # ]:          0 :         if (sTxt.Len() && pObj)
                 [ #  # ]
     479                 :            :         {
     480                 :            :             sTxt = URIHelper::removePassword( sTxt, INetURLObject::WAS_ENCODED,
     481 [ #  # ][ #  # ]:          0 :                                            INetURLObject::DECODE_UNAMBIGUOUS);
                 [ #  # ]
     482                 :            : 
     483 [ #  # ][ #  # ]:          0 :             Rectangle aLogicPix = LogicToPixel(pObj->GetLogicRect());
     484                 :          0 :             Rectangle aScreenRect(OutputToScreenPixel(aLogicPix.TopLeft()),
     485         [ #  # ]:          0 :                                 OutputToScreenPixel(aLogicPix.BottomRight()));
           [ #  #  #  # ]
                 [ #  # ]
     486                 :            : 
     487         [ #  # ]:          0 :             if (bBalloon)
     488 [ #  # ][ #  # ]:          0 :                 Help::ShowBalloon(this, rEvt.GetMousePosPixel(), aScreenRect, sTxt);
     489                 :            :             else
     490         [ #  # ]:          0 :                 Help::ShowQuickHelp(this, aScreenRect, sTxt);
     491         [ #  # ]:          0 :         }
     492                 :            :     }
     493                 :            : 
     494         [ #  # ]:          0 :     if( bWeiter )
     495 [ #  # ][ #  # ]:          0 :         Window::RequestHelp( rEvt );
                 [ #  # ]
     496                 :            : }
     497                 :            : 
     498                 :      11393 : void SwEditWin::PrePaint()
     499                 :            : {
     500                 :      11393 :     SwWrtShell* pWrtShell = GetView().GetWrtShellPtr();
     501                 :            : 
     502         [ +  - ]:      11393 :     if(pWrtShell)
     503                 :            :     {
     504                 :      11393 :         pWrtShell->PrePaint();
     505                 :            :     }
     506                 :      11393 : }
     507                 :            : 
     508                 :       6621 : void  SwEditWin::Paint(const Rectangle& rRect)
     509                 :            : {
     510                 :       6621 :     SwWrtShell* pWrtShell = GetView().GetWrtShellPtr();
     511         [ -  + ]:       6621 :     if(!pWrtShell)
     512                 :       6621 :         return;
     513                 :       6621 :     sal_Bool bPaintShadowCrsr = sal_False;
     514         [ -  + ]:       6621 :     if( pShadCrsr )
     515                 :            :     {
     516         [ #  # ]:          0 :         Rectangle aRect( pShadCrsr->GetRect());
     517                 :            :         // fully resides inside?
     518 [ #  # ][ #  # ]:          0 :         if( rRect.IsInside( aRect ) )
     519                 :            :             // dann aufheben
     520 [ #  # ][ #  # ]:          0 :             delete pShadCrsr, pShadCrsr = 0;
     521 [ #  # ][ #  # ]:          0 :         else if( rRect.IsOver( aRect ))
     522                 :            :         {
     523                 :            :             // resides somewhat above, then everything is clipped outside
     524                 :            :             // and we have to make the "inner part" at the end of the
     525                 :            :             // Paint visible again. Otherwise Paint errors occur!
     526                 :          0 :             bPaintShadowCrsr = sal_True;
     527                 :            :         }
     528                 :            :     }
     529                 :            : 
     530   [ +  -  -  + ]:      13242 :     if ( GetView().GetVisArea().GetWidth()  <= 0 ||
                 [ -  + ]
     531                 :       6621 :               GetView().GetVisArea().GetHeight() <= 0 )
     532                 :          0 :         Invalidate( rRect );
     533                 :            :     else
     534                 :       6621 :         pWrtShell->Paint( rRect );
     535                 :            : 
     536         [ -  + ]:       6621 :     if( bPaintShadowCrsr )
     537                 :          0 :         pShadCrsr->Paint();
     538                 :            : }
     539                 :            : 
     540                 :            : 
     541                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10