[Libreoffice-commits] core.git: sw/inc sw/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Wed Dec 11 07:16:13 UTC 2019
sw/inc/sortopt.hxx | 2 +-
sw/source/core/doc/docsort.cxx | 2 +-
sw/source/core/doc/sortopt.cxx | 2 +-
sw/source/core/unocore/unoobj.cxx | 10 +++++-----
sw/source/ui/misc/srtdlg.cxx | 6 +++---
5 files changed, 11 insertions(+), 11 deletions(-)
New commits:
commit e92206270a1c3a63072e813a948297d1f8332609
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Tue Dec 10 11:50:05 2019 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Dec 11 08:15:10 2019 +0100
convert SwSortOrder to scoped enum
Change-Id: I24f982749a94e32d388663cc3a518d919bad96ff
Reviewed-on: https://gerrit.libreoffice.org/84853
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/sw/inc/sortopt.hxx b/sw/inc/sortopt.hxx
index be697b55e63e..959080b3247e 100644
--- a/sw/inc/sortopt.hxx
+++ b/sw/inc/sortopt.hxx
@@ -25,7 +25,7 @@
#include <memory>
#include <vector>
-enum SwSortOrder { SRT_ASCENDING, SRT_DESCENDING };
+enum class SwSortOrder { Ascending, Descending };
enum SwSortDirection { SRT_COLUMNS, SRT_ROWS };
struct SW_DLLPUBLIC SwSortKey
diff --git a/sw/source/core/doc/docsort.cxx b/sw/source/core/doc/docsort.cxx
index 291e734dc747..0565878c36e9 100644
--- a/sw/source/core/doc/docsort.cxx
+++ b/sw/source/core/doc/docsort.cxx
@@ -123,7 +123,7 @@ int SwSortElement::keycompare(const SwSortElement& rCmp, sal_uInt16 nKey) const
const SwSortElement *pOrig, *pCmp;
const SwSortKey* pSrtKey = pOptions->aKeys[ nKey ].get();
- if( pSrtKey->eSortOrder == SRT_ASCENDING )
+ if( pSrtKey->eSortOrder == SwSortOrder::Ascending )
{
pOrig = this;
pCmp = &rCmp;
diff --git a/sw/source/core/doc/sortopt.cxx b/sw/source/core/doc/sortopt.cxx
index 641885269bf0..585a50f818f4 100644
--- a/sw/source/core/doc/sortopt.cxx
+++ b/sw/source/core/doc/sortopt.cxx
@@ -21,7 +21,7 @@
#include <sortopt.hxx>
SwSortKey::SwSortKey() :
- eSortOrder( SRT_ASCENDING ),
+ eSortOrder( SwSortOrder::Ascending ),
nColumnId( 0 ),
bIsNumeric( true )
{
diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx
index 96ab2254b5bc..e1200d0e10dd 100644
--- a/sw/source/core/unocore/unoobj.cxx
+++ b/sw/source/core/unocore/unoobj.cxx
@@ -2585,17 +2585,17 @@ bool SwUnoCursorHelper::ConvertSortProperties(
std::unique_ptr<SwSortKey> pKey1(new SwSortKey);
pKey1->nColumnId = USHRT_MAX;
pKey1->bIsNumeric = true;
- pKey1->eSortOrder = SRT_ASCENDING;
+ pKey1->eSortOrder = SwSortOrder::Ascending;
std::unique_ptr<SwSortKey> pKey2(new SwSortKey);
pKey2->nColumnId = USHRT_MAX;
pKey2->bIsNumeric = true;
- pKey2->eSortOrder = SRT_ASCENDING;
+ pKey2->eSortOrder = SwSortOrder::Ascending;
std::unique_ptr<SwSortKey> pKey3(new SwSortKey);
pKey3->nColumnId = USHRT_MAX;
pKey3->bIsNumeric = true;
- pKey3->eSortOrder = SRT_ASCENDING;
+ pKey3->eSortOrder = SwSortOrder::Ascending;
SwSortKey* aKeys[3] = {pKey1.get(), pKey2.get(), pKey3.get()};
bool bOldSortdescriptor(false);
@@ -2744,7 +2744,7 @@ bool SwUnoCursorHelper::ConvertSortProperties(
if (bTemp && nIndex < 3)
{
aKeys[nIndex]->eSortOrder = (*bTemp)
- ? SRT_ASCENDING : SRT_DESCENDING;
+ ? SwSortOrder::Ascending : SwSortOrder::Descending;
}
else
{
@@ -2785,7 +2785,7 @@ bool SwUnoCursorHelper::ConvertSortProperties(
aKeys[i]->bIsNumeric = (pFields[i].FieldType ==
table::TableSortFieldType_NUMERIC);
aKeys[i]->eSortOrder = (pFields[i].IsAscending)
- ? SRT_ASCENDING : SRT_DESCENDING;
+ ? SwSortOrder::Ascending : SwSortOrder::Descending;
}
}
else
diff --git a/sw/source/ui/misc/srtdlg.cxx b/sw/source/ui/misc/srtdlg.cxx
index e9a8e715f6a9..6b5c898e20c5 100644
--- a/sw/source/ui/misc/srtdlg.cxx
+++ b/sw/source/ui/misc/srtdlg.cxx
@@ -269,7 +269,7 @@ void SwSortDlg::Apply()
aOptions.aKeys.push_back(
std::make_unique<SwSortKey>( nCol1, sEntry,
- bAsc1 ? SRT_ASCENDING : SRT_DESCENDING ));
+ bAsc1 ? SwSortOrder::Ascending : SwSortOrder::Descending ));
}
if( bCheck2 )
@@ -282,7 +282,7 @@ void SwSortDlg::Apply()
aOptions.aKeys.push_back(
std::make_unique<SwSortKey>( nCol2, sEntry,
- bAsc2 ? SRT_ASCENDING : SRT_DESCENDING ));
+ bAsc2 ? SwSortOrder::Ascending : SwSortOrder::Descending ));
}
if( bCheck3 )
@@ -295,7 +295,7 @@ void SwSortDlg::Apply()
aOptions.aKeys.push_back(
std::make_unique<SwSortKey>( nCol3, sEntry,
- bAsc3 ? SRT_ASCENDING : SRT_DESCENDING ));
+ bAsc3 ? SwSortOrder::Ascending : SwSortOrder::Descending ));
}
aOptions.eDirection = bCol ? SRT_COLUMNS : SRT_ROWS;
More information about the Libreoffice-commits
mailing list