Fix static linkage and use SAL_N_ELEMENTS

Change-Id: Iced21e010b3c06a5f36731f63d41ab55a5c8a2e4
This commit is contained in:
Matteo Casalin
2013-12-08 16:21:14 +01:00
parent 4ba63be415
commit afe6738b71

View File

@@ -1088,10 +1088,10 @@ static const CustomShapeTypeTranslationTable pCustomShapeTypeTranslationTable[]
{ "ooxml-ribbon", "ribbon" }, { "ooxml-ribbon", "ribbon" },
}; };
struct { static struct {
const char* sDML; const char* sDML;
MSO_SPT nVML; MSO_SPT nVML;
} pDMLToVMLTable[] = { } const pDMLToVMLTable[] = {
{"notPrimitive", mso_sptNotPrimitive}, {"notPrimitive", mso_sptNotPrimitive},
{"rectangle", mso_sptRectangle}, {"rectangle", mso_sptRectangle},
{"roundRectangle", mso_sptRoundRectangle}, {"roundRectangle", mso_sptRoundRectangle},
@@ -1307,7 +1307,7 @@ const char* GetOOXMLPresetGeometry( const char* sShapeType )
if( pCustomShapeTypeTranslationHashMap == NULL ) if( pCustomShapeTypeTranslationHashMap == NULL )
{ {
pCustomShapeTypeTranslationHashMap = new CustomShapeTypeTranslationHashMap (); pCustomShapeTypeTranslationHashMap = new CustomShapeTypeTranslationHashMap ();
for( unsigned int i = 0; i < sizeof( pCustomShapeTypeTranslationTable )/sizeof( CustomShapeTypeTranslationTable ); i ++ ) for( unsigned int i = 0; i < SAL_N_ELEMENTS(pCustomShapeTypeTranslationTable); ++i )
{ {
(*pCustomShapeTypeTranslationHashMap)[ pCustomShapeTypeTranslationTable[ i ].sOOo ] = pCustomShapeTypeTranslationTable[ i ].sMSO; (*pCustomShapeTypeTranslationHashMap)[ pCustomShapeTypeTranslationTable[ i ].sOOo ] = pCustomShapeTypeTranslationTable[ i ].sMSO;
} }