Re: Inserting a value into a XComponentContext

2014-12-03 Thread Andrew Pitonyak
Guessing from memory and not east for me to verify at the Moment, but I thought that the context was read only. I think that of you want to add values you need to create a new one with the desired named value pairs. Are you able to inspect an object to see of it supports setting values... I ha

Re: Inserting a value into a XComponentContext

2014-12-01 Thread Chris Sherlock
OK, I've worked it out. What happens is that comphelper::getProcessComponentContext() is actually getting the concrete class ComponentContext, which implements XNameContainer and XContainerContext. All you need to do is to instantiate a new Reference< XNameContainer > like so: Reference< containe

Re: Inserting a value into a XComponentContext

2014-12-01 Thread Stephan Bergmann
On 12/01/2014 12:29 AM, Chris Sherlock wrote: So what about the following approach: Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext(); ::cppu::ContextEntry_Init aContextInfo[] = { ::cppu::ContextEntry_Init("testkey", uno::Any() ), } xNewContext = ::cppu::c

Re: Inserting a value into a XComponentContext

2014-12-01 Thread Stephan Bergmann
On 11/30/2014 01:31 PM, Chris Sherlock wrote: How do you insert a value to be retrieved later into an XComponentContext reference? I see there is a XNameContainer, which is created by comphelper::NameContainer_createInstance(::cppu::UnoType::get()) or whatever value you want. From here you then

Re: Inserting a value into a XComponentContext

2014-11-30 Thread Andrew Pitonyak
No stress on the number of mails. I did not think that you could change a context after it was created... But I would certainly try if I had a need. I know very little about this specifically. Chris Sherlock wrote: >Oh, and sorry for the number of emails, but I guess I'm assuming that you can

Re: Inserting a value into a XComponentContext

2014-11-30 Thread Andrew Pitonyak
Anything I have done has been in basic, which abstracts ask the hard bits of casting away. Of Han that looks to be correct based on my memory. More specifically, that you add the values (or pad the values) on creation. Chris Sherlock wrote: >___ >

Re: Inserting a value into a XComponentContext

2014-11-30 Thread Chris Sherlock
Oh, and sorry for the number of emails, but I guess I'm assuming that you can add a new property key at any point by insertByName()... Thanks in advance, UNO is a little tricky at this level. At least that's what I find... from what I can tell, it really comes down to the cppuhelper::ComponentCont

Re: Inserting a value into a XComponentContext

2014-11-30 Thread Chris Sherlock
So what about the following approach: Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext(); ::cppu::ContextEntry_Init aContextInfo[] = { ::cppu::ContextEntry_Init("testkey", uno::Any() ), } xNewContext = ::cppu::createComponentContext(aContextInfo, sizeof(aConte

Inserting a value into a XComponentContext

2014-11-30 Thread Chris Sherlock
Hi all, How do you insert a value to be retrieved later into an XComponentContext reference? I see there is a XNameContainer, which is created by comphelper::NameContainer_createInstance(::cppu::UnoType::get()) or whatever value you want. From here you then do insertByName. However, how do you t