summaryrefslogtreecommitdiff
path: root/svl/source
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2013-12-11 15:37:26 +0100
committerStephan Bergmann <sbergman@redhat.com>2013-12-11 15:38:30 +0100
commit123e2c3e9350463fde38fbcbb522e3d6d8340ee6 (patch)
treec0f9350733d93f6a906cfe2f19b5dac66a655283 /svl/source
parent90f91088d238469b4a2262c91de3117ba40f5bde (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')
-rw-r--r--svl/source/items/itemprop.cxx17
-rw-r--r--svl/source/numbers/numfmuno.cxx38
2 files changed, 29 insertions, 26 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 );
}
}
diff --git a/svl/source/numbers/numfmuno.cxx b/svl/source/numbers/numfmuno.cxx
index 5ab09bbe9539..daa5bfbe3c45 100644
--- a/svl/source/numbers/numfmuno.cxx
+++ b/svl/source/numbers/numfmuno.cxx
@@ -64,20 +64,20 @@ static const SfxItemPropertyMapEntry* lcl_GetNumberFormatPropertyMap()
{
static const SfxItemPropertyMapEntry aNumberFormatPropertyMap_Impl[] =
{
- {PROPERTYNAME_FMTSTR, 0, getCppuType((OUString*)0), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY, 0},
- {PROPERTYNAME_LOCALE, 0, getCppuType((lang::Locale*)0),beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY, 0},
- {PROPERTYNAME_TYPE, 0, getCppuType((sal_Int16*)0), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY, 0},
- {PROPERTYNAME_COMMENT, 0, getCppuType((OUString*)0), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY, 0},
- {PROPERTYNAME_CURREXT, 0, getCppuType((OUString*)0), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY, 0},
- {PROPERTYNAME_CURRSYM, 0, getCppuType((OUString*)0), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY, 0},
- {PROPERTYNAME_DECIMALS, 0, getCppuType((sal_Int16*)0), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY, 0},
- {PROPERTYNAME_LEADING, 0, getCppuType((sal_Int16*)0), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY, 0},
- {PROPERTYNAME_NEGRED, 0, getBooleanCppuType(), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY, 0},
- {PROPERTYNAME_STDFORM, 0, getBooleanCppuType(), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY, 0},
- {PROPERTYNAME_THOUS, 0, getBooleanCppuType(), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY, 0},
- {PROPERTYNAME_USERDEF, 0, getBooleanCppuType(), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY, 0},
- {PROPERTYNAME_CURRABB, 0, getCppuType((OUString*)0), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY, 0},
- {}
+ {MAP_CHAR_LEN(PROPERTYNAME_FMTSTR), 0, &getCppuType((OUString*)0), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY, 0},
+ {MAP_CHAR_LEN(PROPERTYNAME_LOCALE), 0, &getCppuType((lang::Locale*)0),beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY, 0},
+ {MAP_CHAR_LEN(PROPERTYNAME_TYPE), 0, &getCppuType((sal_Int16*)0), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY, 0},
+ {MAP_CHAR_LEN(PROPERTYNAME_COMMENT), 0, &getCppuType((OUString*)0), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY, 0},
+ {MAP_CHAR_LEN(PROPERTYNAME_CURREXT), 0, &getCppuType((OUString*)0), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY, 0},
+ {MAP_CHAR_LEN(PROPERTYNAME_CURRSYM), 0, &getCppuType((OUString*)0), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY, 0},
+ {MAP_CHAR_LEN(PROPERTYNAME_DECIMALS), 0, &getCppuType((sal_Int16*)0), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY, 0},
+ {MAP_CHAR_LEN(PROPERTYNAME_LEADING), 0, &getCppuType((sal_Int16*)0), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY, 0},
+ {MAP_CHAR_LEN(PROPERTYNAME_NEGRED), 0, &getBooleanCppuType(), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY, 0},
+ {MAP_CHAR_LEN(PROPERTYNAME_STDFORM), 0, &getBooleanCppuType(), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY, 0},
+ {MAP_CHAR_LEN(PROPERTYNAME_THOUS), 0, &getBooleanCppuType(), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY, 0},
+ {MAP_CHAR_LEN(PROPERTYNAME_USERDEF), 0, &getBooleanCppuType(), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY, 0},
+ {MAP_CHAR_LEN(PROPERTYNAME_CURRABB), 0, &getCppuType((OUString*)0), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY, 0},
+ {0,0,0,0,0,0}
};
return aNumberFormatPropertyMap_Impl;
}
@@ -86,11 +86,11 @@ static const SfxItemPropertyMapEntry* lcl_GetNumberSettingsPropertyMap()
{
static const SfxItemPropertyMapEntry aNumberSettingsPropertyMap_Impl[] =
{
- {PROPERTYNAME_NOZERO, 0, getBooleanCppuType(), beans::PropertyAttribute::BOUND, 0},
- {PROPERTYNAME_NULLDATE, 0, getCppuType((util::Date*)0), beans::PropertyAttribute::BOUND, 0},
- {PROPERTYNAME_STDDEC, 0, getCppuType((sal_Int16*)0), beans::PropertyAttribute::BOUND, 0},
- {PROPERTYNAME_TWODIGIT, 0, getCppuType((sal_Int16*)0), beans::PropertyAttribute::BOUND, 0},
- {}
+ {MAP_CHAR_LEN(PROPERTYNAME_NOZERO), 0, &getBooleanCppuType(), beans::PropertyAttribute::BOUND, 0},
+ {MAP_CHAR_LEN(PROPERTYNAME_NULLDATE), 0, &getCppuType((util::Date*)0), beans::PropertyAttribute::BOUND, 0},
+ {MAP_CHAR_LEN(PROPERTYNAME_STDDEC), 0, &getCppuType((sal_Int16*)0), beans::PropertyAttribute::BOUND, 0},
+ {MAP_CHAR_LEN(PROPERTYNAME_TWODIGIT), 0, &getCppuType((sal_Int16*)0), beans::PropertyAttribute::BOUND, 0},
+ {0,0,0,0,0,0}
};
return aNumberSettingsPropertyMap_Impl;
}