summaryrefslogtreecommitdiff
path: root/svl/source/items/style.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2020-10-08 10:21:09 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-10-08 18:45:29 +0200
commit592ad72ae178bc9018354ab37224666293ecbe81 (patch)
tree60954e07087ff8ee053e29e62d72ec1c281caa04 /svl/source/items/style.cxx
parent9b6fb8bf3d8e622bd2d013744a591ff32287d3de (diff)
use sal_Int32 for style-sheet index
instead of a mix of unsigned and sal_uInt16. Change-Id: Ice56d58d22856daa6645577610368ba19a849176 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104076 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svl/source/items/style.cxx')
-rw-r--r--svl/source/items/style.cxx23
1 files changed, 12 insertions, 11 deletions
diff --git a/svl/source/items/style.cxx b/svl/source/items/style.cxx
index e6606c82bdfa..8ef014755874 100644
--- a/svl/source/items/style.cxx
+++ b/svl/source/items/style.cxx
@@ -408,9 +408,9 @@ SfxStyleSheetIterator::~SfxStyleSheetIterator()
{
}
-sal_uInt16 SfxStyleSheetIterator::Count()
+sal_Int32 SfxStyleSheetIterator::Count()
{
- sal_uInt16 n = 0;
+ sal_Int32 n = 0;
if( IsTrivialSearch())
{
n = static_cast<sal_uInt16>(pBasePool->pImpl->mxIndexedStyleSheets->GetNumberOfStyleSheets());
@@ -427,7 +427,7 @@ sal_uInt16 SfxStyleSheetIterator::Count()
return n;
}
-SfxStyleSheetBase* SfxStyleSheetIterator::operator[](sal_uInt16 nIdx)
+SfxStyleSheetBase* SfxStyleSheetIterator::operator[](sal_Int32 nIdx)
{
SfxStyleSheetBase* retval = nullptr;
if( IsTrivialSearch())
@@ -480,8 +480,8 @@ SfxStyleSheetBase* SfxStyleSheetIterator::Next()
if ( IsTrivialSearch() )
{
- unsigned nStyleSheets = pBasePool->pImpl->mxIndexedStyleSheets->GetNumberOfStyleSheets();
- unsigned newPosition = nCurrentPosition +1;
+ sal_Int32 nStyleSheets = pBasePool->pImpl->mxIndexedStyleSheets->GetNumberOfStyleSheets();
+ sal_Int32 newPosition = nCurrentPosition + 1;
if (nStyleSheets > newPosition)
{
nCurrentPosition = newPosition;
@@ -490,13 +490,14 @@ SfxStyleSheetBase* SfxStyleSheetIterator::Next()
}
else if(nMask == SfxStyleSearchBits::All)
{
- unsigned newPosition = nCurrentPosition +1;
- const std::vector<unsigned>& familyVector =
+ sal_Int32 newPosition = nCurrentPosition + 1;
+ const std::vector<sal_Int32>& familyVector
+ =
pBasePool->pImpl->mxIndexedStyleSheets->GetStyleSheetPositionsByFamily(nSearchFamily);
- if (familyVector.size() > newPosition)
+ if (static_cast<sal_Int32>(familyVector.size()) > newPosition)
{
nCurrentPosition = newPosition;
- unsigned stylePosition = familyVector[newPosition];
+ sal_Int32 stylePosition = familyVector[newPosition];
retval = pBasePool->pImpl->mxIndexedStyleSheets->GetStyleSheetByPosition(stylePosition);
}
}
@@ -519,14 +520,14 @@ SfxStyleSheetBase* SfxStyleSheetIterator::Find(const OUString& rStr)
{
DoesStyleMatchStyleSheetPredicate predicate(this);
- std::vector<unsigned> positions =
+ std::vector<sal_Int32> positions =
pBasePool->pImpl->mxIndexedStyleSheets->FindPositionsByNameAndPredicate(rStr, predicate,
svl::IndexedStyleSheets::SearchBehavior::ReturnFirst);
if (positions.empty()) {
return nullptr;
}
- unsigned pos = positions.front();
+ sal_Int32 pos = positions.front();
SfxStyleSheetBase* pStyle = pBasePool->pImpl->mxIndexedStyleSheets->GetStyleSheetByPosition(pos);
nCurrentPosition = pos;
pCurrentStyle = pStyle;