void CAPresentationHandler::searchOtherSlides(SearchDirection direction) { //Reset the count d->countMatchesPerSlide = 0; if( direction == SearchForward) { d->searchSlideNumber = d->currentSlideNum + 1; } else if ( direction == SearchBackwards) { if( d->currentSlideNum != 0) { d->searchSlideNumber = d->currentSlideNum - 1; } else { return; } } while ((d->searchSlideNumber < totalNumberOfSlides()) && (d->searchSlideNumber >= 0)) { setTextData(d->searchSlideNumber); setSearchString(d->searchString); if(d->matchFound == true) { d->currentSlideNum = d->searchSlideNumber; setCurrentSlideNumber(d->currentSlideNum); setSearchString(d->searchString); if(direction == SearchBackwards) { d->countMatchesPerSlide = d->findText->matches().count() - 1; d->findText->findPrevious(); } break; } if(direction == SearchForward) { d->searchSlideNumber++; } else if(direction == SearchBackwards) { d->searchSlideNumber--; } } }
void CASpreadsheetHandler::searchOtherSheets(SearchDirection direction) { int tempCurrentSheet = d->currentSheetNum; if(direction == SearchForward) { d->matchPerSheet = 0; if(d->searchSheetNumber < sheetCount()) { d->searchSheetNumber = currentSheetNumber(); } else { return; } } else if(direction == SearchBackwards) { if(d->searchSheetNumber >= 0) { d->matchPerSheet = d->findText->matches().count() - 1; d->searchSheetNumber = d->currentSheetNum - 1; } else { return; } } Calligra::Sheets::DocBase* kspreadDoc = qobject_cast<Calligra::Sheets::DocBase*> (document()); while((d->searchSheetNumber < sheetCount()) && (d->searchSheetNumber >= 0)) { d->sheet = kspreadDoc->map()->sheet(d->searchSheetNumber); d->sheet = kspreadDoc->map()->sheet(d->searchSheetNumber); setSearchString(d->searchString); if(d->matchFound == true) { gotoSheet(d->searchSheetNumber, direction); setSearchString(d->searchString); if(direction == SearchBackwards) { if(d->findText->matches().count() == 1) { d->matchPerSheet = 0; } if(d->searchSheetNumber == 0) { d->findText->findPrevious(); } } break; } if(direction == SearchForward) { d->searchSheetNumber++; } else if(direction == SearchBackwards) { d->searchSheetNumber--; } } if(d->matchFound == false) { gotoSheet(tempCurrentSheet,direction); if(direction == SearchBackwards) { d->matchPerSheet = d->findText->matches().count(); d->findText->findPrevious(); } else if( direction == SearchForward) { d->matchPerSheet = 1; } } }
KeySymbol::KeySymbol( const KeySymbol & o ) : _nameProg( NULL ) // freed in setSearchString , _contClassProg( NULL ) , _contFunctionProg( NULL ) , _name( o._name ) , _contClass( o._contClass ) , _contFunction( o._contFunction ) , _searchFor( o._searchFor ) , _anonymous( o._anonymous ) , _artificial( o._artificial ) , _declaration( o._declaration ) //-------------------------------------------- { setSearchString( _name, &_nameProg, _name ); setSearchString( _contClass, &_contClassProg, _contClass ); setSearchString( _contFunction, &_contFunctionProg, _contFunction ); _fileFilter = new FileFilter( *o._fileFilter ); }
void KeySymbol::read( CheckedFile & file ) //---------------------------------------- { uint_8 flags; file.readNString( _name ); file.readNString( _contClass ); file.readNString( _contFunction ); setSearchString( _name, &_nameProg, _name ); setSearchString( _contClass, &_contClassProg, _contClass ); setSearchString( _contFunction, &_contFunctionProg, _contFunction ); file.read( &flags, sizeof( uint_8 ) ); _anonymous = ((flags & KSFAnonymous) != 0); _artificial = ((flags & KSFArtificial) != 0); _declaration = ((flags & KSFDeclaration) != 0); _fileFilter->read( file ); }
void CASpreadsheetHandler::nextSheet() { d->canvasItem = dynamic_cast<Calligra::Sheets::CanvasItem*> (canvas()); if (!d->canvasItem) return; d->sheet = d->canvasItem->activeSheet(); if (!d->sheet) return; Calligra::Sheets::DocBase* kspreadDoc = qobject_cast<Calligra::Sheets::DocBase*> (document()); if (!kspreadDoc) return; d->sheet = kspreadDoc->map()->nextSheet (d->sheet); if (!d->sheet) return; d->currentSheetNum++; emit currentSheetNumChanged(); d->canvasItem->setActiveSheet (d->sheet); documentController()->canvasController()->updateDocumentSize (d->sheet->cellCoordinatesToDocument (d->sheet->usedArea (false)).toRect().size(), false); if(!d->searchString.isEmpty()) { setSearchString(d->searchString); } }
void KeySymbol::setContFunction( const char *name ) //------------------------------------------------- { setSearchString( _contFunction, &_contFunctionProg, name ); }
void KeySymbol::setContClass( const char *name ) //---------------------------------------------- { setSearchString( _contClass, &_contClassProg, name ); }
void KeySymbol::setName( const char *name ) //----------------------------------------- { setSearchString( _name, &_nameProg, name ); }