Christoph Lutz wrote:
Hi,

please assueme one creates a new OOo document, moves the window of the
document using the mouse and closes the document again. If you now
create a new document, it will be placed to the position of the
previous document.

How can I modify this default-position in a programmatic way?
Hi Christoph,

I am not sure if this can really be done, it depends on the current implementation. I will describe a way you can try out. OpenOffice.org stores the default position of every document type in the configuration file Setup.xcu. You can find the file here: <User folder>/registry/data/org/openoffice/Setup.xcu. The user folder is normally located under Unix in your home directory. Under Windows normally in <System Drive>:/Documents and Settings/<username>/Application Data. I copied the following snippet from my Office installation:

<?xml version="1.0" encoding="UTF-8"?>
<oor:component-data xmlns:oor="http://openoffice.org/2001/registry"; xmlns:xs="http://www.w3.org/2001/XMLSchema"; oor:name="Setup" oor:package="org.openoffice">
 <node oor:name="L10N">
  <prop oor:name="ooLocale" oor:type="xs:string">
   <value>en-US</value>
  </prop>
 </node>
 <node oor:name="Office">
  <prop oor:name="ooSetupInstCompleted" oor:type="xs:boolean">
   <value>true</value>
  </prop>
  <prop oor:name="LicenseAcceptDate" oor:type="xs:string">
   <value>2006-07-14T08:05:09</value>
  </prop>
  <prop oor:name="FirstStartWizardCompleted" oor:type="xs:boolean">
   <value>true</value>
  </prop>
  <node oor:name="Factories">
   <node oor:name="com.sun.star.frame.StartModule">
    <prop oor:name="ooSetupFactoryWindowAttributes" oor:type="xs:string">
     <value>114,175,952,711;1;0,0,0,0;</value>
    </prop>
   </node>
   <node oor:name="com.sun.star.text.TextDocument">
    <prop oor:name="ooSetupFactoryWindowAttributes" oor:type="xs:string">
     <value>99,113,1179,908;1;0,0,0,0;</value>
    </prop>
   </node>
  </node>
 </node>
</oor:component-data>

You can see that the configuration set "Factories" contains nodes for every appplication module, in the example "com.sun.star.frame.StartModule" and "com.sun.star.text.TextDocument". The property called "ooSetupFactoryWindowAttributes" stores the left,top position and the width and height in pixel. You can use the configuration API to change these values programmatically.

I am not sure if the current implementation reads the values for every new window or if it just uses internal values. So it's possible that the values are only read once from the configuration at startup time. Be aware that these values will be overwritten when a user changes the position or size of an application window.

Regards,
Carsten

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

Reply via email to