To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=69400
                 Issue #|69400
                 Summary|setPropertyValue("PrinterName", myValue) has no effect
               Component|Word processor
                 Version|OOo 2.0.2
                Platform|PC
                     URL|
              OS/Version|Windows 2000
                  Status|UNCONFIRMED
       Status whiteboard|
                Keywords|
              Resolution|
              Issue type|DEFECT
                Priority|P3
            Subcomponent|code
             Assigned to|mru
             Reported by|mvincent





------- Additional comments from [EMAIL PROTECTED] Fri Sep  8 08:13:14 -0700 
2006 -------
I want to change the PrinterName in a document. The following code open the
document, affect a printer name and store the document. Actually,
"setPropertyValue("PrinterName", printerName);" has no effects since
getPropertyValue("PrinterName") still return the initial value.


The code snipet:



XComponent oDoc = OORemoteHelper.loadComponentFromByteArray(document);
try {
   XMultiServiceFactory factory = QueryInterface.XMultiServiceFactory(oDoc);
   Object settings = factory.createInstance("com.sun.star.document.Settings");

   XPropertySet settingsProp = QueryInterface.XPropertySet(settings);
   // affect a new printer name.
   settingsProp.setPropertyValue("PrinterName", printerName);
   // test still be equal to initial printer name...
   String test = (String) settingsProp.getPropertyValue("PrinterName");

   XStorable xStorable = QueryInterface.XStorable(oDoc);
   PropertyValue[] properties =   
PropertyHelper.addProperty(PropertyHelper.makeProperty("FilterName", "StarOffice
XML (Writer)"), PropertyHelper.makeProperties("Overwrite", true));
   xStorable.storeToURL(fileURL, properties);
} catch (Exception e) {
     throw new OORuntimeException(e);
} finally {
     OORemoteHelper.releaseRessources(oDoc);
}


regards
Vincent

---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to