drop the Pair constructor from SfxItemSet
just so we have one fewer odd constructors here Change-Id: I81278e9436747a4eb46a33da9bfec7a8b30079b9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118982 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
@@ -2108,7 +2108,7 @@ void ImpEditEngine::ApplyChangedSentence(EditView const & rEditView,
|
||||
if(aCurrentNewPortion->sText != aCurrentOldPortion->sText)
|
||||
{
|
||||
//change text and apply language
|
||||
SfxItemSet aSet( aEditDoc.GetItemPool(), {{nLangWhichId, nLangWhichId}});
|
||||
SfxItemSet aSet( aEditDoc.GetItemPool(), nLangWhichId, nLangWhichId );
|
||||
aSet.Put(SvxLanguageItem(aCurrentNewPortion->eLanguage, nLangWhichId));
|
||||
SetAttribs( *aCurrentOldPosition, aSet );
|
||||
ImpInsertText( *aCurrentOldPosition, aCurrentNewPortion->sText );
|
||||
@@ -2116,7 +2116,7 @@ void ImpEditEngine::ApplyChangedSentence(EditView const & rEditView,
|
||||
else if(aCurrentNewPortion->eLanguage != aCurrentOldPortion->eLanguage)
|
||||
{
|
||||
//apply language
|
||||
SfxItemSet aSet( aEditDoc.GetItemPool(), {{nLangWhichId, nLangWhichId}});
|
||||
SfxItemSet aSet( aEditDoc.GetItemPool(), nLangWhichId, nLangWhichId);
|
||||
aSet.Put(SvxLanguageItem(aCurrentNewPortion->eLanguage, nLangWhichId));
|
||||
SetAttribs( *aCurrentOldPosition, aSet );
|
||||
}
|
||||
@@ -2150,7 +2150,7 @@ void ImpEditEngine::ApplyChangedSentence(EditView const & rEditView,
|
||||
case SvtScriptType::COMPLEX : nLangWhichId = EE_CHAR_LANGUAGE_CTL; break;
|
||||
default: break;
|
||||
}
|
||||
SfxItemSet aSet( aEditDoc.GetItemPool(), {{nLangWhichId, nLangWhichId}});
|
||||
SfxItemSet aSet( aEditDoc.GetItemPool(), nLangWhichId, nLangWhichId);
|
||||
aSet.Put(SvxLanguageItem(rCurrentNewPortion.eLanguage, nLangWhichId));
|
||||
SetAttribs( aCurrentPaM, aSet );
|
||||
}
|
||||
|
||||
@@ -197,7 +197,7 @@ uno::Any SvxItemPropertySet::getPropertyValue( const SfxItemPropertyMapEntry* pM
|
||||
if( eMapUnit == MapUnit::Map100thMM )
|
||||
nMemberId &= (~CONVERT_TWIPS);
|
||||
uno::Any aVal;
|
||||
SfxItemSet aSet( mrItemPool, {{pMap->nWID, pMap->nWID}});
|
||||
SfxItemSet aSet( mrItemPool, pMap->nWID, pMap->nWID);
|
||||
|
||||
if( (pMap->nWID < OWN_ATTR_VALUE_START) || (pMap->nWID > OWN_ATTR_VALUE_END ) )
|
||||
{
|
||||
|
||||
@@ -1255,7 +1255,7 @@ uno::Any SAL_CALL SvxUnoTextRangeBase::getPropertyDefault( const OUString& aProp
|
||||
// Get Default from ItemPool
|
||||
if(SfxItemPool::IsWhich(pMap->nWID))
|
||||
{
|
||||
SfxItemSet aSet( *pPool, {{pMap->nWID, pMap->nWID}});
|
||||
SfxItemSet aSet( *pPool, pMap->nWID, pMap->nWID );
|
||||
aSet.Put(pPool->GetDefaultItem(pMap->nWID));
|
||||
return SvxItemPropertySet::getPropertyValue(pMap, aSet, true, false );
|
||||
}
|
||||
|
||||
@@ -134,7 +134,6 @@ protected:
|
||||
SfxItemSet( SfxItemPool&, SfxAllItemSetFlag );
|
||||
|
||||
public:
|
||||
struct Pair { sal_uInt16 wid1, wid2; };
|
||||
SfxItemSet( const SfxItemSet& );
|
||||
SfxItemSet( SfxItemSet&& ) noexcept;
|
||||
SfxItemSet( SfxItemPool& );
|
||||
@@ -151,7 +150,6 @@ public:
|
||||
svl::Items<WIDs...>)
|
||||
: SfxItemSet(pool, WhichRangesContainer(svl::Items<WIDs...>::value), svl::detail::rangesSize<WIDs...>()) {}
|
||||
|
||||
SfxItemSet( SfxItemPool&, std::initializer_list<Pair> wids );
|
||||
SfxItemSet( SfxItemPool&, const sal_uInt16* nWhichPairTable );
|
||||
|
||||
virtual ~SfxItemSet();
|
||||
|
||||
@@ -776,7 +776,7 @@ bool openAreaDialog( const uno::Reference<report::XShape >& _xShape,const uno::R
|
||||
try
|
||||
{
|
||||
SfxItemPool& rItemPool = pModel->GetItemPool();
|
||||
SfxItemSet aDescriptor( rItemPool, {{rItemPool.GetFirstWhich(),rItemPool.GetLastWhich()}} );
|
||||
SfxItemSet aDescriptor( rItemPool, rItemPool.GetFirstWhich(), rItemPool.GetLastWhich() );
|
||||
lcl_fillShapeToItems(_xShape, aDescriptor);
|
||||
|
||||
{ // want the dialog to be destroyed before our set
|
||||
|
||||
@@ -1024,7 +1024,7 @@ void SAL_CALL SdStyleSheet::setPropertyValue( const OUString& aPropertyName, con
|
||||
throw IllegalArgumentException();
|
||||
}
|
||||
|
||||
SfxItemSet aSet( GetPool()->GetPool(), {{pEntry->nWID, pEntry->nWID}});
|
||||
SfxItemSet aSet( GetPool()->GetPool(), pEntry->nWID, pEntry->nWID);
|
||||
aSet.Put( rStyleSet );
|
||||
|
||||
if( !aSet.Count() )
|
||||
@@ -1130,7 +1130,7 @@ Any SAL_CALL SdStyleSheet::getPropertyValue( const OUString& PropertyName )
|
||||
}
|
||||
else
|
||||
{
|
||||
SfxItemSet aSet( GetPool()->GetPool(), {{pEntry->nWID, pEntry->nWID}});
|
||||
SfxItemSet aSet( GetPool()->GetPool(), pEntry->nWID, pEntry->nWID);
|
||||
|
||||
const SfxPoolItem* pItem;
|
||||
SfxItemSet& rStyleSet = GetItemSet();
|
||||
@@ -1328,7 +1328,7 @@ Any SAL_CALL SdStyleSheet::getPropertyDefault( const OUString& aPropertyName )
|
||||
else
|
||||
{
|
||||
SfxItemPool& rMyPool = GetPool()->GetPool();
|
||||
SfxItemSet aSet( rMyPool, {{pEntry->nWID, pEntry->nWID}});
|
||||
SfxItemSet aSet( rMyPool, pEntry->nWID, pEntry->nWID);
|
||||
aSet.Put( rMyPool.GetDefaultItem( pEntry->nWID ) );
|
||||
aRet = SvxItemPropertySet_getPropertyValue( pEntry, aSet );
|
||||
}
|
||||
|
||||
@@ -200,15 +200,15 @@ const SfxItemSet* FuPage::ExecuteDialog(weld::Window* pParent, const SfxRequest&
|
||||
if (!mpDrawViewShell)
|
||||
return nullptr;
|
||||
|
||||
SfxItemSet aNewAttr(mpDoc->GetPool(), {
|
||||
{ XATTR_FILL_FIRST, XATTR_FILL_LAST },
|
||||
{ EE_PARA_WRITINGDIR, EE_PARA_WRITINGDIR },
|
||||
{ SID_ATTR_BORDER_OUTER, SID_ATTR_BORDER_OUTER },
|
||||
{ SID_ATTR_BORDER_SHADOW, SID_ATTR_BORDER_SHADOW },
|
||||
{ SID_ATTR_PAGE, SID_ATTR_PAGE_SHARED },
|
||||
{ SID_ATTR_CHAR_GRABBAG, SID_ATTR_CHAR_GRABBAG },
|
||||
{ SID_ATTR_PAGE_COLOR, SID_ATTR_PAGE_FILLSTYLE },
|
||||
});
|
||||
SfxItemSet aNewAttr(mpDoc->GetPool(), svl::Items<
|
||||
XATTR_FILL_FIRST, XATTR_FILL_LAST,
|
||||
EE_PARA_WRITINGDIR, EE_PARA_WRITINGDIR,
|
||||
SID_ATTR_BORDER_OUTER, SID_ATTR_BORDER_OUTER,
|
||||
SID_ATTR_BORDER_SHADOW, SID_ATTR_BORDER_SHADOW,
|
||||
SID_ATTR_PAGE, SID_ATTR_PAGE_SHARED,
|
||||
SID_ATTR_CHAR_GRABBAG, SID_ATTR_CHAR_GRABBAG,
|
||||
SID_ATTR_PAGE_COLOR, SID_ATTR_PAGE_FILLSTYLE
|
||||
>{});
|
||||
// Keep it sorted
|
||||
aNewAttr.MergeRange(mpDoc->GetPool().GetWhich(SID_ATTR_LRSPACE),
|
||||
mpDoc->GetPool().GetWhich(SID_ATTR_ULSPACE));
|
||||
|
||||
@@ -211,7 +211,7 @@ void SAL_CALL SdUnoPageBackground::setPropertyValue( const OUString& aPropertyNa
|
||||
}
|
||||
|
||||
SfxItemPool& rPool = *mpSet->GetPool();
|
||||
SfxItemSet aSet( rPool, {{pEntry->nWID, pEntry->nWID}});
|
||||
SfxItemSet aSet( rPool, pEntry->nWID, pEntry->nWID);
|
||||
aSet.Put( *mpSet );
|
||||
|
||||
if( !aSet.Count() )
|
||||
@@ -271,7 +271,7 @@ uno::Any SAL_CALL SdUnoPageBackground::getPropertyValue( const OUString& Propert
|
||||
else
|
||||
{
|
||||
SfxItemPool& rPool = *mpSet->GetPool();
|
||||
SfxItemSet aSet( rPool, {{pEntry->nWID, pEntry->nWID}});
|
||||
SfxItemSet aSet( rPool, pEntry->nWID, pEntry->nWID);
|
||||
aSet.Put( *mpSet );
|
||||
|
||||
if( !aSet.Count() )
|
||||
@@ -393,7 +393,7 @@ uno::Any SAL_CALL SdUnoPageBackground::getPropertyDefault( const OUString& aProp
|
||||
else
|
||||
{
|
||||
SfxItemPool& rPool = *mpSet->GetPool();
|
||||
SfxItemSet aSet(rPool, { { pEntry->nWID, pEntry->nWID } });
|
||||
SfxItemSet aSet(rPool, pEntry->nWID, pEntry->nWID);
|
||||
aSet.Put(rPool.GetDefaultItem(pEntry->nWID));
|
||||
|
||||
aAny = SvxItemPropertySet_getPropertyValue(pEntry, aSet);
|
||||
|
||||
@@ -987,7 +987,7 @@ void SfxBindings::Execute_Impl( SfxRequest& aReq, const SfxSlot* pSlot, SfxShell
|
||||
{
|
||||
// The value is attached to a toggleable attribute (Bools)
|
||||
sal_uInt16 nWhich = pSlot->GetWhich(rPool);
|
||||
SfxItemSet aSet(rPool, {{nWhich, nWhich}});
|
||||
SfxItemSet aSet(rPool, nWhich, nWhich);
|
||||
SfxStateFunc pFunc = pSlot->GetStateFnc();
|
||||
(*pFunc)(pShell, aSet);
|
||||
const SfxPoolItem *pOldItem;
|
||||
|
||||
@@ -396,7 +396,7 @@ bool SfxShell::CanExecuteSlot_Impl( const SfxSlot &rSlot )
|
||||
// Get Slot status
|
||||
SfxItemPool &rPool = GetPool();
|
||||
const sal_uInt16 nId = rSlot.GetWhich( rPool );
|
||||
SfxItemSet aSet(rPool, {{nId, nId}});
|
||||
SfxItemSet aSet(rPool, nId, nId);
|
||||
SfxStateFunc pFunc = rSlot.GetStateFnc();
|
||||
(*pFunc)( this, aSet );
|
||||
return aSet.GetItemState(nId) != SfxItemState::DISABLED;
|
||||
@@ -484,7 +484,7 @@ const SfxPoolItem* SfxShell::GetSlotState
|
||||
|
||||
// Get Item and Item status
|
||||
const SfxPoolItem *pItem = nullptr;
|
||||
SfxItemSet aSet( rPool, {{nSlotId, nSlotId}} ); // else pItem dies too soon
|
||||
SfxItemSet aSet( rPool, nSlotId, nSlotId ); // else pItem dies too soon
|
||||
if ( nullptr != pSlot )
|
||||
{
|
||||
// Call Status method
|
||||
|
||||
@@ -145,26 +145,6 @@ SfxItemSet::SfxItemSet(
|
||||
m_pItems.reset( new SfxPoolItem const *[size]{} );
|
||||
}
|
||||
|
||||
SfxItemSet::SfxItemSet(
|
||||
SfxItemPool & pool, std::initializer_list<Pair> wids):
|
||||
m_pPool(&pool), m_pParent(nullptr),
|
||||
m_nCount(0)
|
||||
{
|
||||
assert(wids.size() != 0);
|
||||
std::unique_ptr<WhichPair[]> xPairs = std::make_unique<WhichPair[]>(wids.size());
|
||||
std::size_t i = 0;
|
||||
std::size_t size = 0;
|
||||
for (auto const & p: wids) {
|
||||
xPairs[i++] = { p.wid1, p.wid2 };
|
||||
size += svl::detail::rangeSize(p.wid1, p.wid2);
|
||||
// cannot overflow, assuming std::size_t is no smaller than
|
||||
// sal_uInt16
|
||||
}
|
||||
m_pWhichRanges = WhichRangesContainer(std::move(xPairs), wids.size());
|
||||
assert(svl::detail::validRanges2(m_pWhichRanges));
|
||||
m_pItems.reset( new SfxPoolItem const *[size]{} );
|
||||
}
|
||||
|
||||
SfxItemSet::SfxItemSet( SfxItemPool& rPool, const sal_uInt16* pWhichPairTable )
|
||||
: m_pPool(&rPool)
|
||||
, m_pParent(nullptr)
|
||||
|
||||
@@ -115,7 +115,7 @@ namespace sdr::properties
|
||||
ItemChange(nWhichID, &rItem);
|
||||
PostItemChange(nWhichID);
|
||||
|
||||
SfxItemSet aSet(GetSdrObject().GetObjectItemPool(), {{nWhichID, nWhichID}});
|
||||
SfxItemSet aSet(GetSdrObject().GetObjectItemPool(), nWhichID, nWhichID);
|
||||
aSet.Put(rItem);
|
||||
ItemSetChanged(aSet);
|
||||
}
|
||||
@@ -140,7 +140,7 @@ namespace sdr::properties
|
||||
|
||||
if(nWhich)
|
||||
{
|
||||
SfxItemSet aSet(GetSdrObject().GetObjectItemPool(), {{nWhich, nWhich}});
|
||||
SfxItemSet aSet(GetSdrObject().GetObjectItemPool(), nWhich, nWhich);
|
||||
ItemSetChanged(aSet);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1117,7 +1117,7 @@ void SAL_CALL Cell::setPropertyValue( const OUString& rPropertyName, const Any&
|
||||
}
|
||||
default:
|
||||
{
|
||||
SfxItemSet aSet(GetObject().getSdrModelFromSdrObject().GetItemPool(), {{pMap->nWID, pMap->nWID}});
|
||||
SfxItemSet aSet(GetObject().getSdrModelFromSdrObject().GetItemPool(), pMap->nWID, pMap->nWID);
|
||||
aSet.Put(mpProperties->GetItem(pMap->nWID));
|
||||
|
||||
bool bSpecial = false;
|
||||
@@ -1237,7 +1237,7 @@ Any SAL_CALL Cell::getPropertyValue( const OUString& PropertyName )
|
||||
}
|
||||
default:
|
||||
{
|
||||
SfxItemSet aSet(GetObject().getSdrModelFromSdrObject().GetItemPool(), {{pMap->nWID, pMap->nWID}});
|
||||
SfxItemSet aSet(GetObject().getSdrModelFromSdrObject().GetItemPool(), pMap->nWID, pMap->nWID);
|
||||
aSet.Put(mpProperties->GetItem(pMap->nWID));
|
||||
|
||||
Any aAny;
|
||||
@@ -1565,7 +1565,7 @@ Any SAL_CALL Cell::getPropertyDefault( const OUString& aPropertyName )
|
||||
{
|
||||
if( SfxItemPool::IsWhich(pMap->nWID) )
|
||||
{
|
||||
SfxItemSet aSet(GetObject().getSdrModelFromSdrObject().GetItemPool(), {{pMap->nWID, pMap->nWID}});
|
||||
SfxItemSet aSet(GetObject().getSdrModelFromSdrObject().GetItemPool(), pMap->nWID, pMap->nWID);
|
||||
aSet.Put(GetObject().getSdrModelFromSdrObject().GetItemPool().GetDefaultItem(pMap->nWID));
|
||||
return GetAnyForItem( aSet, pMap );
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ sal_Bool SAL_CALL SvxUnoNameItemTable::supportsService( const OUString& Service
|
||||
|
||||
void SvxUnoNameItemTable::ImplInsertByName( const OUString& aName, const uno::Any& aElement )
|
||||
{
|
||||
maItemSetVector.push_back( std::make_unique< SfxItemSet >( *mpModelPool, std::initializer_list<SfxItemSet::Pair>{{mnWhich, mnWhich}} ) );
|
||||
maItemSetVector.push_back( std::make_unique< SfxItemSet >( *mpModelPool, mnWhich, mnWhich ) );
|
||||
|
||||
std::unique_ptr<NameOrIndex> xNewItem(createItem());
|
||||
xNewItem->SetName(aName);
|
||||
|
||||
@@ -1387,7 +1387,7 @@ bool SvxShape::SetFillAttribute( sal_uInt16 nWID, const OUString& rName )
|
||||
{
|
||||
if(HasSdrObject())
|
||||
{
|
||||
SfxItemSet aSet( GetSdrObject()->getSdrModelFromSdrObject().GetItemPool(), {{nWID, nWID}} );
|
||||
SfxItemSet aSet( GetSdrObject()->getSdrModelFromSdrObject().GetItemPool(), nWID, nWID );
|
||||
|
||||
if( SetFillAttribute( nWID, rName, aSet, &GetSdrObject()->getSdrModelFromSdrObject() ) )
|
||||
{
|
||||
@@ -1730,7 +1730,7 @@ uno::Any SvxShape::_getPropertyValue( const OUString& PropertyName )
|
||||
DBG_ASSERT( pMap->nWID == SDRATTR_TEXTDIRECTION || (pMap->nWID < SDRATTR_NOTPERSIST_FIRST || pMap->nWID > SDRATTR_NOTPERSIST_LAST), "Not persist item not handled!" );
|
||||
DBG_ASSERT( pMap->nWID < OWN_ATTR_VALUE_START || pMap->nWID > OWN_ATTR_VALUE_END, "Not item property not handled!" );
|
||||
|
||||
SfxItemSet aSet( GetSdrObject()->getSdrModelFromSdrObject().GetItemPool(), {{pMap->nWID, pMap->nWID}});
|
||||
SfxItemSet aSet( GetSdrObject()->getSdrModelFromSdrObject().GetItemPool(), pMap->nWID, pMap->nWID );
|
||||
aSet.Put(GetSdrObject()->GetMergedItem(pMap->nWID));
|
||||
|
||||
if(SvxUnoTextRangeBase::GetPropertyValueHelper( aSet, pMap, aAny ))
|
||||
@@ -3067,7 +3067,7 @@ uno::Any SvxShape::_getPropertyDefault( const OUString& aPropertyName )
|
||||
if(!SfxItemPool::IsWhich(pMap->nWID))
|
||||
throw beans::UnknownPropertyException( "No WhichID " + OUString::number(pMap->nWID) + " for " + aPropertyName, static_cast<cppu::OWeakObject*>(this));
|
||||
|
||||
SfxItemSet aSet( GetSdrObject()->getSdrModelFromSdrObject().GetItemPool(), {{pMap->nWID, pMap->nWID}});
|
||||
SfxItemSet aSet( GetSdrObject()->getSdrModelFromSdrObject().GetItemPool(), pMap->nWID, pMap->nWID );
|
||||
aSet.Put(GetSdrObject()->getSdrModelFromSdrObject().GetItemPool().GetDefaultItem(pMap->nWID));
|
||||
|
||||
return GetAnyForItem( aSet, pMap );
|
||||
|
||||
@@ -103,7 +103,8 @@ CPPUNIT_TEST_FIXTURE(SwCoreDocTest, testLocaleIndependentTemplate)
|
||||
SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "locale-independent-template.odt");
|
||||
SwDocShell* pDocShell = pDoc->GetDocShell();
|
||||
SwWrtShell* pWrtShell = pDocShell->GetWrtShell();
|
||||
SfxItemSet aSet(pWrtShell->GetAttrPool(), { { RES_CHRATR_LANGUAGE, RES_CHRATR_LANGUAGE } });
|
||||
SfxItemSet aSet(pWrtShell->GetAttrPool(),
|
||||
svl::Items<RES_CHRATR_LANGUAGE, RES_CHRATR_LANGUAGE>{});
|
||||
pWrtShell->GetCurAttr(aSet);
|
||||
const SvxLanguageItem* pItem = aSet.GetItem(RES_CHRATR_LANGUAGE);
|
||||
CPPUNIT_ASSERT(pItem);
|
||||
|
||||
@@ -93,7 +93,7 @@ SwAttrPool::~SwAttrPool()
|
||||
}
|
||||
|
||||
SwAttrSet::SwAttrSet( SwAttrPool& rPool, sal_uInt16 nWh1, sal_uInt16 nWh2 )
|
||||
: SfxItemSet( rPool, {{nWh1, nWh2}} ), m_pOldSet( nullptr ), m_pNewSet( nullptr )
|
||||
: SfxItemSet( rPool, nWh1, nWh2 ), m_pOldSet( nullptr ), m_pNewSet( nullptr )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -3346,7 +3346,7 @@ bool DocumentContentOperationsManager::InsertPoolItem(
|
||||
pUndoAttr.reset(new SwUndoAttr( rRg, rHt, nFlags ));
|
||||
}
|
||||
|
||||
SfxItemSet aSet( m_rDoc.GetAttrPool(), {{rHt.Which(), rHt.Which()}} );
|
||||
SfxItemSet aSet( m_rDoc.GetAttrPool(), rHt.Which(), rHt.Which() );
|
||||
aSet.Put( rHt );
|
||||
const bool bRet = lcl_InsAttr(m_rDoc, rRg, aSet, nFlags, pUndoAttr.get(), pLayout, ppNewTextAttr);
|
||||
|
||||
|
||||
@@ -450,7 +450,7 @@ bool SwDoc::UpdateParRsid( SwTextNode *pTextNode, sal_uInt32 nVal )
|
||||
/// If Undo is enabled, the old values is added to the Undo history.
|
||||
void SwDoc::SetAttr( const SfxPoolItem& rAttr, SwFormat& rFormat )
|
||||
{
|
||||
SfxItemSet aSet( GetAttrPool(), {{rAttr.Which(), rAttr.Which()}} );
|
||||
SfxItemSet aSet( GetAttrPool(), rAttr.Which(), rAttr.Which() );
|
||||
aSet.Put( rAttr );
|
||||
SetAttr( aSet, rFormat );
|
||||
}
|
||||
@@ -526,7 +526,7 @@ static bool lcl_SetNewDefTabStops( SwTwips nOldWidth, SwTwips nNewWidth,
|
||||
/// If Undo is enabled, the old value is added to the Undo history.
|
||||
void SwDoc::SetDefault( const SfxPoolItem& rAttr )
|
||||
{
|
||||
SfxItemSet aSet( GetAttrPool(), {{rAttr.Which(), rAttr.Which()}} );
|
||||
SfxItemSet aSet( GetAttrPool(), rAttr.Which(), rAttr.Which() );
|
||||
aSet.Put( rAttr );
|
||||
SetDefault( aSet );
|
||||
}
|
||||
|
||||
@@ -1196,7 +1196,7 @@ void SwEditShell::ApplyChangedSentence(const svx::SpellPortions& rNewPortions, b
|
||||
case SvtScriptType::COMPLEX : nLangWhichId = RES_CHRATR_CTL_LANGUAGE; break;
|
||||
default: break;
|
||||
}
|
||||
SfxItemSet aSet(GetAttrPool(), {{nLangWhichId, nLangWhichId}});
|
||||
SfxItemSet aSet(GetAttrPool(), nLangWhichId, nLangWhichId);
|
||||
GetCurAttr( aSet );
|
||||
const SvxLanguageItem& rLang = static_cast<const SvxLanguageItem& >(aSet.Get(nLangWhichId));
|
||||
if(rLang.GetLanguage() != rCurrentNewPortion.eLanguage)
|
||||
@@ -1516,7 +1516,7 @@ static LanguageType lcl_GetLanguage(SwEditShell& rSh)
|
||||
case SvtScriptType::COMPLEX : nLangWhichId = RES_CHRATR_CTL_LANGUAGE; break;
|
||||
default: break;
|
||||
}
|
||||
SfxItemSet aSet(rSh.GetAttrPool(), {{nLangWhichId, nLangWhichId}});
|
||||
SfxItemSet aSet(rSh.GetAttrPool(), nLangWhichId, nLangWhichId);
|
||||
rSh.GetCurAttr( aSet );
|
||||
const SvxLanguageItem& rLang = static_cast<const SvxLanguageItem& >(aSet.Get(nLangWhichId));
|
||||
return rLang.GetLanguage();
|
||||
|
||||
@@ -1069,7 +1069,7 @@ void SwTextNode::SetLanguageAndFont( const SwPaM &rPaM,
|
||||
const vcl::Font *pFont, sal_uInt16 nFontWhichId )
|
||||
{
|
||||
SwEditShell *pEditShell = GetDoc().GetEditShell();
|
||||
SfxItemSet aSet(pEditShell->GetAttrPool(), { { nLangWhichId, nLangWhichId } });
|
||||
SfxItemSet aSet(pEditShell->GetAttrPool(), nLangWhichId, nLangWhichId );
|
||||
if (pFont)
|
||||
aSet.MergeRange(nFontWhichId, nFontWhichId); // Keep it sorted
|
||||
aSet.Put( SvxLanguageItem( nLang, nLangWhichId ) );
|
||||
|
||||
@@ -1885,7 +1885,7 @@ void SwXShape::setPropertyToDefault( const OUString& rPropertyName )
|
||||
if(pFormat)
|
||||
{
|
||||
const SfxItemSet& rSet = pFormat->GetAttrSet();
|
||||
SfxItemSet aSet(pFormat->GetDoc()->GetAttrPool(), {{pEntry->nWID, pEntry->nWID}});
|
||||
SfxItemSet aSet(pFormat->GetDoc()->GetAttrPool(), pEntry->nWID, pEntry->nWID);
|
||||
aSet.SetParent(&rSet);
|
||||
aSet.ClearItem(pEntry->nWID);
|
||||
pFormat->GetDoc()->SetAttr(aSet, *pFormat);
|
||||
|
||||
@@ -1910,7 +1910,7 @@ SwUnoCursorHelper::GetPropertyStates(
|
||||
case SW_PROPERTY_STATE_CALLER_SINGLE_VALUE_ONLY:
|
||||
pSet.reset(
|
||||
new SfxItemSet( rPaM.GetDoc().GetAttrPool(),
|
||||
{{pEntry->nWID, pEntry->nWID}} ));
|
||||
pEntry->nWID, pEntry->nWID ));
|
||||
break;
|
||||
default:
|
||||
pSet.reset( new SfxItemSet(
|
||||
|
||||
@@ -836,7 +836,7 @@ void SwXTextSection::Impl::SetPropertyValues_Impl(
|
||||
if (pFormat)
|
||||
{
|
||||
const SfxItemSet& rOldAttrSet = pFormat->GetAttrSet();
|
||||
pItemSet.reset( new SfxItemSet(*rOldAttrSet.GetPool(), {{pEntry->nWID, pEntry->nWID}}));
|
||||
pItemSet.reset( new SfxItemSet(*rOldAttrSet.GetPool(), pEntry->nWID, pEntry->nWID));
|
||||
pItemSet->Put(rOldAttrSet);
|
||||
m_rPropSet.setPropertyValue(*pEntry,
|
||||
pValues[nProperty], *pItemSet);
|
||||
@@ -1568,7 +1568,7 @@ SwXTextSection::setPropertyToDefault(const OUString& rPropertyName)
|
||||
if (pFormat)
|
||||
{
|
||||
const SfxItemSet& rOldAttrSet = pFormat->GetAttrSet();
|
||||
pNewAttrSet.reset( new SfxItemSet(*rOldAttrSet.GetPool(), {{pEntry->nWID, pEntry->nWID}}));
|
||||
pNewAttrSet.reset( new SfxItemSet(*rOldAttrSet.GetPool(), pEntry->nWID, pEntry->nWID));
|
||||
pNewAttrSet->ClearItem(pEntry->nWID);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -1612,7 +1612,7 @@ void SwXStyle::SetPropertyValue<HINT_BEGIN>(const SfxItemPropertyMapEntry& rEntr
|
||||
{
|
||||
// default ItemSet handling
|
||||
SfxItemSet& rStyleSet = o_rStyleBase.GetItemSet();
|
||||
SfxItemSet aSet(*rStyleSet.GetPool(), {{rEntry.nWID, rEntry.nWID}});
|
||||
SfxItemSet aSet(*rStyleSet.GetPool(), rEntry.nWID, rEntry.nWID);
|
||||
aSet.SetParent(&rStyleSet);
|
||||
rPropSet.setPropertyValue(rEntry, rValue, aSet);
|
||||
rStyleSet.Put(aSet);
|
||||
@@ -1721,7 +1721,7 @@ void SwXStyle::SetPropertyValue<sal_uInt16(RES_PAPER_BIN)>(const SfxItemProperty
|
||||
if(nBin == std::numeric_limits<printeridx_t>::max())
|
||||
throw lang::IllegalArgumentException();
|
||||
SfxItemSet& rStyleSet = o_rStyleBase.GetItemSet();
|
||||
SfxItemSet aSet(*rStyleSet.GetPool(), {{rEntry.nWID, rEntry.nWID}});
|
||||
SfxItemSet aSet(*rStyleSet.GetPool(), rEntry.nWID, rEntry.nWID);
|
||||
aSet.SetParent(&rStyleSet);
|
||||
rPropSet.setPropertyValue(rEntry, uno::makeAny(static_cast<sal_Int8>(nBin == std::numeric_limits<printeridx_t>::max()-1 ? -1 : nBin)), aSet);
|
||||
rStyleSet.Put(aSet);
|
||||
@@ -3346,7 +3346,7 @@ void SwXFrameStyle::SetItem(sal_uInt16 eAtr, const SfxPoolItem& rItem)
|
||||
return;
|
||||
rtl::Reference<SwDocStyleSheet> xStyle(new SwDocStyleSheet(*static_cast<SwDocStyleSheet*>(pBase)));
|
||||
SfxItemSet& rStyleSet = xStyle->GetItemSet();
|
||||
SfxItemSet aSet(*rStyleSet.GetPool(), {{sal_uInt16(eAtr), sal_uInt16(eAtr)}});
|
||||
SfxItemSet aSet(*rStyleSet.GetPool(), sal_uInt16(eAtr), sal_uInt16(eAtr));
|
||||
aSet.Put(rItem);
|
||||
xStyle->SetItemSet(aSet);
|
||||
}
|
||||
|
||||
@@ -1671,7 +1671,7 @@ void SwXTextTableCursor::setPropertyValue(const OUString& rPropertyName, const u
|
||||
break;
|
||||
default:
|
||||
{
|
||||
SfxItemSet aItemSet(rDoc.GetAttrPool(), {{pEntry->nWID, pEntry->nWID}});
|
||||
SfxItemSet aItemSet(rDoc.GetAttrPool(), pEntry->nWID, pEntry->nWID);
|
||||
SwUnoCursorHelper::GetCursorAttr(rTableCursor.GetSelRing(),
|
||||
aItemSet);
|
||||
|
||||
@@ -3460,7 +3460,7 @@ SwXCellRange::setPropertyValue(const OUString& rPropertyName, const uno::Any& aV
|
||||
break;
|
||||
default:
|
||||
{
|
||||
SfxItemSet aItemSet( rDoc.GetAttrPool(), {{pEntry->nWID, pEntry->nWID}} );
|
||||
SfxItemSet aItemSet( rDoc.GetAttrPool(), pEntry->nWID, pEntry->nWID );
|
||||
SwUnoCursorHelper::GetCursorAttr(rCursor.GetSelRing(),
|
||||
aItemSet);
|
||||
|
||||
|
||||
@@ -1483,7 +1483,7 @@ const SfxPoolItem* SwWW8FltControlStack::GetFormatAttr(const SwPosition& rPos,
|
||||
if (pNd->IsTextNode())
|
||||
{
|
||||
const sal_Int32 nPos = rPos.nContent.GetIndex();
|
||||
m_xScratchSet.reset(new SfxItemSet(m_rDoc.GetAttrPool(), {{nWhich, nWhich}}));
|
||||
m_xScratchSet.reset(new SfxItemSet(m_rDoc.GetAttrPool(), nWhich, nWhich));
|
||||
if (pNd->GetTextNode()->GetParaAttr(*m_xScratchSet, nPos, nPos))
|
||||
pItem = m_xScratchSet->GetItem(nWhich);
|
||||
}
|
||||
|
||||
@@ -401,7 +401,7 @@ void SwIndexMarkPane::UpdateLanguageDependenciesForPhoneticReading()
|
||||
case SvtScriptType::COMPLEX:nWhich = RES_CHRATR_CTL_LANGUAGE; break;
|
||||
default:nWhich = RES_CHRATR_LANGUAGE; break;
|
||||
}
|
||||
SfxItemSet aLangSet(m_pSh->GetAttrPool(), {{nWhich, nWhich}});
|
||||
SfxItemSet aLangSet(m_pSh->GetAttrPool(), nWhich, nWhich);
|
||||
m_pSh->GetCurAttr(aLangSet);
|
||||
m_nLangForPhoneticReading = static_cast<const SvxLanguageItem&>(aLangSet.Get(nWhich)).GetLanguage();
|
||||
}
|
||||
|
||||
@@ -803,7 +803,7 @@ static sal_uInt16 lcl_isNonDefaultLanguage(LanguageType eBufferLanguage, SwView
|
||||
}
|
||||
if(bLang)
|
||||
{
|
||||
SfxItemSet aLangSet(rView.GetPool(), {{nWhich, nWhich}});
|
||||
SfxItemSet aLangSet(rView.GetPool(), nWhich, nWhich);
|
||||
SwWrtShell& rSh = rView.GetWrtShell();
|
||||
rSh.GetCurAttr(aLangSet);
|
||||
if(SfxItemState::DEFAULT <= aLangSet.GetItemState(nWhich))
|
||||
|
||||
@@ -381,7 +381,7 @@ namespace SwLangHelper
|
||||
/// RES_CHRATR_LANGUAGE, RES_CHRATR_CJK_LANGUAGE, RES_CHRATR_CTL_LANGUAGE,
|
||||
LanguageType GetLanguage( SwWrtShell &rSh, sal_uInt16 nLangWhichId )
|
||||
{
|
||||
SfxItemSet aSet( rSh.GetAttrPool(), {{nLangWhichId, nLangWhichId}} );
|
||||
SfxItemSet aSet( rSh.GetAttrPool(), nLangWhichId, nLangWhichId );
|
||||
rSh.GetCurAttr( aSet );
|
||||
|
||||
return GetLanguage(aSet,nLangWhichId);
|
||||
|
||||
@@ -129,7 +129,7 @@ const sal_uInt16* SwuiGetUITableAttrRange()
|
||||
|
||||
static void lcl_SetAttr( SwWrtShell &rSh, const SfxPoolItem &rItem )
|
||||
{
|
||||
SfxItemSet aSet( rSh.GetView().GetPool(), {{rItem.Which(), rItem.Which()}});
|
||||
SfxItemSet aSet( rSh.GetView().GetPool(), rItem.Which(), rItem.Which());
|
||||
aSet.Put( rItem );
|
||||
rSh.SetTableAttr( aSet );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user