Hi, I'm trying to connect to OPenOffice.org via COM from PHP. The connection works, but I'm struggling with the construction of a PropertyValue, here are two things I tried:
$Props = array();
$myProps = $objServiceManager->Bridge_GetStruct("com.sun.star.beans.PropertyValue");
$myProps = new $Props;
$myProps->Name="FilterName";
$myProps->Value="writer_pdf_Export";
$Props[0]=$myProps;
$myProps->Name="CompressMode";
$myProps->Value=1;
$Props[1]=$myProps;
$myProps->Name="Hidden";
$myProps->Value=0;
$Props[2]=$myProps;
It seems references are used, so I only keep the last Name and Value. So I changed it to:
$Props[] = $objServiceManager->Bridge_GetStruct("com.sun.star.beans.PropertyValue");
$Props[0]->Name="FilterName";
$Props[0]->Value="writer_pdf_Export";
$Props[1]->Name="CompressMode";
$Props[1]->Value=1;
$Props[2]->Name="Hidden";
$Props[2]->Value=0;
This works, but is not recognised anymore by an OpenOffice.org function (storeToURL) as the correct type (the former construction is recognised as the correct type though).
Something seems to be wrong with the way I construct the array. Any hints are welcome,
K