diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2013-12-11 15:37:26 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-12-11 15:38:30 +0100 |
commit | 123e2c3e9350463fde38fbcbb522e3d6d8340ee6 (patch) | |
tree | c0f9350733d93f6a906cfe2f19b5dac66a655283 /svl/source/items/itemprop.cxx | |
parent | 90f91088d238469b4a2262c91de3117ba40f5bde (diff) |
Revert "Don't hold css::uno::Type instances by pointer"
This reverts commit 90f91088d238469b4a2262c91de3117ba40f5bde for now:
Ach, old GCC doesn't like plain string literals to initialize members
of OUString type...
Change-Id: I50563a00406259bb5d41831e2a2796762450d097
Diffstat (limited to 'svl/source/items/itemprop.cxx')
-rw-r--r-- | svl/source/items/itemprop.cxx | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/svl/source/items/itemprop.cxx b/svl/source/items/itemprop.cxx index 8e88b781b22e..00ca36e2218c 100644 --- a/svl/source/items/itemprop.cxx +++ b/svl/source/items/itemprop.cxx @@ -62,9 +62,10 @@ SfxItemPropertyMap_Impl::SfxItemPropertyMap_Impl( const SfxItemPropertyMap_Impl* SfxItemPropertyMap::SfxItemPropertyMap( const SfxItemPropertyMapEntry* pEntries ) : m_pImpl( new SfxItemPropertyMap_Impl ) { - while( !pEntries->aName.isEmpty() ) + while( pEntries->pName ) { - (*m_pImpl) [ pEntries->aName ] = pEntries; + OUString sEntry(pEntries->pName, pEntries->nNameLen, RTL_TEXTENCODING_ASCII_US ); + (*m_pImpl) [ sEntry ] = pEntries; ++pEntries; } } @@ -101,7 +102,8 @@ uno::Sequence<beans::Property> SfxItemPropertyMap::getProperties() const const SfxItemPropertySimpleEntry* pEntry = &(*aIt).second; pPropArray[n].Name = (*aIt).first; pPropArray[n].Handle = pEntry->nWID; - pPropArray[n].Type = pEntry->aType; + if(pEntry->pType) + pPropArray[n].Type = *pEntry->pType; pPropArray[n].Attributes = sal::static_int_cast< sal_Int16 >(pEntry->nFlags); n++; @@ -122,7 +124,8 @@ beans::Property SfxItemPropertyMap::getPropertyByName( const OUString rName ) co beans::Property aProp; aProp.Name = rName; aProp.Handle = pEntry->nWID; - aProp.Type = pEntry->aType; + if(pEntry->pType) + aProp.Type = *pEntry->pType; aProp.Attributes = sal::static_int_cast< sal_Int16 >(pEntry->nFlags); return aProp; } @@ -141,7 +144,7 @@ void SfxItemPropertyMap::mergeProperties( const uno::Sequence< beans::Property > { SfxItemPropertySimpleEntry aTemp( sal::static_int_cast< sal_Int16 >( pPropArray[nElement].Handle ), //nWID - pPropArray[nElement].Type, //aType + &pPropArray[nElement].Type, //pType pPropArray[nElement].Attributes, //nFlags 0 ); //nMemberId (*m_pImpl)[pPropArray[nElement].Name] = aTemp; @@ -206,11 +209,11 @@ void SfxItemPropertySet::getPropertyValue( const SfxItemPropertySimpleEntry& rEn // convert general SfxEnumItem values to specific values - if( rEntry.aType.getTypeClass() == TypeClass_ENUM && + if( rEntry.pType && TypeClass_ENUM == rEntry.pType->getTypeClass() && rAny.getValueTypeClass() == TypeClass_LONG ) { sal_Int32 nTmp = *(sal_Int32*)rAny.getValue(); - rAny.setValue( &nTmp, rEntry.aType ); + rAny.setValue( &nTmp, *rEntry.pType ); } } |