diff options
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/items/IndexedStyleSheets.cxx | 10 | ||||
-rw-r--r-- | svl/source/items/style.cxx | 12 |
2 files changed, 11 insertions, 11 deletions
diff --git a/svl/source/items/IndexedStyleSheets.cxx b/svl/source/items/IndexedStyleSheets.cxx index b74cffb2a2c9..95d579a3231c 100644 --- a/svl/source/items/IndexedStyleSheets.cxx +++ b/svl/source/items/IndexedStyleSheets.cxx @@ -164,19 +164,19 @@ IndexedStyleSheets::GetNumberOfStyleSheetsWithPredicate(StyleSheetPredicate& pre return r; } -rtl::Reference<SfxStyleSheetBase> +SfxStyleSheetBase* IndexedStyleSheets::GetNthStyleSheetThatMatchesPredicate( unsigned n, StyleSheetPredicate& predicate, unsigned startAt) { - rtl::Reference<SfxStyleSheetBase> retval; + SfxStyleSheetBase* retval = nullptr; unsigned matching = 0; for (VectorType::const_iterator it = mStyleSheets.begin()+startAt; it != mStyleSheets.end(); ++it) { SfxStyleSheetBase *ssheet = it->get(); if (predicate.Check(*ssheet)) { if (matching == n) { - retval = *it; + retval = it->get(); break; } ++matching; @@ -223,11 +223,11 @@ IndexedStyleSheets::HasStyleSheet(const rtl::Reference< SfxStyleSheetBase >& sty return false; } -rtl::Reference< SfxStyleSheetBase > +SfxStyleSheetBase* IndexedStyleSheets::GetStyleSheetByPosition(unsigned pos) { if( pos < mStyleSheets.size() ) - return mStyleSheets.at(pos); + return mStyleSheets.at(pos).get(); return nullptr; } diff --git a/svl/source/items/style.cxx b/svl/source/items/style.cxx index 9ffd2aa57062..01873c282455 100644 --- a/svl/source/items/style.cxx +++ b/svl/source/items/style.cxx @@ -437,7 +437,7 @@ SfxStyleSheetBase* SfxStyleSheetIterator::operator[](sal_uInt16 nIdx) SfxStyleSheetBase* retval = nullptr; if( IsTrivialSearch()) { - retval = pBasePool->pImpl->mxIndexedStyleSheets->GetStyleSheetByPosition(nIdx).get(); + retval = pBasePool->pImpl->mxIndexedStyleSheets->GetStyleSheetByPosition(nIdx); nCurrentPosition = nIdx; } else if(nMask == SfxStyleSearchBits::All) @@ -491,7 +491,7 @@ SfxStyleSheetBase* SfxStyleSheetIterator::Next() if (nStyleSheets > newPosition) { nCurrentPosition = newPosition; - retval = pBasePool->pImpl->mxIndexedStyleSheets->GetStyleSheetByPosition(nCurrentPosition).get(); + retval = pBasePool->pImpl->mxIndexedStyleSheets->GetStyleSheetByPosition(nCurrentPosition); } } else if(nMask == SfxStyleSearchBits::All) @@ -502,8 +502,8 @@ SfxStyleSheetBase* SfxStyleSheetIterator::Next() if (familyVector.size() > newPosition) { nCurrentPosition = newPosition; - unsigned stylePosition = familyVector.at(newPosition); - retval = pBasePool->pImpl->mxIndexedStyleSheets->GetStyleSheetByPosition(stylePosition).get(); + unsigned stylePosition = familyVector[newPosition]; + retval = pBasePool->pImpl->mxIndexedStyleSheets->GetStyleSheetByPosition(stylePosition); } } else @@ -533,7 +533,7 @@ SfxStyleSheetBase* SfxStyleSheetIterator::Find(const OUString& rStr) } unsigned pos = positions.front(); - SfxStyleSheetBase* pStyle = pBasePool->pImpl->mxIndexedStyleSheets->GetStyleSheetByPosition(pos).get(); + SfxStyleSheetBase* pStyle = pBasePool->pImpl->mxIndexedStyleSheets->GetStyleSheetByPosition(pos); nCurrentPosition = pos; pCurrentStyle = pStyle; return pCurrentStyle; @@ -971,7 +971,7 @@ SfxStyleSheetBasePool::GetIndexedStyleSheets() const return *pImpl->mxIndexedStyleSheets; } -rtl::Reference<SfxStyleSheetBase> +SfxStyleSheetBase* SfxStyleSheetBasePool::GetStyleSheetByPositionInIndex(unsigned pos) { return pImpl->mxIndexedStyleSheets->GetStyleSheetByPosition(pos); |