Issue 65551 - ODMA UCP: Bug in Creating Provider Element Names
Summary: ODMA UCP: Bug in Creating Provider Element Names
Status: UNCONFIRMED
Alias: None
Product: ucb
Classification: Code
Component: code (show other issues)
Version: OOo 2.0.1
Hardware: PC Windows XP
: P3 Trivial (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL: http://ucb.openoffice.org/docs/ucp-re...
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-18 16:44 UTC by orcmid
Modified: 2013-01-29 21:59 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
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.