So far I have been able to achieve basically what I want to do by adding the following code to the SimpleBootstrap_cpp example:
Code: Select all
Reference< XDocumentInfoSupplier > xDocumentInfoSupplier(xComponent, UNO_QUERY);
Reference< XDocumentInfo > xDocumentInfo = xDocumentInfoSupplier->getDocumentInfo();
Reference< XDocumentPropertiesSupplier > xDocumentPropertiesSupplier(xDocumentInfo, UNO_QUERY);
Reference< XDocumentProperties > xDocumentProperties = xDocumentPropertiesSupplier->getDocumentProperties();
Reference< XPropertyContainer > xPropertyContainer = xDocumentProperties->getUserDefinedProperties();
Reference< XPropertySet > xPropertySet(xPropertyContainer, UNO_QUERY);
Reference< XPropertySetInfo > xPropertySetInfo = xPropertySet->getPropertySetInfo();
if (xPropertySetInfo->hasPropertyByName(OUString::createFromAscii("Info 1")))
{
Any newValue, sName;
newValue <<= OUString::createFromAscii("Value has been set by API");
xPropertySet->setPropertyValue (OUString::createFromAscii("Info 1"), newValue);
}
Secondly please could I ask for advice as to whether it is best to keep this as a standalone utility and execute (spawn) it from the main application or would it be possible to build it into my application or better create a shared library? If so are there any guides / notes that I have missed for doing this?
The reason for asking is that the SDK clearly does a lot of the hard work, such as setting the appropriate environment variables, calling the cpp helper tools etc.
My application is wxWidgets based and I am currently using MinGW (Windows) and gcc / clang (Linux).
Thanks!
p.s. I really appreciate the effort to get the code snippets from oooforum.org back online. It has been something of a struggle for me to get this far and Google has teased me with some tantalizing links to oooforum that are no longer available .