LCOV - code coverage report
Current view: top level - sc/source/ui/miscdlgs - acredlin.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 1082 0.0 %
Date: 2012-08-25 Functions: 0 64 0.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 1536 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 <comphelper/string.hxx>
      31                 :            : #include <svl/undo.hxx>
      32                 :            : #include <unotools/textsearch.hxx>
      33                 :            : #include <unotools/localedatawrapper.hxx>
      34                 :            : #include <unotools/collatorwrapper.hxx>
      35                 :            : #include <vcl/msgbox.hxx>
      36                 :            : #include <sfx2/app.hxx>
      37                 :            : #include <sfx2/viewfrm.hxx>
      38                 :            : 
      39                 :            : #include "acredlin.hxx"
      40                 :            : #include "global.hxx"
      41                 :            : #include "reffact.hxx"
      42                 :            : #include "document.hxx"
      43                 :            : #include "docsh.hxx"
      44                 :            : #include "scresid.hxx"
      45                 :            : #include "globstr.hrc"
      46                 :            : #include "acredlin.hrc"
      47                 :            : #include "simpref.hxx"
      48                 :            : #include "scmod.hxx"
      49                 :            : #include "popmenu.hxx"
      50                 :            : #include "tabvwsh.hxx"
      51                 :            : 
      52                 :            : // defines -------------------------------------------------------------------
      53                 :            : 
      54                 :            : #define ABS_SREF          SCA_VALID \
      55                 :            :                         | SCA_COL_ABSOLUTE | SCA_ROW_ABSOLUTE | SCA_TAB_ABSOLUTE
      56                 :            : #define ABS_DREF          ABS_SREF \
      57                 :            :                         | SCA_COL2_ABSOLUTE | SCA_ROW2_ABSOLUTE | SCA_TAB2_ABSOLUTE
      58                 :            : #define ABS_SREF3D      ABS_SREF | SCA_TAB_3D
      59                 :            : #define ABS_DREF3D      ABS_DREF | SCA_TAB_3D
      60                 :            : 
      61                 :            : #define ERRORBOX(s) ErrorBox(this,WinBits(WB_OK|WB_DEF_OK),s).Execute();
      62                 :            : 
      63                 :            : inline void EnableDisable( Window& rWin, bool bEnable )
      64                 :            : {
      65                 :            :     if (bEnable)
      66                 :            :         rWin.Enable();
      67                 :            :     else
      68                 :            :         rWin.Disable();
      69                 :            : }
      70                 :            : 
      71                 :            : #define RD_SPECIAL_NONE         0
      72                 :            : #define RD_SPECIAL_CONTENT      1
      73                 :            : #define RD_SPECIAL_VISCONTENT   2
      74                 :            : 
      75                 :            : //============================================================================
      76                 :            : //  class ScRedlinData
      77                 :            : //----------------------------------------------------------------------------
      78                 :          0 : ScRedlinData::ScRedlinData()
      79                 :          0 :     :RedlinData()
      80                 :            : {
      81                 :          0 :     nInfo=RD_SPECIAL_NONE;
      82                 :          0 :     nActionNo=0;
      83                 :          0 :     pData=NULL;
      84                 :          0 :     bDisabled=false;
      85                 :          0 :     bIsRejectable=false;
      86                 :          0 :     bIsAcceptable=false;
      87                 :          0 :     nTable=SCTAB_MAX;
      88                 :          0 :     nCol=SCCOL_MAX;
      89                 :          0 :     nRow=SCROW_MAX;
      90                 :          0 : }
      91                 :            : 
      92                 :          0 : ScRedlinData::~ScRedlinData()
      93                 :            : {
      94                 :          0 :     nInfo=RD_SPECIAL_NONE;
      95                 :          0 :     nActionNo=0;
      96                 :          0 :     pData=NULL;
      97                 :          0 :     bDisabled=false;
      98                 :          0 :     bIsRejectable=false;
      99                 :          0 :     bIsAcceptable=false;
     100         [ #  # ]:          0 : }
     101                 :            : 
     102                 :            : //============================================================================
     103                 :            : //  class ScAcceptChgDlg
     104                 :            : //----------------------------------------------------------------------------
     105                 :          0 : ScAcceptChgDlg::ScAcceptChgDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
     106                 :            :                       ScViewData*       ptrViewData)
     107                 :            : 
     108                 :            :     :   SfxModelessDialog( pB, pCW, pParent, ScResId(RID_SCDLG_CHANGES) ),
     109                 :            :         aAcceptChgCtr           ( this, ScResId( CTR_REDLINING ) ),
     110                 :            :         pViewData       ( ptrViewData ),
     111         [ #  # ]:          0 :         pDoc            ( ptrViewData->GetDocument() ),
     112         [ #  # ]:          0 :         aLocalRangeName ( *(pDoc->GetRangeName()) ),
     113                 :            :         aStrInsertCols       (SC_RESSTR(STR_INSERT_COLS)),
     114                 :            :         aStrInsertRows       (SC_RESSTR(STR_INSERT_ROWS)),
     115                 :            :         aStrInsertTabs       (SC_RESSTR(STR_INSERT_TABS)),
     116                 :            :         aStrDeleteCols       (SC_RESSTR(STR_DELETE_COLS)),
     117                 :            :         aStrDeleteRows       (SC_RESSTR(STR_DELETE_ROWS)),
     118                 :            :         aStrDeleteTabs       (SC_RESSTR(STR_DELETE_TABS)),
     119                 :            :         aStrMove             (SC_RESSTR(STR_MOVE)),
     120                 :            :         aStrContent          (SC_RESSTR(STR_CONTENT)),
     121                 :            :         aStrReject           (SC_RESSTR(STR_REJECT)),
     122                 :            :         aStrAllAccepted      (SC_RESSTR(STR_ACCEPTED)),
     123                 :            :         aStrAllRejected      (SC_RESSTR(STR_REJECTED)),
     124                 :            :         aStrNoEntry          (SC_RESSTR(STR_NO_ENTRY)),
     125                 :            :         aStrContentWithChild (SC_RESSTR(STR_CONTENT_WITH_CHILD)),
     126                 :            :         aStrChildContent     (SC_RESSTR(STR_CHILD_CONTENT)),
     127                 :            :         aStrChildOrgContent  (SC_RESSTR(STR_CHILD_ORGCONTENT)),
     128                 :            :         aStrEmpty            (SC_RESSTR(STR_EMPTY)),
     129                 :            :         aUnknown(RTL_CONSTASCII_USTRINGPARAM("Unknown")),
     130                 :            :         bAcceptEnableFlag(true),
     131                 :            :         bRejectEnableFlag(true),
     132                 :            :         bNeedsUpdate(false),
     133                 :            :         bIgnoreMsg(false),
     134                 :            :         bNoSelection(false),
     135                 :            :         bHasFilterEntry(false),
     136 [ #  # ][ #  # ]:          0 :         bUseColor(false)
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     137                 :            : {
     138         [ #  # ]:          0 :     FreeResource();
     139                 :          0 :     nAcceptCount=0;
     140                 :          0 :     nRejectCount=0;
     141         [ #  # ]:          0 :     aReOpenTimer.SetTimeout(50);
     142         [ #  # ]:          0 :     aReOpenTimer.SetTimeoutHdl(LINK( this, ScAcceptChgDlg, ReOpenTimerHdl ));
     143                 :            : 
     144                 :            :     //  dialog is now only hidden, not deleted, on switching views,
     145                 :            :     //  so there's no need to restore settings when reopening
     146         [ #  # ]:          0 :     MinSize=aAcceptChgCtr.GetMinSizePixel();
     147                 :          0 :     MinSize.Height()+=2;
     148                 :          0 :     MinSize.Width()+=2;
     149         [ #  # ]:          0 :     SetMinOutputSizePixel(MinSize);
     150                 :            : 
     151         [ #  # ]:          0 :     pTPFilter=aAcceptChgCtr.GetFilterPage();
     152         [ #  # ]:          0 :     pTPView=aAcceptChgCtr.GetViewPage();
     153         [ #  # ]:          0 :     pTheView=pTPView->GetTableControl();
     154         [ #  # ]:          0 :     aSelectionTimer.SetTimeout(100);
     155         [ #  # ]:          0 :     aSelectionTimer.SetTimeoutHdl(LINK( this, ScAcceptChgDlg, UpdateSelectionHdl ));
     156                 :            : 
     157         [ #  # ]:          0 :     pTPFilter->SetReadyHdl(LINK( this, ScAcceptChgDlg, FilterHandle ));
     158         [ #  # ]:          0 :     pTPFilter->SetRefHdl(LINK( this, ScAcceptChgDlg, RefHandle ));
     159         [ #  # ]:          0 :     pTPFilter->SetModifyHdl(LINK( this, ScAcceptChgDlg, FilterModified));
     160         [ #  # ]:          0 :     pTPFilter->HideRange(false);
     161         [ #  # ]:          0 :     pTPView->InsertCalcHeader();
     162         [ #  # ]:          0 :     pTPView->SetRejectClickHdl( LINK( this, ScAcceptChgDlg,RejectHandle));
     163         [ #  # ]:          0 :     pTPView->SetAcceptClickHdl( LINK(this, ScAcceptChgDlg, AcceptHandle));
     164         [ #  # ]:          0 :     pTPView->SetRejectAllClickHdl( LINK( this, ScAcceptChgDlg,RejectAllHandle));
     165         [ #  # ]:          0 :     pTPView->SetAcceptAllClickHdl( LINK(this, ScAcceptChgDlg, AcceptAllHandle));
     166         [ #  # ]:          0 :     pTheView->SetCalcView();
     167 [ #  # ][ #  # ]:          0 :     pTheView->SetStyle(pTheView->GetStyle()|WB_HASLINES|WB_CLIPCHILDREN|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL);
     168         [ #  # ]:          0 :     pTheView->SetExpandingHdl( LINK(this, ScAcceptChgDlg, ExpandingHandle));
     169         [ #  # ]:          0 :     pTheView->SetSelectHdl( LINK(this, ScAcceptChgDlg, SelectHandle));
     170         [ #  # ]:          0 :     pTheView->SetDeselectHdl( LINK(this, ScAcceptChgDlg, SelectHandle));
     171         [ #  # ]:          0 :     pTheView->SetCommandHdl( LINK(this, ScAcceptChgDlg, CommandHdl));
     172         [ #  # ]:          0 :     pTheView->SetColCompareHdl( LINK(this, ScAcceptChgDlg,ColCompareHdl));
     173         [ #  # ]:          0 :     pTheView->SetSelectionMode(MULTIPLE_SELECTION);
     174         [ #  # ]:          0 :     pTheView->SetHighlightRange(1);
     175                 :            : 
     176         [ #  # ]:          0 :     Init();
     177                 :            : 
     178         [ #  # ]:          0 :     aAcceptChgCtr.SetMinSizeHdl( LINK( this, ScAcceptChgDlg, MinSizeHandle ));
     179                 :            : 
     180         [ #  # ]:          0 :     UpdateView();
     181         [ #  # ]:          0 :     SvLBoxEntry* pEntry=pTheView->First();
     182         [ #  # ]:          0 :     if(pEntry!=NULL)
     183                 :            :     {
     184         [ #  # ]:          0 :         pTheView->Select(pEntry);
     185                 :            :     }
     186                 :          0 : }
     187 [ #  # ][ #  # ]:          0 : ScAcceptChgDlg::~ScAcceptChgDlg()
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     188                 :            : {
     189         [ #  # ]:          0 :     ClearView();
     190                 :          0 :     ScChangeTrack* pChanges=pDoc->GetChangeTrack();
     191                 :            : 
     192         [ #  # ]:          0 :     if(pChanges!=NULL)
     193                 :            :     {
     194         [ #  # ]:          0 :         Link aLink;
     195         [ #  # ]:          0 :         pChanges->SetModifiedLink(aLink);
     196                 :            :     }
     197         [ #  # ]:          0 : }
     198                 :            : 
     199                 :          0 : void ScAcceptChgDlg::ReInit(ScViewData* ptrViewData)
     200                 :            : {
     201                 :          0 :     pViewData=ptrViewData;
     202         [ #  # ]:          0 :     if(pViewData!=NULL)
     203                 :          0 :         pDoc=ptrViewData->GetDocument();
     204                 :            :     else
     205                 :          0 :         pDoc=NULL;
     206                 :            : 
     207                 :          0 :     bNoSelection=false;
     208                 :          0 :     bNeedsUpdate=false;
     209                 :          0 :     bIgnoreMsg=false;
     210                 :          0 :     nAcceptCount=0;
     211                 :          0 :     nRejectCount=0;
     212                 :          0 :     bAcceptEnableFlag=true;
     213                 :          0 :     bRejectEnableFlag=true;
     214                 :            : 
     215                 :            :     //  don't call Init here (switching between views), just set link below
     216                 :            :     //  (dialog is just hidden, not deleted anymore, when switching views)
     217                 :          0 :     ClearView();
     218                 :          0 :     UpdateView();
     219                 :            : 
     220         [ #  # ]:          0 :     if ( pDoc )
     221                 :            :     {
     222                 :          0 :         ScChangeTrack* pChanges = pDoc->GetChangeTrack();
     223         [ #  # ]:          0 :         if ( pChanges )
     224         [ #  # ]:          0 :             pChanges->SetModifiedLink( LINK( this, ScAcceptChgDlg, ChgTrackModHdl ) );
     225                 :            :     }
     226                 :          0 : }
     227                 :            : 
     228                 :          0 : void ScAcceptChgDlg::Init()
     229                 :            : {
     230         [ #  # ]:          0 :     String  aAreaStr;
     231                 :          0 :     ScRange aRange;
     232                 :            : 
     233                 :            :     OSL_ENSURE( pViewData && pDoc, "ViewData oder Document nicht gefunden!" );
     234                 :            : 
     235                 :          0 :     ScChangeTrack* pChanges=pDoc->GetChangeTrack();
     236                 :            : 
     237         [ #  # ]:          0 :     if(pChanges!=NULL)
     238                 :            :     {
     239 [ #  # ][ #  # ]:          0 :         pChanges->SetModifiedLink( LINK( this, ScAcceptChgDlg,ChgTrackModHdl));
     240         [ #  # ]:          0 :         aChangeViewSet.SetTheAuthorToShow(pChanges->GetUser());
     241         [ #  # ]:          0 :         pTPFilter->ClearAuthors();
     242         [ #  # ]:          0 :         const std::set<rtl::OUString>& rUserColl = pChanges->GetUserCollection();
     243                 :          0 :         std::set<rtl::OUString>::const_iterator it = rUserColl.begin(), itEnd = rUserColl.end();
     244         [ #  # ]:          0 :         for (; it != itEnd; ++it)
     245 [ #  # ][ #  # ]:          0 :             pTPFilter->InsertAuthor(*it);
                 [ #  # ]
     246                 :            :     }
     247                 :            : 
     248                 :          0 :     ScChangeViewSettings* pViewSettings=pDoc->GetChangeViewSettings();
     249         [ #  # ]:          0 :     if ( pViewSettings!=NULL )
     250         [ #  # ]:          0 :         aChangeViewSet = *pViewSettings;
     251                 :            :     // adjust TimeField for filter tabpage
     252         [ #  # ]:          0 :     aChangeViewSet.AdjustDateMode( *pDoc );
     253                 :            : 
     254         [ #  # ]:          0 :     pTPFilter->CheckDate(aChangeViewSet.HasDate());
     255         [ #  # ]:          0 :     pTPFilter->SetFirstDate(aChangeViewSet.GetTheFirstDateTime());
     256         [ #  # ]:          0 :     pTPFilter->SetFirstTime(aChangeViewSet.GetTheFirstDateTime());
     257         [ #  # ]:          0 :     pTPFilter->SetLastDate(aChangeViewSet.GetTheLastDateTime());
     258         [ #  # ]:          0 :     pTPFilter->SetLastTime(aChangeViewSet.GetTheLastDateTime());
     259         [ #  # ]:          0 :     pTPFilter->SetDateMode((sal_uInt16)aChangeViewSet.GetTheDateMode());
     260         [ #  # ]:          0 :     pTPFilter->CheckComment(aChangeViewSet.HasComment());
     261 [ #  # ][ #  # ]:          0 :     pTPFilter->SetComment(aChangeViewSet.GetTheComment());
                 [ #  # ]
     262                 :            : 
     263         [ #  # ]:          0 :     pTPFilter->CheckAuthor(aChangeViewSet.HasAuthor());
     264         [ #  # ]:          0 :     String aString=aChangeViewSet.GetTheAuthorToShow();
     265         [ #  # ]:          0 :     if(aString.Len()!=0)
     266                 :            :     {
     267         [ #  # ]:          0 :         pTPFilter->SelectAuthor(aString);
     268 [ #  # ][ #  # ]:          0 :         if(pTPFilter->GetSelectedAuthor()!=aString)
         [ #  # ][ #  # ]
     269                 :            :         {
     270         [ #  # ]:          0 :             pTPFilter->InsertAuthor(aString);
     271         [ #  # ]:          0 :             pTPFilter->SelectAuthor(aString);
     272                 :            :         }
     273                 :            :     }
     274                 :            :     else
     275         [ #  # ]:          0 :         pTPFilter->SelectedAuthorPos(0);
     276                 :            : 
     277         [ #  # ]:          0 :     pTPFilter->CheckRange(aChangeViewSet.HasRange());
     278                 :            : 
     279         [ #  # ]:          0 :     aRangeList=aChangeViewSet.GetTheRangeList();
     280                 :            : 
     281 [ #  # ][ #  # ]:          0 :     if( !aChangeViewSet.GetTheRangeList().empty() )
     282                 :            :     {
     283         [ #  # ]:          0 :         const ScRange* pRangeEntry = aChangeViewSet.GetTheRangeList().front();
     284         [ #  # ]:          0 :         String aRefStr;
     285         [ #  # ]:          0 :         pRangeEntry->Format( aRefStr, ABS_DREF3D, pDoc );
     286 [ #  # ][ #  # ]:          0 :         pTPFilter->SetRange(aRefStr);
     287                 :            :     }
     288                 :            : 
     289                 :          0 :     Point aPoint(1,1);
     290         [ #  # ]:          0 :     aAcceptChgCtr.SetPosPixel(aPoint);
     291 [ #  # ][ #  # ]:          0 :     InitFilter();
                 [ #  # ]
     292                 :          0 : }
     293                 :            : 
     294                 :            : 
     295                 :            : 
     296                 :          0 : void ScAcceptChgDlg::ClearView()
     297                 :            : {
     298                 :          0 :     nAcceptCount=0;
     299                 :          0 :     nRejectCount=0;
     300                 :          0 :     pTheView->SetUpdateMode(false);
     301                 :            : 
     302                 :          0 :     pTheView->Clear();
     303                 :          0 :     pTheView->SetUpdateMode(true);
     304                 :          0 : }
     305                 :            : 
     306                 :          0 : rtl::OUString* ScAcceptChgDlg::MakeTypeString(ScChangeActionType eType)
     307                 :            : {
     308                 :            :     rtl::OUString* pStr;
     309                 :            : 
     310   [ #  #  #  #  :          0 :     switch(eType)
          #  #  #  #  #  
                      # ]
     311                 :            :     {
     312                 :            : 
     313                 :          0 :         case SC_CAT_INSERT_COLS:    pStr=&aStrInsertCols;break;
     314                 :          0 :         case SC_CAT_INSERT_ROWS:    pStr=&aStrInsertRows;break;
     315                 :          0 :         case SC_CAT_INSERT_TABS:    pStr=&aStrInsertTabs;break;
     316                 :          0 :         case SC_CAT_DELETE_COLS:    pStr=&aStrDeleteCols;break;
     317                 :          0 :         case SC_CAT_DELETE_ROWS:    pStr=&aStrDeleteRows;break;
     318                 :          0 :         case SC_CAT_DELETE_TABS:    pStr=&aStrDeleteTabs;break;
     319                 :          0 :         case SC_CAT_MOVE:           pStr=&aStrMove;break;
     320                 :          0 :         case SC_CAT_CONTENT:        pStr=&aStrContent;break;
     321                 :          0 :         case SC_CAT_REJECT:         pStr=&aStrReject;break;
     322                 :          0 :         default:                    pStr=&aUnknown;break;
     323                 :            :     }
     324                 :          0 :     return pStr;
     325                 :            : }
     326                 :            : 
     327                 :            : 
     328                 :          0 : bool ScAcceptChgDlg::IsValidAction(const ScChangeAction* pScChangeAction)
     329                 :            : {
     330         [ #  # ]:          0 :     if(pScChangeAction==NULL) return false;
     331                 :            : 
     332                 :          0 :     bool bFlag = false;
     333                 :            : 
     334                 :          0 :     ScRange aRef=pScChangeAction->GetBigRange().MakeRange();
     335 [ #  # ][ #  # ]:          0 :     String aUser=pScChangeAction->GetUser();
     336         [ #  # ]:          0 :     DateTime aDateTime=pScChangeAction->GetDateTime();
     337                 :            : 
     338                 :          0 :     ScChangeActionType eType=pScChangeAction->GetType();
     339         [ #  # ]:          0 :     String aString;
     340                 :          0 :     rtl::OUString aDesc;
     341                 :            : 
     342 [ #  # ][ #  # ]:          0 :     String aComment = comphelper::string::remove(pScChangeAction->GetComment(), '\n');
     343                 :            : 
     344         [ #  # ]:          0 :     if(eType==SC_CAT_CONTENT)
     345                 :            :     {
     346 [ #  # ][ #  # ]:          0 :         if(!pScChangeAction->IsDialogParent())
     347         [ #  # ]:          0 :             pScChangeAction->GetDescription(aDesc, pDoc, true);
     348                 :            :     }
     349                 :            :     else
     350 [ #  # ][ #  # ]:          0 :         pScChangeAction->GetDescription(aDesc, pDoc, !pScChangeAction->IsMasterDelete());
     351                 :            : 
     352         [ #  # ]:          0 :     if (!aDesc.isEmpty())
     353                 :            :     {
     354         [ #  # ]:          0 :         aComment.AppendAscii(RTL_CONSTASCII_STRINGPARAM( " (" ));
     355 [ #  # ][ #  # ]:          0 :         aComment += String(aDesc);
                 [ #  # ]
     356         [ #  # ]:          0 :         aComment += ')';
     357                 :            :     }
     358                 :            : 
     359 [ #  # ][ #  # ]:          0 :     if(pTheView->IsValidEntry(&aUser,&aDateTime,&aComment))
     360                 :            :     {
     361 [ #  # ][ #  # ]:          0 :         if(pTPFilter->IsRange())
     362                 :            :         {
     363 [ #  # ][ #  # ]:          0 :             for ( size_t i = 0, nRanges = aRangeList.size(); i < nRanges; ++i )
     364                 :            :             {
     365         [ #  # ]:          0 :                 ScRange* pRangeEntry = aRangeList[ i ];
     366 [ #  # ][ #  # ]:          0 :                 if (pRangeEntry->Intersects(aRef)) {
     367                 :          0 :                     bFlag = true;
     368                 :          0 :                     break;
     369                 :            :                 }
     370                 :            :             }
     371                 :            :         }
     372                 :            :         else
     373                 :          0 :             bFlag=true;
     374                 :            :     }
     375                 :            : 
     376 [ #  # ][ #  # ]:          0 :     return bFlag;
                 [ #  # ]
     377                 :            : }
     378                 :            : 
     379                 :          0 : SvLBoxEntry* ScAcceptChgDlg::InsertChangeAction(
     380                 :            :     const ScChangeAction* pScChangeAction, ScChangeActionState /*eState*/,
     381                 :            :     SvLBoxEntry* pParent, bool bDelMaster,bool bDisabled, sal_uLong nPos)
     382                 :            : {
     383                 :          0 :     ScChangeTrack* pChanges=pDoc->GetChangeTrack();
     384                 :            : 
     385 [ #  # ][ #  # ]:          0 :     if(pScChangeAction==NULL || pChanges==NULL) return NULL;
     386                 :            : 
     387                 :          0 :     SvLBoxEntry* pEntry=NULL;
     388                 :            : 
     389                 :          0 :     bool bFlag = false;
     390                 :            : 
     391                 :          0 :     ScRange aRef=pScChangeAction->GetBigRange().MakeRange();
     392 [ #  # ][ #  # ]:          0 :     String aUser=pScChangeAction->GetUser();
     393         [ #  # ]:          0 :     DateTime aDateTime=pScChangeAction->GetDateTime();
     394                 :            : 
     395                 :          0 :     rtl::OUString aRefStr;
     396                 :          0 :     ScChangeActionType eType=pScChangeAction->GetType();
     397                 :          0 :     rtl::OUStringBuffer aBuf;
     398                 :          0 :     rtl::OUString aDesc;
     399                 :            : 
     400 [ #  # ][ #  # ]:          0 :     ScRedlinData* pNewData=new ScRedlinData;
     401                 :          0 :     pNewData->pData=(void *)pScChangeAction;
     402                 :          0 :     pNewData->nActionNo=pScChangeAction->GetActionNumber();
     403         [ #  # ]:          0 :     pNewData->bIsAcceptable=pScChangeAction->IsClickable();
     404         [ #  # ]:          0 :     pNewData->bIsRejectable=pScChangeAction->IsRejectable();
     405                 :          0 :     pNewData->bDisabled=!pNewData->bIsAcceptable | bDisabled;
     406         [ #  # ]:          0 :     pNewData->aDateTime=aDateTime;
     407                 :          0 :     pNewData->nRow  = aRef.aStart.Row();
     408                 :          0 :     pNewData->nCol  = aRef.aStart.Col();
     409                 :          0 :     pNewData->nTable= aRef.aStart.Tab();
     410                 :            : 
     411         [ #  # ]:          0 :     if(eType==SC_CAT_CONTENT)
     412                 :            :     {
     413 [ #  # ][ #  # ]:          0 :         if(pScChangeAction->IsDialogParent())
     414                 :            :         {
     415         [ #  # ]:          0 :             aBuf.append(aStrContentWithChild);
     416                 :          0 :             pNewData->nInfo=RD_SPECIAL_VISCONTENT;
     417                 :          0 :             pNewData->bIsRejectable=false;
     418                 :          0 :             pNewData->bIsAcceptable=false;
     419                 :            :         }
     420                 :            :         else
     421                 :            :         {
     422         [ #  # ]:          0 :             aBuf.append(*MakeTypeString(eType));
     423         [ #  # ]:          0 :             pScChangeAction->GetDescription( aDesc, pDoc, true);
     424                 :            :         }
     425                 :            :     }
     426                 :            :     else
     427                 :            :     {
     428         [ #  # ]:          0 :         aBuf.append(aStrContentWithChild);
     429                 :            : 
     430         [ #  # ]:          0 :         if(bDelMaster)
     431                 :            :         {
     432         [ #  # ]:          0 :             pScChangeAction->GetDescription( aDesc, pDoc,true);
     433                 :          0 :             pNewData->bDisabled=true;
     434                 :          0 :             pNewData->bIsRejectable=false;
     435                 :            :         }
     436                 :            :         else
     437 [ #  # ][ #  # ]:          0 :             pScChangeAction->GetDescription( aDesc, pDoc,!pScChangeAction->IsMasterDelete());
     438                 :            : 
     439                 :            :     }
     440                 :            : 
     441         [ #  # ]:          0 :     pScChangeAction->GetRefString(aRefStr, pDoc, true);
     442                 :            : 
     443         [ #  # ]:          0 :     aBuf.append(sal_Unicode('\t'));
     444         [ #  # ]:          0 :     aBuf.append(aRefStr);
     445         [ #  # ]:          0 :     aBuf.append(sal_Unicode('\t'));
     446                 :            : 
     447                 :          0 :     bool bIsGenerated = false;
     448                 :            : 
     449         [ #  # ]:          0 :     if(!pChanges->IsGenerated(pScChangeAction->GetActionNumber()))
     450                 :            :     {
     451 [ #  # ][ #  # ]:          0 :         aBuf.append(aUser);
     452         [ #  # ]:          0 :         aBuf.append(sal_Unicode('\t'));
     453 [ #  # ][ #  # ]:          0 :         aBuf.append(ScGlobal::pLocaleData->getDate(aDateTime));
     454         [ #  # ]:          0 :         aBuf.append(sal_Unicode(' '));
     455 [ #  # ][ #  # ]:          0 :         aBuf.append(ScGlobal::pLocaleData->getTime(aDateTime));
     456         [ #  # ]:          0 :         aBuf.append(sal_Unicode('\t'));
     457                 :            : 
     458                 :          0 :         bIsGenerated = false;
     459                 :            :     }
     460                 :            :     else
     461                 :            :     {
     462         [ #  # ]:          0 :         aBuf.append(sal_Unicode('\t'));
     463         [ #  # ]:          0 :         aBuf.append(sal_Unicode('\t'));
     464                 :          0 :         bIsGenerated = true;
     465                 :            :     }
     466                 :            : 
     467 [ #  # ][ #  # ]:          0 :     String aComment = comphelper::string::remove(pScChangeAction->GetComment(), '\n');
     468                 :            : 
     469         [ #  # ]:          0 :     if (!aDesc.isEmpty())
     470                 :            :     {
     471         [ #  # ]:          0 :         aComment.AppendAscii(RTL_CONSTASCII_STRINGPARAM( " (" ));
     472 [ #  # ][ #  # ]:          0 :         aComment += String(aDesc);
                 [ #  # ]
     473         [ #  # ]:          0 :         aComment += ')';
     474                 :            :     }
     475                 :            : 
     476 [ #  # ][ #  # ]:          0 :     aBuf.append(aComment);
     477                 :            : 
     478 [ #  # ][ #  # ]:          0 :     if(pTheView->IsValidEntry(&aUser,&aDateTime)|| bIsGenerated)
         [ #  # ][ #  # ]
     479                 :            :     {
     480 [ #  # ][ #  # ]:          0 :         if(pTheView->IsValidComment(&aComment))
     481                 :            :         {
     482 [ #  # ][ #  # ]:          0 :             if(pTPFilter->IsRange())
     483                 :            :             {
     484 [ #  # ][ #  # ]:          0 :                 for ( size_t i = 0, nRanges = aRangeList.size(); i < nRanges; ++i )
     485                 :            :                 {
     486         [ #  # ]:          0 :                     ScRange* pRangeEntry = aRangeList[ i ];
     487 [ #  # ][ #  # ]:          0 :                     if( pRangeEntry->Intersects(aRef) )
     488                 :            :                     {
     489                 :          0 :                         bHasFilterEntry=true;
     490                 :          0 :                         bFlag=true;
     491                 :          0 :                         break;
     492                 :            :                     }
     493                 :            :                 }
     494                 :            :             }
     495         [ #  # ]:          0 :             else if(!bIsGenerated)
     496                 :            :             {
     497                 :          0 :                 bHasFilterEntry=true;
     498                 :          0 :                 bFlag=true;
     499                 :            :             }
     500                 :            :         }
     501                 :            :     }
     502                 :            : 
     503 [ #  # ][ #  # ]:          0 :     if(!bFlag&& bUseColor&& pParent==NULL)
                 [ #  # ]
     504                 :            :     {
     505                 :            :         pEntry = pTheView->InsertEntry(
     506 [ #  # ][ #  # ]:          0 :             aBuf.makeStringAndClear() ,pNewData, Color(COL_LIGHTBLUE), pParent, nPos);
         [ #  # ][ #  # ]
     507                 :            :     }
     508 [ #  # ][ #  # ]:          0 :     else if(bFlag&& bUseColor&& pParent!=NULL)
                 [ #  # ]
     509                 :            :     {
     510                 :            :         pEntry = pTheView->InsertEntry(
     511 [ #  # ][ #  # ]:          0 :             aBuf.makeStringAndClear(), pNewData, Color(COL_GREEN), pParent, nPos);
         [ #  # ][ #  # ]
     512                 :          0 :         SvLBoxEntry* pExpEntry=pParent;
     513                 :            : 
     514 [ #  # ][ #  # ]:          0 :         while(pExpEntry!=NULL && !pTheView->IsExpanded(pExpEntry))
         [ #  # ][ #  # ]
     515                 :            :         {
     516         [ #  # ]:          0 :             SvLBoxEntry* pTmpEntry=pTheView->GetParent(pExpEntry);
     517                 :            : 
     518 [ #  # ][ #  # ]:          0 :             if(pTmpEntry!=NULL) pTheView->Expand(pExpEntry);
     519                 :            : 
     520                 :          0 :             pExpEntry=pTmpEntry;
     521                 :          0 :         }
     522                 :            :     }
     523                 :            :     else
     524                 :            :     {
     525                 :            :         pEntry = pTheView->InsertEntry(
     526 [ #  # ][ #  # ]:          0 :             aBuf.makeStringAndClear(), pNewData, pParent, nPos);
         [ #  # ][ #  # ]
     527                 :            :     }
     528 [ #  # ][ #  # ]:          0 :     return pEntry;
     529                 :            : }
     530                 :            : 
     531                 :          0 : SvLBoxEntry* ScAcceptChgDlg::InsertFilteredAction(
     532                 :            :     const ScChangeAction* pScChangeAction, ScChangeActionState eState,
     533                 :            :     SvLBoxEntry* pParent, bool bDelMaster, bool bDisabled, sal_uLong nPos)
     534                 :            : {
     535                 :            : 
     536                 :          0 :     ScChangeTrack* pChanges=pDoc->GetChangeTrack();
     537                 :            : 
     538 [ #  # ][ #  # ]:          0 :     if(pScChangeAction==NULL || pChanges==NULL) return NULL;
     539                 :            : 
     540                 :          0 :     bool bIsGenerated = pChanges->IsGenerated(pScChangeAction->GetActionNumber());
     541                 :            : 
     542                 :          0 :     SvLBoxEntry* pEntry=NULL;
     543                 :            : 
     544                 :          0 :     bool bFlag = false;
     545                 :            : 
     546                 :          0 :     ScRange aRef=pScChangeAction->GetBigRange().MakeRange();
     547 [ #  # ][ #  # ]:          0 :     String aUser=pScChangeAction->GetUser();
     548         [ #  # ]:          0 :     DateTime aDateTime=pScChangeAction->GetDateTime();
     549                 :            : 
     550 [ #  # ][ #  # ]:          0 :     if(pTheView->IsValidEntry(&aUser,&aDateTime)||bIsGenerated)
         [ #  # ][ #  # ]
     551                 :            :     {
     552 [ #  # ][ #  # ]:          0 :         if(pTPFilter->IsRange())
     553                 :            :         {
     554 [ #  # ][ #  # ]:          0 :             for ( size_t i = 0, nRanges = aRangeList.size(); i < nRanges; ++i )
     555                 :            :             {
     556         [ #  # ]:          0 :                 ScRange* pRangeEntry=aRangeList[ i ];
     557 [ #  # ][ #  # ]:          0 :                 if( pRangeEntry->Intersects(aRef) )
     558                 :            :                 {
     559         [ #  # ]:          0 :                     if( pScChangeAction->GetState()==eState )
     560                 :          0 :                         bFlag = true;
     561                 :          0 :                     break;
     562                 :            :                 }
     563                 :            :             }
     564                 :            :         }
     565 [ #  # ][ #  # ]:          0 :         else if(pScChangeAction->GetState()==eState && !bIsGenerated)
                 [ #  # ]
     566                 :          0 :             bFlag = true;
     567                 :            :     }
     568                 :            : 
     569         [ #  # ]:          0 :     if(bFlag)
     570                 :            :     {
     571                 :            : 
     572                 :          0 :         rtl::OUString aRefStr;
     573                 :          0 :         ScChangeActionType eType=pScChangeAction->GetType();
     574         [ #  # ]:          0 :         String aString;
     575                 :          0 :         rtl::OUString aDesc;
     576                 :            : 
     577 [ #  # ][ #  # ]:          0 :         ScRedlinData* pNewData=new ScRedlinData;
     578                 :          0 :         pNewData->pData=(void *)pScChangeAction;
     579                 :          0 :         pNewData->nActionNo=pScChangeAction->GetActionNumber();
     580         [ #  # ]:          0 :         pNewData->bIsAcceptable=pScChangeAction->IsClickable();
     581         [ #  # ]:          0 :         pNewData->bIsRejectable=pScChangeAction->IsRejectable();
     582                 :          0 :         pNewData->bDisabled=!pNewData->bIsAcceptable | bDisabled;
     583         [ #  # ]:          0 :         pNewData->aDateTime=aDateTime;
     584                 :          0 :         pNewData->nRow  = aRef.aStart.Row();
     585                 :          0 :         pNewData->nCol  = aRef.aStart.Col();
     586                 :          0 :         pNewData->nTable= aRef.aStart.Tab();
     587                 :            : 
     588         [ #  # ]:          0 :         if(eType==SC_CAT_CONTENT)
     589                 :            :         {
     590 [ #  # ][ #  # ]:          0 :             if(pScChangeAction->IsDialogParent())
     591                 :            :             {
     592         [ #  # ]:          0 :                 aString=aStrContentWithChild;
     593                 :          0 :                 pNewData->nInfo=RD_SPECIAL_VISCONTENT;
     594                 :          0 :                 pNewData->bIsRejectable=false;
     595                 :          0 :                 pNewData->bIsAcceptable=false;
     596                 :            :             }
     597                 :            :             else
     598                 :            :             {
     599         [ #  # ]:          0 :                 aString=*MakeTypeString(eType);
     600         [ #  # ]:          0 :                 pScChangeAction->GetDescription( aDesc, pDoc, true);
     601                 :            :             }
     602                 :            :         }
     603                 :            :         else
     604                 :            :         {
     605         [ #  # ]:          0 :             aString=*MakeTypeString(eType);
     606                 :            : 
     607         [ #  # ]:          0 :             if(bDelMaster)
     608                 :            :             {
     609         [ #  # ]:          0 :                 pScChangeAction->GetDescription( aDesc, pDoc,true);
     610                 :          0 :                 pNewData->bDisabled=true;
     611                 :          0 :                 pNewData->bIsRejectable=false;
     612                 :            :             }
     613                 :            :             else
     614 [ #  # ][ #  # ]:          0 :                 pScChangeAction->GetDescription( aDesc, pDoc,!pScChangeAction->IsMasterDelete());
     615                 :            : 
     616                 :            :         }
     617                 :            : 
     618         [ #  # ]:          0 :         aString+='\t';
     619         [ #  # ]:          0 :         pScChangeAction->GetRefString(aRefStr, pDoc, true);
     620         [ #  # ]:          0 :         aString+=aRefStr;
     621         [ #  # ]:          0 :         aString+='\t';
     622                 :            : 
     623         [ #  # ]:          0 :         if(!bIsGenerated)
     624                 :            :         {
     625         [ #  # ]:          0 :             aString+=aUser;
     626         [ #  # ]:          0 :             aString+='\t';
     627 [ #  # ][ #  # ]:          0 :             aString+=ScGlobal::pLocaleData->getDate(aDateTime);
     628         [ #  # ]:          0 :             aString+=' ';
     629 [ #  # ][ #  # ]:          0 :             aString+=ScGlobal::pLocaleData->getTime(aDateTime);
     630         [ #  # ]:          0 :             aString+='\t';
     631                 :            :         }
     632                 :            :         else
     633                 :            :         {
     634         [ #  # ]:          0 :             aString+='\t';
     635         [ #  # ]:          0 :             aString+='\t';
     636                 :            :         }
     637                 :            : 
     638 [ #  # ][ #  # ]:          0 :         String aComment = comphelper::string::remove(pScChangeAction->GetComment(), '\n');
     639                 :            : 
     640         [ #  # ]:          0 :         if (!aDesc.isEmpty())
     641                 :            :         {
     642         [ #  # ]:          0 :             aComment.AppendAscii(RTL_CONSTASCII_STRINGPARAM( " (" ));
     643 [ #  # ][ #  # ]:          0 :             aComment += String(aDesc);
                 [ #  # ]
     644         [ #  # ]:          0 :             aComment += ')';
     645                 :            :         }
     646 [ #  # ][ #  # ]:          0 :         if(pTheView->IsValidComment(&aComment))
     647                 :            :         {
     648         [ #  # ]:          0 :             aString+=aComment;
     649         [ #  # ]:          0 :             pEntry=pTheView->InsertEntry(aString,pNewData,pParent,nPos);
     650                 :            :         }
     651                 :            :         else
     652 [ #  # ][ #  # ]:          0 :             delete pNewData;
         [ #  # ][ #  # ]
     653                 :            :     }
     654         [ #  # ]:          0 :     return pEntry;
     655                 :            : }
     656                 :            : 
     657                 :          0 : SvLBoxEntry* ScAcceptChgDlg::InsertChangeActionContent(const ScChangeActionContent* pScChangeAction,
     658                 :            :                                                           SvLBoxEntry* pParent, sal_uLong nSpecial)
     659                 :            : {
     660                 :          0 :     ScChangeTrack* pChanges=pDoc->GetChangeTrack();
     661                 :          0 :     SvLBoxEntry* pEntry=NULL;
     662                 :            : 
     663 [ #  # ][ #  # ]:          0 :     if(pScChangeAction==NULL || pChanges==NULL) return NULL;
     664                 :            : 
     665                 :          0 :     bool bIsGenerated = pChanges->IsGenerated(pScChangeAction->GetActionNumber());
     666                 :            : 
     667                 :          0 :     bool bFlag = false;
     668                 :            : 
     669                 :          0 :     ScRange aRef=pScChangeAction->GetBigRange().MakeRange();
     670 [ #  # ][ #  # ]:          0 :     String aUser=pScChangeAction->GetUser();
     671         [ #  # ]:          0 :     DateTime aDateTime=pScChangeAction->GetDateTime();
     672                 :            : 
     673 [ #  # ][ #  # ]:          0 :     if(pTheView->IsValidEntry(&aUser,&aDateTime)||bIsGenerated)
         [ #  # ][ #  # ]
     674                 :            :     {
     675 [ #  # ][ #  # ]:          0 :         if(pTPFilter->IsRange())
     676                 :            :         {
     677 [ #  # ][ #  # ]:          0 :             for ( size_t i = 0, nRanges = aRangeList.size(); i < nRanges; ++i )
     678                 :            :             {
     679         [ #  # ]:          0 :                 ScRange* pRangeEntry = aRangeList[ i ];
     680 [ #  # ][ #  # ]:          0 :                 if( pRangeEntry->Intersects(aRef) )
     681                 :            :                 {
     682                 :          0 :                     bFlag=true;
     683                 :          0 :                     break;
     684                 :            :                 }
     685                 :            :             }
     686                 :            :         }
     687         [ #  # ]:          0 :         else if(!bIsGenerated)
     688                 :          0 :             bFlag=true;
     689                 :            :     }
     690                 :            : 
     691                 :          0 :     rtl::OUString aRefStr;
     692         [ #  # ]:          0 :     String aString;
     693         [ #  # ]:          0 :     String a2String;
     694         [ #  # ]:          0 :     String aDesc;
     695                 :            : 
     696         [ #  # ]:          0 :     if(nSpecial==RD_SPECIAL_CONTENT)
     697                 :            :     {
     698                 :          0 :         rtl::OUString aTmp;
     699         [ #  # ]:          0 :         pScChangeAction->GetOldString(aTmp);
     700         [ #  # ]:          0 :         a2String = aTmp;
     701 [ #  # ][ #  # ]:          0 :         if(a2String.Len()==0) a2String=aStrEmpty;
     702                 :            : 
     703                 :            :         //aString+="\'";
     704         [ #  # ]:          0 :         aString+=a2String;
     705                 :            :         //aString+="\'";
     706                 :            : 
     707         [ #  # ]:          0 :         aDesc=aStrChildOrgContent;
     708         [ #  # ]:          0 :         aDesc.AppendAscii(RTL_CONSTASCII_STRINGPARAM( ": " ));
     709                 :            :     }
     710                 :            :     else
     711                 :            :     {
     712                 :          0 :         rtl::OUString aTmp;
     713         [ #  # ]:          0 :         pScChangeAction->GetNewString(aTmp);
     714         [ #  # ]:          0 :         a2String = aTmp;
     715         [ #  # ]:          0 :         if(a2String.Len()==0)
     716                 :            :         {
     717         [ #  # ]:          0 :             a2String=aStrEmpty;
     718         [ #  # ]:          0 :             aString+=a2String;
     719                 :            :         }
     720                 :            :         else
     721                 :            :         {
     722         [ #  # ]:          0 :             aString+='\'';
     723         [ #  # ]:          0 :             aString+=a2String;
     724         [ #  # ]:          0 :             aString+='\'';
     725         [ #  # ]:          0 :             a2String=aString;
     726                 :            :         }
     727         [ #  # ]:          0 :         aDesc=aStrChildContent;
     728                 :            : 
     729                 :            :     }
     730                 :            : 
     731         [ #  # ]:          0 :     aDesc+=a2String;
     732         [ #  # ]:          0 :     aString+='\t';
     733         [ #  # ]:          0 :     pScChangeAction->GetRefString(aRefStr, pDoc, true);
     734         [ #  # ]:          0 :     aString+=aRefStr;
     735         [ #  # ]:          0 :     aString+='\t';
     736                 :            : 
     737         [ #  # ]:          0 :     if(!bIsGenerated)
     738                 :            :     {
     739         [ #  # ]:          0 :         aString+=aUser;
     740         [ #  # ]:          0 :         aString+='\t';
     741                 :            : 
     742 [ #  # ][ #  # ]:          0 :         aString+=ScGlobal::pLocaleData->getDate(aDateTime);
     743         [ #  # ]:          0 :         aString+=' ';
     744 [ #  # ][ #  # ]:          0 :         aString+=ScGlobal::pLocaleData->getTime(aDateTime);
     745         [ #  # ]:          0 :         aString+='\t';
     746                 :            :     }
     747                 :            :     else
     748                 :            :     {
     749         [ #  # ]:          0 :         aString+='\t';
     750         [ #  # ]:          0 :         aString+='\t';
     751                 :            :     }
     752                 :            : 
     753 [ #  # ][ #  # ]:          0 :     String aComment = comphelper::string::remove(pScChangeAction->GetComment(), '\n');
     754                 :            : 
     755         [ #  # ]:          0 :     if(aDesc.Len()>0)
     756                 :            :     {
     757         [ #  # ]:          0 :         aComment.AppendAscii(RTL_CONSTASCII_STRINGPARAM( " (" ));
     758         [ #  # ]:          0 :         aComment+=aDesc;
     759         [ #  # ]:          0 :         aComment+=')';
     760                 :            :     }
     761                 :            : 
     762         [ #  # ]:          0 :     aString+=aComment;
     763                 :            : 
     764 [ #  # ][ #  # ]:          0 :     ScRedlinData* pNewData=new ScRedlinData;
     765                 :          0 :     pNewData->nInfo=nSpecial;
     766                 :          0 :     pNewData->pData=(void *)pScChangeAction;
     767                 :          0 :     pNewData->nActionNo=pScChangeAction->GetActionNumber();
     768         [ #  # ]:          0 :     pNewData->bIsAcceptable=pScChangeAction->IsClickable();
     769                 :          0 :     pNewData->bIsRejectable=false;
     770                 :          0 :     pNewData->bDisabled=!pNewData->bIsAcceptable;
     771         [ #  # ]:          0 :     pNewData->aDateTime=aDateTime;
     772                 :          0 :     pNewData->nRow  = aRef.aStart.Row();
     773                 :          0 :     pNewData->nCol  = aRef.aStart.Col();
     774                 :          0 :     pNewData->nTable= aRef.aStart.Tab();
     775                 :            : 
     776 [ #  # ][ #  # ]:          0 :     if(pTheView->IsValidComment(&aComment) && bFlag)
         [ #  # ][ #  # ]
     777                 :            :     {
     778                 :          0 :         bHasFilterEntry=true;
     779         [ #  # ]:          0 :         pEntry=pTheView->InsertEntry(aString,pNewData,pParent);
     780                 :            :     }
     781                 :            :     else
     782         [ #  # ]:          0 :         pEntry=pTheView->InsertEntry(aString,pNewData,Color(COL_LIGHTBLUE),pParent);
     783 [ #  # ][ #  # ]:          0 :     return pEntry;
         [ #  # ][ #  # ]
                 [ #  # ]
     784                 :            : }
     785                 :            : 
     786                 :          0 : long ScAcceptChgDlg::PreNotify( NotifyEvent& rNEvt )
     787                 :            : {
     788 [ #  # ][ #  # ]:          0 :     if(rNEvt.GetType()==EVENT_GETFOCUS && bNeedsUpdate)
                 [ #  # ]
     789                 :            :     {
     790                 :          0 :         ClearView();
     791                 :          0 :         UpdateView();
     792                 :          0 :         bNoSelection=false;
     793                 :            :     }
     794                 :            : 
     795                 :          0 :     return SfxModelessDialog::PreNotify(rNEvt);
     796                 :            : }
     797                 :            : 
     798                 :            : 
     799                 :          0 : void ScAcceptChgDlg::UpdateView()
     800                 :            : {
     801                 :          0 :     bNeedsUpdate=false;
     802                 :          0 :     SvLBoxEntry* pParent=NULL;
     803                 :          0 :     ScChangeTrack* pChanges=NULL;
     804                 :          0 :     const ScChangeAction* pScChangeAction=NULL;
     805                 :          0 :     bAcceptEnableFlag=true;
     806                 :          0 :     bRejectEnableFlag=true;
     807         [ #  # ]:          0 :     SetPointer(Pointer(POINTER_WAIT));
     808                 :          0 :     pTheView->SetUpdateMode(false);
     809                 :          0 :     bool bFilterFlag = pTPFilter->IsDate() || pTPFilter->IsRange() ||
     810 [ #  # ][ #  # ]:          0 :         pTPFilter->IsAuthor() || pTPFilter->IsComment();
           [ #  #  #  # ]
     811                 :            : 
     812                 :          0 :     bUseColor = bFilterFlag;
     813                 :            : 
     814         [ #  # ]:          0 :     if(pDoc!=NULL)
     815                 :            :     {
     816                 :          0 :         pChanges=pDoc->GetChangeTrack();
     817         [ #  # ]:          0 :         if(pChanges!=NULL)
     818                 :          0 :             pScChangeAction=pChanges->GetFirst();
     819                 :            :     }
     820                 :          0 :     bool bTheFlag = false;
     821                 :            : 
     822         [ #  # ]:          0 :     while(pScChangeAction!=NULL)
     823                 :            :     {
     824                 :          0 :         bHasFilterEntry=false;
     825   [ #  #  #  # ]:          0 :         switch(pScChangeAction->GetState())
     826                 :            :         {
     827                 :            :             case SC_CAS_VIRGIN:
     828                 :            : 
     829         [ #  # ]:          0 :                 if(pScChangeAction->IsDialogRoot())
     830                 :            :                 {
     831         [ #  # ]:          0 :                     if(pScChangeAction->IsDialogParent())
     832                 :          0 :                         pParent=InsertChangeAction(pScChangeAction,SC_CAS_VIRGIN);
     833                 :            :                     else
     834                 :          0 :                         pParent=InsertFilteredAction(pScChangeAction,SC_CAS_VIRGIN);
     835                 :            :                 }
     836                 :            :                 else
     837                 :          0 :                     pParent=NULL;
     838                 :            : 
     839                 :          0 :                 bTheFlag=true;
     840                 :          0 :                 break;
     841                 :            : 
     842                 :            :             case SC_CAS_ACCEPTED:
     843                 :          0 :                 pParent=NULL;
     844                 :          0 :                 nAcceptCount++;
     845                 :          0 :                 break;
     846                 :            : 
     847                 :            :             case SC_CAS_REJECTED:
     848                 :          0 :                 pParent=NULL;
     849                 :          0 :                 nRejectCount++;
     850                 :          0 :                 break;
     851                 :            :         }
     852                 :            : 
     853 [ #  # ][ #  # ]:          0 :         if(pParent!=NULL && pScChangeAction->IsDialogParent())
                 [ #  # ]
     854                 :            :         {
     855         [ #  # ]:          0 :             if(!bFilterFlag)
     856                 :          0 :                 pParent->EnableChildrenOnDemand(true);
     857                 :            :             else
     858                 :            :             {
     859                 :          0 :                 bool bTestFlag = bHasFilterEntry;
     860                 :          0 :                 bHasFilterEntry=false;
     861 [ #  # ][ #  # ]:          0 :                 if(Expand(pChanges,pScChangeAction,pParent,!bTestFlag)&&!bTestFlag)
                 [ #  # ]
     862                 :          0 :                     pTheView->RemoveEntry(pParent);
     863                 :            :             }
     864                 :            :         }
     865                 :            : 
     866                 :          0 :         pScChangeAction=pScChangeAction->GetNext();
     867                 :            :     }
     868                 :            : 
     869 [ #  # ][ #  # ]:          0 :     if( bTheFlag && (!pDoc->IsDocEditable() || pChanges->IsProtected()) )
         [ #  # ][ #  # ]
     870                 :          0 :         bTheFlag=false;
     871                 :            : 
     872                 :          0 :     pTPView->EnableAccept(bTheFlag);
     873                 :          0 :     pTPView->EnableAcceptAll(bTheFlag);
     874                 :          0 :     pTPView->EnableReject(bTheFlag);
     875                 :          0 :     pTPView->EnableRejectAll(bTheFlag);
     876                 :            : 
     877         [ #  # ]:          0 :     if(nAcceptCount>0)
     878                 :            :     {
     879                 :            :         pParent=pTheView->InsertEntry(
     880                 :            :             aStrAllAccepted, static_cast< RedlinData * >(NULL),
     881         [ #  # ]:          0 :             static_cast< SvLBoxEntry * >(NULL));
     882                 :          0 :         pParent->EnableChildrenOnDemand(true);
     883                 :            :     }
     884         [ #  # ]:          0 :     if(nRejectCount>0)
     885                 :            :     {
     886                 :            :         pParent=pTheView->InsertEntry(
     887                 :            :             aStrAllRejected, static_cast< RedlinData * >(NULL),
     888         [ #  # ]:          0 :             static_cast< SvLBoxEntry * >(NULL));
     889                 :          0 :         pParent->EnableChildrenOnDemand(true);
     890                 :            :     }
     891                 :          0 :     pTheView->SetUpdateMode(true);
     892         [ #  # ]:          0 :     SetPointer(Pointer(POINTER_ARROW));
     893                 :          0 :     SvLBoxEntry* pEntry=pTheView->First();
     894         [ #  # ]:          0 :     if(pEntry!=NULL)
     895                 :          0 :         pTheView->Select(pEntry);
     896                 :          0 : }
     897                 :            : 
     898                 :            : //----------------------------------------------------------------------------
     899                 :          0 : sal_Bool ScAcceptChgDlg::Close()
     900                 :            : {
     901                 :          0 :     return SfxModelessDialog::Close();
     902                 :            : }
     903                 :            : 
     904                 :          0 : void ScAcceptChgDlg::Resize()
     905                 :            : {
     906         [ #  # ]:          0 :     SfxModelessDialog::Resize();
     907                 :          0 :     Size aOutSize=GetOutputSizePixel();
     908         [ #  # ]:          0 :     aAcceptChgCtr.SetSizePixel(aOutSize);
     909                 :          0 : }
     910                 :            : 
     911                 :          0 : IMPL_LINK( ScAcceptChgDlg, MinSizeHandle, SvxAcceptChgCtr*, pCtr )
     912                 :            : {
     913         [ #  # ]:          0 :     if(pCtr==&aAcceptChgCtr)
     914         [ #  # ]:          0 :         if(!IsRollUp())
     915                 :          0 :             SetOutputSizePixel(MinSize);
     916                 :          0 :     return 0;
     917                 :            : }
     918                 :            : 
     919                 :          0 : IMPL_LINK_NOARG(ScAcceptChgDlg, RefHandle)
     920                 :            : {
     921                 :          0 :     sal_uInt16 nId  =ScSimpleRefDlgWrapper::GetChildWindowId();
     922                 :            : 
     923                 :          0 :     ScSimpleRefDlgWrapper::SetDefaultPosSize(GetPosPixel(),GetSizePixel(),true);
     924                 :            : 
     925                 :          0 :     SC_MOD()->SetRefDialog( nId, true );
     926                 :            : 
     927                 :          0 :     SfxViewFrame* pViewFrm = pViewData->GetViewShell()->GetViewFrame();
     928                 :          0 :     ScSimpleRefDlgWrapper* pWnd =(ScSimpleRefDlgWrapper*)pViewFrm->GetChildWindow( nId );
     929                 :            : 
     930         [ #  # ]:          0 :     if(pWnd!=NULL)
     931                 :            :     {
     932                 :          0 :         sal_uInt16 nAcceptId=ScAcceptChgDlgWrapper::GetChildWindowId();
     933                 :          0 :         pViewFrm->ShowChildWindow(nAcceptId,false);
     934         [ #  # ]:          0 :         pWnd->SetCloseHdl(LINK( this, ScAcceptChgDlg,RefInfoHandle));
     935         [ #  # ]:          0 :         pWnd->SetRefString(pTPFilter->GetRange());
     936                 :          0 :         pWnd->SetAutoReOpen(false);
     937                 :          0 :         Window* pWin=pWnd->GetWindow();
     938 [ #  # ][ #  # ]:          0 :         pWin->SetPosSizePixel(GetPosPixel(),GetSizePixel());
     939                 :          0 :         Hide();
     940         [ #  # ]:          0 :         pWin->SetText(GetText());
     941                 :          0 :         pWnd->StartRefInput();
     942                 :            :     }
     943                 :          0 :     return 0;
     944                 :            : }
     945                 :            : 
     946                 :          0 : IMPL_LINK( ScAcceptChgDlg, RefInfoHandle, String*, pResult)
     947                 :            : {
     948                 :            :     sal_uInt16 nId;
     949                 :            : 
     950                 :          0 :     ScSimpleRefDlgWrapper::SetAutoReOpen(true);
     951                 :            : 
     952                 :          0 :     SfxViewFrame* pViewFrm = pViewData->GetViewShell()->GetViewFrame();
     953         [ #  # ]:          0 :     if(pResult!=NULL)
     954                 :            :     {
     955                 :          0 :         pTPFilter->SetRange(*pResult);
     956                 :          0 :         FilterHandle(pTPFilter);
     957                 :            : 
     958                 :          0 :         nId = ScSimpleRefDlgWrapper::GetChildWindowId();
     959                 :          0 :         ScSimpleRefDlgWrapper* pWnd = (ScSimpleRefDlgWrapper*)pViewFrm->GetChildWindow( nId );
     960                 :            : 
     961         [ #  # ]:          0 :         if(pWnd!=NULL)
     962                 :            :         {
     963                 :          0 :             Window* pWin=pWnd->GetWindow();
     964         [ #  # ]:          0 :             Size aWinSize=pWin->GetSizePixel();
     965         [ #  # ]:          0 :             aWinSize.Width()=GetSizePixel().Width();
     966 [ #  # ][ #  # ]:          0 :             SetPosSizePixel(pWin->GetPosPixel(),aWinSize);
     967         [ #  # ]:          0 :             Invalidate();
     968                 :            :         }
     969                 :          0 :         nId = ScAcceptChgDlgWrapper::GetChildWindowId();
     970                 :          0 :         pViewFrm->ShowChildWindow( nId, true );
     971                 :            :     }
     972                 :            :     else
     973                 :            :     {
     974                 :          0 :         nId = ScAcceptChgDlgWrapper::GetChildWindowId();
     975                 :          0 :         pViewFrm->SetChildWindow( nId, false );
     976                 :            :     }
     977                 :          0 :     return 0;
     978                 :            : }
     979                 :            : 
     980                 :          0 : IMPL_LINK( ScAcceptChgDlg, FilterHandle, SvxTPFilter*, pRef )
     981                 :            : {
     982         [ #  # ]:          0 :     if(pRef!=NULL)
     983                 :            :     {
     984                 :          0 :         ClearView();
     985                 :          0 :         aRangeList.RemoveAll();
     986         [ #  # ]:          0 :         aRangeList.Parse(pTPFilter->GetRange(),pDoc);
     987                 :          0 :         UpdateView();
     988                 :            :     }
     989                 :          0 :     return 0;
     990                 :            : }
     991                 :            : 
     992                 :          0 : IMPL_LINK( ScAcceptChgDlg, RejectHandle, SvxTPView*, pRef )
     993                 :            : {
     994         [ #  # ]:          0 :     SetPointer(Pointer(POINTER_WAIT));
     995                 :            : 
     996                 :          0 :     bIgnoreMsg=true;
     997                 :          0 :     ScChangeTrack* pChanges=pDoc->GetChangeTrack();
     998                 :            : 
     999         [ #  # ]:          0 :     if(pRef!=NULL)
    1000                 :            :     {
    1001                 :          0 :         SvLBoxEntry* pEntry=pTheView->FirstSelected();
    1002         [ #  # ]:          0 :         while(pEntry!=NULL)
    1003                 :            :         {
    1004                 :          0 :             ScRedlinData *pEntryData=(ScRedlinData *)(pEntry->GetUserData());
    1005         [ #  # ]:          0 :             if(pEntryData!=NULL)
    1006                 :            :             {
    1007                 :            :                 ScChangeAction* pScChangeAction=
    1008                 :          0 :                         (ScChangeAction*) pEntryData->pData;
    1009                 :            : 
    1010         [ #  # ]:          0 :                 if(pScChangeAction->GetType()==SC_CAT_INSERT_TABS)
    1011                 :          0 :                     pViewData->SetTabNo(0);
    1012                 :            : 
    1013                 :          0 :                 pChanges->Reject(pScChangeAction);
    1014                 :            :             }
    1015                 :          0 :             pEntry = pTheView->NextSelected(pEntry);
    1016                 :            :         }
    1017                 :          0 :         ScDocShell* pDocSh=pViewData->GetDocShell();
    1018                 :          0 :         pDocSh->PostPaintExtras();
    1019                 :          0 :         pDocSh->PostPaintGridAll();
    1020                 :          0 :         pDocSh->GetUndoManager()->Clear();
    1021                 :          0 :         pDocSh->SetDocumentModified();
    1022                 :          0 :         ClearView();
    1023                 :          0 :         UpdateView();
    1024                 :            :     }
    1025         [ #  # ]:          0 :     SetPointer(Pointer(POINTER_ARROW));
    1026                 :            : 
    1027                 :          0 :     bIgnoreMsg=false;
    1028                 :          0 :     return 0;
    1029                 :            : }
    1030                 :          0 : IMPL_LINK( ScAcceptChgDlg, AcceptHandle, SvxTPView*, pRef )
    1031                 :            : {
    1032         [ #  # ]:          0 :     SetPointer(Pointer(POINTER_WAIT));
    1033                 :            : 
    1034                 :          0 :     ScChangeTrack* pChanges=pDoc->GetChangeTrack();
    1035                 :          0 :     bIgnoreMsg=true;
    1036         [ #  # ]:          0 :     if(pRef!=NULL)
    1037                 :            :     {
    1038                 :          0 :         SvLBoxEntry* pEntry=pTheView->FirstSelected();
    1039         [ #  # ]:          0 :         while(pEntry!=NULL)
    1040                 :            :         {
    1041                 :          0 :             ScRedlinData *pEntryData=(ScRedlinData *)(pEntry->GetUserData());
    1042         [ #  # ]:          0 :             if(pEntryData!=NULL)
    1043                 :            :             {
    1044                 :            :                 ScChangeAction* pScChangeAction=
    1045                 :          0 :                         (ScChangeAction*) pEntryData->pData;
    1046         [ #  # ]:          0 :                 if(pScChangeAction->GetType()==SC_CAT_CONTENT)
    1047                 :            :                 {
    1048         [ #  # ]:          0 :                     if(pEntryData->nInfo==RD_SPECIAL_CONTENT)
    1049                 :          0 :                         pChanges->SelectContent(pScChangeAction,true);
    1050                 :            :                     else
    1051                 :          0 :                         pChanges->SelectContent(pScChangeAction);
    1052                 :            :                 }
    1053                 :            :                 else
    1054                 :          0 :                     pChanges->Accept(pScChangeAction);
    1055                 :            :             }
    1056                 :          0 :             pEntry = pTheView->NextSelected(pEntry);
    1057                 :            :         }
    1058                 :          0 :         ScDocShell* pDocSh=pViewData->GetDocShell();
    1059                 :          0 :         pDocSh->PostPaintExtras();
    1060                 :          0 :         pDocSh->PostPaintGridAll();
    1061                 :          0 :         pDocSh->SetDocumentModified();
    1062                 :          0 :         ClearView();
    1063                 :          0 :         UpdateView();
    1064                 :            :     }
    1065                 :          0 :     bIgnoreMsg=false;
    1066                 :            : 
    1067                 :          0 :     return 0;
    1068                 :            : }
    1069                 :            : 
    1070                 :          0 : void ScAcceptChgDlg::RejectFiltered()
    1071                 :            : {
    1072         [ #  # ]:          0 :     if(pDoc==NULL) return;
    1073                 :          0 :     ScChangeTrack* pChanges=pDoc->GetChangeTrack();
    1074                 :          0 :     const ScChangeAction* pScChangeAction=NULL;
    1075                 :            : 
    1076         [ #  # ]:          0 :     if(pChanges!=NULL)
    1077                 :            :     {
    1078                 :          0 :         pScChangeAction=pChanges->GetLast();
    1079                 :            :     }
    1080                 :            : 
    1081         [ #  # ]:          0 :     while(pScChangeAction!=NULL)
    1082                 :            :     {
    1083         [ #  # ]:          0 :         if(pScChangeAction->IsDialogRoot())
    1084         [ #  # ]:          0 :             if(IsValidAction(pScChangeAction))
    1085                 :          0 :                 pChanges->Reject((ScChangeAction*)pScChangeAction);
    1086                 :            : 
    1087                 :          0 :         pScChangeAction=pScChangeAction->GetPrev();
    1088                 :            :     }
    1089                 :            : }
    1090                 :          0 : void ScAcceptChgDlg::AcceptFiltered()
    1091                 :            : {
    1092         [ #  # ]:          0 :     if(pDoc==NULL) return;
    1093                 :          0 :     ScChangeTrack* pChanges=pDoc->GetChangeTrack();
    1094                 :          0 :     const ScChangeAction* pScChangeAction=NULL;
    1095                 :            : 
    1096         [ #  # ]:          0 :     if(pChanges!=NULL)
    1097                 :          0 :         pScChangeAction=pChanges->GetLast();
    1098                 :            : 
    1099         [ #  # ]:          0 :     while(pScChangeAction!=NULL)
    1100                 :            :     {
    1101         [ #  # ]:          0 :         if(pScChangeAction->IsDialogRoot())
    1102         [ #  # ]:          0 :             if(IsValidAction(pScChangeAction))
    1103                 :          0 :                 pChanges->Accept((ScChangeAction*)pScChangeAction);
    1104                 :            : 
    1105                 :          0 :         pScChangeAction=pScChangeAction->GetPrev();
    1106                 :            :     }
    1107                 :            : }
    1108                 :            : 
    1109                 :          0 : IMPL_LINK_NOARG(ScAcceptChgDlg, RejectAllHandle)
    1110                 :            : {
    1111         [ #  # ]:          0 :     SetPointer(Pointer(POINTER_WAIT));
    1112                 :          0 :     bIgnoreMsg=true;
    1113                 :          0 :     ScChangeTrack* pChanges=pDoc->GetChangeTrack();
    1114         [ #  # ]:          0 :     if(pChanges!=NULL)
    1115                 :            :     {
    1116 [ #  # ][ #  # ]:          0 :         if(pTPFilter->IsDate()||pTPFilter->IsAuthor()||pTPFilter->IsRange()||pTPFilter->IsComment())
         [ #  # ][ #  # ]
                 [ #  # ]
    1117                 :          0 :             RejectFiltered();
    1118                 :            :         else
    1119                 :          0 :             pChanges->RejectAll();
    1120                 :            : 
    1121                 :          0 :         pViewData->SetTabNo(0);
    1122                 :            : 
    1123                 :          0 :         ScDocShell* pDocSh=pViewData->GetDocShell();
    1124                 :          0 :         pDocSh->PostPaintExtras();
    1125                 :          0 :         pDocSh->PostPaintGridAll();
    1126                 :          0 :         pDocSh->GetUndoManager()->Clear();
    1127                 :          0 :         pDocSh->SetDocumentModified();
    1128                 :          0 :         ClearView();
    1129                 :          0 :         UpdateView();
    1130                 :            :     }
    1131         [ #  # ]:          0 :     SetPointer(Pointer(POINTER_ARROW));
    1132                 :            : 
    1133                 :          0 :     bIgnoreMsg=false;
    1134                 :            : 
    1135                 :          0 :     return 0;
    1136                 :            : }
    1137                 :            : 
    1138                 :          0 : IMPL_LINK_NOARG(ScAcceptChgDlg, AcceptAllHandle)
    1139                 :            : {
    1140         [ #  # ]:          0 :     SetPointer(Pointer(POINTER_WAIT));
    1141                 :            : 
    1142                 :          0 :     bIgnoreMsg=true;
    1143                 :          0 :     ScChangeTrack* pChanges=pDoc->GetChangeTrack();
    1144         [ #  # ]:          0 :     if(pChanges!=NULL)
    1145                 :            :     {
    1146 [ #  # ][ #  # ]:          0 :         if(pTPFilter->IsDate()||pTPFilter->IsAuthor()||pTPFilter->IsRange()||pTPFilter->IsComment())
         [ #  # ][ #  # ]
                 [ #  # ]
    1147                 :          0 :             AcceptFiltered();
    1148                 :            :         else
    1149                 :          0 :             pChanges->AcceptAll();
    1150                 :            : 
    1151                 :          0 :         ScDocShell* pDocSh=pViewData->GetDocShell();
    1152                 :          0 :         pDocSh->PostPaintExtras();
    1153                 :          0 :         pDocSh->PostPaintGridAll();
    1154                 :          0 :         pDocSh->SetDocumentModified();
    1155                 :          0 :         ClearView();
    1156                 :          0 :         UpdateView();
    1157                 :            :     }
    1158                 :          0 :     bIgnoreMsg=false;
    1159         [ #  # ]:          0 :     SetPointer(Pointer(POINTER_ARROW));
    1160                 :            : 
    1161                 :          0 :     return 0;
    1162                 :            : }
    1163                 :            : 
    1164                 :          0 : IMPL_LINK_NOARG(ScAcceptChgDlg, SelectHandle)
    1165                 :            : {
    1166         [ #  # ]:          0 :     if(!bNoSelection)
    1167                 :          0 :         aSelectionTimer.Start();
    1168                 :            : 
    1169                 :          0 :     bNoSelection=false;
    1170                 :          0 :     return 0;
    1171                 :            : }
    1172                 :            : 
    1173                 :          0 : void ScAcceptChgDlg::GetDependents(  const ScChangeAction* pScChangeAction,
    1174                 :            :                                     ScChangeActionMap& aActionMap,
    1175                 :            :                                     SvLBoxEntry* pEntry)
    1176                 :            : {
    1177                 :          0 :     ScChangeTrack* pChanges=pDoc->GetChangeTrack();
    1178                 :            : 
    1179                 :          0 :     SvLBoxEntry* pParent=pTheView->GetParent(pEntry);
    1180         [ #  # ]:          0 :     if(pParent!=NULL)
    1181                 :            :     {
    1182                 :          0 :         ScRedlinData *pParentData=(ScRedlinData *)(pParent->GetUserData());
    1183                 :          0 :         ScChangeAction* pParentAction=(ScChangeAction*) pParentData->pData;
    1184                 :            : 
    1185         [ #  # ]:          0 :         if(pParentAction!=pScChangeAction)
    1186                 :            :             pChanges->GetDependents((ScChangeAction*) pScChangeAction,
    1187                 :          0 :                         aActionMap,pScChangeAction->IsMasterDelete());
    1188                 :            :         else
    1189                 :            :             pChanges->GetDependents( (ScChangeAction*) pScChangeAction,
    1190                 :          0 :                         aActionMap );
    1191                 :            :     }
    1192                 :            :     else
    1193                 :            :         pChanges->GetDependents((ScChangeAction*) pScChangeAction,
    1194                 :          0 :                     aActionMap, pScChangeAction->IsMasterDelete() );
    1195                 :          0 : }
    1196                 :            : 
    1197                 :          0 : bool ScAcceptChgDlg::InsertContentChildren(ScChangeActionMap* pActionMap,SvLBoxEntry* pParent)
    1198                 :            : {
    1199                 :          0 :     bool bTheTestFlag = true;
    1200                 :          0 :     ScRedlinData *pEntryData=(ScRedlinData *)(pParent->GetUserData());
    1201                 :          0 :     const ScChangeAction* pScChangeAction = (ScChangeAction*) pEntryData->pData;
    1202                 :          0 :     bool bParentInserted = false;
    1203                 :            :     // If the parent is a MatrixOrigin then place it in the right order before
    1204                 :            :     // the MatrixReferences. Also if it is the first content change at this
    1205                 :            :     // position don't insert the first dependent MatrixReference as the special
    1206                 :            :     // content (original value) but insert the predecessor of the MatrixOrigin
    1207                 :            :     // itself instead.
    1208 [ #  # ][ #  # ]:          0 :     if ( pScChangeAction->GetType() == SC_CAT_CONTENT &&
                 [ #  # ]
    1209         [ #  # ]:          0 :             ((const ScChangeActionContent*)pScChangeAction)->IsMatrixOrigin() )
    1210                 :            :     {
    1211                 :          0 :         pActionMap->insert( ::std::make_pair( pScChangeAction->GetActionNumber(),
    1212         [ #  # ]:          0 :             const_cast<ScChangeAction*>( pScChangeAction ) ) );
    1213                 :          0 :         bParentInserted = true;
    1214                 :            :     }
    1215                 :          0 :     SvLBoxEntry* pEntry=NULL;
    1216                 :            : 
    1217                 :          0 :     ScChangeActionMap::iterator itChangeAction = pActionMap->begin();
    1218         [ #  # ]:          0 :     while( itChangeAction != pActionMap->end() )
    1219                 :            :     {
    1220         [ #  # ]:          0 :         if( itChangeAction->second->GetState()==SC_CAS_VIRGIN )
    1221                 :          0 :             break;
    1222                 :          0 :         ++itChangeAction;
    1223                 :            :     }
    1224                 :            : 
    1225         [ #  # ]:          0 :     if( itChangeAction == pActionMap->end() )
    1226                 :          0 :         return true;
    1227                 :            : 
    1228                 :            :     SvLBoxEntry* pOriginal = InsertChangeActionContent(
    1229                 :          0 :         dynamic_cast<const ScChangeActionContent*>( itChangeAction->second ),
    1230 [ #  # ][ #  # ]:          0 :         pParent, RD_SPECIAL_CONTENT );
    1231                 :            : 
    1232         [ #  # ]:          0 :     if(pOriginal!=NULL)
    1233                 :            :     {
    1234                 :          0 :         bTheTestFlag=false;
    1235                 :          0 :         ScRedlinData *pParentData=(ScRedlinData *)(pOriginal->GetUserData());
    1236                 :          0 :         pParentData->pData=(void *)pScChangeAction;
    1237                 :          0 :         pParentData->nActionNo=pScChangeAction->GetActionNumber();
    1238         [ #  # ]:          0 :         pParentData->bIsAcceptable=pScChangeAction->IsRejectable(); // select old value
    1239                 :          0 :         pParentData->bIsRejectable=false;
    1240                 :          0 :         pParentData->bDisabled=false;
    1241                 :            :     }
    1242         [ #  # ]:          0 :     while( itChangeAction != pActionMap->end() )
    1243                 :            :     {
    1244         [ #  # ]:          0 :         if( itChangeAction->second->GetState() == SC_CAS_VIRGIN )
    1245                 :            :         {
    1246                 :          0 :             pEntry = InsertChangeActionContent( dynamic_cast<const ScChangeActionContent*>( itChangeAction->second ),
    1247 [ #  # ][ #  # ]:          0 :                 pParent, RD_SPECIAL_NONE );
    1248                 :            : 
    1249         [ #  # ]:          0 :             if(pEntry!=NULL)
    1250                 :          0 :                 bTheTestFlag=false;
    1251                 :            :         }
    1252                 :          0 :         ++itChangeAction;
    1253                 :            :     }
    1254                 :            : 
    1255         [ #  # ]:          0 :     if ( !bParentInserted )
    1256                 :            :     {
    1257                 :            :         pEntry=InsertChangeActionContent((const ScChangeActionContent*)
    1258         [ #  # ]:          0 :                                 pScChangeAction,pParent,RD_SPECIAL_NONE);
    1259                 :            : 
    1260         [ #  # ]:          0 :         if(pEntry!=NULL)
    1261                 :            :         {
    1262                 :          0 :             bTheTestFlag=false;
    1263                 :          0 :             ScRedlinData *pParentData=(ScRedlinData *)(pEntry->GetUserData());
    1264                 :          0 :             pParentData->pData=(void *)pScChangeAction;
    1265                 :          0 :             pParentData->nActionNo=pScChangeAction->GetActionNumber();
    1266         [ #  # ]:          0 :             pParentData->bIsAcceptable=pScChangeAction->IsClickable();
    1267                 :          0 :             pParentData->bIsRejectable=false;
    1268                 :          0 :             pParentData->bDisabled=false;
    1269                 :            :         }
    1270                 :            :     }
    1271                 :            : 
    1272                 :          0 :     return bTheTestFlag;
    1273                 :            : 
    1274                 :            : }
    1275                 :            : 
    1276                 :          0 : bool ScAcceptChgDlg::InsertAcceptedORejected(SvLBoxEntry* pParent)
    1277                 :            : {
    1278                 :          0 :     ScChangeTrack* pChanges=pDoc->GetChangeTrack();
    1279                 :          0 :     bool bTheTestFlag = true;
    1280                 :            : 
    1281                 :          0 :     ScChangeActionState eState = SC_CAS_VIRGIN;
    1282 [ #  # ][ #  # ]:          0 :     rtl::OUString aString = pTheView->GetEntryText(pParent);
                 [ #  # ]
    1283                 :          0 :     rtl::OUString a2String = aString.copy(0, aStrAllAccepted.getLength());
    1284         [ #  # ]:          0 :     if (a2String.equals(aStrAllAccepted))
    1285                 :          0 :         eState=SC_CAS_ACCEPTED;
    1286                 :            :     else
    1287                 :            :     {
    1288                 :          0 :         a2String = aString.copy(0, aStrAllRejected.getLength());
    1289         [ #  # ]:          0 :         if (a2String.equals(aStrAllRejected))
    1290                 :          0 :             eState=SC_CAS_REJECTED;
    1291                 :            :     }
    1292                 :            : 
    1293                 :          0 :     ScChangeAction* pScChangeAction=pChanges->GetFirst();
    1294         [ #  # ]:          0 :     while(pScChangeAction!=NULL)
    1295                 :            :     {
    1296 [ #  # ][ #  # ]:          0 :         if(pScChangeAction->GetState()==eState &&
                 [ #  # ]
    1297         [ #  # ]:          0 :             InsertFilteredAction(pScChangeAction,eState,pParent)!=NULL)
    1298                 :          0 :             bTheTestFlag=false;
    1299                 :          0 :         pScChangeAction=pScChangeAction->GetNext();
    1300                 :            :     }
    1301                 :          0 :     return bTheTestFlag;
    1302                 :            : }
    1303                 :            : 
    1304                 :          0 : bool ScAcceptChgDlg::InsertChildren(ScChangeActionMap* pActionMap,SvLBoxEntry* pParent)
    1305                 :            : {
    1306                 :          0 :     ScChangeTrack* pChanges=pDoc->GetChangeTrack();
    1307                 :          0 :     bool bTheTestFlag = true;
    1308                 :          0 :     SvLBoxEntry* pEntry=NULL;
    1309                 :          0 :     ScChangeActionMap::iterator itChangeAction;
    1310                 :            : 
    1311         [ #  # ]:          0 :     for( itChangeAction = pActionMap->begin(); itChangeAction != pActionMap->end(); ++itChangeAction )
    1312                 :            :     {
    1313         [ #  # ]:          0 :         pEntry=InsertChangeAction( itChangeAction->second, SC_CAS_VIRGIN, pParent, false, true );
    1314                 :            : 
    1315         [ #  # ]:          0 :         if(pEntry!=NULL)
    1316                 :            :         {
    1317                 :          0 :             bTheTestFlag=false;
    1318                 :            : 
    1319                 :          0 :             ScRedlinData *pEntryData=(ScRedlinData *)(pEntry->GetUserData());
    1320                 :          0 :             pEntryData->bIsRejectable=false;
    1321                 :          0 :             pEntryData->bIsAcceptable=false;
    1322                 :          0 :             pEntryData->bDisabled=true;
    1323                 :            : 
    1324 [ #  # ][ #  # ]:          0 :             if( itChangeAction->second->IsDialogParent() )
    1325         [ #  # ]:          0 :                 Expand( pChanges, itChangeAction->second, pEntry );
    1326                 :            :         }
    1327                 :            :     }
    1328                 :          0 :     return bTheTestFlag;
    1329                 :            : }
    1330                 :            : 
    1331                 :          0 : bool ScAcceptChgDlg::InsertDeletedChildren(const ScChangeAction* pScChangeAction,
    1332                 :            :                                          ScChangeActionMap* pActionMap,SvLBoxEntry* pParent)
    1333                 :            : {
    1334                 :          0 :     ScChangeTrack* pChanges=pDoc->GetChangeTrack();
    1335                 :          0 :     bool bTheTestFlag = true;
    1336                 :          0 :     SvLBoxEntry* pEntry=NULL;
    1337                 :          0 :     ScChangeActionMap::iterator itChangeAction;
    1338                 :            : 
    1339         [ #  # ]:          0 :     for( itChangeAction = pActionMap->begin(); itChangeAction != pActionMap->end(); ++itChangeAction )
    1340                 :            :     {
    1341                 :            : 
    1342         [ #  # ]:          0 :         if( pScChangeAction != itChangeAction->second )
    1343         [ #  # ]:          0 :             pEntry = InsertChangeAction( itChangeAction->second, SC_CAS_VIRGIN, pParent, false, true );
    1344                 :            :         else
    1345         [ #  # ]:          0 :             pEntry = InsertChangeAction( itChangeAction->second, SC_CAS_VIRGIN, pParent, true, true );
    1346                 :            : 
    1347         [ #  # ]:          0 :         if(pEntry!=NULL)
    1348                 :            :         {
    1349                 :          0 :             ScRedlinData *pEntryData=(ScRedlinData *)(pEntry->GetUserData());
    1350                 :          0 :             pEntryData->bIsRejectable=false;
    1351                 :          0 :             pEntryData->bIsAcceptable=false;
    1352                 :          0 :             pEntryData->bDisabled=true;
    1353                 :            : 
    1354                 :          0 :             bTheTestFlag=false;
    1355                 :            : 
    1356 [ #  # ][ #  # ]:          0 :             if( itChangeAction->second->IsDialogParent() )
    1357         [ #  # ]:          0 :                 Expand( pChanges, itChangeAction->second, pEntry );
    1358                 :            :         }
    1359                 :            :     }
    1360                 :          0 :     return bTheTestFlag;
    1361                 :            : }
    1362                 :            : 
    1363                 :          0 : bool ScAcceptChgDlg::Expand(
    1364                 :            :     ScChangeTrack* pChanges, const ScChangeAction* pScChangeAction,
    1365                 :            :     SvLBoxEntry* pEntry, bool bFilter)
    1366                 :            : {
    1367                 :          0 :     bool bTheTestFlag = true;
    1368                 :            : 
    1369 [ #  # ][ #  # ]:          0 :     if(pChanges!=NULL &&pEntry!=NULL &&pScChangeAction!=NULL)
                 [ #  # ]
    1370                 :            :     {
    1371         [ #  # ]:          0 :         ScChangeActionMap aActionMap;
    1372                 :            : 
    1373         [ #  # ]:          0 :         GetDependents( pScChangeAction, aActionMap, pEntry );
    1374                 :            : 
    1375      [ #  #  # ]:          0 :         switch(pScChangeAction->GetType())
    1376                 :            :         {
    1377                 :            :             case SC_CAT_CONTENT:
    1378                 :            :             {
    1379         [ #  # ]:          0 :                 InsertContentChildren( &aActionMap, pEntry );
    1380                 :          0 :                 bTheTestFlag=!bHasFilterEntry;
    1381                 :          0 :                 break;
    1382                 :            :             }
    1383                 :            :             case SC_CAT_DELETE_COLS:
    1384                 :            :             case SC_CAT_DELETE_ROWS:
    1385                 :            :             case SC_CAT_DELETE_TABS:
    1386                 :            :             {
    1387         [ #  # ]:          0 :                 InsertDeletedChildren( pScChangeAction, &aActionMap, pEntry );
    1388                 :          0 :                 bTheTestFlag=!bHasFilterEntry;
    1389                 :          0 :                 break;
    1390                 :            :             }
    1391                 :            :             default:
    1392                 :            :             {
    1393         [ #  # ]:          0 :                 if(!bFilter)
    1394         [ #  # ]:          0 :                     bTheTestFlag = InsertChildren( &aActionMap, pEntry );
    1395                 :          0 :                 break;
    1396                 :            :             }
    1397                 :            :         }
    1398                 :          0 :         aActionMap.clear();
    1399                 :            :     }
    1400                 :          0 :     return bTheTestFlag;
    1401                 :            : }
    1402                 :            : 
    1403                 :          0 : IMPL_LINK( ScAcceptChgDlg, ExpandingHandle, SvxRedlinTable*, pTable )
    1404                 :            : {
    1405                 :          0 :     ScChangeTrack* pChanges=pDoc->GetChangeTrack();
    1406                 :          0 :     ScChangeAction* pScChangeAction=NULL;
    1407         [ #  # ]:          0 :     SetPointer(Pointer(POINTER_WAIT));
    1408 [ #  # ][ #  # ]:          0 :     if(pTable!=NULL && pChanges!=NULL)
    1409                 :            :     {
    1410         [ #  # ]:          0 :         ScChangeActionMap aActionMap;
    1411                 :          0 :         SvLBoxEntry* pEntry=pTheView->GetHdlEntry();
    1412         [ #  # ]:          0 :         if(pEntry!=NULL)
    1413                 :            :         {
    1414                 :          0 :             ScRedlinData *pEntryData=(ScRedlinData *)(pEntry->GetUserData());
    1415         [ #  # ]:          0 :             if(pEntryData!=NULL)
    1416                 :          0 :                 pScChangeAction=(ScChangeAction*) pEntryData->pData;
    1417                 :            : 
    1418         [ #  # ]:          0 :             if(pEntry->HasChildrenOnDemand())
    1419                 :            :             {
    1420                 :          0 :                 bool bTheTestFlag = true;
    1421         [ #  # ]:          0 :                 pEntry->EnableChildrenOnDemand(false);
    1422 [ #  # ][ #  # ]:          0 :                 pTheView->RemoveEntry(pTheView->FirstChild(pEntry));
    1423                 :            : 
    1424         [ #  # ]:          0 :                 if(pEntryData!=NULL)
    1425                 :            :                 {
    1426                 :          0 :                     pScChangeAction=(ScChangeAction*) pEntryData->pData;
    1427                 :            : 
    1428         [ #  # ]:          0 :                     GetDependents( pScChangeAction, aActionMap, pEntry );
    1429                 :            : 
    1430      [ #  #  # ]:          0 :                     switch(pScChangeAction->GetType())
    1431                 :            :                     {
    1432                 :            :                         case SC_CAT_CONTENT:
    1433                 :            :                         {
    1434         [ #  # ]:          0 :                             bTheTestFlag = InsertContentChildren( &aActionMap, pEntry );
    1435                 :          0 :                             break;
    1436                 :            :                         }
    1437                 :            :                         case SC_CAT_DELETE_COLS:
    1438                 :            :                         case SC_CAT_DELETE_ROWS:
    1439                 :            :                         case SC_CAT_DELETE_TABS:
    1440                 :            :                         {
    1441         [ #  # ]:          0 :                             bTheTestFlag = InsertDeletedChildren( pScChangeAction, &aActionMap, pEntry );
    1442                 :          0 :                             break;
    1443                 :            :                         }
    1444                 :            :                         default:
    1445                 :            :                         {
    1446         [ #  # ]:          0 :                             bTheTestFlag = InsertChildren( &aActionMap, pEntry );
    1447                 :          0 :                             break;
    1448                 :            :                         }
    1449                 :            :                     }
    1450                 :          0 :                     aActionMap.clear();
    1451                 :            : 
    1452                 :            :                 }
    1453                 :            :                 else
    1454                 :            :                 {
    1455         [ #  # ]:          0 :                     bTheTestFlag=InsertAcceptedORejected(pEntry);
    1456                 :            :                 }
    1457 [ #  # ][ #  # ]:          0 :                 if(bTheTestFlag) pTheView->InsertEntry(aStrNoEntry,NULL,Color(COL_GRAY),pEntry);
         [ #  # ][ #  # ]
    1458                 :            :             }
    1459                 :            : 
    1460                 :          0 :         }
    1461                 :            :     }
    1462         [ #  # ]:          0 :     SetPointer(Pointer(POINTER_ARROW));
    1463                 :          0 :     return (sal_uLong) true;
    1464                 :            : }
    1465                 :            : 
    1466                 :            : 
    1467                 :          0 : void ScAcceptChgDlg::AppendChanges(ScChangeTrack* pChanges,sal_uLong nStartAction,
    1468                 :            :                                    sal_uLong nEndAction, sal_uLong /* nPos */)
    1469                 :            : {
    1470         [ #  # ]:          0 :     if(pChanges!=NULL)
    1471                 :            :     {
    1472                 :          0 :         SvLBoxEntry* pParent=NULL;
    1473                 :          0 :         const ScChangeAction* pScChangeAction=NULL;
    1474                 :          0 :         bAcceptEnableFlag=true;
    1475                 :          0 :         bRejectEnableFlag=true;
    1476         [ #  # ]:          0 :         SetPointer(Pointer(POINTER_WAIT));
    1477                 :          0 :         pTheView->SetUpdateMode(false);
    1478                 :            : 
    1479                 :          0 :         bool bTheFlag = false;
    1480                 :            : 
    1481                 :          0 :         bool bFilterFlag = pTPFilter->IsDate() || pTPFilter->IsRange() ||
    1482 [ #  # ][ #  # ]:          0 :             pTPFilter->IsAuthor() || pTPFilter->IsComment();
           [ #  #  #  # ]
    1483                 :            : 
    1484                 :          0 :         bUseColor = bFilterFlag;
    1485                 :            : 
    1486         [ #  # ]:          0 :         for(sal_uLong i=nStartAction;i<=nEndAction;i++)
    1487                 :            :         {
    1488                 :          0 :             pScChangeAction=pChanges->GetAction(i);
    1489         [ #  # ]:          0 :             if(pScChangeAction==NULL) continue;
    1490                 :            : 
    1491                 :            : 
    1492   [ #  #  #  # ]:          0 :             switch(pScChangeAction->GetState())
    1493                 :            :             {
    1494                 :            :                 case SC_CAS_VIRGIN:
    1495                 :            : 
    1496         [ #  # ]:          0 :                     if(pScChangeAction->IsDialogRoot())
    1497                 :            :                     {
    1498         [ #  # ]:          0 :                         if(pScChangeAction->IsDialogParent())
    1499                 :          0 :                             pParent=InsertChangeAction(pScChangeAction,SC_CAS_VIRGIN);
    1500                 :            :                         else
    1501                 :          0 :                             pParent=InsertFilteredAction(pScChangeAction,SC_CAS_VIRGIN);
    1502                 :            :                     }
    1503                 :            :                     else
    1504                 :          0 :                         pParent=NULL;
    1505                 :            : 
    1506                 :          0 :                     bTheFlag=true;
    1507                 :          0 :                     break;
    1508                 :            : 
    1509                 :            :                 case SC_CAS_ACCEPTED:
    1510                 :          0 :                     pParent=NULL;
    1511                 :          0 :                     nAcceptCount++;
    1512                 :          0 :                     break;
    1513                 :            : 
    1514                 :            :                 case SC_CAS_REJECTED:
    1515                 :          0 :                     pParent=NULL;
    1516                 :          0 :                     nRejectCount++;
    1517                 :          0 :                     break;
    1518                 :            :             }
    1519                 :            : 
    1520 [ #  # ][ #  # ]:          0 :             if(pParent!=NULL && pScChangeAction->IsDialogParent())
                 [ #  # ]
    1521                 :            :             {
    1522         [ #  # ]:          0 :                 if(!bFilterFlag)
    1523                 :          0 :                     pParent->EnableChildrenOnDemand(true);
    1524                 :            :                 else
    1525                 :            :                 {
    1526                 :          0 :                     bool bTestFlag = bHasFilterEntry;
    1527                 :          0 :                     bHasFilterEntry = false;
    1528 [ #  # ][ #  # ]:          0 :                     if(Expand(pChanges,pScChangeAction,pParent,!bTestFlag)&&!bTestFlag)
                 [ #  # ]
    1529                 :          0 :                         pTheView->RemoveEntry(pParent);
    1530                 :            :                 }
    1531                 :            :             }
    1532                 :            : 
    1533                 :          0 :             pScChangeAction=pScChangeAction->GetNext();
    1534                 :            :         }
    1535                 :            : 
    1536 [ #  # ][ #  # ]:          0 :         if( bTheFlag && (!pDoc->IsDocEditable() || pChanges->IsProtected()) )
         [ #  # ][ #  # ]
    1537                 :          0 :             bTheFlag=false;
    1538                 :            : 
    1539                 :          0 :         pTPView->EnableAccept(bTheFlag);
    1540                 :          0 :         pTPView->EnableAcceptAll(bTheFlag);
    1541                 :          0 :         pTPView->EnableReject(bTheFlag);
    1542                 :          0 :         pTPView->EnableRejectAll(bTheFlag);
    1543                 :            : 
    1544                 :          0 :         pTheView->SetUpdateMode(true);
    1545         [ #  # ]:          0 :         SetPointer(Pointer(POINTER_ARROW));
    1546                 :            :     }
    1547                 :          0 : }
    1548                 :            : 
    1549                 :          0 : void ScAcceptChgDlg::RemoveEntrys(sal_uLong nStartAction,sal_uLong nEndAction)
    1550                 :            : {
    1551                 :            : 
    1552                 :          0 :     pTheView->SetUpdateMode(false);
    1553                 :            : 
    1554                 :          0 :     SvLBoxEntry* pEntry=pTheView->GetCurEntry();
    1555                 :            : 
    1556                 :          0 :     ScRedlinData *pEntryData=NULL;
    1557                 :            : 
    1558         [ #  # ]:          0 :     if(pEntry!=NULL)
    1559                 :          0 :         pEntryData=(ScRedlinData *)(pEntry->GetUserData());
    1560                 :            : 
    1561                 :          0 :     sal_uLong nAction=0;
    1562         [ #  # ]:          0 :     if(pEntryData!=NULL)
    1563                 :          0 :         nAction=pEntryData->nActionNo;
    1564                 :            : 
    1565 [ #  # ][ #  # ]:          0 :     if(nAction>=nStartAction && nAction<=nEndAction)
    1566                 :          0 :         pTheView->SetCurEntry(pTheView->GetModel()->GetEntry(0));
    1567                 :            : 
    1568                 :          0 :     bool bRemove = false;
    1569                 :            : 
    1570                 :            :     // MUST do it backwards, don't delete parents before children and GPF
    1571                 :          0 :     pEntry=pTheView->Last();
    1572         [ #  # ]:          0 :     while(pEntry!=NULL)
    1573                 :            :     {
    1574                 :          0 :         bRemove=false;
    1575                 :          0 :         pEntryData=(ScRedlinData *)(pEntry->GetUserData());
    1576         [ #  # ]:          0 :         if(pEntryData!=NULL)
    1577                 :            :         {
    1578                 :          0 :             nAction=pEntryData->nActionNo;
    1579                 :            : 
    1580 [ #  # ][ #  # ]:          0 :             if(nStartAction<=nAction && nAction<=nEndAction) bRemove=true;
    1581                 :            : 
    1582                 :            : 
    1583                 :            :         }
    1584                 :          0 :         SvLBoxEntry* pPrevEntry = pTheView->Prev(pEntry);
    1585                 :            : 
    1586         [ #  # ]:          0 :         if(bRemove)
    1587                 :          0 :             pTheView->RemoveEntry(pEntry);
    1588                 :            : 
    1589                 :          0 :         pEntry=pPrevEntry;
    1590                 :            :     }
    1591                 :          0 :     pTheView->SetUpdateMode(true);
    1592                 :            : 
    1593                 :          0 : }
    1594                 :            : 
    1595                 :          0 : void ScAcceptChgDlg::UpdateEntrys(ScChangeTrack* pChgTrack, sal_uLong nStartAction,sal_uLong nEndAction)
    1596                 :            : {
    1597                 :          0 :     pTheView->SetUpdateMode(false);
    1598                 :            : 
    1599                 :          0 :     sal_uLong nPos=LIST_APPEND;
    1600                 :            : 
    1601                 :          0 :     bool bRemove = false;
    1602                 :            : 
    1603                 :          0 :     SvLBoxEntry* pEntry=pTheView->First();
    1604         [ #  # ]:          0 :     SvLBoxEntry* pNextEntry = (pEntry ? pTheView->NextSibling(pEntry) : NULL);
    1605                 :          0 :     SvLBoxEntry* pLastEntry=NULL;
    1606         [ #  # ]:          0 :     while(pEntry!=NULL)
    1607                 :            :     {
    1608                 :          0 :         bRemove=false;
    1609                 :          0 :         ScRedlinData *pEntryData=(ScRedlinData *)(pEntry->GetUserData());
    1610         [ #  # ]:          0 :         if(pEntryData!=NULL)
    1611                 :            :         {
    1612                 :            :             ScChangeAction* pScChangeAction=
    1613                 :          0 :                     (ScChangeAction*) pEntryData->pData;
    1614                 :            : 
    1615                 :          0 :             sal_uLong nAction=pScChangeAction->GetActionNumber();
    1616                 :            : 
    1617 [ #  # ][ #  # ]:          0 :             if(nStartAction<=nAction && nAction<=nEndAction) bRemove=true;
    1618                 :            :         }
    1619                 :            : 
    1620         [ #  # ]:          0 :         if(bRemove)
    1621                 :            :         {
    1622                 :          0 :             nPos=pEntry->GetChildListPos();
    1623                 :          0 :             pTheView->RemoveEntry(pEntry);
    1624                 :            : 
    1625         [ #  # ]:          0 :             if(pLastEntry==NULL) pLastEntry=pTheView->First();
    1626         [ #  # ]:          0 :             if(pLastEntry!=NULL)
    1627                 :            :             {
    1628                 :          0 :                 pNextEntry=pTheView->Next(pLastEntry);
    1629                 :            : 
    1630         [ #  # ]:          0 :                 if(pNextEntry==NULL)
    1631                 :            :                 {
    1632                 :          0 :                     pNextEntry=pLastEntry;
    1633                 :          0 :                     pLastEntry=NULL;
    1634                 :            :                 }
    1635                 :            :             }
    1636                 :            :             else
    1637                 :          0 :                 pNextEntry=NULL;
    1638                 :            : 
    1639                 :            :         }
    1640                 :            :         else
    1641                 :            :         {
    1642                 :          0 :             pLastEntry = pEntry;
    1643                 :          0 :             pNextEntry = pTheView->Next(pEntry);
    1644                 :            :         }
    1645                 :          0 :         pEntry=pNextEntry;
    1646                 :            :     }
    1647                 :            : 
    1648         [ #  # ]:          0 :     if(nStartAction==nEndAction)
    1649                 :          0 :         AppendChanges(pChgTrack,nStartAction,nEndAction,nPos);
    1650                 :            :     else
    1651                 :          0 :         AppendChanges(pChgTrack,nStartAction,nEndAction);
    1652                 :            : 
    1653                 :          0 :     pTheView->SetUpdateMode(true);
    1654                 :            : 
    1655                 :          0 : }
    1656                 :            : 
    1657                 :          0 : IMPL_LINK( ScAcceptChgDlg, ChgTrackModHdl, ScChangeTrack*, pChgTrack)
    1658                 :            : {
    1659                 :          0 :     ScChangeTrackMsgQueue::iterator iter;
    1660                 :          0 :     ScChangeTrackMsgQueue& aMsgQueue= pChgTrack->GetMsgQueue();
    1661                 :            : 
    1662                 :            :     sal_uLong   nStartAction;
    1663                 :            :     sal_uLong   nEndAction;
    1664                 :            : 
    1665 [ #  # ][ #  # ]:          0 :     for (iter = aMsgQueue.begin(); iter != aMsgQueue.end(); ++iter)
                 [ #  # ]
    1666                 :            :     {
    1667                 :          0 :         nStartAction=(*iter)->nStartAction;
    1668                 :          0 :         nEndAction=(*iter)->nEndAction;
    1669                 :            : 
    1670         [ #  # ]:          0 :         if(!bIgnoreMsg)
    1671                 :            :         {
    1672                 :          0 :             bNoSelection=true;
    1673                 :            : 
    1674   [ #  #  #  # ]:          0 :             switch((*iter)->eMsgType)
    1675                 :            :             {
    1676         [ #  # ]:          0 :                 case SC_CTM_APPEND: AppendChanges(pChgTrack,nStartAction,nEndAction);
    1677                 :          0 :                                     break;
    1678         [ #  # ]:          0 :                 case SC_CTM_REMOVE: RemoveEntrys(nStartAction,nEndAction);
    1679                 :          0 :                                     break;
    1680                 :            :                 case SC_CTM_PARENT:
    1681                 :            :                 case SC_CTM_CHANGE: //bNeedsUpdate=true;
    1682         [ #  # ]:          0 :                                     UpdateEntrys(pChgTrack,nStartAction,nEndAction);
    1683                 :          0 :                                     break;
    1684                 :            :                 default:
    1685                 :            :                 {
    1686                 :            :                     // added to avoid warnings
    1687                 :            :                 }
    1688                 :            :             }
    1689                 :            :         }
    1690         [ #  # ]:          0 :         delete *iter;
    1691                 :            :     }
    1692                 :            : 
    1693                 :          0 :     aMsgQueue.clear();
    1694                 :            : 
    1695                 :          0 :     return 0;
    1696                 :            : }
    1697                 :          0 : IMPL_LINK_NOARG(ScAcceptChgDlg, ReOpenTimerHdl)
    1698                 :            : {
    1699                 :          0 :     ScSimpleRefDlgWrapper::SetAutoReOpen(true);
    1700                 :          0 :     aAcceptChgCtr.ShowFilterPage();
    1701                 :          0 :     RefHandle(NULL);
    1702                 :            : 
    1703                 :          0 :     return 0;
    1704                 :            : }
    1705                 :            : 
    1706                 :          0 : IMPL_LINK_NOARG(ScAcceptChgDlg, UpdateSelectionHdl)
    1707                 :            : {
    1708         [ #  # ]:          0 :     ScTabView* pTabView = pViewData->GetView();
    1709                 :            : 
    1710                 :          0 :     bool bAcceptFlag = true;
    1711                 :          0 :     bool bRejectFlag = true;
    1712                 :          0 :     bool bContMark = false;
    1713                 :            : 
    1714                 :          0 :     pTabView->DoneBlockMode();  // clears old marking
    1715                 :          0 :     SvLBoxEntry* pEntry = pTheView->FirstSelected();
    1716         [ #  # ]:          0 :     while( pEntry )
    1717                 :            :     {
    1718                 :          0 :         ScRedlinData* pEntryData = (ScRedlinData*) pEntry->GetUserData();
    1719         [ #  # ]:          0 :         if( pEntryData )
    1720                 :            :         {
    1721                 :          0 :             bRejectFlag &= (bool) pEntryData->bIsRejectable;
    1722                 :          0 :             bAcceptFlag &= (bool) pEntryData->bIsAcceptable;
    1723                 :            : 
    1724                 :          0 :             const ScChangeAction* pScChangeAction = (ScChangeAction*) pEntryData->pData;
    1725 [ #  # ][ #  # ]:          0 :             if( pScChangeAction && (pScChangeAction->GetType() != SC_CAT_DELETE_TABS) &&
           [ #  #  #  # ]
                 [ #  # ]
    1726                 :          0 :                     (!pEntryData->bDisabled || pScChangeAction->IsVisible()) )
    1727                 :            :             {
    1728                 :          0 :                 const ScBigRange& rBigRange = pScChangeAction->GetBigRange();
    1729 [ #  # ][ #  # ]:          0 :                 if( rBigRange.IsValid( pDoc ) && IsActive() )
                 [ #  # ]
    1730                 :            :                 {
    1731                 :          0 :                     bool bSetCursor = !pTheView->NextSelected( pEntry );
    1732         [ #  # ]:          0 :                     pTabView->MarkRange( rBigRange.MakeRange(), bSetCursor, bContMark );
    1733                 :          0 :                     bContMark = true;
    1734                 :            :                 }
    1735                 :            :             }
    1736                 :            :         }
    1737                 :            :         else
    1738                 :            :         {
    1739                 :          0 :             bAcceptFlag = false;
    1740                 :          0 :             bRejectFlag = false;
    1741                 :            :         }
    1742                 :          0 :         bAcceptEnableFlag = bAcceptFlag;
    1743                 :          0 :         bRejectEnableFlag = bRejectFlag;
    1744                 :            : 
    1745                 :          0 :         pEntry = pTheView->NextSelected( pEntry );
    1746                 :            :     }
    1747                 :            : 
    1748                 :          0 :     ScChangeTrack* pChanges = pDoc->GetChangeTrack();
    1749 [ #  # ][ #  # ]:          0 :     bool bEnable = pDoc->IsDocEditable() && pChanges && !pChanges->IsProtected();
                 [ #  # ]
    1750 [ #  # ][ #  # ]:          0 :     pTPView->EnableAccept( bAcceptFlag && bEnable );
    1751 [ #  # ][ #  # ]:          0 :     pTPView->EnableReject( bRejectFlag && bEnable );
    1752                 :            : 
    1753                 :          0 :     return 0;
    1754                 :            : }
    1755                 :            : 
    1756                 :          0 : IMPL_LINK_NOARG(ScAcceptChgDlg, CommandHdl)
    1757                 :            : {
    1758                 :            : 
    1759         [ #  # ]:          0 :     const CommandEvent aCEvt(pTheView->GetCommandEvent());
    1760                 :            : 
    1761         [ #  # ]:          0 :     if(aCEvt.GetCommand()==COMMAND_CONTEXTMENU)
    1762                 :            :     {
    1763 [ #  # ][ #  # ]:          0 :         ScPopupMenu aPopup(ScResId(RID_POPUP_CHANGES));
    1764                 :            : 
    1765                 :          0 :         aPopup.SetMenuFlags(MENU_FLAG_HIDEDISABLEDENTRIES);
    1766                 :            : 
    1767         [ #  # ]:          0 :         SvLBoxEntry* pEntry=pTheView->GetCurEntry();
    1768         [ #  # ]:          0 :         if(pEntry!=NULL)
    1769                 :            :         {
    1770         [ #  # ]:          0 :             pTheView->Select(pEntry);
    1771                 :            :         }
    1772                 :            :         else
    1773                 :            :         {
    1774         [ #  # ]:          0 :             aPopup.Deactivate();
    1775                 :            :         }
    1776                 :            : 
    1777                 :          0 :         sal_uInt16 nSortedCol= pTheView->GetSortedCol();
    1778                 :            : 
    1779         [ #  # ]:          0 :         if(nSortedCol!=0xFFFF)
    1780                 :            :         {
    1781                 :          0 :             sal_uInt16 nItemId=nSortedCol+SC_SUB_SORT+1;
    1782                 :            : 
    1783         [ #  # ]:          0 :             aPopup.CheckItem(nItemId);
    1784                 :            : 
    1785         [ #  # ]:          0 :             PopupMenu *pSubMenu = aPopup.GetPopupMenu(SC_SUB_SORT);
    1786                 :            : 
    1787         [ #  # ]:          0 :             if (pSubMenu)
    1788         [ #  # ]:          0 :                 pSubMenu->CheckItem(nItemId);
    1789                 :            :         }
    1790                 :            : 
    1791         [ #  # ]:          0 :         aPopup.EnableItem(SC_CHANGES_COMMENT,false);
    1792                 :            : 
    1793 [ #  # ][ #  # ]:          0 :         if(pDoc->IsDocEditable() && pEntry!=NULL)
         [ #  # ][ #  # ]
    1794                 :            :         {
    1795                 :          0 :             ScRedlinData *pEntryData=(ScRedlinData *)(pEntry->GetUserData());
    1796         [ #  # ]:          0 :             if(pEntryData!=NULL)
    1797                 :            :             {
    1798                 :            :                 ScChangeAction* pScChangeAction=
    1799                 :          0 :                         (ScChangeAction*) pEntryData->pData;
    1800 [ #  # ][ #  # ]:          0 :                 if(pScChangeAction!=NULL && !pTheView->GetParent(pEntry))
         [ #  # ][ #  # ]
    1801         [ #  # ]:          0 :                     aPopup.EnableItem(SC_CHANGES_COMMENT);
    1802                 :            :             }
    1803                 :            :         }
    1804                 :            : 
    1805 [ #  # ][ #  # ]:          0 :         sal_uInt16 nCommand=aPopup.Execute( this, GetPointerPosPixel() );
    1806                 :            : 
    1807                 :            : 
    1808         [ #  # ]:          0 :         if(nCommand)
    1809                 :            :         {
    1810         [ #  # ]:          0 :             if(nCommand==SC_CHANGES_COMMENT)
    1811                 :            :             {
    1812         [ #  # ]:          0 :                 if(pEntry!=NULL)
    1813                 :            :                 {
    1814                 :          0 :                     ScRedlinData *pEntryData=(ScRedlinData *)(pEntry->GetUserData());
    1815         [ #  # ]:          0 :                     if(pEntryData!=NULL)
    1816                 :            :                     {
    1817                 :            :                         ScChangeAction* pScChangeAction=
    1818                 :          0 :                                 (ScChangeAction*) pEntryData->pData;
    1819                 :            : 
    1820         [ #  # ]:          0 :                         pViewData->GetDocShell()->ExecuteChangeCommentDialog( pScChangeAction, this,false);
    1821                 :            :                     }
    1822                 :            :                 }
    1823                 :            :             }
    1824                 :            :             else
    1825                 :            :             {
    1826                 :          0 :                 bool bSortDir = pTheView->GetSortDirection();
    1827                 :          0 :                 sal_uInt16 nDialogCol=nCommand-SC_SUB_SORT-1;
    1828         [ #  # ]:          0 :                 if(nSortedCol==nDialogCol) bSortDir=!bSortDir;
    1829         [ #  # ]:          0 :                 pTheView->SortByCol(nDialogCol,bSortDir);
    1830                 :            :                 /*
    1831                 :            :                 SC_SUB_SORT
    1832                 :            :                 SC_SORT_ACTION
    1833                 :            :                 SC_SORT_POSITION
    1834                 :            :                 SC_SORT_AUTHOR
    1835                 :            :                 SC_SORT_DATE
    1836                 :            :                 SC_SORT_COMMENT
    1837                 :            :                 */
    1838                 :            :             }
    1839         [ #  # ]:          0 :         }
    1840                 :            :     }
    1841                 :          0 :     return 0;
    1842                 :            : }
    1843                 :            : 
    1844                 :          0 : void ScAcceptChgDlg::Initialize(SfxChildWinInfo *pInfo)
    1845                 :            : {
    1846         [ #  # ]:          0 :     String aStr;
    1847         [ #  # ]:          0 :     if(pInfo!=NULL)
    1848                 :            :     {
    1849         [ #  # ]:          0 :         if ( pInfo->aExtraString.Len() )
    1850                 :            :         {
    1851                 :            :             xub_StrLen nPos = pInfo->aExtraString.Search(
    1852 [ #  # ][ #  # ]:          0 :                 rtl::OUString("AcceptChgDat:"));
                 [ #  # ]
    1853                 :            : 
    1854                 :            :             // Versuche, den Alignment-String "ALIGN:(...)" einzulesen; wenn
    1855                 :            :             // er nicht vorhanden ist, liegt eine "altere Version vor
    1856         [ #  # ]:          0 :             if ( nPos != STRING_NOTFOUND )
    1857                 :            :             {
    1858         [ #  # ]:          0 :                 xub_StrLen n1 = pInfo->aExtraString.Search('(', nPos);
    1859         [ #  # ]:          0 :                 if ( n1 != STRING_NOTFOUND )
    1860                 :            :                 {
    1861         [ #  # ]:          0 :                     xub_StrLen n2 = pInfo->aExtraString.Search(')', n1);
    1862         [ #  # ]:          0 :                     if ( n2 != STRING_NOTFOUND )
    1863                 :            :                     {
    1864                 :            :                         // Alignment-String herausschneiden
    1865 [ #  # ][ #  # ]:          0 :                         aStr = pInfo->aExtraString.Copy(nPos, n2 - nPos + 1);
                 [ #  # ]
    1866         [ #  # ]:          0 :                         pInfo->aExtraString.Erase(nPos, n2 - nPos + 1);
    1867         [ #  # ]:          0 :                         aStr.Erase(0, n1-nPos+1);
    1868                 :            :                     }
    1869                 :            :                 }
    1870                 :            :             }
    1871                 :            :         }
    1872                 :            :     }
    1873         [ #  # ]:          0 :     SfxModelessDialog::Initialize(pInfo);
    1874                 :            : 
    1875         [ #  # ]:          0 :     if ( aStr.Len())
    1876                 :            :     {
    1877         [ #  # ]:          0 :         sal_uInt16 nCount=(sal_uInt16)aStr.ToInt32();
    1878                 :            : 
    1879         [ #  # ]:          0 :         for(sal_uInt16 i=0;i<nCount;i++)
    1880                 :            :         {
    1881         [ #  # ]:          0 :             xub_StrLen n1 = aStr.Search(';');
    1882         [ #  # ]:          0 :             aStr.Erase(0, n1+1);
    1883 [ #  # ][ #  # ]:          0 :             pTheView->SetTab(i,(sal_uInt16)aStr.ToInt32(),MAP_PIXEL);
    1884                 :            :         }
    1885         [ #  # ]:          0 :     }
    1886                 :          0 : }
    1887                 :            : 
    1888                 :            : //-------------------------------------------------------------------------
    1889                 :            : 
    1890                 :          0 : void ScAcceptChgDlg::FillInfo(SfxChildWinInfo& rInfo) const
    1891                 :            : {
    1892                 :          0 :     SfxModelessDialog::FillInfo(rInfo);
    1893                 :          0 :     rInfo.aExtraString.AppendAscii(RTL_CONSTASCII_STRINGPARAM( "AcceptChgDat:(" ));
    1894                 :            : 
    1895                 :          0 :     sal_uInt16  nCount=pTheView->TabCount();
    1896                 :            : 
    1897         [ #  # ]:          0 :     rInfo.aExtraString += String::CreateFromInt32(nCount);
    1898                 :          0 :     rInfo.aExtraString += ';';
    1899         [ #  # ]:          0 :     for(sal_uInt16 i=0;i<nCount;i++)
    1900                 :            :     {
    1901         [ #  # ]:          0 :         rInfo.aExtraString += String::CreateFromInt32(pTheView->GetTab(i));
    1902                 :          0 :         rInfo.aExtraString += ';';
    1903                 :            :     }
    1904                 :          0 :     rInfo.aExtraString += ')';
    1905                 :          0 : }
    1906                 :            : 
    1907                 :          0 : void ScAcceptChgDlg::InitFilter()
    1908                 :            : {
    1909 [ #  # ][ #  #  :          0 :     if(pTPFilter->IsDate()||pTPFilter->IsRange()||
             #  #  #  # ]
                 [ #  # ]
    1910                 :          0 :         pTPFilter->IsAuthor()||pTPFilter->IsComment())
    1911                 :            :     {
    1912 [ #  # ][ #  # ]:          0 :         pTheView->SetFilterDate(pTPFilter->IsDate());
    1913 [ #  # ][ #  # ]:          0 :         pTheView->SetDateTimeMode(pTPFilter->GetDateMode());
    1914 [ #  # ][ #  # ]:          0 :         pTheView->SetFirstDate(pTPFilter->GetFirstDate());
    1915 [ #  # ][ #  # ]:          0 :         pTheView->SetLastDate(pTPFilter->GetLastDate());
    1916 [ #  # ][ #  # ]:          0 :         pTheView->SetFirstTime(pTPFilter->GetFirstTime());
    1917 [ #  # ][ #  # ]:          0 :         pTheView->SetLastTime(pTPFilter->GetLastTime());
    1918 [ #  # ][ #  # ]:          0 :         pTheView->SetFilterAuthor(pTPFilter->IsAuthor());
    1919 [ #  # ][ #  # ]:          0 :         pTheView->SetAuthor(pTPFilter->GetSelectedAuthor());
                 [ #  # ]
    1920                 :            : 
    1921 [ #  # ][ #  # ]:          0 :         pTheView->SetFilterComment(pTPFilter->IsComment());
    1922                 :            : 
    1923                 :            :         utl::SearchParam aSearchParam( pTPFilter->GetComment(),
    1924 [ #  # ][ #  # ]:          0 :                 utl::SearchParam::SRCH_REGEXP,false,false,false );
                 [ #  # ]
    1925                 :            : 
    1926         [ #  # ]:          0 :         pTheView->SetCommentParams(&aSearchParam);
    1927                 :            : 
    1928 [ #  # ][ #  # ]:          0 :         pTheView->UpdateFilterTest();
    1929                 :            :     }
    1930                 :          0 : }
    1931                 :            : 
    1932                 :          0 : IMPL_LINK_NOARG(ScAcceptChgDlg, FilterModified)
    1933                 :            : {
    1934                 :          0 :     return 0;
    1935                 :            : }
    1936                 :            : 
    1937                 :            : #define CALC_DATE       3
    1938                 :            : #define CALC_POS        1
    1939                 :            : 
    1940                 :          0 : IMPL_LINK( ScAcceptChgDlg, ColCompareHdl, SvSortData*, pSortData )
    1941                 :            : {
    1942                 :          0 :     StringCompare eCompare=COMPARE_EQUAL;
    1943                 :          0 :     SCCOL nSortCol= static_cast<SCCOL>(pTheView->GetSortedCol());
    1944                 :            : 
    1945         [ #  # ]:          0 :     if(pSortData)
    1946                 :            :     {
    1947                 :          0 :         SvLBoxEntry* pLeft = (SvLBoxEntry*)(pSortData->pLeft );
    1948                 :          0 :         SvLBoxEntry* pRight = (SvLBoxEntry*)(pSortData->pRight );
    1949                 :            : 
    1950         [ #  # ]:          0 :         if(CALC_DATE==nSortCol)
    1951                 :            :         {
    1952                 :          0 :             RedlinData *pLeftData=(RedlinData *)(pLeft->GetUserData());
    1953                 :          0 :             RedlinData *pRightData=(RedlinData *)(pRight->GetUserData());
    1954                 :            : 
    1955 [ #  # ][ #  # ]:          0 :             if(pLeftData!=NULL && pRightData!=NULL)
    1956                 :            :             {
    1957         [ #  # ]:          0 :                 if(pLeftData->aDateTime < pRightData->aDateTime)
    1958                 :          0 :                     eCompare=COMPARE_LESS;
    1959         [ #  # ]:          0 :                 else if(pLeftData->aDateTime > pRightData->aDateTime)
    1960                 :          0 :                     eCompare=COMPARE_GREATER;
    1961                 :            : 
    1962                 :          0 :                 return eCompare;
    1963                 :            :             }
    1964                 :            :         }
    1965         [ #  # ]:          0 :         else if(CALC_POS==nSortCol)
    1966                 :            :         {
    1967                 :          0 :             ScRedlinData *pLeftData=(ScRedlinData *)(pLeft->GetUserData());
    1968                 :          0 :             ScRedlinData *pRightData=(ScRedlinData *)(pRight->GetUserData());
    1969                 :            : 
    1970 [ #  # ][ #  # ]:          0 :             if(pLeftData!=NULL && pRightData!=NULL)
    1971                 :            :             {
    1972                 :          0 :                 eCompare=COMPARE_GREATER;
    1973                 :            : 
    1974         [ #  # ]:          0 :                 if(pLeftData->nTable < pRightData->nTable)
    1975                 :          0 :                     eCompare=COMPARE_LESS;
    1976         [ #  # ]:          0 :                 else if(pLeftData->nTable == pRightData->nTable)
    1977                 :            :                 {
    1978         [ #  # ]:          0 :                     if(pLeftData->nRow < pRightData->nRow)
    1979                 :          0 :                         eCompare=COMPARE_LESS;
    1980         [ #  # ]:          0 :                     else if(pLeftData->nRow == pRightData->nRow)
    1981                 :            :                     {
    1982         [ #  # ]:          0 :                         if(pLeftData->nCol < pRightData->nCol)
    1983                 :          0 :                             eCompare=COMPARE_LESS;
    1984         [ #  # ]:          0 :                         else if(pLeftData->nCol == pRightData->nCol)
    1985                 :          0 :                             eCompare=COMPARE_EQUAL;
    1986                 :            :                     }
    1987                 :            :                 }
    1988                 :            : 
    1989                 :          0 :                 return eCompare;
    1990                 :            :             }
    1991                 :            :         }
    1992                 :            : 
    1993                 :          0 :         SvLBoxItem* pLeftItem = pTheView->GetEntryAtPos( pLeft, static_cast<sal_uInt16>(nSortCol));
    1994                 :          0 :         SvLBoxItem* pRightItem = pTheView->GetEntryAtPos( pRight, static_cast<sal_uInt16>(nSortCol));
    1995                 :            : 
    1996 [ #  # ][ #  # ]:          0 :         if(pLeftItem != NULL && pRightItem != NULL)
    1997                 :            :         {
    1998                 :          0 :             sal_uInt16 nLeftKind=pLeftItem->IsA();
    1999                 :          0 :             sal_uInt16 nRightKind=pRightItem->IsA();
    2000                 :            : 
    2001 [ #  # ][ #  # ]:          0 :             if(nRightKind == SV_ITEM_ID_LBOXSTRING &&
    2002                 :            :                 nLeftKind == SV_ITEM_ID_LBOXSTRING )
    2003                 :            :             {
    2004                 :            :                 eCompare= (StringCompare) ScGlobal::GetCaseCollator()->compareString(
    2005                 :            :                                         ((SvLBoxString*)pLeftItem)->GetText(),
    2006 [ #  # ][ #  # ]:          0 :                                         ((SvLBoxString*)pRightItem)->GetText());
    2007                 :            : 
    2008         [ #  # ]:          0 :                 if(eCompare==COMPARE_EQUAL) eCompare=COMPARE_LESS;
    2009                 :            :             }
    2010                 :            :         }
    2011                 :            : 
    2012                 :            : 
    2013                 :            :     }
    2014                 :          0 :     return eCompare;
    2015                 :            : }
    2016                 :            : 
    2017                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10