LCOV - code coverage report
Current view: top level - sw/source/ui/wrtsh - wrtsh2.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 210 0.0 %
Date: 2012-08-25 Functions: 0 11 0.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 374 0.0 %

           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                 :            : 
      30                 :            : #include <hintids.hxx>      // define ITEMIDs
      31                 :            : #include <svl/macitem.hxx>
      32                 :            : #include <sfx2/frame.hxx>
      33                 :            : #include <vcl/msgbox.hxx>
      34                 :            : #include <svl/urihelper.hxx>
      35                 :            : #include <svl/eitem.hxx>
      36                 :            : #include <svl/stritem.hxx>
      37                 :            : #include <sfx2/docfile.hxx>
      38                 :            : #include <sfx2/fcontnr.hxx>
      39                 :            : #include <sfx2/dispatch.hxx>
      40                 :            : #include <sfx2/linkmgr.hxx>
      41                 :            : #include <fmtinfmt.hxx>
      42                 :            : #include <frmatr.hxx>
      43                 :            : #include <swtypes.hxx>      // SET_CURR_SHELL
      44                 :            : #include <wrtsh.hxx>
      45                 :            : #include <docsh.hxx>
      46                 :            : #include <fldbas.hxx>       // Felder
      47                 :            : #include <expfld.hxx>
      48                 :            : #include <ddefld.hxx>
      49                 :            : #include <docufld.hxx>
      50                 :            : #include <reffld.hxx>
      51                 :            : #include <swundo.hxx>
      52                 :            : #include <doc.hxx>
      53                 :            : #include <IDocumentUndoRedo.hxx>
      54                 :            : #include <viewopt.hxx>      // SwViewOptions
      55                 :            : #include <frmfmt.hxx>       // fuer UpdateTable
      56                 :            : #include <swtable.hxx>      // fuer UpdateTable
      57                 :            : #include <mdiexp.hxx>
      58                 :            : #include <view.hxx>
      59                 :            : #include <swevent.hxx>
      60                 :            : #include <poolfmt.hxx>
      61                 :            : #include <section.hxx>
      62                 :            : #include <navicont.hxx>
      63                 :            : #include <navipi.hxx>
      64                 :            : #include <crsskip.hxx>
      65                 :            : #include <txtinet.hxx>
      66                 :            : #include <cmdid.h>
      67                 :            : #include <wrtsh.hrc>
      68                 :            : #include "swabstdlg.hxx"
      69                 :            : #include "fldui.hrc"
      70                 :            : #include <SwRewriter.hxx>
      71                 :            : 
      72                 :            : #include <com/sun/star/document/XDocumentProperties.hpp>
      73                 :            : #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
      74                 :            : 
      75                 :            : #include <xmloff/odffields.hxx>
      76                 :            : 
      77                 :          0 : void SwWrtShell::Insert(SwField &rFld, SwPaM *pCommentRange)
      78                 :            : {
      79         [ #  # ]:          0 :     ResetCursorStack();
      80 [ #  # ][ #  # ]:          0 :     if(!CanInsert())
      81                 :          0 :         return;
      82         [ #  # ]:          0 :     StartAllAction();
      83                 :            : 
      84         [ #  # ]:          0 :     SwRewriter aRewriter;
      85 [ #  # ][ #  # ]:          0 :     aRewriter.AddRule(UndoArg1, rFld.GetDescription());
                 [ #  # ]
      86                 :            : 
      87         [ #  # ]:          0 :     StartUndo(UNDO_INSERT, &aRewriter);
      88                 :            : 
      89 [ #  # ][ #  # ]:          0 :     if (pCommentRange && GetDoc())
                 [ #  # ]
      90                 :            :     {
      91                 :            :         // If an annotation field is inserted, take care of the relevant fieldmark.
      92         [ #  # ]:          0 :         IDocumentMarkAccess* pMarksAccess = GetDoc()->getIDocumentMarkAccess();
      93         [ #  # ]:          0 :         sw::mark::IFieldmark* pFieldmark = pMarksAccess->makeFieldBookmark(*pCommentRange, OUString(), ODF_COMMENTRANGE);
      94 [ #  # ][ #  # ]:          0 :         ((SwPostItField&)rFld).SetName(pFieldmark->GetName());
      95                 :            :     }
      96                 :            : 
      97                 :          0 :     bool bDeleted = false;
      98 [ #  # ][ #  # ]:          0 :     if( HasSelection() )
      99                 :            :     {
     100         [ #  # ]:          0 :         bDeleted = DelRight() != 0;
     101                 :            :     }
     102                 :            : 
     103         [ #  # ]:          0 :     SwEditShell::Insert2(rFld, bDeleted);
     104         [ #  # ]:          0 :     EndUndo();
     105 [ #  # ][ #  # ]:          0 :     EndAllAction();
     106                 :            : }
     107                 :            : 
     108                 :            : /*--------------------------------------------------------------------
     109                 :            :     Beschreibung: Felder Update anschmeissen
     110                 :            :  --------------------------------------------------------------------*/
     111                 :            : 
     112                 :            : 
     113                 :            : 
     114                 :          0 : void SwWrtShell::UpdateInputFlds( SwInputFieldList* pLst, sal_Bool bOnlyInSel )
     115                 :            : {
     116                 :            :     // ueber die Liste der Eingabefelder gehen und Updaten
     117                 :          0 :     SwInputFieldList* pTmp = pLst;
     118         [ #  # ]:          0 :     if( !pTmp )
     119         [ #  # ]:          0 :         pTmp = new SwInputFieldList( this );
     120                 :            : 
     121         [ #  # ]:          0 :     if (bOnlyInSel)
     122                 :          0 :         pTmp->RemoveUnselectedFlds();
     123                 :            : 
     124                 :          0 :     const sal_uInt16 nCnt = pTmp->Count();
     125         [ #  # ]:          0 :     if(nCnt)
     126                 :            :     {
     127         [ #  # ]:          0 :         pTmp->PushCrsr();
     128                 :            : 
     129                 :          0 :         sal_Bool bCancel = sal_False;
     130                 :          0 :         rtl::OString aDlgPos;
     131 [ #  # ][ #  # ]:          0 :         for( sal_uInt16 i = 0; i < nCnt && !bCancel; ++i )
                 [ #  # ]
     132                 :            :         {
     133         [ #  # ]:          0 :             pTmp->GotoFieldPos( i );
     134         [ #  # ]:          0 :             SwField* pField = pTmp->GetField( i );
     135         [ #  # ]:          0 :             if(pField->GetTyp()->Which() == RES_DROPDOWN)
     136         [ #  # ]:          0 :                 bCancel = StartDropDownFldDlg( pField, sal_True, &aDlgPos );
     137                 :            :             else
     138         [ #  # ]:          0 :                 bCancel = StartInputFldDlg( pField, sal_True, 0, &aDlgPos);
     139                 :            : 
     140                 :            :             // Sonst Updatefehler bei Multiselektion:
     141 [ #  # ][ #  # ]:          0 :             pTmp->GetField( i )->GetTyp()->UpdateFlds();
     142                 :            :         }
     143         [ #  # ]:          0 :         pTmp->PopCrsr();
     144                 :            :     }
     145                 :            : 
     146         [ #  # ]:          0 :     if( !pLst )
     147         [ #  # ]:          0 :         delete pTmp;
     148                 :          0 : }
     149                 :            : 
     150                 :            : 
     151                 :            : /*--------------------------------------------------------------------
     152                 :            :     Beschreibung: EingabeDialog fuer ein bestimmtes Feld starten
     153                 :            :  --------------------------------------------------------------------*/
     154                 :            : 
     155                 :            : 
     156                 :            : 
     157                 :          0 : sal_Bool SwWrtShell::StartInputFldDlg( SwField* pFld, sal_Bool bNextButton,
     158                 :            :                                     Window* pParentWin, rtl::OString* pWindowState )
     159                 :            : {
     160                 :            : 
     161                 :          0 :     SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
     162                 :            :     OSL_ENSURE(pFact, "Dialogdiet fail!");
     163                 :            :     AbstractFldInputDlg* pDlg = pFact->CreateFldInputDlg( DLG_FLD_INPUT,
     164                 :          0 :                                                         pParentWin, *this, pFld, bNextButton);
     165                 :            :     OSL_ENSURE(pDlg, "Dialogdiet fail!");
     166 [ #  # ][ #  # ]:          0 :     if(pWindowState && !pWindowState->isEmpty())
                 [ #  # ]
     167                 :          0 :         pDlg->SetWindowState(*pWindowState);
     168                 :          0 :     sal_Bool bRet = RET_CANCEL == pDlg->Execute();
     169         [ #  # ]:          0 :     if(pWindowState)
     170                 :          0 :         *pWindowState = pDlg->GetWindowState();
     171                 :            : 
     172         [ #  # ]:          0 :     delete pDlg;
     173                 :          0 :     GetWin()->Update();
     174                 :          0 :     return bRet;
     175                 :            : }
     176                 :            : 
     177                 :          0 : sal_Bool SwWrtShell::StartDropDownFldDlg(SwField* pFld, sal_Bool bNextButton, rtl::OString* pWindowState)
     178                 :            : {
     179                 :          0 :     SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
     180                 :            :     OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
     181                 :            : 
     182                 :          0 :     AbstractDropDownFieldDialog* pDlg = pFact->CreateDropDownFieldDialog( NULL, *this, pFld, DLG_FLD_DROPDOWN ,bNextButton );
     183                 :            :     OSL_ENSURE(pDlg, "Dialogdiet fail!");
     184 [ #  # ][ #  # ]:          0 :     if(pWindowState && !pWindowState->isEmpty())
                 [ #  # ]
     185                 :          0 :         pDlg->SetWindowState(*pWindowState);
     186                 :          0 :     sal_uInt16 nRet = pDlg->Execute();
     187         [ #  # ]:          0 :     if(pWindowState)
     188                 :          0 :         *pWindowState = pDlg->GetWindowState();
     189         [ #  # ]:          0 :     delete pDlg;
     190                 :          0 :     sal_Bool bRet = RET_CANCEL == nRet;
     191                 :          0 :     GetWin()->Update();
     192         [ #  # ]:          0 :     if(RET_YES == nRet)
     193                 :            :     {
     194                 :          0 :         GetView().GetViewFrame()->GetDispatcher()->Execute(FN_EDIT_FIELD, SFX_CALLMODE_SYNCHRON);
     195                 :            :     }
     196                 :          0 :     return bRet;
     197                 :            : }
     198                 :            : 
     199                 :            : /*--------------------------------------------------------------------
     200                 :            :     Beschreibung: Verzeichnis einfuegen Selektion loeschen
     201                 :            :  --------------------------------------------------------------------*/
     202                 :            : 
     203                 :            : 
     204                 :            : 
     205                 :          0 : void SwWrtShell::InsertTableOf(const SwTOXBase& rTOX, const SfxItemSet* pSet)
     206                 :            : {
     207         [ #  # ]:          0 :     if(!CanInsert())
     208                 :          0 :         return;
     209                 :            : 
     210         [ #  # ]:          0 :     if(HasSelection())
     211                 :          0 :         DelRight();
     212                 :            : 
     213                 :          0 :     SwEditShell::InsertTableOf(rTOX, pSet);
     214                 :            : }
     215                 :            : 
     216                 :            : 
     217                 :            : /*--------------------------------------------------------------------
     218                 :            :     Beschreibung: Verzeichnis Updaten Selektion loeschen
     219                 :            :  --------------------------------------------------------------------*/
     220                 :            : 
     221                 :          0 : sal_Bool SwWrtShell::UpdateTableOf(const SwTOXBase& rTOX, const SfxItemSet* pSet)
     222                 :            : {
     223                 :          0 :     sal_Bool bResult = sal_False;
     224                 :            : 
     225         [ #  # ]:          0 :     if(CanInsert())
     226                 :            :     {
     227                 :          0 :         bResult = SwEditShell::UpdateTableOf(rTOX, pSet);
     228                 :            : 
     229         [ #  # ]:          0 :         if (pSet == NULL)
     230                 :            :         {
     231                 :          0 :             SwDoc *const pDoc_ = GetDoc();
     232         [ #  # ]:          0 :             if (pDoc_)
     233                 :            :             {
     234                 :          0 :                 pDoc_->GetIDocumentUndoRedo().DelAllUndoObj();
     235                 :            :             }
     236                 :            :         }
     237                 :            :     }
     238                 :            : 
     239                 :          0 :     return bResult;
     240                 :            : }
     241                 :            : 
     242                 :            : // handler for click on the field given as parameter.
     243                 :            : // the cursor is positioned on the field.
     244                 :            : 
     245                 :            : 
     246                 :          0 : void SwWrtShell::ClickToField( const SwField& rFld )
     247                 :            : {
     248                 :          0 :     bIsInClickToEdit = sal_True;
     249   [ #  #  #  #  :          0 :     switch( rFld.GetTyp()->Which() )
                #  #  # ]
     250                 :            :     {
     251                 :            :     case RES_JUMPEDITFLD:
     252                 :            :         {
     253                 :          0 :             sal_uInt16 nSlotId = 0;
     254   [ #  #  #  #  :          0 :             switch( rFld.GetFormat() )
                      # ]
     255                 :            :             {
     256                 :            :             case JE_FMT_TABLE:
     257                 :          0 :                 nSlotId = FN_INSERT_TABLE;
     258                 :          0 :                 break;
     259                 :            : 
     260                 :            :             case JE_FMT_FRAME:
     261                 :          0 :                 nSlotId = FN_INSERT_FRAME;
     262                 :          0 :                 break;
     263                 :            : 
     264                 :          0 :             case JE_FMT_GRAPHIC:    nSlotId = SID_INSERT_GRAPHIC;       break;
     265                 :          0 :             case JE_FMT_OLE:        nSlotId = SID_INSERT_OBJECT;        break;
     266                 :            : 
     267                 :            :             }
     268                 :            : 
     269                 :          0 :             Right( CRSR_SKIP_CHARS, sal_True, 1, sal_False );       // Feld selektieren
     270                 :            : 
     271         [ #  # ]:          0 :             if( nSlotId )
     272                 :            :             {
     273                 :          0 :                 StartUndo( UNDO_START );
     274                 :            :                 //#97295# immediately select the right shell
     275                 :          0 :                 GetView().StopShellTimer();
     276                 :          0 :                 GetView().GetViewFrame()->GetDispatcher()->Execute( nSlotId,
     277                 :          0 :                             SFX_CALLMODE_SYNCHRON|SFX_CALLMODE_RECORD );
     278                 :          0 :                 EndUndo( UNDO_END );
     279                 :            :             }
     280                 :            :         }
     281                 :          0 :         break;
     282                 :            : 
     283                 :            :     case RES_MACROFLD:
     284                 :            :         {
     285                 :          0 :             const SwMacroField *pFld = (const SwMacroField*)&rFld;
     286 [ #  # ][ #  # ]:          0 :             String sText( rFld.GetPar2() );
     287         [ #  # ]:          0 :             String sRet( sText );
     288 [ #  # ][ #  # ]:          0 :             ExecMacro( pFld->GetSvxMacro(), &sRet );
                 [ #  # ]
     289                 :            : 
     290                 :            :             // return Wert veraendert?
     291 [ #  # ][ #  # ]:          0 :             if( sRet != sText )
     292                 :            :             {
     293         [ #  # ]:          0 :                 StartAllAction();
     294 [ #  # ][ #  # ]:          0 :                 ((SwField&)rFld).SetPar2( sRet );
     295         [ #  # ]:          0 :                 ((SwField&)rFld).GetTyp()->UpdateFlds();
     296         [ #  # ]:          0 :                 EndAllAction();
     297 [ #  # ][ #  # ]:          0 :             }
     298                 :            :         }
     299                 :          0 :         break;
     300                 :            : 
     301                 :            :     case RES_GETREFFLD:
     302                 :          0 :         StartAllAction();
     303                 :          0 :         SwCrsrShell::GotoRefMark( ((SwGetRefField&)rFld).GetSetRefName(),
     304                 :          0 :                                     ((SwGetRefField&)rFld).GetSubType(),
     305         [ #  # ]:          0 :                                     ((SwGetRefField&)rFld).GetSeqNo() );
     306                 :          0 :         EndAllAction();
     307                 :          0 :         break;
     308                 :            : 
     309                 :            :     case RES_INPUTFLD:
     310                 :          0 :         StartInputFldDlg( (SwField*)&rFld, sal_False );
     311                 :          0 :         break;
     312                 :            : 
     313                 :            :     case RES_SETEXPFLD:
     314         [ #  # ]:          0 :         if( ((SwSetExpField&)rFld).GetInputFlag() )
     315                 :          0 :             StartInputFldDlg( (SwField*)&rFld, sal_False );
     316                 :          0 :         break;
     317                 :            :     case RES_DROPDOWN :
     318                 :          0 :         StartDropDownFldDlg( (SwField*)&rFld, sal_False );
     319                 :          0 :     break;
     320                 :            :     }
     321                 :            : 
     322                 :          0 :     bIsInClickToEdit = sal_False;
     323                 :          0 : }
     324                 :            : 
     325                 :            : 
     326                 :            : 
     327                 :          0 : void SwWrtShell::ClickToINetAttr( const SwFmtINetFmt& rItem, sal_uInt16 nFilter )
     328                 :            : {
     329         [ #  # ]:          0 :     if( !rItem.GetValue().Len() )
     330                 :          0 :         return ;
     331                 :            : 
     332                 :          0 :     bIsInClickToEdit = sal_True;
     333                 :            : 
     334                 :            :     // erstmal das evt. gesetzte ObjectSelect Macro ausfuehren
     335                 :          0 :     const SvxMacro* pMac = rItem.GetMacro( SFX_EVENT_MOUSECLICK_OBJECT );
     336         [ #  # ]:          0 :     if( pMac )
     337                 :            :     {
     338                 :          0 :         SwCallMouseEvent aCallEvent;
     339                 :          0 :         aCallEvent.Set( &rItem );
     340         [ #  # ]:          0 :         GetDoc()->CallEvent( SFX_EVENT_MOUSECLICK_OBJECT, aCallEvent, sal_False );
     341                 :            :     }
     342                 :            : 
     343                 :            :     // damit die Vorlagenumsetzung sofort angezeigt wird
     344 [ #  # ][ #  # ]:          0 :     ::LoadURL( *this, rItem.GetValue(), nFilter, rItem.GetTargetFrame() );
     345                 :          0 :     const SwTxtINetFmt* pTxtAttr = rItem.GetTxtINetFmt();
     346         [ #  # ]:          0 :     if( pTxtAttr )
     347                 :            :     {
     348                 :          0 :         const_cast<SwTxtINetFmt*>(pTxtAttr)->SetVisited( true );
     349                 :          0 :         const_cast<SwTxtINetFmt*>(pTxtAttr)->SetVisitedValid( true );
     350                 :            :     }
     351                 :            : 
     352                 :          0 :     bIsInClickToEdit = sal_False;
     353                 :            : }
     354                 :            : 
     355                 :            : 
     356                 :            : 
     357                 :          0 : sal_Bool SwWrtShell::ClickToINetGrf( const Point& rDocPt, sal_uInt16 nFilter )
     358                 :            : {
     359                 :          0 :     sal_Bool bRet = sal_False;
     360         [ #  # ]:          0 :     String sURL;
     361         [ #  # ]:          0 :     String sTargetFrameName;
     362         [ #  # ]:          0 :     const SwFrmFmt* pFnd = IsURLGrfAtPos( rDocPt, &sURL, &sTargetFrameName );
     363 [ #  # ][ #  # ]:          0 :     if( pFnd && sURL.Len() )
                 [ #  # ]
     364                 :            :     {
     365                 :          0 :         bRet = sal_True;
     366                 :            :         // erstmal das evt. gesetzte ObjectSelect Macro ausfuehren
     367 [ #  # ][ #  # ]:          0 :         const SvxMacro* pMac = &pFnd->GetMacro().GetMacro( SFX_EVENT_MOUSECLICK_OBJECT );
     368         [ #  # ]:          0 :         if( pMac )
     369                 :            :         {
     370                 :          0 :             SwCallMouseEvent aCallEvent;
     371                 :          0 :             aCallEvent.Set( EVENT_OBJECT_URLITEM, pFnd );
     372         [ #  # ]:          0 :             GetDoc()->CallEvent( SFX_EVENT_MOUSECLICK_OBJECT, aCallEvent, sal_False );
     373                 :            :         }
     374                 :            : 
     375 [ #  # ][ #  # ]:          0 :         ::LoadURL(*this, sURL, nFilter, sTargetFrameName);
                 [ #  # ]
     376                 :            :     }
     377 [ #  # ][ #  # ]:          0 :     return bRet;
     378                 :            : }
     379                 :            : 
     380                 :            : 
     381                 :          0 : void LoadURL( ViewShell& rVSh, const rtl::OUString& rURL, sal_uInt16 nFilter,
     382                 :            :               const rtl::OUString& rTargetFrameName )
     383                 :            : {
     384                 :            :     OSL_ENSURE( !rURL.isEmpty(), "what should be loaded here?" );
     385         [ #  # ]:          0 :     if( rURL.isEmpty() )
     386                 :            :         return ;
     387                 :            : 
     388                 :            :     // die Shell kann auch 0 sein !!!!!
     389 [ #  # ][ #  # ]:          0 :     if ( !rVSh.ISA(SwCrsrShell) )
                 [ #  # ]
     390                 :            :         return;
     391                 :            : 
     392                 :            :     //Eine CrsrShell ist auch immer eine WrtShell
     393                 :          0 :     SwWrtShell &rSh = (SwWrtShell&)rVSh;
     394                 :            : 
     395         [ #  # ]:          0 :     SwDocShell* pDShell = rSh.GetView().GetDocShell();
     396                 :            :     OSL_ENSURE( pDShell, "No DocShell?!");
     397                 :          0 :     rtl::OUString sTargetFrame(rTargetFrameName);
     398 [ #  # ][ #  # ]:          0 :     if (sTargetFrame.isEmpty() && pDShell)
                 [ #  # ]
     399                 :            :     {
     400                 :            :         using namespace ::com::sun::star;
     401                 :            :         uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
     402 [ #  # ][ #  # ]:          0 :             pDShell->GetModel(), uno::UNO_QUERY_THROW);
     403                 :            :         uno::Reference<document::XDocumentProperties> xDocProps
     404 [ #  # ][ #  # ]:          0 :             = xDPS->getDocumentProperties();
     405 [ #  # ][ #  # ]:          0 :         sTargetFrame = xDocProps->getDefaultTarget();
     406                 :            :     }
     407                 :            : 
     408         [ #  # ]:          0 :     String sReferer;
     409 [ #  # ][ #  # ]:          0 :     if( pDShell && pDShell->GetMedium() )
                 [ #  # ]
     410 [ #  # ][ #  # ]:          0 :         sReferer = pDShell->GetMedium()->GetName();
     411                 :          0 :     SfxViewFrame* pViewFrm = rSh.GetView().GetViewFrame();
     412         [ #  # ]:          0 :     SfxFrameItem aView( SID_DOCFRAME, pViewFrm );
     413 [ #  # ][ #  # ]:          0 :     SfxStringItem aName( SID_FILE_NAME, rURL );
                 [ #  # ]
     414 [ #  # ][ #  # ]:          0 :     SfxStringItem aTargetFrameName( SID_TARGETNAME, sTargetFrame );
                 [ #  # ]
     415         [ #  # ]:          0 :     SfxStringItem aReferer( SID_REFERER, sReferer );
     416                 :            : 
     417         [ #  # ]:          0 :     SfxBoolItem aNewView( SID_OPEN_NEW_VIEW, sal_False );
     418                 :            :     //#39076# Silent kann lt. SFX entfernt werden.
     419         [ #  # ]:          0 :     SfxBoolItem aBrowse( SID_BROWSE, sal_True );
     420                 :            : 
     421         [ #  # ]:          0 :     if( nFilter & URLLOAD_NEWVIEW )
     422 [ #  # ][ #  # ]:          0 :         aTargetFrameName.SetValue( rtl::OUString("_blank") );
                 [ #  # ]
     423                 :            : 
     424                 :            :     const SfxPoolItem* aArr[] = {
     425                 :            :                 &aName,
     426                 :            :                 &aNewView, /*&aSilent,*/
     427                 :            :                 &aReferer,
     428                 :            :                 &aView, &aTargetFrameName,
     429                 :            :                 &aBrowse,
     430                 :            :                 0L
     431                 :          0 :     };
     432                 :            : 
     433                 :            :     pViewFrm->GetDispatcher()->GetBindings()->Execute( SID_OPENDOC, aArr,
     434 [ #  # ][ #  # ]:          0 :             SFX_CALLMODE_ASYNCHRON|SFX_CALLMODE_RECORD );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     435                 :            : }
     436                 :            : 
     437                 :          0 : void SwWrtShell::NavigatorPaste( const NaviContentBookmark& rBkmk,
     438                 :            :                                     const sal_uInt16 nAction )
     439                 :            : {
     440         [ #  # ]:          0 :     if( EXCHG_IN_ACTION_COPY == nAction )
     441                 :            :     {
     442                 :            :         // Einfuegen
     443         [ #  # ]:          0 :         String sURL = rBkmk.GetURL();
     444                 :            :         //handelt es sich um ein Sprung innerhalb des akt. Docs?
     445         [ #  # ]:          0 :         const SwDocShell* pDocShell = GetView().GetDocShell();
     446         [ #  # ]:          0 :         if(pDocShell->HasName())
     447                 :            :         {
     448 [ #  # ][ #  # ]:          0 :             const String rName = pDocShell->GetMedium()->GetURLObject().GetURLNoMark();
                 [ #  # ]
     449                 :            : 
     450 [ #  # ][ #  # ]:          0 :             if(COMPARE_EQUAL == sURL.CompareTo(rName, rName.Len()))
     451 [ #  # ][ #  # ]:          0 :                 sURL.Erase(0, rName.Len());
     452                 :            :         }
     453         [ #  # ]:          0 :         SwFmtINetFmt aFmt( sURL, aEmptyStr );
     454 [ #  # ][ #  # ]:          0 :         InsertURL( aFmt, rBkmk.GetDescription() );
                 [ #  # ]
     455                 :            :     }
     456                 :            :     else
     457                 :            :     {
     458 [ #  # ][ #  # ]:          0 :         SwSectionData aSection( FILE_LINK_SECTION, GetUniqueSectionName( 0 ) );
                 [ #  # ]
     459         [ #  # ]:          0 :         String aLinkFile( rBkmk.GetURL().GetToken(0, '#') );
     460         [ #  # ]:          0 :         aLinkFile += sfx2::cTokenSeperator;
     461         [ #  # ]:          0 :         aLinkFile += sfx2::cTokenSeperator;
     462 [ #  # ][ #  # ]:          0 :         aLinkFile += rBkmk.GetURL().GetToken(1, '#');
                 [ #  # ]
     463         [ #  # ]:          0 :         aSection.SetLinkFileName( aLinkFile );
     464                 :          0 :         aSection.SetProtectFlag( true );
     465         [ #  # ]:          0 :         const SwSection* pIns = InsertSection( aSection );
     466 [ #  # ][ #  # ]:          0 :         if( EXCHG_IN_ACTION_MOVE == nAction && pIns )
     467                 :            :         {
     468 [ #  # ][ #  # ]:          0 :             aSection = SwSectionData(*pIns);
                 [ #  # ]
     469         [ #  # ]:          0 :             aSection.SetLinkFileName( aEmptyStr );
     470                 :          0 :             aSection.SetType( CONTENT_SECTION );
     471                 :          0 :             aSection.SetProtectFlag( false );
     472                 :            : 
     473                 :            :             // the update of content from linked section at time delete
     474                 :            :             // the undostack. Then the change of the section dont create
     475                 :            :             // any undoobject. -  BUG 69145
     476         [ #  # ]:          0 :             sal_Bool bDoesUndo = DoesUndo();
     477                 :          0 :             SwUndoId nLastUndoId(UNDO_EMPTY);
     478 [ #  # ][ #  # ]:          0 :             if (GetLastUndoInfo(0, & nLastUndoId))
     479                 :            :             {
     480         [ #  # ]:          0 :                 if (UNDO_INSSECTION != nLastUndoId)
     481                 :            :                 {
     482         [ #  # ]:          0 :                     DoUndo(false);
     483                 :            :                 }
     484                 :            :             }
     485 [ #  # ][ #  # ]:          0 :             UpdateSection( GetSectionFmtPos( *pIns->GetFmt() ), aSection );
     486         [ #  # ]:          0 :             DoUndo( bDoesUndo );
     487 [ #  # ][ #  # ]:          0 :         }
     488                 :            :     }
     489                 :          0 : }
     490                 :            : 
     491                 :            : 
     492                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10