diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-12-10 11:51:27 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-12-11 09:08:31 +0100 |
commit | c3d5da852584154b5efbce564006e06acbc5f604 (patch) | |
tree | baba185a90b5b9467ef50bb53a57195c858119b9 /sw/source | |
parent | 48e8c03710a540341a0d901273c42acfe0189498 (diff) |
convert SwSortDirection to scoped enum
Change-Id: I20eea9b1addf0f7483d1b48a3d74eb342b479d04
Reviewed-on: https://gerrit.libreoffice.org/84854
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/doc/docsort.cxx | 10 | ||||
-rw-r--r-- | sw/source/core/doc/sortopt.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/unocore/unoobj.cxx | 6 | ||||
-rw-r--r-- | sw/source/ui/misc/srtdlg.cxx | 2 |
4 files changed, 10 insertions, 10 deletions
diff --git a/sw/source/core/doc/docsort.cxx b/sw/source/core/doc/docsort.cxx index 0565878c36e9..75e432a701c0 100644 --- a/sw/source/core/doc/docsort.cxx +++ b/sw/source/core/doc/docsort.cxx @@ -236,7 +236,7 @@ OUString SwSortBoxElement::GetKey(sal_uInt16 nKey) const const FndBox_* pFndBox; sal_uInt16 nCol = pOptions->aKeys[nKey]->nColumnId-1; - if( SRT_ROWS == pOptions->eDirection ) + if( SwSortDirection::Rows == pOptions->eDirection ) pFndBox = pBox->GetBox(nCol, nRow); // Sort rows else pFndBox = pBox->GetBox(nRow, nCol); // Sort columns @@ -265,7 +265,7 @@ double SwSortBoxElement::GetValue( sal_uInt16 nKey ) const const FndBox_* pFndBox; sal_uInt16 nCol = pOptions->aKeys[nKey]->nColumnId-1; - if( SRT_ROWS == pOptions->eDirection ) + if( SwSortDirection::Rows == pOptions->eDirection ) pFndBox = pBox->GetBox(nCol, nRow); // Sort rows else pFndBox = pBox->GetBox(nRow, nCol); // Sort columns @@ -491,7 +491,7 @@ bool SwDoc::SortTable(const SwSelBoxes& rBoxes, const SwSortOptions& rOpt) getIDocumentRedlineAccess().DeleteRedline( *pTableNd, true, RedlineType::Any ); FndLines_t::size_type nStart = 0; - if( pTableNd->GetTable().GetRowsToRepeat() > 0 && rOpt.eDirection == SRT_ROWS ) + if( pTableNd->GetTable().GetRowsToRepeat() > 0 && rOpt.eDirection == SwSortDirection::Rows ) { // Uppermost selected Cell FndLines_t& rLines = aFndBox.GetLines(); @@ -547,7 +547,7 @@ bool SwDoc::SortTable(const SwSelBoxes& rBoxes, const SwSortOptions& rOpt) ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo()); // Insert KeyElements - sal_uInt16 nCount = (rOpt.eDirection == SRT_ROWS) ? + sal_uInt16 nCount = (rOpt.eDirection == SwSortDirection::Rows) ? aFlatBox.GetRows() : aFlatBox.GetCols(); // Sort SortList by Key @@ -565,7 +565,7 @@ bool SwDoc::SortTable(const SwSelBoxes& rBoxes, const SwSortOptions& rOpt) sal_uInt16 i = 0; for (const auto& rElem : aSortList) { - if(rOpt.eDirection == SRT_ROWS) + if(rOpt.eDirection == SwSortDirection::Rows) { MoveRow(this, aFlatBox, rElem.nRow, i+nStart, aMovedList, pUndoSort); } diff --git a/sw/source/core/doc/sortopt.cxx b/sw/source/core/doc/sortopt.cxx index 585a50f818f4..06ac058568af 100644 --- a/sw/source/core/doc/sortopt.cxx +++ b/sw/source/core/doc/sortopt.cxx @@ -36,7 +36,7 @@ SwSortKey::SwSortKey(sal_uInt16 nId, const OUString& rSrtType, SwSortOrder eOrde } SwSortOptions::SwSortOptions() - : eDirection( SRT_ROWS ), + : eDirection( SwSortDirection::Rows ), cDeli( 9 ), nLanguage( LANGUAGE_SYSTEM ), bTable( false ), diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx index e1200d0e10dd..612adeb01e90 100644 --- a/sw/source/core/unocore/unoobj.cxx +++ b/sw/source/core/unocore/unoobj.cxx @@ -2580,7 +2580,7 @@ bool SwUnoCursorHelper::ConvertSortProperties( rSortOpt.bTable = false; rSortOpt.cDeli = ' '; - rSortOpt.eDirection = SRT_COLUMNS; //!! UI text may be contrary though !! + rSortOpt.eDirection = SwSortDirection::Columns; //!! UI text may be contrary though !! std::unique_ptr<SwSortKey> pKey1(new SwSortKey); pKey1->nColumnId = USHRT_MAX; @@ -2644,7 +2644,7 @@ bool SwUnoCursorHelper::ConvertSortProperties( bool bTemp(false); if (aValue >>= bTemp) { - rSortOpt.eDirection = bTemp ? SRT_COLUMNS : SRT_ROWS; + rSortOpt.eDirection = bTemp ? SwSortDirection::Columns : SwSortDirection::Rows; } else { @@ -2757,7 +2757,7 @@ bool SwUnoCursorHelper::ConvertSortProperties( bNewSortdescriptor = true; if (auto bTemp = o3tl::tryAccess<bool>(aValue)) { - rSortOpt.eDirection = *bTemp ? SRT_COLUMNS : SRT_ROWS; + rSortOpt.eDirection = *bTemp ? SwSortDirection::Columns : SwSortDirection::Rows; } else { diff --git a/sw/source/ui/misc/srtdlg.cxx b/sw/source/ui/misc/srtdlg.cxx index 6b5c898e20c5..b94922e93845 100644 --- a/sw/source/ui/misc/srtdlg.cxx +++ b/sw/source/ui/misc/srtdlg.cxx @@ -298,7 +298,7 @@ void SwSortDlg::Apply() bAsc3 ? SwSortOrder::Ascending : SwSortOrder::Descending )); } - aOptions.eDirection = bCol ? SRT_COLUMNS : SRT_ROWS; + aOptions.eDirection = bCol ? SwSortDirection::Columns : SwSortDirection::Rows; aOptions.cDeli = cDeli; aOptions.nLanguage = nLang; aOptions.bTable = rSh.IsTableMode(); |