diff options
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/export-tests-ooxml1.cxx | 5 | ||||
-rw-r--r-- | sd/source/core/drawdoc2.cxx | 8 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unomodel.cxx | 18 |
3 files changed, 11 insertions, 20 deletions
diff --git a/sd/qa/unit/export-tests-ooxml1.cxx b/sd/qa/unit/export-tests-ooxml1.cxx index e7080ae0a6e8..e8ce39dc68a0 100644 --- a/sd/qa/unit/export-tests-ooxml1.cxx +++ b/sd/qa/unit/export-tests-ooxml1.cxx @@ -297,9 +297,8 @@ void SdOOXMLExportTest1::testN828390_5() SdrTextObj *pTxtObj = dynamic_cast<SdrTextObj *>( pObj ); CPPUNIT_ASSERT( pTxtObj ); const EditTextObject& aEdit = pTxtObj->GetOutlinerParaObject()->GetTextObject(); - const SvxNumBulletItem *pNumFmt = aEdit.GetPool()->GetItem2(EE_PARA_NUMBULLET, 5); - CPPUNIT_ASSERT( pNumFmt ); - CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bullet's relative size is wrong!", sal_uInt16(75), pNumFmt->GetNumRule()->GetLevel(1).GetBulletRelSize() ); // != 25 + const SvxNumBulletItem& rNumFmt = aEdit.GetParaAttribs(3).Get(EE_PARA_NUMBULLET); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bullet's relative size is wrong!", sal_uInt16(75), rNumFmt.GetNumRule()->GetLevel(1).GetBulletRelSize() ); // != 25 } xDocShRef->DoClose(); diff --git a/sd/source/core/drawdoc2.cxx b/sd/source/core/drawdoc2.cxx index 7c73d7dc66ca..ba420d20ab03 100644 --- a/sd/source/core/drawdoc2.cxx +++ b/sd/source/core/drawdoc2.cxx @@ -272,10 +272,8 @@ void SdDrawDocument::UpdatePageRelativeURLs(const OUString& rOldName, const OUSt return; SfxItemPool& rPool(GetPool()); - sal_uInt32 nCount = rPool.GetItemCount2(EE_FEATURE_FIELD); - for (sal_uInt32 nOff = 0; nOff < nCount; nOff++) + for (const SfxPoolItem* pItem : rPool.GetItemSurrogates(EE_FEATURE_FIELD)) { - const SfxPoolItem *pItem = rPool.GetItem2(EE_FEATURE_FIELD, nOff); const SvxFieldItem* pFldItem = dynamic_cast< const SvxFieldItem * > (pItem); if(pFldItem) @@ -316,10 +314,8 @@ void SdDrawDocument::UpdatePageRelativeURLs(SdPage const * pPage, sal_uInt16 nPo bool bNotes = (pPage->GetPageKind() == PageKind::Notes); SfxItemPool& rPool(GetPool()); - sal_uInt32 nCount = rPool.GetItemCount2(EE_FEATURE_FIELD); - for (sal_uInt32 nOff = 0; nOff < nCount; nOff++) + for (const SfxPoolItem* pItem : rPool.GetItemSurrogates(EE_FEATURE_FIELD)) { - const SfxPoolItem *pItem = rPool.GetItem2(EE_FEATURE_FIELD, nOff); const SvxFieldItem* pFldItem; if ((pFldItem = dynamic_cast< const SvxFieldItem * > (pItem)) != nullptr) diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 7f61d8bef8ba..ed83fd956bec 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -1370,7 +1370,6 @@ uno::Any SAL_CALL SdXImpressDocument::getPropertyValue( const OUString& Property EE_CHAR_FONTINFO_CTL }; const SfxItemPool& rPool = mpDoc->GetPool(); - const SfxPoolItem* pItem; for(sal_uInt16 nWhichId : aWhichIds) { @@ -1378,18 +1377,15 @@ uno::Any SAL_CALL SdXImpressDocument::getPropertyValue( const OUString& Property aSeq.realloc( aSeq.getLength() + nItems*5 + 5 ); - for( sal_uInt32 j = 0; j < nItems; ++j ) + for (const SfxPoolItem* pItem : rPool.GetItemSurrogates(nWhichId)) { - if( nullptr != (pItem = rPool.GetItem2( nWhichId, j ) ) ) - { - const SvxFontItem *pFont = static_cast<const SvxFontItem *>(pItem); + const SvxFontItem *pFont = static_cast<const SvxFontItem *>(pItem); - aSeq[nSeqIndex++] <<= pFont->GetFamilyName(); - aSeq[nSeqIndex++] <<= pFont->GetStyleName(); - aSeq[nSeqIndex++] <<= sal_Int16(pFont->GetFamily()); - aSeq[nSeqIndex++] <<= sal_Int16(pFont->GetPitch()); - aSeq[nSeqIndex++] <<= sal_Int16(pFont->GetCharSet()); - } + aSeq[nSeqIndex++] <<= pFont->GetFamilyName(); + aSeq[nSeqIndex++] <<= pFont->GetStyleName(); + aSeq[nSeqIndex++] <<= sal_Int16(pFont->GetFamily()); + aSeq[nSeqIndex++] <<= sal_Int16(pFont->GetPitch()); + aSeq[nSeqIndex++] <<= sal_Int16(pFont->GetCharSet()); } const SvxFontItem& rFont = static_cast<const SvxFontItem&>(rPool.GetDefaultItem( nWhichId )); |