1f6e50924SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3f6e50924SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4f6e50924SAndrew Rist * or more contributor license agreements. See the NOTICE file 5f6e50924SAndrew Rist * distributed with this work for additional information 6f6e50924SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7f6e50924SAndrew Rist * to you under the Apache License, Version 2.0 (the 8f6e50924SAndrew Rist * "License"); you may not use this file except in compliance 9f6e50924SAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 11f6e50924SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 13f6e50924SAndrew Rist * Unless required by applicable law or agreed to in writing, 14f6e50924SAndrew Rist * software distributed under the License is distributed on an 15f6e50924SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16f6e50924SAndrew Rist * KIND, either express or implied. See the License for the 17f6e50924SAndrew Rist * specific language governing permissions and limitations 18f6e50924SAndrew Rist * under the License. 19cdf0e10cSrcweir * 20f6e50924SAndrew Rist *************************************************************/ 21f6e50924SAndrew Rist 22f6e50924SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove 25cdf0e10cSrcweir #include "precompiled_svx.hxx" 26cdf0e10cSrcweir 27cdf0e10cSrcweir // System - Includes --------------------------------------------------------- 28cdf0e10cSrcweir #include <vcl/svapp.hxx> 29cdf0e10cSrcweir #include <tools/shl.hxx> 30cdf0e10cSrcweir #include <sfx2/app.hxx> 31cdf0e10cSrcweir #include <sfx2/module.hxx> 32cdf0e10cSrcweir #include <svtools/txtcmp.hxx> 33cdf0e10cSrcweir #include <unotools/charclass.hxx> 34cdf0e10cSrcweir // INCLUDE ------------------------------------------------------------------- 35cdf0e10cSrcweir #include <editeng/unolingu.hxx> 36cdf0e10cSrcweir #include <svx/dialmgr.hxx> 37cdf0e10cSrcweir #include "ctredlin.hrc" 38cdf0e10cSrcweir #include <svx/ctredlin.hxx> 39cdf0e10cSrcweir #include "helpid.hrc" 40cdf0e10cSrcweir 41cdf0e10cSrcweir //============================================================================ 42cdf0e10cSrcweir // Local Defines and Function 43cdf0e10cSrcweir //---------------------------------------------------------------------------- 44cdf0e10cSrcweir 45cdf0e10cSrcweir inline void EnableDisable( Window& rWin, sal_Bool bEnable ) 46cdf0e10cSrcweir { 47cdf0e10cSrcweir if (bEnable) 48cdf0e10cSrcweir rWin.Enable(); 49cdf0e10cSrcweir else 50cdf0e10cSrcweir rWin.Disable(); 51cdf0e10cSrcweir } 52cdf0e10cSrcweir 53cdf0e10cSrcweir static long nStaticTabs[]= 54cdf0e10cSrcweir { 55cdf0e10cSrcweir 5,10,65,120,170,220 56cdf0e10cSrcweir }; 57cdf0e10cSrcweir 58cdf0e10cSrcweir #define MIN_DISTANCE 6 59cdf0e10cSrcweir #define WRITER_AUTHOR 1 60cdf0e10cSrcweir #define WRITER_DATE 2 61cdf0e10cSrcweir #define CALC_AUTHOR 2 62cdf0e10cSrcweir #define CALC_DATE 3 63cdf0e10cSrcweir 64cdf0e10cSrcweir RedlinData::RedlinData() 65cdf0e10cSrcweir { 66cdf0e10cSrcweir bDisabled=sal_False; 67cdf0e10cSrcweir pData=NULL; 68cdf0e10cSrcweir } 69cdf0e10cSrcweir RedlinData::~RedlinData() 70cdf0e10cSrcweir { 71cdf0e10cSrcweir } 72cdf0e10cSrcweir 73cdf0e10cSrcweir //============================================================================ 74cdf0e10cSrcweir // class SvxRedlinEntry (Eintraege fuer Liste) 75cdf0e10cSrcweir //---------------------------------------------------------------------------- 76cdf0e10cSrcweir 77cdf0e10cSrcweir SvxRedlinEntry::SvxRedlinEntry() 78cdf0e10cSrcweir :SvLBoxEntry() 79cdf0e10cSrcweir { 80cdf0e10cSrcweir } 81cdf0e10cSrcweir 82cdf0e10cSrcweir SvxRedlinEntry::~SvxRedlinEntry() 83cdf0e10cSrcweir { 84cdf0e10cSrcweir RedlinData* pRedDat=(RedlinData*) GetUserData(); 85cdf0e10cSrcweir if(pRedDat!=NULL) 86cdf0e10cSrcweir { 87cdf0e10cSrcweir delete pRedDat; 88cdf0e10cSrcweir } 89cdf0e10cSrcweir } 90cdf0e10cSrcweir 91cdf0e10cSrcweir /************************************************************************* 92cdf0e10cSrcweir #* Funktionen der in den SvxRedlinTable eingefuegten Items 93cdf0e10cSrcweir #************************************************************************/ 94cdf0e10cSrcweir 95cdf0e10cSrcweir DBG_NAME(SvLBoxColorString); 96cdf0e10cSrcweir 97cdf0e10cSrcweir /************************************************************************* 98cdf0e10cSrcweir #* Member: SvLBoxColorString Datum:23.10.97 99cdf0e10cSrcweir #*------------------------------------------------------------------------ 100cdf0e10cSrcweir #* 101cdf0e10cSrcweir #* Klasse: SvLBoxColorString 102cdf0e10cSrcweir #* 103cdf0e10cSrcweir #* Funktion: Konstruktor der Klasse SvLBoxColorString 104cdf0e10cSrcweir #* 105cdf0e10cSrcweir #* Input: Box- Entry,Flags, Text fuer Anzeige, Schrift 106cdf0e10cSrcweir #* 107cdf0e10cSrcweir #* Output: --- 108cdf0e10cSrcweir #* 109cdf0e10cSrcweir #************************************************************************/ 110cdf0e10cSrcweir 111cdf0e10cSrcweir SvLBoxColorString::SvLBoxColorString( SvLBoxEntry*pEntry,sal_uInt16 nFlags,const XubString& rStr, 112cdf0e10cSrcweir const Color& rCol) 113cdf0e10cSrcweir 114cdf0e10cSrcweir : SvLBoxString( pEntry, nFlags, rStr ) 115cdf0e10cSrcweir { 116cdf0e10cSrcweir DBG_CTOR(SvLBoxColorString,0); 117cdf0e10cSrcweir aPrivColor=rCol; 118cdf0e10cSrcweir SetText( pEntry, rStr ); 119cdf0e10cSrcweir } 120cdf0e10cSrcweir 121cdf0e10cSrcweir /************************************************************************* 122cdf0e10cSrcweir #* Member: SvLBoxColorString Datum:23.10.97 123cdf0e10cSrcweir #*------------------------------------------------------------------------ 124cdf0e10cSrcweir #* 125cdf0e10cSrcweir #* Klasse: SvLBoxColorString 126cdf0e10cSrcweir #* 127cdf0e10cSrcweir #* Funktion: Default Konstruktor der Klasse SvLBoxColorString 128cdf0e10cSrcweir #* 129cdf0e10cSrcweir #* Input: --- 130cdf0e10cSrcweir #* 131cdf0e10cSrcweir #* Output: --- 132cdf0e10cSrcweir #* 133cdf0e10cSrcweir #************************************************************************/ 134cdf0e10cSrcweir 135cdf0e10cSrcweir SvLBoxColorString::SvLBoxColorString() 136cdf0e10cSrcweir : SvLBoxString() 137cdf0e10cSrcweir { 138cdf0e10cSrcweir DBG_CTOR(SvLBoxColorString,0); 139cdf0e10cSrcweir } 140cdf0e10cSrcweir 141cdf0e10cSrcweir /************************************************************************* 142cdf0e10cSrcweir #* Member: ~SvLBoxColorString Datum:23.10.97 143cdf0e10cSrcweir #*------------------------------------------------------------------------ 144cdf0e10cSrcweir #* 145cdf0e10cSrcweir #* Klasse: SvLBoxColorString 146cdf0e10cSrcweir #* 147cdf0e10cSrcweir #* Funktion: Destruktor der Klasse SvLBoxColorString 148cdf0e10cSrcweir #* 149cdf0e10cSrcweir #* Input: --- 150cdf0e10cSrcweir #* 151cdf0e10cSrcweir #* Output: --- 152cdf0e10cSrcweir #* 153cdf0e10cSrcweir #************************************************************************/ 154cdf0e10cSrcweir 155cdf0e10cSrcweir SvLBoxColorString::~SvLBoxColorString() 156cdf0e10cSrcweir { 157cdf0e10cSrcweir DBG_DTOR(SvLBoxColorString,0); 158cdf0e10cSrcweir } 159cdf0e10cSrcweir 160cdf0e10cSrcweir 161cdf0e10cSrcweir /************************************************************************* 162cdf0e10cSrcweir #* Member: SvLBoxColorString Datum:23.10.97 163cdf0e10cSrcweir #*------------------------------------------------------------------------ 164cdf0e10cSrcweir #* 165cdf0e10cSrcweir #* Klasse: SvLBoxColorString 166cdf0e10cSrcweir #* 167cdf0e10cSrcweir #* Funktion: Erzeugt einen neuen SvLBoxColorString 168cdf0e10cSrcweir #* 169cdf0e10cSrcweir #* Input: --- 170cdf0e10cSrcweir #* 171cdf0e10cSrcweir #* Output: SvLBoxColorString 172cdf0e10cSrcweir #* 173cdf0e10cSrcweir #************************************************************************/ 174cdf0e10cSrcweir 175cdf0e10cSrcweir SvLBoxItem* SvLBoxColorString::Create() const 176cdf0e10cSrcweir { 177cdf0e10cSrcweir DBG_CHKTHIS(SvLBoxColorString,0); 178cdf0e10cSrcweir return new SvLBoxColorString; 179cdf0e10cSrcweir } 180cdf0e10cSrcweir 181cdf0e10cSrcweir 182cdf0e10cSrcweir 183cdf0e10cSrcweir /************************************************************************* 184cdf0e10cSrcweir #* Member: SvLBoxColorString Datum:23.10.97 185cdf0e10cSrcweir #*------------------------------------------------------------------------ 186cdf0e10cSrcweir #* 187cdf0e10cSrcweir #* Klasse: SvLBoxColorString 188cdf0e10cSrcweir #* 189cdf0e10cSrcweir #* Funktion: Zeichenroutine des SvLBoxColorString. Gezeichnet wird 190cdf0e10cSrcweir #* der entsprechende Text mit der eingestellten Farbe 191cdf0e10cSrcweir #* im Ausgabe- Device. 192cdf0e10cSrcweir #* 193cdf0e10cSrcweir #* Input: Position, Ausgabe- Device, Flag fuer Selection, 194cdf0e10cSrcweir #* Zeiger auf den Eintrag 195cdf0e10cSrcweir #* 196cdf0e10cSrcweir #* Output: --- 197cdf0e10cSrcweir #* 198cdf0e10cSrcweir #************************************************************************/ 199cdf0e10cSrcweir 200cdf0e10cSrcweir void SvLBoxColorString::Paint( const Point& rPos, SvLBox& rDev, 201cdf0e10cSrcweir sal_uInt16 nFlags, SvLBoxEntry* pEntry ) 202cdf0e10cSrcweir { 203cdf0e10cSrcweir Color aColor=rDev.GetTextColor(); 204cdf0e10cSrcweir Color a2Color=aColor; 205cdf0e10cSrcweir if(!(nFlags & SVLISTENTRYFLAG_SELECTED)) 206cdf0e10cSrcweir { 207cdf0e10cSrcweir rDev.SetTextColor(aPrivColor); 208cdf0e10cSrcweir } 209cdf0e10cSrcweir SvLBoxString::Paint(rPos,rDev,nFlags,pEntry ); 210cdf0e10cSrcweir rDev.SetTextColor(a2Color); 211cdf0e10cSrcweir } 212cdf0e10cSrcweir 213cdf0e10cSrcweir //============================================================================ 214cdf0e10cSrcweir // class SvxRedlinTable 215cdf0e10cSrcweir //---------------------------------------------------------------------------- 216cdf0e10cSrcweir 217cdf0e10cSrcweir SvxRedlinTable::SvxRedlinTable( Window* pParent,WinBits nBits ): 218cdf0e10cSrcweir SvxSimpleTable(pParent,nBits ) 219cdf0e10cSrcweir { 220cdf0e10cSrcweir bAuthor=sal_False; 221cdf0e10cSrcweir bDate=sal_False; 222cdf0e10cSrcweir bIsCalc=sal_False; 223cdf0e10cSrcweir bComment=sal_False; 224cdf0e10cSrcweir nDatePos=WRITER_DATE; 225cdf0e10cSrcweir pCommentSearcher=NULL; 226cdf0e10cSrcweir SetNodeDefaultImages(); 227cdf0e10cSrcweir } 228cdf0e10cSrcweir 229cdf0e10cSrcweir SvxRedlinTable::SvxRedlinTable( Window* pParent,const ResId& rResId): 230cdf0e10cSrcweir SvxSimpleTable(pParent,rResId) 231cdf0e10cSrcweir { 232cdf0e10cSrcweir bAuthor=sal_False; 233cdf0e10cSrcweir bDate=sal_False; 234cdf0e10cSrcweir bIsCalc=sal_False; 235cdf0e10cSrcweir bComment=sal_False; 236cdf0e10cSrcweir nDatePos=WRITER_DATE; 237cdf0e10cSrcweir pCommentSearcher=NULL; 238cdf0e10cSrcweir SetNodeDefaultImages(); 239cdf0e10cSrcweir } 240cdf0e10cSrcweir 241cdf0e10cSrcweir SvxRedlinTable::~SvxRedlinTable() 242cdf0e10cSrcweir { 243cdf0e10cSrcweir if(pCommentSearcher!=NULL) 244cdf0e10cSrcweir delete pCommentSearcher; 245cdf0e10cSrcweir } 246cdf0e10cSrcweir 247cdf0e10cSrcweir StringCompare SvxRedlinTable::ColCompare(SvLBoxEntry* pLeft,SvLBoxEntry* pRight) 248cdf0e10cSrcweir { 249cdf0e10cSrcweir StringCompare eCompare=COMPARE_EQUAL; 250cdf0e10cSrcweir 251cdf0e10cSrcweir if(aColCompareLink.IsSet()) 252cdf0e10cSrcweir { 253cdf0e10cSrcweir SvSortData aRedlinCompare; 254cdf0e10cSrcweir aRedlinCompare.pLeft=pLeft; 255cdf0e10cSrcweir aRedlinCompare.pRight=pRight; 256cdf0e10cSrcweir eCompare=(StringCompare) aColCompareLink.Call(&aRedlinCompare); 257cdf0e10cSrcweir } 258cdf0e10cSrcweir else 259cdf0e10cSrcweir { 260cdf0e10cSrcweir if(nDatePos==GetSortedCol()) 261cdf0e10cSrcweir { 262cdf0e10cSrcweir RedlinData *pLeftData=(RedlinData *)(pLeft->GetUserData()); 263cdf0e10cSrcweir RedlinData *pRightData=(RedlinData *)(pRight->GetUserData()); 264cdf0e10cSrcweir 265cdf0e10cSrcweir if(pLeftData!=NULL && pRightData!=NULL) 266cdf0e10cSrcweir { 267cdf0e10cSrcweir if(pLeftData->aDateTime < pRightData->aDateTime) 268cdf0e10cSrcweir { 269cdf0e10cSrcweir eCompare=COMPARE_LESS; 270cdf0e10cSrcweir } 271cdf0e10cSrcweir else if(pLeftData->aDateTime > pRightData->aDateTime) 272cdf0e10cSrcweir { 273cdf0e10cSrcweir eCompare=COMPARE_GREATER; 274cdf0e10cSrcweir } 275cdf0e10cSrcweir } 276cdf0e10cSrcweir else 277cdf0e10cSrcweir eCompare=SvxSimpleTable::ColCompare(pLeft,pRight); 278cdf0e10cSrcweir } 279cdf0e10cSrcweir else 280cdf0e10cSrcweir { 281cdf0e10cSrcweir eCompare=SvxSimpleTable::ColCompare(pLeft,pRight); 282cdf0e10cSrcweir } 283cdf0e10cSrcweir 284cdf0e10cSrcweir } 285cdf0e10cSrcweir 286cdf0e10cSrcweir return eCompare; 287cdf0e10cSrcweir } 288cdf0e10cSrcweir void SvxRedlinTable::SetCalcView(sal_Bool bFlag) 289cdf0e10cSrcweir { 290cdf0e10cSrcweir bIsCalc=bFlag; 291cdf0e10cSrcweir if(bFlag) 292cdf0e10cSrcweir { 293cdf0e10cSrcweir nDatePos=CALC_DATE; 294cdf0e10cSrcweir } 295cdf0e10cSrcweir else 296cdf0e10cSrcweir { 297cdf0e10cSrcweir nDatePos=WRITER_DATE; 298cdf0e10cSrcweir } 299cdf0e10cSrcweir } 300cdf0e10cSrcweir 301cdf0e10cSrcweir 302cdf0e10cSrcweir void SvxRedlinTable::UpdateFilterTest() 303cdf0e10cSrcweir { 304cdf0e10cSrcweir Date aDateMax; 305cdf0e10cSrcweir sal_uInt16 nYEAR=aDateMax.GetYear()+100; 306cdf0e10cSrcweir aDateMax.SetYear(nYEAR); 307cdf0e10cSrcweir Date aDateMin(1,1,1989); 308cdf0e10cSrcweir Time aTMin(0); 309cdf0e10cSrcweir Time aTMax(23,59,59); 310cdf0e10cSrcweir 311cdf0e10cSrcweir 312cdf0e10cSrcweir DateTime aDTMin(aDateMin); 313cdf0e10cSrcweir DateTime aDTMax(aDateMax); 314cdf0e10cSrcweir 315cdf0e10cSrcweir switch(nDaTiMode) 316cdf0e10cSrcweir { 317cdf0e10cSrcweir case FLT_DATE_BEFORE: 318cdf0e10cSrcweir aDaTiFilterFirst=aDTMin; 319cdf0e10cSrcweir aDaTiFilterLast=aDaTiFirst; 320cdf0e10cSrcweir break; 321cdf0e10cSrcweir case FLT_DATE_SAVE: 322cdf0e10cSrcweir case FLT_DATE_SINCE: 323cdf0e10cSrcweir aDaTiFilterFirst=aDaTiFirst; 324cdf0e10cSrcweir aDaTiFilterLast=aDTMax; 325cdf0e10cSrcweir break; 326cdf0e10cSrcweir case FLT_DATE_EQUAL: 327cdf0e10cSrcweir aDaTiFilterFirst=aDaTiFirst; 328cdf0e10cSrcweir aDaTiFilterLast=aDaTiFirst; 329cdf0e10cSrcweir aDaTiFilterFirst.SetTime(aTMin.GetTime()); 330cdf0e10cSrcweir aDaTiFilterLast.SetTime(aTMax.GetTime()); 331cdf0e10cSrcweir break; 332cdf0e10cSrcweir case FLT_DATE_NOTEQUAL: 333cdf0e10cSrcweir aDaTiFilterFirst=aDaTiFirst; 334cdf0e10cSrcweir aDaTiFilterLast=aDaTiFirst; 335cdf0e10cSrcweir aDaTiFilterFirst.SetTime(aTMin.GetTime()); 336cdf0e10cSrcweir aDaTiFilterLast.SetTime(aTMax.GetTime()); 337cdf0e10cSrcweir break; 338cdf0e10cSrcweir case FLT_DATE_BETWEEN: 339cdf0e10cSrcweir aDaTiFilterFirst=aDaTiFirst; 340cdf0e10cSrcweir aDaTiFilterLast=aDaTiLast; 341cdf0e10cSrcweir break; 342cdf0e10cSrcweir } 343cdf0e10cSrcweir } 344cdf0e10cSrcweir 345cdf0e10cSrcweir 346cdf0e10cSrcweir void SvxRedlinTable::SetFilterDate(sal_Bool bFlag) 347cdf0e10cSrcweir { 348cdf0e10cSrcweir bDate=bFlag; 349cdf0e10cSrcweir } 350cdf0e10cSrcweir 351cdf0e10cSrcweir void SvxRedlinTable::SetDateTimeMode(sal_uInt16 nMode) 352cdf0e10cSrcweir { 353cdf0e10cSrcweir nDaTiMode=nMode; 354cdf0e10cSrcweir } 355cdf0e10cSrcweir 356cdf0e10cSrcweir void SvxRedlinTable::SetFirstDate(const Date& aDate) 357cdf0e10cSrcweir { 358cdf0e10cSrcweir aDaTiFirst.SetDate(aDate.GetDate()); 359cdf0e10cSrcweir } 360cdf0e10cSrcweir 361cdf0e10cSrcweir void SvxRedlinTable::SetLastDate(const Date& aDate) 362cdf0e10cSrcweir { 363cdf0e10cSrcweir aDaTiLast.SetDate(aDate.GetDate()); 364cdf0e10cSrcweir } 365cdf0e10cSrcweir 366cdf0e10cSrcweir void SvxRedlinTable::SetFirstTime(const Time& aTime) 367cdf0e10cSrcweir { 368cdf0e10cSrcweir aDaTiFirst.SetTime(aTime.GetTime()); 369cdf0e10cSrcweir } 370cdf0e10cSrcweir 371cdf0e10cSrcweir void SvxRedlinTable::SetLastTime(const Time& aTime) 372cdf0e10cSrcweir { 373cdf0e10cSrcweir aDaTiLast.SetTime(aTime.GetTime()); 374cdf0e10cSrcweir } 375cdf0e10cSrcweir 376cdf0e10cSrcweir void SvxRedlinTable::SetFilterAuthor(sal_Bool bFlag) 377cdf0e10cSrcweir { 378cdf0e10cSrcweir bAuthor=bFlag; 379cdf0e10cSrcweir } 380cdf0e10cSrcweir 381cdf0e10cSrcweir void SvxRedlinTable::SetAuthor(const String &aString) 382cdf0e10cSrcweir { 383cdf0e10cSrcweir aAuthor=aString; 384cdf0e10cSrcweir } 385cdf0e10cSrcweir 386cdf0e10cSrcweir void SvxRedlinTable::SetFilterComment(sal_Bool bFlag) 387cdf0e10cSrcweir { 388cdf0e10cSrcweir bComment=bFlag; 389cdf0e10cSrcweir } 390cdf0e10cSrcweir 391cdf0e10cSrcweir void SvxRedlinTable::SetCommentParams( const utl::SearchParam* pSearchPara ) 392cdf0e10cSrcweir { 393cdf0e10cSrcweir if(pSearchPara!=NULL) 394cdf0e10cSrcweir { 395cdf0e10cSrcweir if(pCommentSearcher!=NULL) delete pCommentSearcher; 396cdf0e10cSrcweir 397cdf0e10cSrcweir pCommentSearcher=new utl::TextSearch(*pSearchPara, LANGUAGE_SYSTEM ); 398cdf0e10cSrcweir } 399cdf0e10cSrcweir } 400cdf0e10cSrcweir 401cdf0e10cSrcweir sal_Bool SvxRedlinTable::IsValidWriterEntry(const String& rString,RedlinData *pUserData) 402cdf0e10cSrcweir { 403cdf0e10cSrcweir sal_Bool nTheFlag=sal_True; 404cdf0e10cSrcweir String aString=rString.GetToken(WRITER_AUTHOR,'\t'); 405cdf0e10cSrcweir if(pUserData==NULL) 406cdf0e10cSrcweir { 407cdf0e10cSrcweir if(bAuthor) 408cdf0e10cSrcweir { 409cdf0e10cSrcweir if(aAuthor.CompareTo(aString)==COMPARE_EQUAL) 410cdf0e10cSrcweir nTheFlag=sal_True; 411cdf0e10cSrcweir else 412cdf0e10cSrcweir nTheFlag=sal_False; 413cdf0e10cSrcweir } 414cdf0e10cSrcweir } 415cdf0e10cSrcweir else 416cdf0e10cSrcweir { 417cdf0e10cSrcweir DateTime aDateTime=pUserData->aDateTime; 418cdf0e10cSrcweir nTheFlag=IsValidEntry(&aString,&aDateTime); 419cdf0e10cSrcweir } 420cdf0e10cSrcweir return nTheFlag; 421cdf0e10cSrcweir } 422cdf0e10cSrcweir 423cdf0e10cSrcweir sal_Bool SvxRedlinTable::IsValidCalcEntry(const String& rString,RedlinData *pUserData) 424cdf0e10cSrcweir { 425cdf0e10cSrcweir sal_Bool nTheFlag=sal_True; 426cdf0e10cSrcweir String aString=rString.GetToken(CALC_AUTHOR,'\t'); 427cdf0e10cSrcweir if(pUserData==NULL) 428cdf0e10cSrcweir { 429cdf0e10cSrcweir if(bAuthor) 430cdf0e10cSrcweir { 431cdf0e10cSrcweir if(aAuthor.CompareTo(aString)==COMPARE_EQUAL) 432cdf0e10cSrcweir nTheFlag=sal_True; 433cdf0e10cSrcweir else 434cdf0e10cSrcweir nTheFlag=sal_False; 435cdf0e10cSrcweir } 436cdf0e10cSrcweir } 437cdf0e10cSrcweir else 438cdf0e10cSrcweir { 439cdf0e10cSrcweir DateTime aDateTime=pUserData->aDateTime; 440cdf0e10cSrcweir nTheFlag=IsValidEntry(&aString,&aDateTime); 441cdf0e10cSrcweir } 442cdf0e10cSrcweir return nTheFlag; 443cdf0e10cSrcweir } 444cdf0e10cSrcweir 445cdf0e10cSrcweir sal_Bool SvxRedlinTable::IsValidEntry(const String* pAuthorStr, 446cdf0e10cSrcweir const DateTime *pDateTime,const String* pCommentStr) 447cdf0e10cSrcweir { 448cdf0e10cSrcweir bool nTheFlag=true; 449cdf0e10cSrcweir if(bAuthor) 450cdf0e10cSrcweir { 451cdf0e10cSrcweir nTheFlag = aAuthor.CompareTo(*pAuthorStr)==COMPARE_EQUAL; 452cdf0e10cSrcweir } 453cdf0e10cSrcweir if(bDate && nTheFlag) 454cdf0e10cSrcweir { 455cdf0e10cSrcweir if(nDaTiMode!=FLT_DATE_NOTEQUAL) 456cdf0e10cSrcweir { 457cdf0e10cSrcweir nTheFlag=pDateTime->IsBetween(aDaTiFilterFirst,aDaTiFilterLast); 458cdf0e10cSrcweir } 459cdf0e10cSrcweir else 460cdf0e10cSrcweir { 461cdf0e10cSrcweir nTheFlag=!(pDateTime->IsBetween(aDaTiFilterFirst,aDaTiFilterLast)); 462cdf0e10cSrcweir } 463cdf0e10cSrcweir } 464cdf0e10cSrcweir if(bComment && nTheFlag) 465cdf0e10cSrcweir { 466cdf0e10cSrcweir xub_StrLen nStartPos = 0; 467cdf0e10cSrcweir xub_StrLen nEndPos = pCommentStr->Len(); 468cdf0e10cSrcweir 469cdf0e10cSrcweir nTheFlag=pCommentSearcher->SearchFrwrd( *pCommentStr, &nStartPos, &nEndPos); 470cdf0e10cSrcweir } 471cdf0e10cSrcweir return nTheFlag; 472cdf0e10cSrcweir } 473cdf0e10cSrcweir 474cdf0e10cSrcweir sal_Bool SvxRedlinTable::IsValidEntry(const String* pAuthorStr,const DateTime *pDateTime) 475cdf0e10cSrcweir { 476cdf0e10cSrcweir sal_Bool nTheFlag=sal_True; 477cdf0e10cSrcweir if(bAuthor) 478cdf0e10cSrcweir { 479cdf0e10cSrcweir if(aAuthor.CompareTo(*pAuthorStr)==COMPARE_EQUAL) 480cdf0e10cSrcweir nTheFlag=sal_True; 481cdf0e10cSrcweir else 482cdf0e10cSrcweir nTheFlag=sal_False; 483cdf0e10cSrcweir } 484cdf0e10cSrcweir if(bDate && nTheFlag) 485cdf0e10cSrcweir { 486cdf0e10cSrcweir if(nDaTiMode!=FLT_DATE_NOTEQUAL) 487cdf0e10cSrcweir { 488cdf0e10cSrcweir nTheFlag=pDateTime->IsBetween(aDaTiFilterFirst,aDaTiFilterLast); 489cdf0e10cSrcweir } 490cdf0e10cSrcweir else 491cdf0e10cSrcweir { 492cdf0e10cSrcweir nTheFlag=!(pDateTime->IsBetween(aDaTiFilterFirst,aDaTiFilterLast)); 493cdf0e10cSrcweir } 494cdf0e10cSrcweir } 495cdf0e10cSrcweir return nTheFlag; 496cdf0e10cSrcweir } 497cdf0e10cSrcweir 498cdf0e10cSrcweir sal_Bool SvxRedlinTable::IsValidComment(const String* pCommentStr) 499cdf0e10cSrcweir { 500cdf0e10cSrcweir bool nTheFlag=true; 501cdf0e10cSrcweir 502cdf0e10cSrcweir if(bComment) 503cdf0e10cSrcweir { 504cdf0e10cSrcweir xub_StrLen nStartPos = 0; 505cdf0e10cSrcweir xub_StrLen nEndPos = pCommentStr->Len(); 506cdf0e10cSrcweir 507cdf0e10cSrcweir nTheFlag=pCommentSearcher->SearchFrwrd( *pCommentStr, &nStartPos, &nEndPos); 508cdf0e10cSrcweir } 509cdf0e10cSrcweir return nTheFlag; 510cdf0e10cSrcweir } 511cdf0e10cSrcweir 512cdf0e10cSrcweir SvLBoxEntry* SvxRedlinTable::InsertEntry(const String& rStr,RedlinData *pUserData, 513cdf0e10cSrcweir SvLBoxEntry* pParent,sal_uIntPtr nPos) 514cdf0e10cSrcweir { 515cdf0e10cSrcweir aEntryColor=GetTextColor(); 516cdf0e10cSrcweir if(pUserData!=NULL) 517cdf0e10cSrcweir { 518cdf0e10cSrcweir if(pUserData->bDisabled) 519cdf0e10cSrcweir aEntryColor=Color(COL_GRAY); 520cdf0e10cSrcweir } 521cdf0e10cSrcweir 522cdf0e10cSrcweir XubString aStr= rStr; 523cdf0e10cSrcweir 524cdf0e10cSrcweir XubString aFirstStr( aStr ); 525cdf0e10cSrcweir xub_StrLen nEnd = aFirstStr.Search( sal_Unicode( '\t' ) ); 526cdf0e10cSrcweir if( nEnd != STRING_NOTFOUND ) 527cdf0e10cSrcweir { 528cdf0e10cSrcweir aFirstStr.Erase( nEnd ); 529cdf0e10cSrcweir aCurEntry = aStr; 530cdf0e10cSrcweir aCurEntry.Erase( 0, ++nEnd ); 531cdf0e10cSrcweir } 532cdf0e10cSrcweir else 533cdf0e10cSrcweir aCurEntry.Erase(); 534cdf0e10cSrcweir 535cdf0e10cSrcweir return SvTreeListBox::InsertEntry( aFirstStr, pParent, sal_False, nPos, pUserData ); 536cdf0e10cSrcweir 537cdf0e10cSrcweir } 538cdf0e10cSrcweir 539cdf0e10cSrcweir SvLBoxEntry* SvxRedlinTable::InsertEntry(const String& rStr,RedlinData *pUserData,const Color& aColor, 540cdf0e10cSrcweir SvLBoxEntry* pParent,sal_uIntPtr nPos) 541cdf0e10cSrcweir { 542cdf0e10cSrcweir aEntryColor=aColor; 543cdf0e10cSrcweir 544cdf0e10cSrcweir XubString aStr= rStr; 545cdf0e10cSrcweir 546cdf0e10cSrcweir XubString aFirstStr( aStr ); 547cdf0e10cSrcweir xub_StrLen nEnd = aFirstStr.Search( sal_Unicode ( '\t' ) ); 548cdf0e10cSrcweir if( nEnd != STRING_NOTFOUND ) 549cdf0e10cSrcweir { 550cdf0e10cSrcweir aFirstStr.Erase( nEnd ); 551cdf0e10cSrcweir aCurEntry = aStr; 552cdf0e10cSrcweir aCurEntry.Erase( 0, ++nEnd ); 553cdf0e10cSrcweir } 554cdf0e10cSrcweir else 555cdf0e10cSrcweir aCurEntry.Erase(); 556cdf0e10cSrcweir 557cdf0e10cSrcweir return SvTreeListBox::InsertEntry( aFirstStr, pParent, sal_False, nPos, pUserData ); 558cdf0e10cSrcweir } 559cdf0e10cSrcweir 560cdf0e10cSrcweir SvLBoxEntry* SvxRedlinTable::CreateEntry() const 561cdf0e10cSrcweir { 562cdf0e10cSrcweir return new SvxRedlinEntry; 563cdf0e10cSrcweir } 564cdf0e10cSrcweir 565cdf0e10cSrcweir void SvxRedlinTable::InitEntry( SvLBoxEntry* pEntry, const XubString& rStr, 566cdf0e10cSrcweir const Image& rColl, const Image& rExp, SvLBoxButtonKind eButtonKind ) 567cdf0e10cSrcweir { 568cdf0e10cSrcweir SvLBoxButton* pButton; 569cdf0e10cSrcweir SvLBoxString* pString; 570cdf0e10cSrcweir SvLBoxContextBmp* pContextBmp; 571cdf0e10cSrcweir 572cdf0e10cSrcweir if( nTreeFlags & TREEFLAG_CHKBTN ) 573cdf0e10cSrcweir { 574cdf0e10cSrcweir pButton= new SvLBoxButton( pEntry,eButtonKind,0,pCheckButtonData ); 575cdf0e10cSrcweir pEntry->AddItem( pButton ); 576cdf0e10cSrcweir } 577cdf0e10cSrcweir 578cdf0e10cSrcweir pContextBmp= new SvLBoxContextBmp( pEntry,0, rColl,rExp, 579cdf0e10cSrcweir SVLISTENTRYFLAG_EXPANDED); 580cdf0e10cSrcweir pEntry->AddItem( pContextBmp ); 581cdf0e10cSrcweir 582cdf0e10cSrcweir pString = new SvLBoxColorString( pEntry, 0, rStr ,aEntryColor); 583cdf0e10cSrcweir pEntry->AddItem( pString ); 584cdf0e10cSrcweir 585cdf0e10cSrcweir XubString aToken; 586cdf0e10cSrcweir 587cdf0e10cSrcweir xub_Unicode* pCurToken = (xub_Unicode*)aCurEntry.GetBuffer(); 588cdf0e10cSrcweir sal_uInt16 nCurTokenLen; 589cdf0e10cSrcweir xub_Unicode* pNextToken = (xub_Unicode*)GetToken( pCurToken, nCurTokenLen ); 590cdf0e10cSrcweir sal_uInt16 nCount = TabCount(); nCount--; 591cdf0e10cSrcweir 592cdf0e10cSrcweir for( sal_uInt16 nToken = 0; nToken < nCount; nToken++ ) 593cdf0e10cSrcweir { 594cdf0e10cSrcweir if( pCurToken && nCurTokenLen ) 595cdf0e10cSrcweir // aToken.Assign( pCurToken, nCurTokenLen ); 596cdf0e10cSrcweir aToken = XubString( pCurToken, nCurTokenLen ); 597cdf0e10cSrcweir else 598cdf0e10cSrcweir aToken.Erase(); 599cdf0e10cSrcweir 600cdf0e10cSrcweir SvLBoxColorString* pStr = new SvLBoxColorString( pEntry, 0, aToken ,aEntryColor); 601cdf0e10cSrcweir pEntry->AddItem( pStr ); 602cdf0e10cSrcweir 603cdf0e10cSrcweir pCurToken = pNextToken; 604cdf0e10cSrcweir if( pCurToken ) 605cdf0e10cSrcweir pNextToken = (xub_Unicode*)GetToken( pCurToken, nCurTokenLen ); 606cdf0e10cSrcweir else 607cdf0e10cSrcweir nCurTokenLen = 0; 608cdf0e10cSrcweir } 609cdf0e10cSrcweir } 610cdf0e10cSrcweir 611cdf0e10cSrcweir 612cdf0e10cSrcweir 613cdf0e10cSrcweir 614cdf0e10cSrcweir //============================================================================ 615cdf0e10cSrcweir // class SvxTPView 616cdf0e10cSrcweir //---------------------------------------------------------------------------- 617cdf0e10cSrcweir 618cdf0e10cSrcweir SvxTPView::SvxTPView( Window * pParent) 619cdf0e10cSrcweir : TabPage( pParent, SVX_RES(SID_REDLIN_VIEW_PAGE)), 620cdf0e10cSrcweir aViewData ( this, SVX_RES( DG_VIEW) ), 621cdf0e10cSrcweir PbAccept ( this, SVX_RES(PB_ACCEPT ) ), 622cdf0e10cSrcweir PbReject ( this, SVX_RES(PB_REJECT ) ), 623cdf0e10cSrcweir PbAcceptAll ( this, SVX_RES(PB_ACCEPTALL ) ), 624cdf0e10cSrcweir PbRejectAll ( this, SVX_RES(PB_REJECTALL ) ), 625cdf0e10cSrcweir PbUndo ( this, SVX_RES(PB_UNDO ) ), 626cdf0e10cSrcweir aTitle1 ( SVX_RES( STR_TITLE1 ) ), // lokale Resource 627cdf0e10cSrcweir aTitle2 ( SVX_RES( STR_TITLE2 ) ), 628cdf0e10cSrcweir aTitle3 ( SVX_RES( STR_TITLE3 ) ), 629cdf0e10cSrcweir aTitle4 ( SVX_RES( STR_TITLE4 ) ), 630cdf0e10cSrcweir aTitle5 ( SVX_RES( STR_TITLE5 ) ), 631cdf0e10cSrcweir aStrMyName ( SVX_RES( STR_VIEW) ) 632cdf0e10cSrcweir { 633cdf0e10cSrcweir aViewData.SetAccessibleName(String(SVX_RES(STR_TREE))); 634cdf0e10cSrcweir FreeResource(); 635cdf0e10cSrcweir 636cdf0e10cSrcweir aViewData.SetHelpId(HID_REDLINING_VIEW_DG_VIEW_TABLE); 637cdf0e10cSrcweir aViewData.SetHeaderBarHelpId(HID_REDLINING_VIEW_DG_VIEW_HEADER); 638cdf0e10cSrcweir 639cdf0e10cSrcweir aMinSize=GetSizePixel(); 640cdf0e10cSrcweir 641cdf0e10cSrcweir Link aLink=LINK( this, SvxTPView, PbClickHdl); 642cdf0e10cSrcweir 643cdf0e10cSrcweir PbAccept.SetClickHdl(aLink); 644cdf0e10cSrcweir PbAcceptAll.SetClickHdl(aLink); 645cdf0e10cSrcweir PbReject.SetClickHdl(aLink); 646cdf0e10cSrcweir PbRejectAll.SetClickHdl(aLink); 647cdf0e10cSrcweir PbUndo.SetClickHdl(aLink); 648cdf0e10cSrcweir 649cdf0e10cSrcweir nDistance=PbAccept.GetSizePixel().Height()+2*MIN_DISTANCE; 650cdf0e10cSrcweir aViewData.SetTabs(nStaticTabs); 651cdf0e10cSrcweir } 652cdf0e10cSrcweir 653cdf0e10cSrcweir String SvxTPView::GetMyName() const 654cdf0e10cSrcweir { 655cdf0e10cSrcweir return aStrMyName; 656cdf0e10cSrcweir } 657cdf0e10cSrcweir 658cdf0e10cSrcweir void SvxTPView::Resize() 659cdf0e10cSrcweir { 660cdf0e10cSrcweir Size aSize=GetOutputSizePixel(); 661cdf0e10cSrcweir Point aPos=aViewData.GetPosPixel(); 662cdf0e10cSrcweir aSize.Height()-=aPos.Y()+nDistance; 663cdf0e10cSrcweir aSize.Width()-=2*aPos.X(); 664cdf0e10cSrcweir 665cdf0e10cSrcweir long newY=aPos.Y()+aSize.Height()+MIN_DISTANCE; 666cdf0e10cSrcweir aPos=PbAccept.GetPosPixel(); 667cdf0e10cSrcweir aPos.Y()=newY; 668cdf0e10cSrcweir PbAccept.SetPosPixel(aPos); 669cdf0e10cSrcweir aPos=PbAcceptAll.GetPosPixel(); 670cdf0e10cSrcweir aPos.Y()=newY; 671cdf0e10cSrcweir PbAcceptAll.SetPosPixel(aPos); 672cdf0e10cSrcweir aPos=PbReject.GetPosPixel(); 673cdf0e10cSrcweir aPos.Y()=newY; 674cdf0e10cSrcweir PbReject.SetPosPixel(aPos); 675cdf0e10cSrcweir aPos=PbRejectAll.GetPosPixel(); 676cdf0e10cSrcweir aPos.Y()=newY; 677cdf0e10cSrcweir PbRejectAll.SetPosPixel(aPos); 678cdf0e10cSrcweir 679cdf0e10cSrcweir if(PbUndo.IsVisible()) 680cdf0e10cSrcweir { 681cdf0e10cSrcweir aPos=PbUndo.GetPosPixel(); 682cdf0e10cSrcweir aPos.Y()=newY; 683cdf0e10cSrcweir PbUndo.SetPosPixel(aPos); 684cdf0e10cSrcweir } 685cdf0e10cSrcweir aViewData.SetSizePixel(aSize); 686cdf0e10cSrcweir } 687cdf0e10cSrcweir 688cdf0e10cSrcweir void SvxTPView::InsertWriterHeader() 689cdf0e10cSrcweir { 690cdf0e10cSrcweir String aStrTab(sal_Unicode('\t')); 691cdf0e10cSrcweir String aString(aTitle1); 692cdf0e10cSrcweir aString+=aStrTab; 693cdf0e10cSrcweir aString+=aTitle3; 694cdf0e10cSrcweir aString+=aStrTab; 695cdf0e10cSrcweir aString+=aTitle4; 696cdf0e10cSrcweir aString+=aStrTab; 697cdf0e10cSrcweir aString+=aTitle5; 698cdf0e10cSrcweir aViewData.ClearHeader(); 699cdf0e10cSrcweir aViewData.InsertHeaderEntry(aString); 700cdf0e10cSrcweir } 701cdf0e10cSrcweir 702cdf0e10cSrcweir void SvxTPView::InsertCalcHeader() 703cdf0e10cSrcweir { 704cdf0e10cSrcweir String aStrTab(sal_Unicode('\t')); 705cdf0e10cSrcweir String aString(aTitle1); 706cdf0e10cSrcweir aString+=aStrTab; 707cdf0e10cSrcweir aString+=aTitle2; 708cdf0e10cSrcweir aString+=aStrTab; 709cdf0e10cSrcweir aString+=aTitle3; 710cdf0e10cSrcweir aString+=aStrTab; 711cdf0e10cSrcweir aString+=aTitle4; 712cdf0e10cSrcweir aString+=aStrTab; 713cdf0e10cSrcweir aString+=aTitle5; 714cdf0e10cSrcweir aViewData.ClearHeader(); 715cdf0e10cSrcweir aViewData.InsertHeaderEntry(aString); 716cdf0e10cSrcweir } 717cdf0e10cSrcweir 718cdf0e10cSrcweir void SvxTPView::EnableAccept(sal_Bool nFlag) 719cdf0e10cSrcweir { 720cdf0e10cSrcweir PbAccept.Enable(nFlag); 721cdf0e10cSrcweir } 722cdf0e10cSrcweir 723cdf0e10cSrcweir void SvxTPView::EnableAcceptAll(sal_Bool nFlag) 724cdf0e10cSrcweir { 725cdf0e10cSrcweir PbAcceptAll.Enable(nFlag); 726cdf0e10cSrcweir } 727cdf0e10cSrcweir 728cdf0e10cSrcweir void SvxTPView::EnableReject(sal_Bool nFlag) 729cdf0e10cSrcweir { 730cdf0e10cSrcweir PbReject.Enable(nFlag); 731cdf0e10cSrcweir } 732cdf0e10cSrcweir 733cdf0e10cSrcweir void SvxTPView::EnableRejectAll(sal_Bool nFlag) 734cdf0e10cSrcweir { 735cdf0e10cSrcweir PbRejectAll.Enable(nFlag); 736cdf0e10cSrcweir } 737cdf0e10cSrcweir 738cdf0e10cSrcweir void SvxTPView::ShowUndo(sal_Bool nFlag) 739cdf0e10cSrcweir { 740cdf0e10cSrcweir PbUndo.Show(nFlag); 741cdf0e10cSrcweir } 742cdf0e10cSrcweir 743cdf0e10cSrcweir void SvxTPView::EnableUndo(sal_Bool nFlag) 744cdf0e10cSrcweir { 745cdf0e10cSrcweir PbUndo.Enable(nFlag); 746cdf0e10cSrcweir } 747cdf0e10cSrcweir 748cdf0e10cSrcweir Size SvxTPView::GetMinSizePixel() 749cdf0e10cSrcweir { 750cdf0e10cSrcweir Size aSize=aMinSize; 751cdf0e10cSrcweir if(PbUndo.IsVisible()) 752cdf0e10cSrcweir { 753cdf0e10cSrcweir sal_uIntPtr nSize=PbUndo.GetSizePixel().Width() 754cdf0e10cSrcweir +PbUndo.GetPosPixel().X() 755cdf0e10cSrcweir +PbAccept.GetPosPixel().X(); 756cdf0e10cSrcweir 757cdf0e10cSrcweir aSize.Width()=nSize; 758cdf0e10cSrcweir } 759cdf0e10cSrcweir 760cdf0e10cSrcweir return aSize; 761cdf0e10cSrcweir } 762cdf0e10cSrcweir 763cdf0e10cSrcweir 764cdf0e10cSrcweir SvxRedlinTable* SvxTPView::GetTableControl() 765cdf0e10cSrcweir { 766cdf0e10cSrcweir return &aViewData; 767cdf0e10cSrcweir } 768cdf0e10cSrcweir 769cdf0e10cSrcweir IMPL_LINK( SvxTPView, PbClickHdl, PushButton*, pPushB ) 770cdf0e10cSrcweir { 771cdf0e10cSrcweir if(pPushB==&PbAccept) 772cdf0e10cSrcweir { 773cdf0e10cSrcweir AcceptClickLk.Call(this); 774cdf0e10cSrcweir } 775cdf0e10cSrcweir else if(pPushB==&PbAcceptAll) 776cdf0e10cSrcweir { 777cdf0e10cSrcweir AcceptAllClickLk.Call(this); 778cdf0e10cSrcweir } 779cdf0e10cSrcweir else if(pPushB==&PbReject) 780cdf0e10cSrcweir { 781cdf0e10cSrcweir RejectClickLk.Call(this); 782cdf0e10cSrcweir } 783cdf0e10cSrcweir else if(pPushB==&PbRejectAll) 784cdf0e10cSrcweir { 785cdf0e10cSrcweir RejectAllClickLk.Call(this); 786cdf0e10cSrcweir } 787cdf0e10cSrcweir else if(pPushB==&PbUndo) 788cdf0e10cSrcweir { 789cdf0e10cSrcweir UndoClickLk.Call(this); 790cdf0e10cSrcweir } 791cdf0e10cSrcweir 792cdf0e10cSrcweir return 0; 793cdf0e10cSrcweir } 794cdf0e10cSrcweir 795cdf0e10cSrcweir 796cdf0e10cSrcweir 797cdf0e10cSrcweir 798cdf0e10cSrcweir //============================================================================ 799cdf0e10cSrcweir // class SvxTPFilter 800cdf0e10cSrcweir //---------------------------------------------------------------------------- 801cdf0e10cSrcweir 802cdf0e10cSrcweir SvxTPFilter::SvxTPFilter( Window * pParent) 803cdf0e10cSrcweir : TabPage( pParent, SVX_RES(SID_REDLIN_FILTER_PAGE)), 804cdf0e10cSrcweir pRedlinTable(NULL), 805cdf0e10cSrcweir aCbDate ( this, SVX_RES( CB_DATE ) ), 806cdf0e10cSrcweir aLbDate ( this, SVX_RES( LB_DATE ) ), 807cdf0e10cSrcweir aDfDate ( this, SVX_RES( DF_DATE ) ), 808cdf0e10cSrcweir aTfDate ( this, SVX_RES( TF_DATE ) ), 809cdf0e10cSrcweir aIbClock ( this, SVX_RES( IB_CLOCK ) ), 810cdf0e10cSrcweir aFtDate2 ( this, SVX_RES( FT_DATE2 ) ), 811cdf0e10cSrcweir aDfDate2 ( this, SVX_RES( DF_DATE2 ) ), 812cdf0e10cSrcweir aTfDate2 ( this, SVX_RES( TF_DATE2 ) ), 813cdf0e10cSrcweir aIbClock2 ( this, SVX_RES( IB_CLOCK2) ), 814cdf0e10cSrcweir aCbAuthor ( this, SVX_RES( CB_AUTOR ) ), 815cdf0e10cSrcweir aLbAuthor ( this, SVX_RES( LB_AUTOR ) ), 816cdf0e10cSrcweir aCbRange ( this, SVX_RES( CB_RANGE ) ), 817cdf0e10cSrcweir aEdRange ( this, SVX_RES( ED_RANGE ) ), 818cdf0e10cSrcweir aBtnRange ( this, SVX_RES( BTN_REF ) ), 819cdf0e10cSrcweir aLbAction ( this, SVX_RES( LB_ACTION ) ), 820cdf0e10cSrcweir aCbComment ( this, SVX_RES( CB_COMMENT) ), 821cdf0e10cSrcweir aEdComment ( this, SVX_RES( ED_COMMENT) ), 822cdf0e10cSrcweir aActionStr ( SVX_RES( STR_ACTION) ), 823cdf0e10cSrcweir aStrMyName ( SVX_RES( STR_FILTER) ), 824cdf0e10cSrcweir bModified (sal_False) 825cdf0e10cSrcweir { 826cdf0e10cSrcweir aLbDate.SetAccessibleName( String( SVX_RES( STR_DATE_COMBOX) ) ); 827cdf0e10cSrcweir aDfDate.SetAccessibleName( String( SVX_RES( STR_DATE_SPIN) ) ); 828cdf0e10cSrcweir aTfDate.SetAccessibleName( String( SVX_RES( STR_DATE_TIME_SPIN) ) ); 829cdf0e10cSrcweir aDfDate2.SetAccessibleName( String( SVX_RES( STR_DATE_SPIN1) ) ); 830cdf0e10cSrcweir aTfDate2.SetAccessibleName( String( SVX_RES( STR_DATE_TIME_SPIN1) ) ); 831cdf0e10cSrcweir aLbAuthor.SetAccessibleName(aCbAuthor.GetText()); 832cdf0e10cSrcweir aLbAction.SetAccessibleName( String( SVX_RES( STR_ACTION) ) ); 833cdf0e10cSrcweir aEdComment.SetAccessibleName(aCbComment.GetText()); 834cdf0e10cSrcweir Image aImgTimeHC( SVX_RES( IMG_TIME_H ) ); 835cdf0e10cSrcweir FreeResource(); 836cdf0e10cSrcweir 837cdf0e10cSrcweir aIbClock.SetModeImage( aImgTimeHC, BMP_COLOR_HIGHCONTRAST ); 838cdf0e10cSrcweir aIbClock2.SetModeImage( aImgTimeHC, BMP_COLOR_HIGHCONTRAST ); 839cdf0e10cSrcweir 840cdf0e10cSrcweir aDfDate.SetShowDateCentury( sal_True ); 841cdf0e10cSrcweir aDfDate2.SetShowDateCentury( sal_True ); 842cdf0e10cSrcweir 843cdf0e10cSrcweir aRangeStr=aCbRange.GetText(); 844cdf0e10cSrcweir aLbDate.SelectEntryPos(0); 845cdf0e10cSrcweir aLbDate.SetSelectHdl( LINK( this, SvxTPFilter, SelDateHdl ) ); 846cdf0e10cSrcweir aIbClock.SetClickHdl( LINK( this, SvxTPFilter, TimeHdl) ); 847cdf0e10cSrcweir aIbClock2.SetClickHdl( LINK( this, SvxTPFilter,TimeHdl) ); 848cdf0e10cSrcweir aBtnRange.SetClickHdl( LINK( this, SvxTPFilter, RefHandle)); 849cdf0e10cSrcweir 850cdf0e10cSrcweir Link aLink=LINK( this, SvxTPFilter, RowEnableHdl) ; 851cdf0e10cSrcweir aCbDate.SetClickHdl(aLink); 852cdf0e10cSrcweir aCbAuthor.SetClickHdl(aLink); 853cdf0e10cSrcweir aCbRange.SetClickHdl(aLink); 854cdf0e10cSrcweir aCbComment.SetClickHdl(aLink); 855cdf0e10cSrcweir 856cdf0e10cSrcweir Link a2Link=LINK( this, SvxTPFilter, ModifyDate); 857cdf0e10cSrcweir aDfDate.SetModifyHdl(a2Link); 858cdf0e10cSrcweir aTfDate.SetModifyHdl(a2Link); 859cdf0e10cSrcweir aDfDate2.SetModifyHdl(a2Link); 860cdf0e10cSrcweir aTfDate2.SetModifyHdl(a2Link); 861cdf0e10cSrcweir 862cdf0e10cSrcweir Link a3Link=LINK( this, SvxTPFilter, ModifyHdl); 863cdf0e10cSrcweir aEdRange.SetModifyHdl(a3Link); 864cdf0e10cSrcweir aEdComment.SetModifyHdl(a3Link); 865cdf0e10cSrcweir aLbAction.SetSelectHdl(a3Link); 866cdf0e10cSrcweir aLbAuthor.SetSelectHdl(a3Link); 867cdf0e10cSrcweir 868cdf0e10cSrcweir RowEnableHdl(&aCbDate); 869cdf0e10cSrcweir RowEnableHdl(&aCbAuthor); 870cdf0e10cSrcweir RowEnableHdl(&aCbRange); 871cdf0e10cSrcweir RowEnableHdl(&aCbComment); 872cdf0e10cSrcweir 873cdf0e10cSrcweir Date aDate; 874cdf0e10cSrcweir Time aTime; 875cdf0e10cSrcweir aDfDate.SetDate(aDate); 876cdf0e10cSrcweir aTfDate.SetTime(aTime); 877cdf0e10cSrcweir aDfDate2.SetDate(aDate); 878cdf0e10cSrcweir aTfDate2.SetTime(aTime); 879cdf0e10cSrcweir HideRange(); 880cdf0e10cSrcweir ShowAction(); 881cdf0e10cSrcweir bModified=sal_False; 882cdf0e10cSrcweir 883cdf0e10cSrcweir aLbDate.SetAccessibleRelationLabeledBy(&aCbDate); 884cdf0e10cSrcweir aLbAuthor.SetAccessibleRelationLabeledBy(&aCbAuthor); 885cdf0e10cSrcweir aLbAction.SetAccessibleRelationLabeledBy(&aCbRange); 886cdf0e10cSrcweir aEdRange.SetAccessibleRelationLabeledBy(&aCbRange); 887cdf0e10cSrcweir aBtnRange.SetAccessibleRelationLabeledBy(&aCbRange); 888cdf0e10cSrcweir aEdComment.SetAccessibleRelationLabeledBy(&aCbComment); 889cdf0e10cSrcweir aDfDate2.SetAccessibleRelationLabeledBy(&aDfDate2); 890cdf0e10cSrcweir aTfDate2.SetAccessibleRelationLabeledBy(&aTfDate2); 891cdf0e10cSrcweir } 892cdf0e10cSrcweir 893cdf0e10cSrcweir void SvxTPFilter::SetRedlinTable(SvxRedlinTable* pTable) 894cdf0e10cSrcweir { 895cdf0e10cSrcweir pRedlinTable=pTable; 896cdf0e10cSrcweir } 897cdf0e10cSrcweir 898cdf0e10cSrcweir String SvxTPFilter::GetMyName() const 899cdf0e10cSrcweir { 900cdf0e10cSrcweir return aStrMyName; 901cdf0e10cSrcweir } 902cdf0e10cSrcweir 903cdf0e10cSrcweir void SvxTPFilter::DisableRange(sal_Bool bFlag) 904cdf0e10cSrcweir { 905cdf0e10cSrcweir if(bFlag) 906cdf0e10cSrcweir { 907cdf0e10cSrcweir aCbRange.Disable(); 908cdf0e10cSrcweir aEdRange.Disable(); 909cdf0e10cSrcweir aBtnRange.Disable(); 910cdf0e10cSrcweir } 911cdf0e10cSrcweir else 912cdf0e10cSrcweir { 913cdf0e10cSrcweir aCbRange.Enable(); 914cdf0e10cSrcweir aEdRange.Enable(); 915cdf0e10cSrcweir aBtnRange.Enable(); 916cdf0e10cSrcweir } 917cdf0e10cSrcweir } 918cdf0e10cSrcweir 919cdf0e10cSrcweir void SvxTPFilter::ShowDateFields(sal_uInt16 nKind) 920cdf0e10cSrcweir { 921cdf0e10cSrcweir String aEmpty; 922cdf0e10cSrcweir switch(nKind) 923cdf0e10cSrcweir { 924cdf0e10cSrcweir case FLT_DATE_BEFORE: 925cdf0e10cSrcweir EnableDateLine1(sal_True); 926cdf0e10cSrcweir EnableDateLine2(sal_False); 927cdf0e10cSrcweir break; 928cdf0e10cSrcweir case FLT_DATE_SINCE: 929cdf0e10cSrcweir EnableDateLine1(sal_True); 930cdf0e10cSrcweir EnableDateLine2(sal_False); 931cdf0e10cSrcweir break; 932cdf0e10cSrcweir case FLT_DATE_EQUAL: 933cdf0e10cSrcweir EnableDateLine1(sal_True); 934cdf0e10cSrcweir aTfDate.Disable(); 935cdf0e10cSrcweir aTfDate.SetText(aEmpty); 936cdf0e10cSrcweir EnableDateLine2(sal_False); 937cdf0e10cSrcweir break; 938cdf0e10cSrcweir case FLT_DATE_NOTEQUAL: 939cdf0e10cSrcweir EnableDateLine1(sal_True); 940cdf0e10cSrcweir aTfDate.Disable(); 941cdf0e10cSrcweir aTfDate.SetText(aEmpty); 942cdf0e10cSrcweir EnableDateLine2(sal_False); 943cdf0e10cSrcweir break; 944cdf0e10cSrcweir case FLT_DATE_BETWEEN: 945cdf0e10cSrcweir EnableDateLine1(sal_True); 946cdf0e10cSrcweir EnableDateLine2(sal_True); 947cdf0e10cSrcweir break; 948cdf0e10cSrcweir case FLT_DATE_SAVE: 949cdf0e10cSrcweir EnableDateLine1(sal_False); 950cdf0e10cSrcweir EnableDateLine2(sal_False); 951cdf0e10cSrcweir break; 952cdf0e10cSrcweir } 953cdf0e10cSrcweir } 954cdf0e10cSrcweir 955cdf0e10cSrcweir void SvxTPFilter::EnableDateLine1(sal_Bool bFlag) 956cdf0e10cSrcweir { 957cdf0e10cSrcweir if(bFlag && aCbDate.IsChecked()) 958cdf0e10cSrcweir { 959cdf0e10cSrcweir aDfDate.Enable(); 960cdf0e10cSrcweir aTfDate.Enable(); 961cdf0e10cSrcweir aIbClock.Enable(); 962cdf0e10cSrcweir } 963cdf0e10cSrcweir else 964cdf0e10cSrcweir { 965cdf0e10cSrcweir aDfDate.Disable(); 966cdf0e10cSrcweir aTfDate.Disable(); 967cdf0e10cSrcweir aIbClock.Disable(); 968cdf0e10cSrcweir } 969cdf0e10cSrcweir } 970cdf0e10cSrcweir void SvxTPFilter::EnableDateLine2(sal_Bool bFlag) 971cdf0e10cSrcweir { 972cdf0e10cSrcweir String aEmpty; 973cdf0e10cSrcweir if(bFlag && aCbDate.IsChecked()) 974cdf0e10cSrcweir { 975cdf0e10cSrcweir aFtDate2.Enable(); 976cdf0e10cSrcweir aDfDate2.Enable(); 977cdf0e10cSrcweir aTfDate2.Enable(); 978cdf0e10cSrcweir aIbClock2.Enable(); 979cdf0e10cSrcweir } 980cdf0e10cSrcweir else 981cdf0e10cSrcweir { 982cdf0e10cSrcweir aFtDate2.Disable(); 983cdf0e10cSrcweir aDfDate2.Disable(); 984cdf0e10cSrcweir aDfDate2.SetText(aEmpty); 985cdf0e10cSrcweir aTfDate2.Disable(); 986cdf0e10cSrcweir aTfDate2.SetText(aEmpty); 987cdf0e10cSrcweir aIbClock2.Disable(); 988cdf0e10cSrcweir } 989cdf0e10cSrcweir } 990cdf0e10cSrcweir 991cdf0e10cSrcweir Date SvxTPFilter::GetFirstDate() const 992cdf0e10cSrcweir { 993cdf0e10cSrcweir return aDfDate.GetDate(); 994cdf0e10cSrcweir } 995cdf0e10cSrcweir 996cdf0e10cSrcweir void SvxTPFilter::SetFirstDate(const Date &aDate) 997cdf0e10cSrcweir { 998cdf0e10cSrcweir aDfDate.SetDate(aDate); 999cdf0e10cSrcweir } 1000cdf0e10cSrcweir 1001cdf0e10cSrcweir Time SvxTPFilter::GetFirstTime() const 1002cdf0e10cSrcweir { 1003cdf0e10cSrcweir return aTfDate.GetTime(); 1004cdf0e10cSrcweir } 1005cdf0e10cSrcweir 1006cdf0e10cSrcweir void SvxTPFilter::SetFirstTime(const Time &aTime) 1007cdf0e10cSrcweir { 1008cdf0e10cSrcweir aTfDate.SetTime(aTime); 1009cdf0e10cSrcweir } 1010cdf0e10cSrcweir 1011cdf0e10cSrcweir 1012cdf0e10cSrcweir Date SvxTPFilter::GetLastDate() const 1013cdf0e10cSrcweir { 1014cdf0e10cSrcweir return aDfDate2.GetDate(); 1015cdf0e10cSrcweir } 1016cdf0e10cSrcweir 1017cdf0e10cSrcweir void SvxTPFilter::SetLastDate(const Date &aDate) 1018cdf0e10cSrcweir { 1019cdf0e10cSrcweir aDfDate2.SetDate(aDate); 1020cdf0e10cSrcweir } 1021cdf0e10cSrcweir 1022cdf0e10cSrcweir Time SvxTPFilter::GetLastTime() const 1023cdf0e10cSrcweir { 1024cdf0e10cSrcweir return aTfDate2.GetTime(); 1025cdf0e10cSrcweir } 1026cdf0e10cSrcweir 1027cdf0e10cSrcweir void SvxTPFilter::SetLastTime(const Time &aTime) 1028cdf0e10cSrcweir { 1029cdf0e10cSrcweir aTfDate2.SetTime(aTime); 1030cdf0e10cSrcweir } 1031cdf0e10cSrcweir 1032cdf0e10cSrcweir void SvxTPFilter::SetDateMode(sal_uInt16 nMode) 1033cdf0e10cSrcweir { 1034cdf0e10cSrcweir aLbDate.SelectEntryPos(nMode); 1035cdf0e10cSrcweir SelDateHdl(&aLbDate); 1036cdf0e10cSrcweir } 1037cdf0e10cSrcweir 1038cdf0e10cSrcweir sal_uInt16 SvxTPFilter::GetDateMode() 1039cdf0e10cSrcweir { 1040cdf0e10cSrcweir return (sal_uInt16) aLbDate.GetSelectEntryPos(); 1041cdf0e10cSrcweir } 1042cdf0e10cSrcweir void SvxTPFilter::ClearAuthors() 1043cdf0e10cSrcweir { 1044cdf0e10cSrcweir aLbAuthor.Clear(); 1045cdf0e10cSrcweir } 1046cdf0e10cSrcweir 1047cdf0e10cSrcweir void SvxTPFilter::InsertAuthor( const String& rString, sal_uInt16 nPos) 1048cdf0e10cSrcweir { 1049cdf0e10cSrcweir aLbAuthor.InsertEntry(rString,nPos); 1050cdf0e10cSrcweir } 1051cdf0e10cSrcweir 1052cdf0e10cSrcweir String SvxTPFilter::GetSelectedAuthor() const 1053cdf0e10cSrcweir { 1054cdf0e10cSrcweir return aLbAuthor.GetSelectEntry(); 1055cdf0e10cSrcweir } 1056cdf0e10cSrcweir 1057cdf0e10cSrcweir sal_uInt16 SvxTPFilter::GetSelectedAuthorPos() 1058cdf0e10cSrcweir { 1059cdf0e10cSrcweir return (sal_uInt16) aLbAuthor.GetSelectEntryPos(); 1060cdf0e10cSrcweir } 1061cdf0e10cSrcweir 1062cdf0e10cSrcweir void SvxTPFilter::SelectedAuthorPos(sal_uInt16 nPos) 1063cdf0e10cSrcweir { 1064cdf0e10cSrcweir aLbAuthor.SelectEntryPos(nPos); 1065cdf0e10cSrcweir } 1066cdf0e10cSrcweir 1067cdf0e10cSrcweir sal_uInt16 SvxTPFilter::SelectAuthor(const String& aString) 1068cdf0e10cSrcweir { 1069cdf0e10cSrcweir aLbAuthor.SelectEntry(aString); 1070cdf0e10cSrcweir return aLbAuthor.GetSelectEntryPos(); 1071cdf0e10cSrcweir } 1072cdf0e10cSrcweir 1073cdf0e10cSrcweir void SvxTPFilter::SetRange(const String& rString) 1074cdf0e10cSrcweir { 1075cdf0e10cSrcweir aEdRange.SetText(rString); 1076cdf0e10cSrcweir } 1077cdf0e10cSrcweir 1078cdf0e10cSrcweir String SvxTPFilter::GetRange() const 1079cdf0e10cSrcweir { 1080cdf0e10cSrcweir return aEdRange.GetText(); 1081cdf0e10cSrcweir } 1082cdf0e10cSrcweir 1083cdf0e10cSrcweir void SvxTPFilter::SetFocusToRange() 1084cdf0e10cSrcweir { 1085cdf0e10cSrcweir aEdRange.GrabFocus(); 1086cdf0e10cSrcweir } 1087cdf0e10cSrcweir 1088cdf0e10cSrcweir void SvxTPFilter::HideRange(sal_Bool bHide) 1089cdf0e10cSrcweir { 1090cdf0e10cSrcweir if(bHide) 1091cdf0e10cSrcweir { 1092cdf0e10cSrcweir aCbRange.Hide(); 1093cdf0e10cSrcweir aEdRange.Hide(); 1094cdf0e10cSrcweir aBtnRange.Hide(); 1095cdf0e10cSrcweir } 1096cdf0e10cSrcweir else 1097cdf0e10cSrcweir { 1098cdf0e10cSrcweir ShowAction(sal_False); 1099cdf0e10cSrcweir aCbRange.SetText(aRangeStr); 1100cdf0e10cSrcweir aCbRange.Show(); 1101cdf0e10cSrcweir aEdRange.Show(); 1102cdf0e10cSrcweir aBtnRange.Show(); 1103cdf0e10cSrcweir } 1104cdf0e10cSrcweir } 1105cdf0e10cSrcweir 1106cdf0e10cSrcweir void SvxTPFilter::HideClocks(sal_Bool bHide) 1107cdf0e10cSrcweir { 1108cdf0e10cSrcweir if(bHide) 1109cdf0e10cSrcweir { 1110cdf0e10cSrcweir aIbClock. Hide(); 1111cdf0e10cSrcweir aIbClock2.Hide(); 1112cdf0e10cSrcweir } 1113cdf0e10cSrcweir else 1114cdf0e10cSrcweir { 1115cdf0e10cSrcweir aIbClock. Show(); 1116cdf0e10cSrcweir aIbClock2.Show(); 1117cdf0e10cSrcweir } 1118cdf0e10cSrcweir } 1119cdf0e10cSrcweir 1120cdf0e10cSrcweir void SvxTPFilter::SetComment(const String &rComment) 1121cdf0e10cSrcweir { 1122cdf0e10cSrcweir aEdComment.SetText(rComment); 1123cdf0e10cSrcweir } 1124cdf0e10cSrcweir String SvxTPFilter::GetComment()const 1125cdf0e10cSrcweir { 1126cdf0e10cSrcweir return aEdComment.GetText(); 1127cdf0e10cSrcweir } 1128cdf0e10cSrcweir 1129cdf0e10cSrcweir sal_Bool SvxTPFilter::IsDate() 1130cdf0e10cSrcweir { 1131cdf0e10cSrcweir return aCbDate.IsChecked(); 1132cdf0e10cSrcweir } 1133cdf0e10cSrcweir 1134cdf0e10cSrcweir sal_Bool SvxTPFilter::IsAuthor() 1135cdf0e10cSrcweir { 1136cdf0e10cSrcweir return aCbAuthor.IsChecked(); 1137cdf0e10cSrcweir } 1138cdf0e10cSrcweir 1139cdf0e10cSrcweir sal_Bool SvxTPFilter::IsRange() 1140cdf0e10cSrcweir { 1141cdf0e10cSrcweir return aCbRange.IsChecked(); 1142cdf0e10cSrcweir } 1143cdf0e10cSrcweir sal_Bool SvxTPFilter::IsAction() 1144cdf0e10cSrcweir { 1145cdf0e10cSrcweir return aCbRange.IsChecked(); 1146cdf0e10cSrcweir } 1147cdf0e10cSrcweir 1148cdf0e10cSrcweir sal_Bool SvxTPFilter::IsComment() 1149cdf0e10cSrcweir { 1150cdf0e10cSrcweir return aCbComment.IsChecked(); 1151cdf0e10cSrcweir } 1152cdf0e10cSrcweir 1153cdf0e10cSrcweir void SvxTPFilter::CheckDate(sal_Bool bFlag) 1154cdf0e10cSrcweir { 1155cdf0e10cSrcweir aCbDate.Check(bFlag); 1156cdf0e10cSrcweir RowEnableHdl(&aCbDate); 1157cdf0e10cSrcweir bModified=sal_False; 1158cdf0e10cSrcweir } 1159cdf0e10cSrcweir 1160cdf0e10cSrcweir void SvxTPFilter::CheckAuthor(sal_Bool bFlag) 1161cdf0e10cSrcweir { 1162cdf0e10cSrcweir aCbAuthor.Check(bFlag); 1163cdf0e10cSrcweir RowEnableHdl(&aCbAuthor); 1164cdf0e10cSrcweir bModified=sal_False; 1165cdf0e10cSrcweir } 1166cdf0e10cSrcweir 1167cdf0e10cSrcweir void SvxTPFilter::CheckRange(sal_Bool bFlag) 1168cdf0e10cSrcweir { 1169cdf0e10cSrcweir aCbRange.Check(bFlag); 1170cdf0e10cSrcweir RowEnableHdl(&aCbRange); 1171cdf0e10cSrcweir bModified=sal_False; 1172cdf0e10cSrcweir } 1173cdf0e10cSrcweir 1174cdf0e10cSrcweir void SvxTPFilter::CheckAction(sal_Bool bFlag) 1175cdf0e10cSrcweir { 1176cdf0e10cSrcweir aCbRange.Check(bFlag); 1177cdf0e10cSrcweir RowEnableHdl(&aCbRange); 1178cdf0e10cSrcweir bModified=sal_False; 1179cdf0e10cSrcweir } 1180cdf0e10cSrcweir 1181cdf0e10cSrcweir void SvxTPFilter::CheckComment(sal_Bool bFlag) 1182cdf0e10cSrcweir { 1183cdf0e10cSrcweir aCbComment.Check(bFlag); 1184cdf0e10cSrcweir RowEnableHdl(&aCbComment); 1185cdf0e10cSrcweir bModified=sal_False; 1186cdf0e10cSrcweir } 1187cdf0e10cSrcweir 1188cdf0e10cSrcweir void SvxTPFilter::ShowAction(sal_Bool bShow) 1189cdf0e10cSrcweir { 1190cdf0e10cSrcweir if(!bShow) 1191cdf0e10cSrcweir { 1192cdf0e10cSrcweir aCbRange.Hide(); 1193cdf0e10cSrcweir aLbAction.Hide(); 1194cdf0e10cSrcweir aCbRange.SetHelpId(HID_REDLINING_FILTER_CB_RANGE); 1195cdf0e10cSrcweir } 1196cdf0e10cSrcweir else 1197cdf0e10cSrcweir { 1198cdf0e10cSrcweir HideRange(); 1199cdf0e10cSrcweir aCbRange.SetText(aActionStr); 1200cdf0e10cSrcweir aCbRange.SetHelpId(HID_REDLINING_FILTER_CB_ACTION); 1201cdf0e10cSrcweir aCbRange.Show(); 1202cdf0e10cSrcweir aLbAction.Show(); 1203cdf0e10cSrcweir 1204cdf0e10cSrcweir } 1205cdf0e10cSrcweir } 1206cdf0e10cSrcweir 1207cdf0e10cSrcweir ListBox* SvxTPFilter::GetLbAction() 1208cdf0e10cSrcweir { 1209cdf0e10cSrcweir return &aLbAction; 1210cdf0e10cSrcweir } 1211cdf0e10cSrcweir 1212cdf0e10cSrcweir IMPL_LINK( SvxTPFilter, SelDateHdl, ListBox*, pLb ) 1213cdf0e10cSrcweir { 1214cdf0e10cSrcweir ShowDateFields((sal_uInt16)aLbDate.GetSelectEntryPos()); 1215cdf0e10cSrcweir ModifyHdl(pLb); 1216cdf0e10cSrcweir return 0; 1217cdf0e10cSrcweir } 1218cdf0e10cSrcweir 1219cdf0e10cSrcweir IMPL_LINK( SvxTPFilter, RowEnableHdl, CheckBox*, pCB ) 1220cdf0e10cSrcweir { 1221cdf0e10cSrcweir if(pCB==&aCbDate) 1222cdf0e10cSrcweir { 1223cdf0e10cSrcweir aLbDate.Enable(aCbDate.IsChecked()); 1224cdf0e10cSrcweir aLbDate.Invalidate(); 1225cdf0e10cSrcweir EnableDateLine1(sal_False); 1226cdf0e10cSrcweir EnableDateLine2(sal_False); 1227cdf0e10cSrcweir if(aCbDate.IsChecked()) SelDateHdl(&aLbDate); 1228cdf0e10cSrcweir } 1229cdf0e10cSrcweir else if(pCB==&aCbAuthor) 1230cdf0e10cSrcweir { 1231cdf0e10cSrcweir aLbAuthor.Enable(aCbAuthor.IsChecked()); 1232cdf0e10cSrcweir aLbAuthor.Invalidate(); 1233cdf0e10cSrcweir } 1234cdf0e10cSrcweir else if(pCB==&aCbRange) 1235cdf0e10cSrcweir { 1236cdf0e10cSrcweir aLbAction.Enable(aCbRange.IsChecked()); 1237cdf0e10cSrcweir aLbAction.Invalidate(); 1238cdf0e10cSrcweir aEdRange.Enable(aCbRange.IsChecked()); 1239cdf0e10cSrcweir aBtnRange.Enable(aCbRange.IsChecked()); 1240cdf0e10cSrcweir } 1241cdf0e10cSrcweir else if(pCB==&aCbComment) 1242cdf0e10cSrcweir { 1243cdf0e10cSrcweir aEdComment.Enable(aCbComment.IsChecked()); 1244cdf0e10cSrcweir aEdComment.Invalidate(); 1245cdf0e10cSrcweir } 1246cdf0e10cSrcweir 1247cdf0e10cSrcweir ModifyHdl(pCB); 1248cdf0e10cSrcweir return 0; 1249cdf0e10cSrcweir } 1250cdf0e10cSrcweir 1251cdf0e10cSrcweir IMPL_LINK( SvxTPFilter, TimeHdl, ImageButton*,pIB ) 1252cdf0e10cSrcweir { 1253cdf0e10cSrcweir Date aDate; 1254cdf0e10cSrcweir Time aTime; 1255cdf0e10cSrcweir if(pIB==&aIbClock) 1256cdf0e10cSrcweir { 1257cdf0e10cSrcweir aDfDate.SetDate(aDate); 1258cdf0e10cSrcweir aTfDate.SetTime(aTime); 1259cdf0e10cSrcweir } 1260cdf0e10cSrcweir else if(pIB==&aIbClock2) 1261cdf0e10cSrcweir { 1262cdf0e10cSrcweir aDfDate2.SetDate(aDate); 1263cdf0e10cSrcweir aTfDate2.SetTime(aTime); 1264cdf0e10cSrcweir } 1265cdf0e10cSrcweir ModifyHdl(&aDfDate); 1266cdf0e10cSrcweir return 0; 1267cdf0e10cSrcweir } 1268cdf0e10cSrcweir 1269cdf0e10cSrcweir IMPL_LINK( SvxTPFilter, ModifyHdl, void*, pCtr) 1270cdf0e10cSrcweir { 1271cdf0e10cSrcweir if(pCtr!=NULL) 1272cdf0e10cSrcweir { 1273cdf0e10cSrcweir if(pCtr==&aCbDate || pCtr==&aLbDate || 1274cdf0e10cSrcweir pCtr==&aDfDate || pCtr==&aTfDate || 1275cdf0e10cSrcweir pCtr==&aIbClock || pCtr==&aFtDate2|| 1276cdf0e10cSrcweir pCtr==&aDfDate2 || pCtr==&aTfDate2|| 1277cdf0e10cSrcweir pCtr==&aIbClock2) 1278cdf0e10cSrcweir { 1279cdf0e10cSrcweir aModifyDateLink.Call(this); 1280cdf0e10cSrcweir } 1281cdf0e10cSrcweir else if(pCtr==&aCbAuthor || pCtr==&aLbAuthor) 1282cdf0e10cSrcweir { 1283cdf0e10cSrcweir aModifyAuthorLink.Call(this); 1284cdf0e10cSrcweir } 1285cdf0e10cSrcweir else if(pCtr==&aCbRange || pCtr==&aEdRange || 1286cdf0e10cSrcweir pCtr==&aBtnRange ) 1287cdf0e10cSrcweir { 1288cdf0e10cSrcweir aModifyRefLink.Call(this); 1289cdf0e10cSrcweir } 1290cdf0e10cSrcweir else if(pCtr==&aCbComment || pCtr==&aEdComment) 1291cdf0e10cSrcweir { 1292cdf0e10cSrcweir aModifyComLink.Call(this); 1293cdf0e10cSrcweir } 1294cdf0e10cSrcweir 1295cdf0e10cSrcweir bModified=sal_True; 1296cdf0e10cSrcweir aModifyLink.Call(this); 1297cdf0e10cSrcweir } 1298cdf0e10cSrcweir return 0; 1299cdf0e10cSrcweir } 1300cdf0e10cSrcweir 1301cdf0e10cSrcweir void SvxTPFilter::DeactivatePage() 1302cdf0e10cSrcweir { 1303cdf0e10cSrcweir if(bModified) 1304cdf0e10cSrcweir { 1305cdf0e10cSrcweir if(pRedlinTable!=NULL) 1306cdf0e10cSrcweir { 1307cdf0e10cSrcweir pRedlinTable->SetFilterDate(IsDate()); 1308cdf0e10cSrcweir pRedlinTable->SetDateTimeMode(GetDateMode()); 1309cdf0e10cSrcweir pRedlinTable->SetFirstDate(aDfDate.GetDate()); 1310cdf0e10cSrcweir pRedlinTable->SetLastDate(aDfDate2.GetDate()); 1311cdf0e10cSrcweir pRedlinTable->SetFirstTime(aTfDate.GetTime()); 1312cdf0e10cSrcweir pRedlinTable->SetLastTime(aTfDate2.GetTime()); 1313cdf0e10cSrcweir pRedlinTable->SetFilterAuthor(IsAuthor()); 1314cdf0e10cSrcweir pRedlinTable->SetAuthor(GetSelectedAuthor()); 1315cdf0e10cSrcweir 1316cdf0e10cSrcweir pRedlinTable->SetFilterComment(IsComment()); 1317cdf0e10cSrcweir 1318cdf0e10cSrcweir utl::SearchParam aSearchParam( aEdComment.GetText(), 1319cdf0e10cSrcweir utl::SearchParam::SRCH_REGEXP,sal_False,sal_False,sal_False ); 1320cdf0e10cSrcweir 1321cdf0e10cSrcweir pRedlinTable->SetCommentParams(&aSearchParam); 1322cdf0e10cSrcweir 1323cdf0e10cSrcweir pRedlinTable->UpdateFilterTest(); 1324cdf0e10cSrcweir } 1325cdf0e10cSrcweir 1326cdf0e10cSrcweir aReadyLink.Call(this); 1327cdf0e10cSrcweir } 1328cdf0e10cSrcweir bModified=sal_False; 1329cdf0e10cSrcweir TabPage::DeactivatePage(); 1330cdf0e10cSrcweir } 1331cdf0e10cSrcweir 1332cdf0e10cSrcweir void SvxTPFilter::Enable( bool bEnable, bool bChild) 1333cdf0e10cSrcweir { 1334cdf0e10cSrcweir TabPage::Enable(bEnable,bChild); 1335cdf0e10cSrcweir if(aCbDate.IsEnabled()) 1336cdf0e10cSrcweir { 1337cdf0e10cSrcweir RowEnableHdl(&aCbDate); 1338cdf0e10cSrcweir RowEnableHdl(&aCbAuthor); 1339cdf0e10cSrcweir RowEnableHdl(&aCbRange); 1340cdf0e10cSrcweir RowEnableHdl(&aCbComment); 1341cdf0e10cSrcweir } 1342cdf0e10cSrcweir } 1343cdf0e10cSrcweir void SvxTPFilter::Disable( bool bChild) 1344cdf0e10cSrcweir { 1345cdf0e10cSrcweir Enable( false, bChild ); 1346cdf0e10cSrcweir } 1347cdf0e10cSrcweir 1348*9b8096d0SSteve Yin //IAccessibility2 Implementation 2009----- 1349*9b8096d0SSteve Yin void SvxTPFilter::SetAccessibleRelationMemberOf( Window* pWin ) 1350*9b8096d0SSteve Yin { 1351*9b8096d0SSteve Yin aCbDate.SetAccessibleRelationMemberOf(pWin); 1352*9b8096d0SSteve Yin aLbDate.SetAccessibleRelationMemberOf(pWin); 1353*9b8096d0SSteve Yin aDfDate.SetAccessibleRelationMemberOf(pWin); 1354*9b8096d0SSteve Yin aTfDate.SetAccessibleRelationMemberOf(pWin); 1355*9b8096d0SSteve Yin aIbClock.SetAccessibleRelationMemberOf(pWin); 1356*9b8096d0SSteve Yin aFtDate2.SetAccessibleRelationMemberOf(pWin); 1357*9b8096d0SSteve Yin aDfDate2.SetAccessibleRelationMemberOf(pWin); 1358*9b8096d0SSteve Yin aTfDate2.SetAccessibleRelationMemberOf(pWin); 1359*9b8096d0SSteve Yin aIbClock2.SetAccessibleRelationMemberOf(pWin); 1360*9b8096d0SSteve Yin aCbAuthor.SetAccessibleRelationMemberOf(pWin); 1361*9b8096d0SSteve Yin aLbAuthor.SetAccessibleRelationMemberOf(pWin); 1362*9b8096d0SSteve Yin aCbRange.SetAccessibleRelationMemberOf(pWin); 1363*9b8096d0SSteve Yin aEdRange.SetAccessibleRelationMemberOf(pWin); 1364*9b8096d0SSteve Yin aBtnRange.SetAccessibleRelationMemberOf(pWin); 1365*9b8096d0SSteve Yin aLbAction.SetAccessibleRelationMemberOf(pWin); 1366*9b8096d0SSteve Yin aCbComment.SetAccessibleRelationMemberOf(pWin); 1367*9b8096d0SSteve Yin aEdComment.SetAccessibleRelationMemberOf(pWin); 1368*9b8096d0SSteve Yin } 1369*9b8096d0SSteve Yin //-----IAccessibility2 Implementation 2009 1370*9b8096d0SSteve Yin 1371cdf0e10cSrcweir IMPL_LINK( SvxTPFilter, ModifyDate, void*,pTF) 1372cdf0e10cSrcweir { 1373cdf0e10cSrcweir 1374cdf0e10cSrcweir Date aDate; 1375cdf0e10cSrcweir Time aTime(0); 1376cdf0e10cSrcweir if(&aDfDate==pTF) 1377cdf0e10cSrcweir { 1378cdf0e10cSrcweir if(aDfDate.GetText().Len()==0) 1379cdf0e10cSrcweir aDfDate.SetDate(aDate); 1380cdf0e10cSrcweir 1381cdf0e10cSrcweir if(pRedlinTable!=NULL) 1382cdf0e10cSrcweir pRedlinTable->SetFirstDate(aDfDate.GetDate()); 1383cdf0e10cSrcweir } 1384cdf0e10cSrcweir else if(&aDfDate2==pTF) 1385cdf0e10cSrcweir { 1386cdf0e10cSrcweir if(aDfDate2.GetText().Len()==0) 1387cdf0e10cSrcweir aDfDate2.SetDate(aDate); 1388cdf0e10cSrcweir 1389cdf0e10cSrcweir if(pRedlinTable!=NULL) 1390cdf0e10cSrcweir pRedlinTable->SetLastDate(aDfDate2.GetDate()); 1391cdf0e10cSrcweir } 1392cdf0e10cSrcweir else if(&aTfDate==pTF) 1393cdf0e10cSrcweir { 1394cdf0e10cSrcweir if(aTfDate.GetText().Len()==0) 1395cdf0e10cSrcweir aTfDate.SetTime(aTime); 1396cdf0e10cSrcweir 1397cdf0e10cSrcweir if(pRedlinTable!=NULL) 1398cdf0e10cSrcweir pRedlinTable->SetFirstTime(aTfDate.GetTime()); 1399cdf0e10cSrcweir } 1400cdf0e10cSrcweir else if(&aTfDate2==pTF) 1401cdf0e10cSrcweir { 1402cdf0e10cSrcweir if(aTfDate2.GetText().Len()==0) 1403cdf0e10cSrcweir aTfDate2.SetTime(aTime); 1404cdf0e10cSrcweir 1405cdf0e10cSrcweir if(pRedlinTable!=NULL) 1406cdf0e10cSrcweir pRedlinTable->SetLastTime(aTfDate2.GetTime()); 1407cdf0e10cSrcweir 1408cdf0e10cSrcweir } 1409cdf0e10cSrcweir ModifyHdl(&aDfDate); 1410cdf0e10cSrcweir return 0; 1411cdf0e10cSrcweir } 1412cdf0e10cSrcweir 1413cdf0e10cSrcweir IMPL_LINK( SvxTPFilter, RefHandle, PushButton*, pRef ) 1414cdf0e10cSrcweir { 1415cdf0e10cSrcweir if(pRef!=NULL) 1416cdf0e10cSrcweir { 1417cdf0e10cSrcweir aRefLink.Call(this); 1418cdf0e10cSrcweir } 1419cdf0e10cSrcweir return 0; 1420cdf0e10cSrcweir } 1421cdf0e10cSrcweir 1422cdf0e10cSrcweir static Size gDiffSize; 1423cdf0e10cSrcweir //============================================================================ 1424cdf0e10cSrcweir // class SvxAcceptChgCtr 1425cdf0e10cSrcweir //---------------------------------------------------------------------------- 1426cdf0e10cSrcweir 1427cdf0e10cSrcweir SvxAcceptChgCtr::SvxAcceptChgCtr( Window* pParent, WinBits nWinStyle) 1428cdf0e10cSrcweir : Control(pParent,nWinStyle |WB_DIALOGCONTROL), 1429cdf0e10cSrcweir aTCAccept(this,WB_TABSTOP |WB_DIALOGCONTROL) 1430cdf0e10cSrcweir { 1431cdf0e10cSrcweir pTPFilter=new SvxTPFilter(&aTCAccept); 1432cdf0e10cSrcweir pTPView=new SvxTPView(&aTCAccept); 1433cdf0e10cSrcweir aMinSize=pTPView->GetMinSizePixel(); 1434cdf0e10cSrcweir 1435cdf0e10cSrcweir aTCAccept.InsertPage( TP_VIEW, pTPView->GetMyName()); 1436cdf0e10cSrcweir aTCAccept.InsertPage( TP_FILTER, pTPFilter->GetMyName()); 1437cdf0e10cSrcweir aTCAccept.SetTabPage( TP_VIEW, pTPView); 1438cdf0e10cSrcweir aTCAccept.SetTabPage( TP_FILTER, pTPFilter); 1439cdf0e10cSrcweir aTCAccept.SetHelpId(HID_REDLINING_TABCONTROL); 1440cdf0e10cSrcweir 1441cdf0e10cSrcweir aTCAccept.SetTabPageSizePixel(aMinSize); 1442cdf0e10cSrcweir Size aSize=aTCAccept.GetSizePixel(); 1443cdf0e10cSrcweir 1444cdf0e10cSrcweir gDiffSize.Height()=aSize.Height()-aMinSize.Height(); 1445cdf0e10cSrcweir gDiffSize.Width()=aSize.Width()-aMinSize.Width(); 1446cdf0e10cSrcweir 1447cdf0e10cSrcweir 1448cdf0e10cSrcweir pTPFilter->SetRedlinTable(GetViewTable()); 1449cdf0e10cSrcweir 1450cdf0e10cSrcweir aTCAccept.Show(); 1451cdf0e10cSrcweir ShowViewPage(); 1452cdf0e10cSrcweir } 1453cdf0e10cSrcweir 1454cdf0e10cSrcweir SvxAcceptChgCtr::SvxAcceptChgCtr( Window* pParent, const ResId& rResId ) 1455cdf0e10cSrcweir : Control(pParent,rResId ), 1456cdf0e10cSrcweir aTCAccept(this,WB_TABSTOP |WB_DIALOGCONTROL) 1457cdf0e10cSrcweir { 1458cdf0e10cSrcweir pTPFilter=new SvxTPFilter(&aTCAccept); 1459cdf0e10cSrcweir pTPView=new SvxTPView(&aTCAccept); 1460cdf0e10cSrcweir aMinSize=pTPView->GetMinSizePixel(); 1461cdf0e10cSrcweir 1462cdf0e10cSrcweir aTCAccept.InsertPage( TP_VIEW, pTPView->GetMyName()); 1463cdf0e10cSrcweir aTCAccept.InsertPage( TP_FILTER, pTPFilter->GetMyName()); 1464cdf0e10cSrcweir aTCAccept.SetTabPage( TP_VIEW, pTPView); 1465cdf0e10cSrcweir aTCAccept.SetTabPage( TP_FILTER, pTPFilter); 1466cdf0e10cSrcweir aTCAccept.SetHelpId(HID_REDLINING_TABCONTROL); 1467cdf0e10cSrcweir 1468cdf0e10cSrcweir aTCAccept.SetTabPageSizePixel(aMinSize); 1469cdf0e10cSrcweir Size aSize=aTCAccept.GetSizePixel(); 1470cdf0e10cSrcweir 1471cdf0e10cSrcweir gDiffSize.Height()=aSize.Height()-aMinSize.Height(); 1472cdf0e10cSrcweir gDiffSize.Width()=aSize.Width()-aMinSize.Width(); 1473cdf0e10cSrcweir 1474cdf0e10cSrcweir 1475cdf0e10cSrcweir pTPFilter->SetRedlinTable(GetViewTable()); 1476cdf0e10cSrcweir WinBits nWinStyle=GetStyle()|WB_DIALOGCONTROL; 1477cdf0e10cSrcweir SetStyle(nWinStyle); 1478cdf0e10cSrcweir 1479cdf0e10cSrcweir aTCAccept.Show(); 1480cdf0e10cSrcweir ShowViewPage(); 1481cdf0e10cSrcweir Resize(); 1482cdf0e10cSrcweir } 1483cdf0e10cSrcweir 1484cdf0e10cSrcweir SvxAcceptChgCtr::~SvxAcceptChgCtr() 1485cdf0e10cSrcweir { 1486cdf0e10cSrcweir delete pTPView; 1487cdf0e10cSrcweir delete pTPFilter; 1488cdf0e10cSrcweir } 1489cdf0e10cSrcweir 1490cdf0e10cSrcweir void SvxAcceptChgCtr::Resize() 1491cdf0e10cSrcweir { 1492cdf0e10cSrcweir aMinSize=pTPView->GetMinSizePixel(); 1493cdf0e10cSrcweir Size aSize=GetOutputSizePixel(); 1494cdf0e10cSrcweir sal_Bool bFlag=sal_False; 1495cdf0e10cSrcweir 1496cdf0e10cSrcweir if(aMinSize.Height()>aSize.Height()) 1497cdf0e10cSrcweir { 1498cdf0e10cSrcweir aSize.Height()=aMinSize.Height(); 1499cdf0e10cSrcweir bFlag=sal_True; 1500cdf0e10cSrcweir } 1501cdf0e10cSrcweir if(aMinSize.Width()>aSize.Width()) 1502cdf0e10cSrcweir { 1503cdf0e10cSrcweir aSize.Width()=aMinSize.Width(); 1504cdf0e10cSrcweir bFlag=sal_True; 1505cdf0e10cSrcweir } 1506cdf0e10cSrcweir 1507cdf0e10cSrcweir if(bFlag) 1508cdf0e10cSrcweir { 1509cdf0e10cSrcweir SetOutputSizePixel(aSize); 1510cdf0e10cSrcweir aMinSizeLink.Call(this); 1511cdf0e10cSrcweir } 1512cdf0e10cSrcweir 1513cdf0e10cSrcweir aSize.Height()-=2; 1514cdf0e10cSrcweir aSize.Width()-=2; 1515cdf0e10cSrcweir aTCAccept.SetSizePixel(aSize); 1516cdf0e10cSrcweir } 1517cdf0e10cSrcweir 1518cdf0e10cSrcweir Size SvxAcceptChgCtr::GetMinSizePixel() const 1519cdf0e10cSrcweir { 1520cdf0e10cSrcweir Size aSize=pTPView->GetMinSizePixel(); 1521cdf0e10cSrcweir aSize.Height()+=gDiffSize.Height(); 1522cdf0e10cSrcweir aSize.Width()+=gDiffSize.Width(); 1523cdf0e10cSrcweir return aSize; 1524cdf0e10cSrcweir } 1525cdf0e10cSrcweir 1526cdf0e10cSrcweir void SvxAcceptChgCtr::ShowFilterPage() 1527cdf0e10cSrcweir { 1528cdf0e10cSrcweir aTCAccept.SetCurPageId(TP_FILTER); 1529cdf0e10cSrcweir } 1530cdf0e10cSrcweir 1531cdf0e10cSrcweir void SvxAcceptChgCtr::ShowViewPage() 1532cdf0e10cSrcweir { 1533cdf0e10cSrcweir aTCAccept.SetCurPageId(TP_VIEW); 1534cdf0e10cSrcweir } 1535cdf0e10cSrcweir 1536cdf0e10cSrcweir sal_Bool SvxAcceptChgCtr::IsFilterPageVisible() 1537cdf0e10cSrcweir { 1538cdf0e10cSrcweir return (aTCAccept.GetCurPageId()==TP_FILTER); 1539cdf0e10cSrcweir } 1540cdf0e10cSrcweir 1541cdf0e10cSrcweir sal_Bool SvxAcceptChgCtr::IsViewPageVisible() 1542cdf0e10cSrcweir { 1543cdf0e10cSrcweir return (aTCAccept.GetCurPageId()==TP_VIEW); 1544cdf0e10cSrcweir } 1545cdf0e10cSrcweir 1546cdf0e10cSrcweir SvxTPFilter* SvxAcceptChgCtr::GetFilterPage() 1547cdf0e10cSrcweir { 1548cdf0e10cSrcweir return pTPFilter; 1549cdf0e10cSrcweir } 1550cdf0e10cSrcweir 1551cdf0e10cSrcweir SvxTPView* SvxAcceptChgCtr::GetViewPage() 1552cdf0e10cSrcweir { 1553cdf0e10cSrcweir return pTPView; 1554cdf0e10cSrcweir } 1555cdf0e10cSrcweir 1556cdf0e10cSrcweir SvxRedlinTable* SvxAcceptChgCtr::GetViewTable() 1557cdf0e10cSrcweir { 1558cdf0e10cSrcweir if(pTPView!=NULL) 1559cdf0e10cSrcweir { 1560cdf0e10cSrcweir return pTPView->GetTableControl(); 1561cdf0e10cSrcweir } 1562cdf0e10cSrcweir else 1563cdf0e10cSrcweir { 1564cdf0e10cSrcweir return NULL; 1565cdf0e10cSrcweir } 1566cdf0e10cSrcweir } 1567cdf0e10cSrcweir 1568cdf0e10cSrcweir 1569