Issue 65551

Summary: ODMA UCP: Bug in Creating Provider Element Names
Product: ucb Reporter: orcmid <orcmid>
Component: codeAssignee: AOO issues mailing list <issues>
Status: UNCONFIRMED --- QA Contact:
Severity: Trivial    
Priority: P3 CC: esigra, issues
Version: OOo 2.0.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
URL: http://ucb.openoffice.org/docs/ucp-ref/odma-ucp.html
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---

Description orcmid 2006-05-18 16:44:25 UTC
This defect was detected in OOo 2.0.2

The line

aProviderData.insertByName( "Provider" + (UBOUND(xx) - LBOUND(xx) + 2), 
aContentProviderData )

in the Open Office Basic script for RegisterUcpOdma is based on the assumption 
that the array xx(LBOUND(xx) to UBOUND(xx)) will have only provider 
numbers "Provider1" to "Provider"+(UBOUND(xx)-LBOUND(xx)+1).  This is an 
invalid assumption once there have been any deletions of provider entries.

On a fresh installation of OO.o 2.0.2, the following 10 values were found in 
the xx() array: Provider1, Provider10, Provider11, Provider2, Provider3, 
Provider4, Provider5, Provider6, Provider8, and Provider9

On attempting to add an entry with element identification "Provider11", the 
procedure failed with message 

    BASIC runtime error.
    An exception occured
    Type: com.sun.star.container.ElementExistException
    Message: Configuration - cannot insert into Set.  Element 'Provider11' is 
already present in Set
    /org.openoffice.ucb.Configuration/ContentProviders/ContentProvidersDataPrim
aryKeys['Local']/SecondaryKeys/ContentProvidersDataSecondaryKeys
["Office"]/ProviderData.

WORKAROUND:
   To overcome the bug, I updated the RegisterUcpOdma script to use a 
hardwired Element number, 'Provider99', after commenting out the failing 
operation:

' aProviderData.insertByName( "Provider" + (UBOUND(xx) - LBOUND(xx) + 2), 
aContentProviderData )
aProviderData.insertByName( "Provider99", aContentProviderData )

I would have used something like "ProviderOCP" but I wasn't sure whether there 
are other dependencies on the use of numerals in these element names.