diff options
author | Noel Grandin <noel@peralex.com> | 2016-08-30 12:15:41 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-08-31 10:00:07 +0200 |
commit | 8b52d4e73a06d433d128d61a4939e92e4a497d71 (patch) | |
tree | 7888aa54b430ea537ad7c8adb59379163d4d4a64 | |
parent | fd405ab457183f1c0d48d47bbd3308edb2e30242 (diff) |
convert SwDocPositions to scoped enum
Change-Id: Idd9414b4a10398130337e474fb8fd4063e3bd4f8
-rw-r--r-- | sw/inc/crsrsh.hxx | 6 | ||||
-rw-r--r-- | sw/inc/cshtyp.hxx | 12 | ||||
-rw-r--r-- | sw/qa/core/macros-test.cxx | 4 | ||||
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter.cxx | 14 | ||||
-rw-r--r-- | sw/source/core/crsr/swcrsr.cxx | 14 | ||||
-rw-r--r-- | sw/source/core/edit/editsh.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/edit/edlingu.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/edit/edtox.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/index/swuiidxmrk.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx | 16 | ||||
-rw-r--r-- | sw/source/uibase/uiview/view2.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/uiview/viewling.cxx | 42 | ||||
-rw-r--r-- | sw/source/uibase/uiview/viewsrch.cxx | 18 | ||||
-rw-r--r-- | sw/source/uibase/uno/unotxdoc.cxx | 8 |
14 files changed, 73 insertions, 73 deletions
diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx index 2b9b013fd4b2..dbe62d646350 100644 --- a/sw/inc/crsrsh.hxx +++ b/sw/inc/crsrsh.hxx @@ -267,7 +267,7 @@ typedef bool (SwCursor:: *FNCursor)(); protected: - inline SwMoveFnCollection const & MakeFindRange( sal_uInt16, sal_uInt16, SwPaM* ) const; + inline SwMoveFnCollection const & MakeFindRange( SwDocPositions, SwDocPositions, SwPaM* ) const; /* * Compare-Methode for the StackCursor and the current Cursor. @@ -846,9 +846,9 @@ public: // Cursor Inlines: inline SwMoveFnCollection const & SwCursorShell::MakeFindRange( - sal_uInt16 nStt, sal_uInt16 nEnd, SwPaM* pPam ) const + SwDocPositions nStt, SwDocPositions nEnd, SwPaM* pPam ) const { - return m_pCurrentCursor->MakeFindRange( (SwDocPositions)nStt, (SwDocPositions)nEnd, pPam ); + return m_pCurrentCursor->MakeFindRange( nStt, nEnd, pPam ); } inline SwCursor* SwCursorShell::GetSwCursor() const diff --git a/sw/inc/cshtyp.hxx b/sw/inc/cshtyp.hxx index e9dc3a7ad525..c2e9a3bbcc1e 100644 --- a/sw/inc/cshtyp.hxx +++ b/sw/inc/cshtyp.hxx @@ -87,13 +87,13 @@ enum FindRanges FND_IN_SELALL = 0x01 ///< All (only in non-body and selections). }; -enum SwDocPositions +enum class SwDocPositions { - DOCPOS_START, - DOCPOS_CURR, - DOCPOS_END, - DOCPOS_OTHERSTART, - DOCPOS_OTHEREND + Start, + Curr, + End, + OtherStart, + OtherEnd }; SW_DLLPUBLIC SwWhichPara GetfnParaCurr(); diff --git a/sw/qa/core/macros-test.cxx b/sw/qa/core/macros-test.cxx index 2f4d95369622..b73205545e93 100644 --- a/sw/qa/core/macros-test.cxx +++ b/sw/qa/core/macros-test.cxx @@ -558,7 +558,7 @@ void SwMacrosTest::testFindReplace() // find newline on 1st paragraph bool bFound = pPaM->Find( - opts, false, DOCPOS_CURR, DOCPOS_END, bCancel); + opts, false, SwDocPositions::Curr, SwDocPositions::End, bCancel); CPPUNIT_ASSERT(bFound); CPPUNIT_ASSERT(pPaM->HasMark()); CPPUNIT_ASSERT_EQUAL(OUString(""), pPaM->GetText()); @@ -566,7 +566,7 @@ void SwMacrosTest::testFindReplace() // now do another Find, inside the selection from the first Find // opts.searchFlags = 71680; bFound = pPaM->Find( - opts, false, DOCPOS_CURR, DOCPOS_END, bCancel, FND_IN_SEL); + opts, false, SwDocPositions::Curr, SwDocPositions::End, bCancel, FND_IN_SEL); CPPUNIT_ASSERT(bFound); CPPUNIT_ASSERT(pPaM->HasMark()); CPPUNIT_ASSERT_EQUAL(OUString(""), pPaM->GetText()); diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index b2ebfffca846..3ef3363e5ff1 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -1967,14 +1967,14 @@ void SwUiWriterTest::testSearchWithTransliterate() SearchOpt.AlgorithmType2 = css::util::SearchAlgorithms2::ABSOLUTE; SearchOpt.WildcardEscapeCharacter = 0; //transliteration option set so that at least one of the search strings is not found - sal_uLong case1 = pWrtShell->SearchPattern(SearchOpt,true,DOCPOS_START,DOCPOS_END); + sal_uLong case1 = pWrtShell->SearchPattern(SearchOpt,true,SwDocPositions::Start,SwDocPositions::End); SwShellCursor* pShellCursor = pWrtShell->getShellCursor(true); CPPUNIT_ASSERT_EQUAL(OUString(""),pShellCursor->GetText()); CPPUNIT_ASSERT_EQUAL(0,(int)case1); SearchOpt.searchString = "paragraph"; SearchOpt.transliterateFlags = css::i18n::TransliterationModulesExtra::IGNORE_KASHIDA_CTL; //transliteration option set so that all search strings are found - sal_uLong case2 = pWrtShell->SearchPattern(SearchOpt,true,DOCPOS_START,DOCPOS_END); + sal_uLong case2 = pWrtShell->SearchPattern(SearchOpt,true,SwDocPositions::Start,SwDocPositions::End); pShellCursor = pWrtShell->getShellCursor(true); CPPUNIT_ASSERT_EQUAL(OUString("paragraph"),pShellCursor->GetText()); CPPUNIT_ASSERT_EQUAL(1,(int)case2); @@ -2002,19 +2002,19 @@ void SwUiWriterTest::testTdf73660() searchOpt.searchFlag = css::util::SearchFlags::NORM_WORD_ONLY; //case 1 searchOpt.searchString = "First"; - CPPUNIT_ASSERT_EQUAL(sal_uLong(1), pWrtShell->SearchPattern(searchOpt,true,DOCPOS_START,DOCPOS_END)); + CPPUNIT_ASSERT_EQUAL(sal_uLong(1), pWrtShell->SearchPattern(searchOpt,true,SwDocPositions::Start,SwDocPositions::End)); //case 2 searchOpt.searchString = "Second"; - CPPUNIT_ASSERT_EQUAL(sal_uLong(1), pWrtShell->SearchPattern(searchOpt,true,DOCPOS_START,DOCPOS_END)); + CPPUNIT_ASSERT_EQUAL(sal_uLong(1), pWrtShell->SearchPattern(searchOpt,true,SwDocPositions::Start,SwDocPositions::End)); //case 3 searchOpt.searchString = "Third"; - CPPUNIT_ASSERT_EQUAL(sal_uLong(1), pWrtShell->SearchPattern(searchOpt,true,DOCPOS_START,DOCPOS_END)); + CPPUNIT_ASSERT_EQUAL(sal_uLong(1), pWrtShell->SearchPattern(searchOpt,true,SwDocPositions::Start,SwDocPositions::End)); //case 4 searchOpt.searchString = "Fourth"; - CPPUNIT_ASSERT_EQUAL(sal_uLong(1), pWrtShell->SearchPattern(searchOpt,true,DOCPOS_START,DOCPOS_END)); + CPPUNIT_ASSERT_EQUAL(sal_uLong(1), pWrtShell->SearchPattern(searchOpt,true,SwDocPositions::Start,SwDocPositions::End)); //case 5 searchOpt.searchString = "Fifth"; - CPPUNIT_ASSERT_EQUAL(sal_uLong(1), pWrtShell->SearchPattern(searchOpt,true,DOCPOS_START,DOCPOS_END)); + CPPUNIT_ASSERT_EQUAL(sal_uLong(1), pWrtShell->SearchPattern(searchOpt,true,SwDocPositions::Start,SwDocPositions::End)); } void SwUiWriterTest::testNewDocModifiedState() diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx index 0e377e906b6a..3309d8923577 100644 --- a/sw/source/core/crsr/swcrsr.cxx +++ b/sw/source/core/crsr/swcrsr.cxx @@ -729,9 +729,9 @@ SwMoveFnCollection const & SwCursor::MakeFindRange( SwDocPositions nStart, FillFindPos( nEnd, *pRange->GetPoint() ); // determine direction of search - return ( DOCPOS_START == nStart || DOCPOS_OTHERSTART == nStart || - (DOCPOS_CURR == nStart && - (DOCPOS_END == nEnd || DOCPOS_OTHEREND == nEnd ) )) + return ( SwDocPositions::Start == nStart || SwDocPositions::OtherStart == nStart || + (SwDocPositions::Curr == nStart && + (SwDocPositions::End == nEnd || SwDocPositions::OtherEnd == nEnd ) )) ? fnMoveForward : fnMoveBackward; } @@ -1086,20 +1086,20 @@ void SwCursor::FillFindPos( SwDocPositions ePos, SwPosition& rPos ) const switch( ePos ) { - case DOCPOS_START: + case SwDocPositions::Start: rPos.nNode = *rNds.GetEndOfContent().StartOfSectionNode(); pCNd = rNds.GoNext( &rPos.nNode ); break; - case DOCPOS_END: + case SwDocPositions::End: rPos.nNode = rNds.GetEndOfContent(); pCNd = SwNodes::GoPrevious( &rPos.nNode ); bIsStart = false; break; - case DOCPOS_OTHERSTART: + case SwDocPositions::OtherStart: rPos.nNode = *rNds[ sal_uLong(0) ]; pCNd = rNds.GoNext( &rPos.nNode ); break; - case DOCPOS_OTHEREND: + case SwDocPositions::OtherEnd: rPos.nNode = *rNds.GetEndOfContent().StartOfSectionNode(); pCNd = SwNodes::GoPrevious( &rPos.nNode ); bIsStart = false; diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx index 20b576547a53..d7147837468e 100644 --- a/sw/source/core/edit/editsh.cxx +++ b/sw/source/core/edit/editsh.cxx @@ -729,9 +729,9 @@ void SwEditShell::SetNumberingRestart() for(int i = 0; i < 2; i++) { if(!i) - MakeFindRange(DOCPOS_START, DOCPOS_END, pCursor); // body content + MakeFindRange(SwDocPositions::Start, SwDocPositions::End, pCursor); // body content else - MakeFindRange(DOCPOS_OTHERSTART, DOCPOS_OTHEREND, pCursor); // extra content + MakeFindRange(SwDocPositions::OtherStart, SwDocPositions::OtherEnd, pCursor); // extra content SwPosition* pSttPos = pCursor->Start(), *pEndPos = pCursor->End(); sal_uLong nCurrNd = pSttPos->nNode.GetIndex(); sal_uLong nEndNd = pEndPos->nNode.GetIndex(); diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx index 4d0c46eb6e83..afaba234faf8 100644 --- a/sw/source/core/edit/edlingu.cxx +++ b/sw/source/core/edit/edlingu.cxx @@ -617,7 +617,7 @@ bool SwEditShell::HasHyphIter() void SwEditShell::SetLinguRange( SwDocPositions eStart, SwDocPositions eEnd ) { SwPaM *pCursor = GetCursor(); - MakeFindRange( static_cast<sal_uInt16>(eStart), static_cast<sal_uInt16>(eEnd), pCursor ); + MakeFindRange( eStart, eEnd, pCursor ); if( *pCursor->GetPoint() > *pCursor->GetMark() ) pCursor->Exchange(); } diff --git a/sw/source/core/edit/edtox.cxx b/sw/source/core/edit/edtox.cxx index eb006419dae2..d1d58f5e3c67 100644 --- a/sw/source/core/edit/edtox.cxx +++ b/sw/source/core/edit/edtox.cxx @@ -373,7 +373,7 @@ void SwEditShell::ApplyAutoMark() // todo/mba: assuming that notes shouldn't be searched bool bSearchInNotes = false; - sal_uLong nRet = Find( aSearchOpt, bSearchInNotes, DOCPOS_START, DOCPOS_END, bCancel, + sal_uLong nRet = Find( aSearchOpt, bSearchInNotes, SwDocPositions::Start, SwDocPositions::End, bCancel, (FindRanges)(FND_IN_SELALL) ); if(nRet) diff --git a/sw/source/ui/index/swuiidxmrk.cxx b/sw/source/ui/index/swuiidxmrk.cxx index 361a91044105..2bbf6145988a 100644 --- a/sw/source/ui/index/swuiidxmrk.cxx +++ b/sw/source/ui/index/swuiidxmrk.cxx @@ -455,7 +455,7 @@ static void lcl_SelectSameStrings(SwWrtShell& rSh, bool bWordOnly, bool bCaseSen //todo/mba: assuming that notes should not be searched bool bSearchInNotes = false; - rSh.Find( aSearchOpt, bSearchInNotes, DOCPOS_START, DOCPOS_END, bCancel, + rSh.Find( aSearchOpt, bSearchInNotes, SwDocPositions::Start, SwDocPositions::End, bCancel, (FindRanges)(FND_IN_SELALL|FND_IN_BODYONLY) ); } diff --git a/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx b/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx index dc383d0cbce6..105da59eb028 100644 --- a/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx +++ b/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx @@ -232,7 +232,7 @@ svx::SpellPortions SwSpellDialogChildWindow::GetNextWrongSentence(bool bRecheck) { m_pSpellState->pOtherCursor = new SwPaM(*pWrtShell->GetCursor()->GetPoint()); m_pSpellState->m_bStartedInOther = true; - pWrtShell->SpellStart( DOCPOS_OTHERSTART, DOCPOS_OTHEREND, DOCPOS_CURR ); + pWrtShell->SpellStart( SwDocPositions::OtherStart, SwDocPositions::OtherEnd, SwDocPositions::Curr ); } else { @@ -245,7 +245,7 @@ svx::SpellPortions SwSpellDialogChildWindow::GetNextWrongSentence(bool bRecheck) *pWrtShell->GetDoc(), *pCursor->Start(), pCursor->End()); } - pWrtShell->SpellStart( DOCPOS_START, DOCPOS_END, DOCPOS_CURR ); + pWrtShell->SpellStart( SwDocPositions::Start, SwDocPositions::End, SwDocPositions::Curr ); } } else @@ -290,7 +290,7 @@ The code below would only be part of the solution. // if there's any that has not been spelled yet if(!m_pSpellState->m_bOtherSpelled && pWrtShell->HasOtherCnt()) { - pWrtShell->SpellStart(DOCPOS_OTHERSTART, DOCPOS_OTHEREND, DOCPOS_OTHERSTART ); + pWrtShell->SpellStart(SwDocPositions::OtherStart, SwDocPositions::OtherEnd, SwDocPositions::OtherStart ); if(!pWrtShell->SpellSentence(aRet, m_bIsGrammarCheckingOn)) { pWrtShell->SpellEnd(); @@ -302,7 +302,7 @@ The code below would only be part of the solution. // if no result has been found try at the body text - completely if(!m_pSpellState->m_bBodySpelled && aRet.empty()) { - pWrtShell->SpellStart(DOCPOS_START, DOCPOS_END, DOCPOS_START ); + pWrtShell->SpellStart(SwDocPositions::Start, SwDocPositions::End, SwDocPositions::Start ); if(!pWrtShell->SpellSentence(aRet, m_bIsGrammarCheckingOn)) { m_pSpellState->m_bBodySpelled = true; @@ -331,7 +331,7 @@ The code below would only be part of the solution. pWrtShell->SpellEnd(); delete m_pSpellState->pOtherCursor; m_pSpellState->pOtherCursor = nullptr; - pWrtShell->SpellStart(DOCPOS_OTHERSTART, DOCPOS_CURR, DOCPOS_OTHERSTART ); + pWrtShell->SpellStart(SwDocPositions::OtherStart, SwDocPositions::Curr, SwDocPositions::OtherStart ); (void)pWrtShell->SpellSentence(aRet, m_bIsGrammarCheckingOn); } if(aRet.empty()) @@ -344,7 +344,7 @@ The code below would only be part of the solution. // has the body been spelled? if(!m_pSpellState->m_bBodySpelled) { - pWrtShell->SpellStart(DOCPOS_START, DOCPOS_END, DOCPOS_START ); + pWrtShell->SpellStart(SwDocPositions::Start, SwDocPositions::End, SwDocPositions::Start ); if(!pWrtShell->SpellSentence(aRet, m_bIsGrammarCheckingOn)) { m_pSpellState->m_bBodySpelled = true; @@ -357,7 +357,7 @@ The code below would only be part of the solution. m_pSpellState->m_bBodySpelled = true; if(!m_pSpellState->m_bOtherSpelled && pWrtShell->HasOtherCnt()) { - pWrtShell->SpellStart(DOCPOS_OTHERSTART, DOCPOS_OTHEREND, DOCPOS_OTHERSTART ); + pWrtShell->SpellStart(SwDocPositions::OtherStart, SwDocPositions::OtherEnd, SwDocPositions::OtherStart ); if(!pWrtShell->SpellSentence(aRet, m_bIsGrammarCheckingOn)) { pWrtShell->SpellEnd(); @@ -400,7 +400,7 @@ The code below would only be part of the solution. m_pSpellState->m_xStartRange)) { pWrtShell->SetSelection(aPam); - pWrtShell->SpellStart(DOCPOS_START, DOCPOS_CURR, DOCPOS_START); + pWrtShell->SpellStart(SwDocPositions::Start, SwDocPositions::Curr, SwDocPositions::Start); if(!pWrtShell->SpellSentence(aRet, m_bIsGrammarCheckingOn)) pWrtShell->SpellEnd(); } diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx index e07f72363295..a0828a93a1a6 100644 --- a/sw/source/uibase/uiview/view2.cxx +++ b/sw/source/uibase/uiview/view2.cxx @@ -2001,7 +2001,7 @@ bool SwView::JumpToSwMark( const OUString& rMark ) //todo/mba: assuming that notes shouldn't be searched bool bSearchInNotes = false; - if( m_pWrtShell->SearchPattern( aSearchOpt, bSearchInNotes, DOCPOS_START, DOCPOS_END )) + if( m_pWrtShell->SearchPattern( aSearchOpt, bSearchInNotes, SwDocPositions::Start, SwDocPositions::End )) { m_pWrtShell->EnterStdMode(); // remove the selection bRet = true; diff --git a/sw/source/uibase/uiview/viewling.cxx b/sw/source/uibase/uiview/viewling.cxx index f9000619abca..cfaf3965d7ed 100644 --- a/sw/source/uibase/uiview/viewling.cxx +++ b/sw/source/uibase/uiview/viewling.cxx @@ -273,49 +273,49 @@ void SwView::SpellStart( SvxSpellArea eWhich, Reference< XLinguProperties > xProp = ::GetLinguPropertySet(); bool bIsWrapReverse = !pConvArgs && xProp.is() && xProp->getIsWrapReverse(); - SwDocPositions eStart = DOCPOS_START; - SwDocPositions eEnd = DOCPOS_END; - SwDocPositions eCurr = DOCPOS_CURR; + SwDocPositions eStart = SwDocPositions::Start; + SwDocPositions eEnd = SwDocPositions::End; + SwDocPositions eCurr = SwDocPositions::Curr; switch ( eWhich ) { case SvxSpellArea::Body: if( bIsWrapReverse ) - eCurr = DOCPOS_END; + eCurr = SwDocPositions::End; else - eCurr = DOCPOS_START; + eCurr = SwDocPositions::Start; break; case SvxSpellArea::BodyEnd: if( bIsWrapReverse ) { if( bStartDone ) - eStart = DOCPOS_CURR; - eCurr = DOCPOS_END; + eStart = SwDocPositions::Curr; + eCurr = SwDocPositions::End; } else if( bStartDone ) - eCurr = DOCPOS_START; + eCurr = SwDocPositions::Start; break; case SvxSpellArea::BodyStart: if( !bIsWrapReverse ) { if( bEndDone ) - eEnd = DOCPOS_CURR; - eCurr = DOCPOS_START; + eEnd = SwDocPositions::Curr; + eCurr = SwDocPositions::Start; } else if( bEndDone ) - eCurr = DOCPOS_END; + eCurr = SwDocPositions::End; break; case SvxSpellArea::Other: if( bIsWrapReverse ) { - eStart = DOCPOS_OTHERSTART; - eEnd = DOCPOS_OTHEREND; - eCurr = DOCPOS_OTHEREND; + eStart = SwDocPositions::OtherStart; + eEnd = SwDocPositions::OtherEnd; + eCurr = SwDocPositions::OtherEnd; } else { - eStart = DOCPOS_OTHERSTART; - eEnd = DOCPOS_OTHEREND; - eCurr = DOCPOS_OTHERSTART; + eStart = SwDocPositions::OtherStart; + eEnd = SwDocPositions::OtherEnd; + eCurr = SwDocPositions::OtherStart; } break; default: @@ -398,16 +398,16 @@ void SwView::HyphStart( SvxSpellArea eWhich ) switch ( eWhich ) { case SvxSpellArea::Body: - m_pWrtShell->HyphStart( DOCPOS_START, DOCPOS_END ); + m_pWrtShell->HyphStart( SwDocPositions::Start, SwDocPositions::End ); break; case SvxSpellArea::BodyEnd: - m_pWrtShell->HyphStart( DOCPOS_CURR, DOCPOS_END ); + m_pWrtShell->HyphStart( SwDocPositions::Curr, SwDocPositions::End ); break; case SvxSpellArea::BodyStart: - m_pWrtShell->HyphStart( DOCPOS_START, DOCPOS_CURR ); + m_pWrtShell->HyphStart( SwDocPositions::Start, SwDocPositions::Curr ); break; case SvxSpellArea::Other: - m_pWrtShell->HyphStart( DOCPOS_OTHERSTART, DOCPOS_OTHEREND ); + m_pWrtShell->HyphStart( SwDocPositions::OtherStart, SwDocPositions::OtherEnd ); break; default: OSL_ENSURE( false, "HyphStart with unknown Area" ); diff --git a/sw/source/uibase/uiview/viewsrch.cxx b/sw/source/uibase/uiview/viewsrch.cxx index 2c8752c59d95..48eee5e63b99 100644 --- a/sw/source/uibase/uiview/viewsrch.cxx +++ b/sw/source/uibase/uiview/viewsrch.cxx @@ -367,7 +367,7 @@ void SwView::ExecSearch(SfxRequest& rReq) // i#8288 "replace all" should not change cursor // position, so save current cursor m_pWrtShell->Push(); - if (DOCPOS_START == aOpts.eEnd) + if (SwDocPositions::Start == aOpts.eEnd) { m_pWrtShell->EndDoc(); } @@ -523,7 +523,7 @@ bool SwView::SearchAndWrap(bool bApi) // occurrence in the document instead of the second. if( m_eLastSearchCommand == SvxSearchCmd::FIND_ALL ) { - if( DOCPOS_START == aOpts.eEnd ) + if( SwDocPositions::Start == aOpts.eEnd ) m_pWrtShell->EndDoc(); else m_pWrtShell->SttDoc(); @@ -604,10 +604,10 @@ bool SwView::SearchAndWrap(bool bApi) m_pWrtShell->Pop(false); pWait.reset(new SwWait( *GetDocShell(), true )); - bool bSrchBkwrd = DOCPOS_START == aOpts.eEnd; + bool bSrchBkwrd = SwDocPositions::Start == aOpts.eEnd; - aOpts.eEnd = bSrchBkwrd ? DOCPOS_START : DOCPOS_END; - aOpts.eStart = bSrchBkwrd ? DOCPOS_END : DOCPOS_START; + aOpts.eEnd = bSrchBkwrd ? SwDocPositions::Start : SwDocPositions::End; + aOpts.eStart = bSrchBkwrd ? SwDocPositions::End : SwDocPositions::Start; if (bHasSrchInOther) { @@ -661,7 +661,7 @@ bool SwView::SearchAll() // Cancel existing selections, if should not be sought in selected areas. m_pWrtShell->KillSelection(nullptr, false); - if( DOCPOS_START == aOpts.eEnd ) + if( SwDocPositions::Start == aOpts.eEnd ) m_pWrtShell->EndDoc(); else m_pWrtShell->SttDoc(); @@ -770,15 +770,15 @@ void SwView::Replace() SwSearchOptions::SwSearchOptions( SwWrtShell* pSh, bool bBackward ) { - eStart = DOCPOS_CURR; + eStart = SwDocPositions::Curr; if( bBackward ) { - eEnd = DOCPOS_START; + eEnd = SwDocPositions::Start; bDontWrap = pSh->IsEndOfDoc(); } else { - eEnd = DOCPOS_END; + eEnd = SwDocPositions::End; bDontWrap = pSh->IsStartOfDoc(); } } diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index 121416245fea..4944162bcd7d 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -761,8 +761,8 @@ sal_Int32 SwXTextDocument::replaceAll(const Reference< util::XSearchDescriptor > util::SearchOptions2 aSearchOpt; pSearch->FillSearchOptions( aSearchOpt ); - SwDocPositions eStart = pSearch->m_bBack ? DOCPOS_END : DOCPOS_START; - SwDocPositions eEnd = pSearch->m_bBack ? DOCPOS_START : DOCPOS_END; + SwDocPositions eStart = pSearch->m_bBack ? SwDocPositions::End : SwDocPositions::Start; + SwDocPositions eEnd = pSearch->m_bBack ? SwDocPositions::Start : SwDocPositions::End; // Search should take place anywhere pUnoCursor->SetRemainInSection(false); @@ -897,8 +897,8 @@ SwUnoCursor* SwXTextDocument::FindAny(const Reference< util::XSearchDescriptor > eRanges = FND_IN_OTHER; if(bAll) //always - everywhere? eRanges = FND_IN_SELALL; - SwDocPositions eStart = !bAll ? DOCPOS_CURR : pSearch->m_bBack ? DOCPOS_END : DOCPOS_START; - SwDocPositions eEnd = pSearch->m_bBack ? DOCPOS_START : DOCPOS_END; + SwDocPositions eStart = !bAll ? SwDocPositions::Curr : pSearch->m_bBack ? SwDocPositions::End : SwDocPositions::Start; + SwDocPositions eEnd = pSearch->m_bBack ? SwDocPositions::Start : SwDocPositions::End; nResult = 0; for (int nSearchProc = 0; nSearchProc < 2; ++nSearchProc) |