[api-dev] How can I get the url of the currently opened document?

2005-03-09 Thread Ines Pfauch
My java addon now has some functions which are only visible if a 
document is opened. Before I can do anything with this document I need 
the url of it (path and name on the filesystem), how can I retrieve 
this?

Thanks in advance,
Ines
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [api-dev] How can I get the url of the currently opened document?

2005-03-09 Thread Aidan Butler
Hello,
 The URL of the document is stored as a property of the document 
component. The following python code will print the URL

#ctx is the current context
desktop = ctx.ServiceManager.createInstanceWithContext( \
   com.sun.star.frame.Desktop, ctx )
document = desktop.getCurrentComponent()
print document.URL 

Alternatively a document.getPropertyValue(URL) should do the trick
Regards,
-Aidan
Ines Pfauch wrote:
My java addon now has some functions which are only visible if a 
document is opened. Before I can do anything with this document I need 
the url of it (path and name on the filesystem), how can I retrieve this?

Thanks in advance,
Ines
-
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]


Re: [api-dev] Menu control

2005-03-09 Thread Mathias Bauer
Christian Junker wrote:
 Hi Matthias,
 I do ask myself, why those interfaces are deprecated. Why not removing
 them completely?
 a) from source code (I searched with ximian lxr and there was no
 single implementation I found about XMenu)
 b) from documentation (IDL Reference)

Deprecated means: don't use that interface, it's doomed, but you have
a grace period. After this period it will be removed. In case if the
XMenu... interfaces I assume that there just wasn't nobody who did it.

We are planning an API revision (checking for possible usage of new UNO
features), maybe that's a good opportunity for removing some deprecated
stuff.

Best regards,
Mathias

-- 
Mathias Bauer - OpenOffice.org Application Framework Project Lead
Please reply to the list only, [EMAIL PROTECTED] is a spam sink.


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



[api-dev] Setting Paper Properties of Spreadsheet

2005-03-10 Thread Tom Schindl
Hi,
I search the Developers Guide and the IDL-Docs but could find an answer 
to my problem. Using the GUI I can set the Paper Format(e.g. to A3) and 
Orientation of an Spreadsheet (e.g. to Landscape). I have not found yet 
the functions needed to set these using the API. I only found how to set 
them when sending a document to the printer e.g. in Andrews Macro-Document.

Any pointers would be greate.
Thx
Tom
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [api-dev] Setting Paper Properties of Spreadsheet

2005-03-10 Thread Niklas Nebel
Tom Schindl wrote:
I search the Developers Guide and the IDL-Docs but could find an answer 
to my problem. Using the GUI I can set the Paper Format(e.g. to A3) and 
Orientation of an Spreadsheet (e.g. to Landscape). I have not found yet 
the functions needed to set these using the API. I only found how to set 
them when sending a document to the printer e.g. in Andrews Macro-Document.
These are properties of the page style (Size, IsLandscape).
Niklas
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [api-dev] Could someone remove this guy: [EMAIL PROTECTED]

2005-03-10 Thread Michael Hoennig
Hi Tom,

 It's really getting on my nerves that people can not configure their
 mail-server apropiately when they use mailling lists.
 
 For every message sent to [EMAIL PROTECTED] I get the notice I think everybody
 does from his Anti-Spam agent.

I know, its annoying.  But I have noo influence on the subscription list.
All I can do is sending him a direct mail asking him to stop this.  

Michael


-- 
Michael Hoennig [EMAIL PROTECTED]
project lead OpenOffice.org API
http://api.openoffice.org

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



Re: [api-dev] Setting Paper Properties of Spreadsheet

2005-03-10 Thread Tom Schindl
Niklas Nebel wrote:
Tom Schindl wrote:
well flipping the orientation to IsLandscape = true is working more on 
this later. Are there any predefined properties for the page-format? 
There is an enum for paper formats 
http://api.openoffice.org/docs/common/ref/com/sun/star/view/PaperFormat.html#A3 

The VCL printer implementation has a table, but it's not available to 
the API.
But where from does the GUI know? Is it hardcoded somewhere because when 
switching the Format DropDown e.g. to A3 it automatically recalculates 
the height and width.


Now back to the IsLandscape property. When switching this property it 
does not automatically switch the size. Is this intented or have I 
discovered a bug here?

It has to be that way. The order of setting a style's properties isn't 
supposed to make a difference.

Ok. Now summerized as a codesnippet: 
http://codesnippets.services.openoffice.org/Calc/Calc.SwitchOrientation.snip

Tom
Niklas
-
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]


Re: [api-dev] Setting Paper Properties of Spreadsheet

2005-03-10 Thread Niklas Nebel
Tom Schindl wrote:
But where from does the GUI know? Is it hardcoded somewhere because when 
switching the Format DropDown e.g. to A3 it automatically recalculates 
the height and width.
The dialog actually has its own table.
Ok. Now summerized as a codesnippet: 
http://codesnippets.services.openoffice.org/Calc/Calc.SwitchOrientation.snip 
Don't use Standard to get the style. That's the localized German name, 
and it won't work in other language versions. Use Default, which is 
the programmatic name and works in any version.

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


Re: [api-dev] Number of line of a paragraph

2005-03-10 Thread Michael Hoennig
Hi Laurent,

 I retreive a paragraph containing text. Is there a way to know how many 
 lines it represents displayed in the document ? (so, depending on the 
 formats,  font, font size aso)
 
 I know i can count characters with
 num = Len(myParagraph.string)
 but need know that this number is displayed on N lines

Just a weird idea, which I have not checked yet:

The view cursor has an interface XViewCursor which can go down.  Starting
at the beginning of the paragraph you could go down until you reach the
next paragraph, while counting the number of lines.

Michael


-- 
Michael Hoennig [EMAIL PROTECTED]
project lead OpenOffice.org API
http://api.openoffice.org

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



Re: [api-dev] Number of line of a paragraph

2005-03-10 Thread Michael Hoennig


 while thiscomponent.getText.compareRegionEnds(textCursor,viewCursor)0
   viewCursor.goDown(1,false)
   counter = counter +1

I should have read everything before I answered.. 
(for my excuse, the thread was somehow broken into two parts)

Michael

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



Re: [api-dev] Number of line of a paragraph

2005-03-10 Thread Laurent Godard
Hi Michael,
while thiscomponent.getText.compareRegionEnds(textCursor,viewCursor)0
viewCursor.goDown(1,false)
counter = counter +1

I should have read everything before I answered.. 
(for my excuse, the thread was somehow broken into two parts)

No problem for me :)
Thanks anyway
The problem is that i have to remember the previous selection and set it 
back after processing

Laurent
--
Laurent Godard [EMAIL PROTECTED] - Ingénierie OpenOffice.org
Indesko  http://www.indesko.com
Nuxeo CPS  http://www.nuxeo.com - http://www.cps-project.org
Livre Programmation OpenOffice.org, Eyrolles 2004
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [api-dev] How can I get the url of the currently opened document?

2005-03-10 Thread Ines Pfauch
On 09.03.2005, at 13:20, Aidan Butler wrote:
Hello,
 The URL of the document is stored as a property of the document 
component. The following python code will print the URL

#ctx is the current context
desktop = ctx.ServiceManager.createInstanceWithContext( \
   com.sun.star.frame.Desktop, ctx )
document = desktop.getCurrentComponent()
print document.URL
Alternatively a document.getPropertyValue(URL) should do the trick
Maybe I so something wrong but this does not work, when I try to 
convert it to java.

I can understand the whole thing unto here:
// XComponentContext ctx ...
// XMultiComponentFactory f ...
XDesktop desktop = 
(XDesktop)f.createInstanceWithContext(com.sun.star.frame.Desktop, 
ctx);
XComponent document = (XComponent)desktop.getCurrentComponent();

But a document.getPropertyValue(URL) method does not exist.
Please help me.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [api-dev] How can I get the url of the currently opened document?

2005-03-10 Thread Christoph Lutz
Ines Pfauch wrote:
On 09.03.2005, at 13:20, Aidan Butler wrote:
[...]
desktop = ctx.ServiceManager.createInstanceWithContext( \
   com.sun.star.frame.Desktop, ctx )
document = desktop.getCurrentComponent()
print document.URL
Alternatively a document.getPropertyValue(URL) should do the trick

Maybe I so something wrong but this does not work, when I try to convert 
it to java.

I can understand the whole thing unto here:
// XComponentContext ctx ...
// XMultiComponentFactory f ...
XDesktop desktop = 
(XDesktop)f.createInstanceWithContext(com.sun.star.frame.Desktop, ctx);
XComponent document = (XComponent)desktop.getCurrentComponent();

But a document.getPropertyValue(URL) method does not exist.
Please help me.
the Component-Service implements the Interface XPropertySet. To 
access the property URL use (add) the following lines:

XPropertySet documentProps = 
(XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, document);
String url = (String) documentProps.getPropertyValue(URL);

(not tested...)
http://api.openoffice.org/docs/DevelopersGuide/FirstSteps/FirstSteps.htm
provides more information about this concept...
regards,
Christoph Lutz
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [api-dev] How can I get the url of the currently opened document?

2005-03-10 Thread Christian Junker
That's because you need to query for the correct interface first,
before you use such a method. In this case I would query the
com.sun.star.frame.XModel interface and call the method getURL() on
the returned object.
In order to code in Java for OOo, you need to know about such things
as queryInterface, and I suggest that you read the first chapters of
the Developer's Guide which should explain this.

-- 
Best Regards
Christian Junker

On Thu, 10 Mar 2005 13:46:47 +0100, Ines Pfauch [EMAIL PROTECTED] wrote:
 On 09.03.2005, at 13:20, Aidan Butler wrote:
 
  Hello,
   The URL of the document is stored as a property of the document
  component. The following python code will print the URL
 
  #ctx is the current context
 
  desktop = ctx.ServiceManager.createInstanceWithContext( \
 com.sun.star.frame.Desktop, ctx )
  document = desktop.getCurrentComponent()
  print document.URL
  Alternatively a document.getPropertyValue(URL) should do the trick
 
 Maybe I so something wrong but this does not work, when I try to
 convert it to java.
 
 I can understand the whole thing unto here:
 
 // XComponentContext ctx ...
 // XMultiComponentFactory f ...
 XDesktop desktop =
 (XDesktop)f.createInstanceWithContext(com.sun.star.frame.Desktop,
 ctx);
 XComponent document = (XComponent)desktop.getCurrentComponent();
 
 But a document.getPropertyValue(URL) method does not exist.
 Please help me.
 
 -
 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]



Re: [api-dev] Code snippets ....

2005-03-10 Thread Jürgen Schmidt
Hi Tom,
thanks for the extensison, i think it is very helpful to improve the 
navigation to the IDL reference and implicit to the DevGuide.

- Juergen
Tom Schindl wrote:
Jürgen Schmidt wrote:
Tom Schindl wrote:
Jürgen Schmidt wrote:
Hi,
we have started some time ago with our code snippet base where Tom 
Schindle did a great work and also Paolo Mantovani who created the 
code snippet wizard.
I would like to invite all of you to submit code snippets for often 
used API's or often asked questions. I think it so important to have 
a good base of code snippets which helps people to solve their 
problems fast or simple get started. I have promised that i will 
submit one snippet per week and i must apologize that i haven't 
reached my personal goal but i will work on it when i have time ;-)

The upcoming MS Office Developer Studio will come with a bunch of 
code snippets for often used API's. Everything is well integrated 
and the user have only to click here and there, fill in some gaps 
(controlled navigation from gap to gap) and has then a working macro.
We will probably not reach this kind of IDE integration but we can 
provide a good code snippet base. And of course it is possible to 
take this code snippets, convert them all to Java for example and 
create an extension for NetBeans or Eclipse. Any volunteers here?

I have added today 3 new snippets:
http://codesnippets.services.openoffice.org/Calc/Calc.SwitchPageSizeToDin.snip 

http://codesnippets.services.openoffice.org/Calc/Calc.SwitchOrientation.snip 

http://codesnippets.services.openoffice.org/Calc/Calc.AutoFormat.snip
And because I have been at it I added a new functionality to add links 
to IDL documentation.

The syntax is lend from javadoc:
* In Text-Sections one could use: [EMAIL PROTECTED] $IDL-Definition}
* In Code-Comments one could use: [EMAIL PROTECTED] $IDL-Definition}
$IDL-Definition means a fully qualified Class-name including the package 
e.g. com.sun.star.table.XAutoFormattable

An example usage could be seen in Calc.AutoFormat.snip
The search functionality is still on my list and I hope I can manage 
soon to implement it.

Tom
-
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]


Re: [api-dev] Code snippets ....

2005-03-10 Thread Thomas Schindl
I thought about automatically linking all imports or includes when we are
talking C++. We could even link all com.sun to the IDL?

What do you think about it?

Tom


 Hi Tom,
 
 thanks for the extensison, i think it is very helpful to improve the 
 navigation to the IDL reference and implicit to the DevGuide.
 
 - Juergen
 
 Tom Schindl wrote:
  Jürgen Schmidt wrote:
  
  Tom Schindl wrote:
 
  Jürgen Schmidt wrote:
 
  Hi,
 
  we have started some time ago with our code snippet base where Tom 
  Schindle did a great work and also Paolo Mantovani who created the 
  code snippet wizard.
  I would like to invite all of you to submit code snippets for often 
  used API's or often asked questions. I think it so important to have 
  a good base of code snippets which helps people to solve their 
  problems fast or simple get started. I have promised that i will 
  submit one snippet per week and i must apologize that i haven't 
  reached my personal goal but i will work on it when i have time ;-)
 
  The upcoming MS Office Developer Studio will come with a bunch of 
  code snippets for often used API's. Everything is well integrated 
  and the user have only to click here and there, fill in some gaps 
  (controlled navigation from gap to gap) and has then a working macro.
  We will probably not reach this kind of IDE integration but we can 
  provide a good code snippet base. And of course it is possible to 
  take this code snippets, convert them all to Java for example and 
  create an extension for NetBeans or Eclipse. Any volunteers here?
  
  
  I have added today 3 new snippets:
  
 

http://codesnippets.services.openoffice.org/Calc/Calc.SwitchPageSizeToDin.snip

  
 

http://codesnippets.services.openoffice.org/Calc/Calc.SwitchOrientation.snip

  
  http://codesnippets.services.openoffice.org/Calc/Calc.AutoFormat.snip
  
  And because I have been at it I added a new functionality to add links 
  to IDL documentation.
  
  The syntax is lend from javadoc:
  * In Text-Sections one could use: [EMAIL PROTECTED] $IDL-Definition}
  * In Code-Comments one could use: [EMAIL PROTECTED] $IDL-Definition}
  
  $IDL-Definition means a fully qualified Class-name including the package
  e.g. com.sun.star.table.XAutoFormattable
  
  An example usage could be seen in Calc.AutoFormat.snip
  
  The search functionality is still on my list and I hope I can manage 
  soon to implement it.
  
  Tom
  
  -
  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]
 

-- 
SMS bei wichtigen e-mails und Ihre Gedanken sind frei ...
Alle Infos zur SMS-Benachrichtigung: http://www.gmx.net/de/go/sms

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



Re: [api-dev] Code snippets ....

2005-03-10 Thread Jürgen Schmidt
yep, that is also a good idea. We should simplify the access to further 
information wherever we can. Important is that the snippets can be 
copied and used directly in the users prefered editor.

- Juergen
Thomas Schindl wrote:
I thought about automatically linking all imports or includes when we are
talking C++. We could even link all com.sun to the IDL?
What do you think about it?
Tom

Hi Tom,
thanks for the extensison, i think it is very helpful to improve the 
navigation to the IDL reference and implicit to the DevGuide.

- Juergen
Tom Schindl wrote:
Jürgen Schmidt wrote:

Tom Schindl wrote:

Jürgen Schmidt wrote:

Hi,
we have started some time ago with our code snippet base where Tom 
Schindle did a great work and also Paolo Mantovani who created the 
code snippet wizard.
I would like to invite all of you to submit code snippets for often 
used API's or often asked questions. I think it so important to have 
a good base of code snippets which helps people to solve their 
problems fast or simple get started. I have promised that i will 
submit one snippet per week and i must apologize that i haven't 
reached my personal goal but i will work on it when i have time ;-)

The upcoming MS Office Developer Studio will come with a bunch of 
code snippets for often used API's. Everything is well integrated 
and the user have only to click here and there, fill in some gaps 
(controlled navigation from gap to gap) and has then a working macro.
We will probably not reach this kind of IDE integration but we can 
provide a good code snippet base. And of course it is possible to 
take this code snippets, convert them all to Java for example and 
create an extension for NetBeans or Eclipse. Any volunteers here?

I have added today 3 new snippets:


http://codesnippets.services.openoffice.org/Calc/Calc.SwitchPageSizeToDin.snip


http://codesnippets.services.openoffice.org/Calc/Calc.SwitchOrientation.snip

http://codesnippets.services.openoffice.org/Calc/Calc.AutoFormat.snip
And because I have been at it I added a new functionality to add links 
to IDL documentation.

The syntax is lend from javadoc:
* In Text-Sections one could use: [EMAIL PROTECTED] $IDL-Definition}
* In Code-Comments one could use: [EMAIL PROTECTED] $IDL-Definition}
$IDL-Definition means a fully qualified Class-name including the package
e.g. com.sun.star.table.XAutoFormattable
An example usage could be seen in Calc.AutoFormat.snip
The search functionality is still on my list and I hope I can manage 
soon to implement it.

Tom
-
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]

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


Re: [api-dev] Could someone remove this guy: [EMAIL PROTECTED]

2005-03-10 Thread Anthony Chilco
Hi Tom,
Create a mail filter to delete anti-spam agent mail from
your server. You'll never see it.
tc
Tom Schindl wrote:
It's really getting on my nerves that people can not configure their
mail-server apropiately when they use mailling lists.
For every message sent to [EMAIL PROTECTED] I get the notice I think everybody
does from his Anti-Spam agent.
Tom
-
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]


[api-dev] setting OOo options

2005-03-10 Thread Jorge Marques Pelizzoni

Hi, all!

I'd like to write a macro setting some of OOo's options (Menu Tools-Options)
programatically. Can this be done?

So far, by means of recording a macro, I've just got to:

   dispatcher = createUnoService(com.sun.star.frame.DispatchHelper)
   dispatcher.executeDispatch(document, .uno:OptionsTreeDialog, , 0,
Array())

which displays the options dialog. I guess using the right command URLs might do
it, but I cannot find this sort of info in the docs.

Thanks in advance. Cheers,

Jorge.

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



Re: [api-dev] Code snippets ....

2005-03-10 Thread Marc Santhoff
Am Do, den 10.03.2005 schrieb Jürgen Schmidt um 15:50:
 Hi Tom,
 
 thanks for the extensison, i think it is very helpful to improve the 
 navigation to the IDL reference and implicit to the DevGuide.

I think so, too. I'd really love a list of all implementing classes
for interfaces and services like in java docs. That would help
navigating and searching very much.

Marc



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



Re: [api-dev] Code snippets ....

2005-03-10 Thread G. Jasper
Tom Schindl wrote:
The search functionality is still on my list and I hope I can manage 
soon to implement it.

Tom
Tom,
Do you mean a search functionality to be let loose on IDL documentation  
or  on a Calc sheet?
In the latter case I suggest you take a look at Andrew Pitonyak's  
OpenOffice.org Macro document http://www.pitonyak.org/AndrewMacro.sxw
( http://www.pitonyak.org/AndrewMacro.sxw ), section  6.24Searching 
a Calc document.
I think he has covered the subject very well. It, or rather he, helped 
me a lot.

In the former case  the same document, section 7.13. Search And Replace 
#7.13.Search%20And%20Replace%7Coutline (text), may provide some code.
I am not sure; I don't do much with text files.

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


[api-dev] [EMAIL PROTECTED] REQUEST: unanswered questions

2005-03-10 Thread Michael Hoennig
Dear OpenOffice.org community,

We really would like to see all questions answered, but
we need your help to keep track of your questions and their
answer status.  Thus, if you still have a question unanswered
for more than two days, feel free to place a reminder on the
list.  But maybe you should think about simplifying your
question, strip down your code example etc.

I'd like to remind that this mailinglist is not a support 
forum. We core developers like to see all questions answered,
but we cannot do your work.  Thus, even though some background
information can be helpful, phrase your question as easy as 
possible to us and focus on the OOo API rather then your 
application.

Michael

-- 
http://api.openoffice.org


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



Re: [api-dev] Code snippets ....

2005-03-10 Thread Tom Schindl
G. Jasper wrote:
Tom Schindl wrote:
The search functionality is still on my list and I hope I can manage 
soon to implement it.

Tom
Tom,
Do you mean a search functionality to be let loose on IDL documentation  
or  on a Calc sheet?
In the latter case I suggest you take a look at Andrew Pitonyak's  
OpenOffice.org Macro document http://www.pitonyak.org/AndrewMacro.sxw
( http://www.pitonyak.org/AndrewMacro.sxw ), section  6.24Searching 
a Calc document.
I think he has covered the subject very well. It, or rather he, helped 
me a lot.

In the former case  the same document, section 7.13. Search And Replace 
#7.13.Search%20And%20Replace%7Coutline (text), may provide some code.
I am not sure; I don't do much with text files.

No. With search functionality we/I mean a search engine for codesnippets 
homepage. All snippets have key words assigned and it should not be to 
much a problem to create a search-engine e.g. using Plucene or something 
like that. At the moment the only possibility to search the 
snippets-page is a common purpose search engine like google.

Tom
Sincerely,
Gerrit Jasper
-
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]


Re: [api-dev] How can I get the url of the currently opened document?

2005-03-11 Thread Ines Pfauch
On 10.03.2005, at 14:09, Christoph Lutz wrote:

XDesktop desktop =  
(XDesktop)xmulticomponentfactory.createInstanceWithContext 
(com.sun.star.frame.Desktop, ctx);


Unfortunately I get a ClassCastException at the line above. To get the  
URL is the only thing I need. I dont program more in java for OOo, and  
the developers guide is very complicated for me...

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


Re: [api-dev] How can I get the url of the currently opened document?

2005-03-11 Thread Jürgen Schmidt
Hi Ines,
Ines Pfauch wrote:
On 10.03.2005, at 14:09, Christoph Lutz wrote:

XDesktop desktop =  
(XDesktop)xmulticomponentfactory.createInstanceWithContext 
(com.sun.star.frame.Desktop, ctx);


Unfortunately I get a ClassCastException at the line above. To get the  
URL is the only thing I need. I dont program more in java for OOo, and  
the developers guide is very complicated for me...
you have to query for the XDesktop interface.
Object oDesktop = xmulticomponentfactory.createInstanceWithContext 
(com.sun.star.frame.Desktop, ctx);
XDEsktop xDesktop = (XDesktop)UnoRuntime.queryInterface(XDesktop.class, 
oDesktop);

createInstanceWithcontext returns an XInterface and you have to query to 
the interface you want to use. This is the general concept of the UNO 
API, you have to query to a different functional view of an object 
before you can use this specific functionality. And of course we have 
identified this as a problem for many users.
The new UNO ease of use features provide the opportunity to eliminate 
for example the queryInterface call by using multiple inheritance 
interfaces. But this improvement is at the moment only available for new 
API's. I hope that we can adapt this features to existing and often used 
API's in the near future to simplify the usage of this often used API's. 
But i can't say when and for which API's this simplification will be 
available.
But we are working on further improvements in this area!

- Juergen


-
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]


Re: [api-dev] How can I get the url of the currently opened document?

2005-03-11 Thread Ines Pfauch
On 11.03.2005, at 09:50, Jürgen Schmidt wrote:

Object oDesktop = xmulticomponentfactory.createInstanceWithContext  
(com.sun.star.frame.Desktop, ctx);
XDEsktop xDesktop =  
(XDesktop)UnoRuntime.queryInterface(XDesktop.class, oDesktop);

I did.
At the moment I use the following code, but it still seems to be  
wrong...:

--snip--
Object desktop =  
xmulticomponentfactory.createInstanceWithContext 
(com.sun.star.frame.Desktop, ctx );
XDesktop xDesktop =  
(XDesktop)UnoRuntime.queryInterface(com.sun.star.frame.XDesktop.class,  
desktop);
XComponent document = xDesktop.getCurrentComponent();
XPropertySet documentProps =  
(XPropertySet)UnoRuntime.queryInterface(XPropertySet.class,document);
System.out.println(documentProps.getPropertyValue(URL));
--snap--

... because I get following error at the System.out.println-line above:
--snip--
com.sun.star.beans.UnknownPropertyException:
at com.sun.star.bridges.jni_uno.JNI_proxy.dispatch_call(Native  
Method)
at  
com.sun.star.bridges.jni_uno.JNI_proxy.invoke(JNI_proxy.java:204)
at $Proxy6.getPropertyValue(Unknown Source)
--snap--


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


Re: [api-dev] How can I get the url of the currently opened document?

2005-03-11 Thread Tom Schindl
Ines Pfauch wrote:
On 11.03.2005, at 09:50, Jürgen Schmidt wrote:

Object oDesktop = xmulticomponentfactory.createInstanceWithContext  
(com.sun.star.frame.Desktop, ctx);
XDEsktop xDesktop =  
(XDesktop)UnoRuntime.queryInterface(XDesktop.class, oDesktop);

I did.
At the moment I use the following code, but it still seems to be  wrong...:
--snip--
Object desktop =  xmulticomponentfactory.createInstanceWithContext 
(com.sun.star.frame.Desktop, ctx );
XDesktop xDesktop =  
(XDesktop)UnoRuntime.queryInterface(com.sun.star.frame.XDesktop.class,  
desktop);
XComponent document = xDesktop.getCurrentComponent();
XPropertySet documentProps =  
(XPropertySet)UnoRuntime.queryInterface(XPropertySet.class,document);
System.out.println(documentProps.getPropertyValue(URL));
--snap--
URL is only optional. See 
http://api.openoffice.org/docs/common/ref/com/sun/star/document/MediaDescriptor.html#URL

But as already suggested by Christian
((XModel)UnoRuntime.queryInterface(com.sun.star.XModel,xDesktop.getCurrentComponent())).getURL();
Should work.
Tom
... because I get following error at the System.out.println-line above:
--snip--
com.sun.star.beans.UnknownPropertyException:
at com.sun.star.bridges.jni_uno.JNI_proxy.dispatch_call(Native  
Method)
at  
com.sun.star.bridges.jni_uno.JNI_proxy.invoke(JNI_proxy.java:204)
at $Proxy6.getPropertyValue(Unknown Source)
--snap--


-
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]


Re: [api-dev] How can I get the url of the currently opened document?

2005-03-11 Thread Ines Pfauch
On 11.03.2005, at 10:15, Tom Schindl wrote:
But as already suggested by Christian
((XModel)UnoRuntime.queryInterface 
(com.sun.star.XModel,xDesktop.getCurrentComponent())).getURL();

Should work.
Tom

No: I get the following error.
cannot resolve symbol
symbol  : method queryInterface  
(java.lang.String,com.sun.star.lang.XComponent)
location: class com.sun.star.uno.UnoRuntime
XModel xmodel =  
(XModel)UnoRuntime.queryInterface(com.sun.star.frame.XModel,  
desktop);


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


Re: [api-dev] How can I get the url of the currently opened document?

2005-03-11 Thread Ines Pfauch
On 11.03.2005, at 10:34, Tom Schindl wrote:
Sorry should have been  
((XModel)UnoRuntime.queryInterface 
(XModel.class,xDesktop.getCurrentComponent())).getURL();
Great. Thank you! It works.

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


Re: [api-dev] setting OOo options

2005-03-11 Thread Stephan Wunderlich
Hi Jorge,
I'd like to write a macro setting some of OOo's options (Menu Tools-Options)
programatically. Can this be done?
So far, by means of recording a macro, I've just got to:
   dispatcher = createUnoService(com.sun.star.frame.DispatchHelper)
   dispatcher.executeDispatch(document, .uno:OptionsTreeDialog, , 0,
Array())
which displays the options dialog. I guess using the right command URLs might do
it, but I cannot find this sort of info in the docs.
most of the settings in this dialogue should be accessible through the 
configuration api, you might want to take a look at the corresponding 
developers guide chapter 
http://api.openoffice.org/docs/DevelopersGuide/Config/Config.htm

Hope that helps
Regards
Stephan
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [api-dev] How can I get the url of the currently opened document?

2005-03-11 Thread Tom Schindl
Ines Pfauch wrote:
On 11.03.2005, at 10:34, Tom Schindl wrote:
Sorry should have been  ((XModel)UnoRuntime.queryInterface 
(XModel.class,xDesktop.getCurrentComponent())).getURL();

Great. Thank you! It works.
It would be great if you would summerize this small thread which showed 
us not to use the MediaDescriptor.html#URL to retrieve the URL form a 
document but instead the XModel in a small and tiny codesnippet.

It's worth the time you saved by people helping to your solve problem ;-)

-
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]


Re: [api-dev] How can I get the url of the currently opened document?

2005-03-11 Thread Ines Pfauch
On 11.03.2005, at 11:10, Tom Schindl wrote:
It would be great if you would summerize this small thread which 
showed us not to use the MediaDescriptor.html#URL to retrieve the URL 
form a document but instead the XModel in a small and tiny 
codesnippet.

It's worth the time you saved by people helping to your solve problem 
;-)
OK. That is no problem. And thanks again for the help! :)
Here is the codesnippet for getting the url of a current opened 
document:

-- snip --
// XMultiComponentFactory xmcf = ...
// XComponentContext ctx = ...
Object desktop = 
xmcf.createInstanceWithContext(com.sun.star.frame.Desktop, ctx);
XDesktop xDesktop = 
(XDesktop)UnoRuntime.queryInterface(com.sun.star.frame.XDesktop.class, 
desktop);
XComponent document = xDesktop.getCurrentComponent();
XPropertySet documentProps = 
(XPropertySet)UnoRuntime.queryInterface(XPropertySet.class,document);
XModel xmodel = 
(XModel)UnoRuntime.queryInterface(XModel.class,document);
if (xmodel != null) String url = xmodel.getURL();
-- snap --



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


[api-dev] [code snippet] Drawing on Uno Dialogs

2005-03-11 Thread Paolo Mantovani
Hi,

I've grepped around in the Dev Guide in order to find some example of the use 
of com.sun.star.awtXGraphics but with no success.

After some testing I've learned how to draw some nice shapes :-) on a Uno 
Dialog and I've summarized my testing in the attached code snippet

ciao
Paolo M.








	drawing
	dialog
	listener
	com.sun.star.awt.XWindowPeer
	com.sun.star.awt.XDevice
	com.sun.star.awt.XGraphics
	com.sun.star.awt.XPaintListener



	Paolo Mantovani




	







Is it possible to draw lines or shapes (or text) directly on a Uno dialog ?



Yes, it is.
the com.sun.star.awt.XGraphics provide methods for drawing.
If you want your draw to be persistent you shall register an com.sun.star.awt.XPaintListener and place your drawing instructions in the method XPaintListener.windowPaint.
To see the whole thing at work, create an empty dialog in the OOBasic IDE and run the example code below:

REM  *  BASIC  *

Dim oDlg As Object
Dim oPaintListener As Object
Dim oDlgGraph As Object

__
Sub Main

	oDlg = CreateUnoDialog(DialogLibraries.Standard.Dialog1)
	oDlgGraph = oDlg.getPeer.createGraphics
	
	setup some defaults
	With oDlgGraph
		.setFillColor(RGB(255,255,255))
		.setLineColor(RGB(200,200,200))
	End With

	oPaintListener = CreateUnoListener(ThisDialog_, com.sun.star.awt.XPaintListener

	oDlg.addPaintListener( oPaintListener ) 
	oDlg.execute

	oDlg.removePaintListener( oPaintListener )
	
End Sub


__
 This is a good place for drawing instructions. 
 This routine is called whenever the dialof has to be repainted
Sub ThisDialog_windowPaint(oEvt)

	skip if there are other paint events in queue
	If oEvt.count  0 Then Exit Sub

	Dim oGrad As New com.sun.star.awt.Gradient
	With oGrad
		.Style = com.sun.star.awt.GradientStyle.LINEAR
		.StartColor = RGB( 255, 255, 255 )
		.EndColor = RGB( 200, 230, 230 )
		.Angle = 450  45.0 degrees
		.Border = 0
		.XOffset = 0
		.YOffset = 0
		.StartIntensity = 100
		.EndIntensity = 100
		.StepCount = 100
	End With

	nDlgWidth = oDlg.Peer.Size.Width
	nDlgHeight = oDlg.Peer.Size.Height
	
	draw something
	With oDlgGraph
		.drawGradient(0,0, 100,220, oGrad)
		.drawGradient(100,220, nDlgWidth,nDlgHeight, oGrad)
		.drawText(10,10,ciao a tutti)
		.DrawLine(100,0,100,nDlgHeight)
		.DrawLine(0,220,nDlgWidth,220)
	End With
	
	some nested rounded rect
	For I = 10 To 100 Step 10
	
		nX = 100 + I
		nY = 0 + I
		nWidth = nDlgWidth - 100 - 2*I
		nHeight = 220 - 2*I
		nRound = 110-I
		
		oDlgGraph.setFillColor(RGB(255-I, 255, 255-I))
		oDlgGraph.drawRoundedRect(nX, nY, nWidth, nHeight ,nRound, nRound)	
		
	Next I
	
	
End Sub

__
Sub ThisDialog_disposing(oEvt As Object)
	nothing to do 
End Sub







	Initial version




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

Re: [api-dev] [code snippet] Drawing on Uno Dialogs

2005-03-11 Thread Tom Schindl
Paolo Mantovani wrote:
Hi,
I've grepped around in the Dev Guide in order to find some example of the use 
of com.sun.star.awtXGraphics but with no success.

After some testing I've learned how to draw some nice shapes :-) on a Uno 
Dialog and I've summarized my testing in the attached code snippet

ciao
Paolo M.
http://codesnippets.services.openoffice.org/Office/Office.DrawingOnDialogs.snip
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [api-dev] [code snippet] Drawing on Uno Dialogs

2005-03-11 Thread Laurent Godard
Hi paolo
After some testing I've learned how to draw some nice shapes :-) on a Uno 
Dialog and I've summarized my testing in the attached code snippet

That's great !!!
I just tested and it offers nice ideas
As i didn't dig in this part of the api, do you think there is a way to 
modify the shap of the window itself

Laurent
--
Laurent Godard [EMAIL PROTECTED] - Ingénierie OpenOffice.org
Indesko  http://www.indesko.com
Nuxeo CPS  http://www.nuxeo.com - http://www.cps-project.org
Livre Programmation OpenOffice.org, Eyrolles 2004
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [api-dev] How can I get the url of the currently opened document?

2005-03-11 Thread Tom Schindl
Ines Pfauch wrote:
On 11.03.2005, at 11:10, Tom Schindl wrote:
It would be great if you would summerize this small thread which 
showed us not to use the MediaDescriptor.html#URL to retrieve the URL 
form a document but instead the XModel in a small and tiny codesnippet.

It's worth the time you saved by people helping to your solve problem ;-)

OK. That is no problem. And thanks again for the help! :)
Here is the codesnippet for getting the url of a current opened document:
-- snip --
// XMultiComponentFactory xmcf = ...
// XComponentContext ctx = ...
Object desktop = 
xmcf.createInstanceWithContext(com.sun.star.frame.Desktop, ctx);
XDesktop xDesktop = 
(XDesktop)UnoRuntime.queryInterface(com.sun.star.frame.XDesktop.class, 
desktop);
XComponent document = xDesktop.getCurrentComponent();
XPropertySet documentProps = 
(XPropertySet)UnoRuntime.queryInterface(XPropertySet.class,document);
XModel xmodel = (XModel)UnoRuntime.queryInterface(XModel.class,document);
if (xmodel != null) String url = xmodel.getURL();
-- snap --

I meant something like this :-)
http://codesnippets.services.openoffice.org/Office/Office.GetDocumentURL.snip


-
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]


Re: [api-dev] [code snippet] Drawing on Uno Dialogs

2005-03-11 Thread Paolo Mantovani
Hi Laurent,

Alle 12:20, venerdì 11 marzo 2005, Laurent Godard ha scritto:
 Hi paolo

  After some testing I've learned how to draw some nice shapes :-) on a Uno
  Dialog and I've summarized my testing in the attached code snippet

 That's great !!!
 I just tested and it offers nice ideas

 As i didn't dig in this part of the api, 
 do you think there is a way to   
 modify the shap of the window itself

I must admit that awt API's are quite obscure to me, and it's difficult to say 
what can be done and what cannot. 

Anyway, if I well remember, when I was playing with VB, peoples used some 
window API's to create shaped buttons or forms.

The trick was something like this:
- create a non rectangular region on the screen (Hwnd = 0) using intesection 
or union or elliptic regions
- set the region to a form (or control) using the API call setWindowRegion (or 
something similar)

Now, In the OOo API's there should be something similar because you can create 
and manipulate regions, for example:

 oRegion = oDlg.Peer.Toolkit.createRegion
 Dim aRect As New com.sun.star.awt.Rectangle
 aRect.Width = 100
 aRect.Height = 100
 
 oRegion.unionRectangle(aRect)

Unfortunately I've no idea if you can create a region from the screen and if 
you can set a region to a specified window, but maybe it worth some further 
investigations on this track.

ciao
Paolo M.


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



[api-dev] Search text and insert page break

2005-03-11 Thread Cristian Fonti
Hi to all,
I'm a newbie in Api Open Office programmation with Java.
I have a writer document, and i want to search a particular string, 
when i found it, i want to insert a PAGE BREAK.
How can i do it??
Mi first, and big problem is how to use the objects that the interface 
com.sun.star.util.XReplaceable returns when i use the method findAll...
Please someone help me!
Thanks
Dott. Cristian Fonti



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


Re: [api-dev] [code snippet] Drawing on Uno Dialogs

2005-03-11 Thread Laurent Godard
Hi paolo,
I must admit that awt API's are quite obscure to me, and it's difficult to say 
what can be done and what cannot. 

like for me
Anyway, if I well remember, when I was playing with VB, peoples used some 
window API's to create shaped buttons or forms.

The trick was something like this:
- create a non rectangular region on the screen (Hwnd = 0) using intesection 
or union or elliptic regions
- set the region to a form (or control) using the API call setWindowRegion (or 
something similar)

yesy, i did such games in my earlier years (created a stamp-like window 
with sinus and cosinus)

That's why i asked
Now, In the OOo API's there should be something similar because you can create 
and manipulate regions, for example:


Unfortunately I've no idea if you can create a region from the screen and if 
you can set a region to a specified window, but maybe it worth some further 
investigations on this track.

I'll try to have a look when some time
be patient , it may take weeks, months, years ;)
Thansk again Paolo for your snippet
Laurent
--
Laurent Godard [EMAIL PROTECTED] - Ingénierie OpenOffice.org
Indesko  http://www.indesko.com
Nuxeo CPS  http://www.nuxeo.com - http://www.cps-project.org
Livre Programmation OpenOffice.org, Eyrolles 2004
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [api-dev] [code snippet] Drawing on Uno Dialogs

2005-03-11 Thread Jürgen Schmidt
Hi,
yep, the awt API'S was deprecated in the past but in fact of a missing 
alternative we removed the deprecated flag. But you should not expect 
too much of this API.

- Juergen
Paolo Mantovani wrote:
Hi Laurent,
Alle 12:20, venerdì 11 marzo 2005, Laurent Godard ha scritto:
Hi paolo

After some testing I've learned how to draw some nice shapes :-) on a Uno
Dialog and I've summarized my testing in the attached code snippet
That's great !!!
I just tested and it offers nice ideas
As i didn't dig in this part of the api, 
do you think there is a way to   
modify the shap of the window itself

I must admit that awt API's are quite obscure to me, and it's difficult to say 
what can be done and what cannot. 

Anyway, if I well remember, when I was playing with VB, peoples used some 
window API's to create shaped buttons or forms.

The trick was something like this:
- create a non rectangular region on the screen (Hwnd = 0) using intesection 
or union or elliptic regions
- set the region to a form (or control) using the API call setWindowRegion (or 
something similar)

Now, In the OOo API's there should be something similar because you can create 
and manipulate regions, for example:

 oRegion = oDlg.Peer.Toolkit.createRegion
 Dim aRect As New com.sun.star.awt.Rectangle
 aRect.Width = 100
 aRect.Height = 100
 
 oRegion.unionRectangle(aRect)

Unfortunately I've no idea if you can create a region from the screen and if 
you can set a region to a specified window, but maybe it worth some further 
investigations on this track.

ciao
Paolo M.
-
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]


Re: [api-dev] How can I get the url of the currently opened document?

2005-03-11 Thread Christian Junker
Hi Tom, you don't need the line:
XPropertySet documentProps = (XPropertySet)
UnoRuntime.queryInterface(XPropertySet.class, document);

Thus the import of XPropertySet can be omitted, too.

On Fri, 11 Mar 2005 13:27:44 +0100, Tom Schindl [EMAIL PROTECTED] wrote:
 Ines Pfauch wrote:
  On 11.03.2005, at 11:10, Tom Schindl wrote:
 
  It would be great if you would summerize this small thread which
  showed us not to use the MediaDescriptor.html#URL to retrieve the URL
  form a document but instead the XModel in a small and tiny codesnippet.
 
  It's worth the time you saved by people helping to your solve problem ;-)
 
 
  OK. That is no problem. And thanks again for the help! :)
  Here is the codesnippet for getting the url of a current opened document:
 
  -- snip --
  // XMultiComponentFactory xmcf = ...
  // XComponentContext ctx = ...
  Object desktop =
  xmcf.createInstanceWithContext(com.sun.star.frame.Desktop, ctx);
  XDesktop xDesktop =
  (XDesktop)UnoRuntime.queryInterface(com.sun.star.frame.XDesktop.class,
  desktop);
  XComponent document = xDesktop.getCurrentComponent();
  XPropertySet documentProps =
  (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class,document);
  XModel xmodel = (XModel)UnoRuntime.queryInterface(XModel.class,document);
  if (xmodel != null) String url = xmodel.getURL();
  -- snap --
 
 
 I meant something like this :-)
 http://codesnippets.services.openoffice.org/Office/Office.GetDocumentURL.snip
 
 
 
 
 
  -
  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]
 
 


-- 
Best Regards
Christian Junker

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



Re: [api-dev] How can I get the url of the currently opened document?

2005-03-11 Thread Christian Junker
Hi Kai,
I tested this SB script...
code
Sub Main
odoc = thisComponent
odoc.storeAsURL(file:///C:/file1.sxw, Array())
msgbox odoc.getURL()
odoc.storeAsURL(file:///C:/file2.sxw, Array())
msgbox odoc.getURL()
End Sub
/code

and it does return the correct filenames.

On Fri, 11 Mar 2005 16:44:13 +0100, Kai Sommerfeld
[EMAIL PROTECTED] wrote:
 Hi,
 
   just a comment based on my personal experience with
 css.frame.XModel.getURL() implementation:
 
   The returned URL gets not updated after storing the document to a
 different name/location. I was told that it is best to use
 css.frame.XStorable.getLocation() in order to obtain the document's URL.
 XStorable is implemented by every OOo doc instance.
 
   Maybe somebody from the Framework team can comment on this.
 
 - Kai.
 
 Christian Junker wrote:
  Hi Tom, you don't need the line:
  XPropertySet documentProps = (XPropertySet)
  UnoRuntime.queryInterface(XPropertySet.class, document);
 
  Thus the import of XPropertySet can be omitted, too.
 
  On Fri, 11 Mar 2005 13:27:44 +0100, Tom Schindl [EMAIL PROTECTED] wrote:
 
 Ines Pfauch wrote:
 
 On 11.03.2005, at 11:10, Tom Schindl wrote:
 
 
 It would be great if you would summerize this small thread which
 showed us not to use the MediaDescriptor.html#URL to retrieve the URL
 form a document but instead the XModel in a small and tiny codesnippet.
 
 It's worth the time you saved by people helping to your solve problem ;-)
 
 
 OK. That is no problem. And thanks again for the help! :)
 Here is the codesnippet for getting the url of a current opened document:
 
 -- snip --
 // XMultiComponentFactory xmcf = ...
 // XComponentContext ctx = ...
 Object desktop =
 xmcf.createInstanceWithContext(com.sun.star.frame.Desktop, ctx);
 XDesktop xDesktop =
 (XDesktop)UnoRuntime.queryInterface(com.sun.star.frame.XDesktop.class,
 desktop);
 XComponent document = xDesktop.getCurrentComponent();
 XPropertySet documentProps =
 (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class,document);
 XModel xmodel = (XModel)UnoRuntime.queryInterface(XModel.class,document);
 if (xmodel != null) String url = xmodel.getURL();
 -- snap --
 
 I meant something like this :-)
 http://codesnippets.services.openoffice.org/Office/Office.GetDocumentURL.snip
 
 
 
 
 
 -
 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]
 
 
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


-- 
Best Regards
Christian Junker

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



Re: [api-dev] [code snippet] Drawing on Uno Dialogs

2005-03-11 Thread Laurent Godard
Hi Christian
Tom, or whoever is responsible that this codesnippet works, please
check the syntax before posting it online.
I quickly looked over it to see how Paolo managed to draw on a dialog,
but found this line
code
oPaintListener = CreateUnoListener(ThisDialog_,
com.sun.star.awt.XPaintListener
/code
There is no closing parenthesis.
- 
http://codesnippets.services.openoffice.org/Office/Office.DrawingOnDialogs.snip
That's really strange as i tested using copy/paste of the snippet page 
and didn't experience any error and it worked

i confirm that there is ) missing
really, a great magician, this Paolo ;)
Laurent
--
Laurent Godard [EMAIL PROTECTED] - Ingénierie OpenOffice.org
Indesko  http://www.indesko.com
Nuxeo CPS  http://www.nuxeo.com - http://www.cps-project.org
Livre Programmation OpenOffice.org, Eyrolles 2004
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [api-dev] [code snippet] Drawing on Uno Dialogs

2005-03-11 Thread Paolo Mantovani
Alle 16:44, venerdì 11 marzo 2005, Laurent Godard ha scritto:
 Hi Christian

  Tom, or whoever is responsible that this codesnippet works, please
  check the syntax before posting it online.
  I quickly looked over it to see how Paolo managed to draw on a dialog,
  but found this line
  code
  oPaintListener = CreateUnoListener(ThisDialog_,
  com.sun.star.awt.XPaintListener
  /code
  There is no closing parenthesis.
  -
  http://codesnippets.services.openoffice.org/Office/Office.DrawingOnDialog
 s.snip

 That's really strange as i tested using copy/paste of the snippet page
 and didn't experience any error and it worked

 i confirm that there is ) missing

 really, a great magician, this Paolo ;)

Don't blame me, it's the basic interpreter! :-)

http://qa.openoffice.org/issues/show_bug.cgi?id=17781

ciao
Paolo M.


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



Re: [api-dev] setting OOo options

2005-03-11 Thread Mathias Bauer
Jorge Marques Pelizzoni wrote:
 Hi, all!
 
 I'd like to write a macro setting some of OOo's options (Menu Tools-Options)
 programatically. Can this be done?
 
 So far, by means of recording a macro, I've just got to:
 
dispatcher = createUnoService(com.sun.star.frame.DispatchHelper)
dispatcher.executeDispatch(document, .uno:OptionsTreeDialog, , 0,
 Array())
 
 which displays the options dialog. I guess using the right command URLs might 
 do
 it, but I cannot find this sort of info in the docs.

That will not lead to any results. You have to use the configuration
API. You can find out more about it in the Developers Guide and maybe in
other sources. Additionally you must find out the configuration path
name of the setting you want to change.

Best regards,
Mathias

-- 
Mathias Bauer - OpenOffice.org Application Framework Project Lead
Please reply to the list only, [EMAIL PROTECTED] is a spam sink.


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



[api-dev] error exporting file

2005-03-11 Thread Chen, Yu
Had anyone seen the error below? Any ideas what could go wrong? I can
run the same program run on one box, but not the other w/ the following
error...   Thanks!


Connecting:
uno:socket,host=localhost,port=8200;urp;StarOffice.ServiceManager
Adding data props
Loading file:///home/yc119253/CoreCompetencies.sxi
storeToURL: /home/yc119253/result/CoreCompetencies.pdf
com.sun.star.io.IOException:
at
com.sun.star.lib.uno.environments.java.Proxy.invoke(Proxy.java:143)
at
com.sun.star.lib.sandbox.generic.DispatcherAdapterBase.invokeSec(DispatcherAdapterBase.java:91)
at
com.sun.star.lib.sandbox.generic.DispatcherAdapterBase.invokeV(DispatcherAdapterBase.java:145)
at
JSGencom_sun_star_frame_XStorablecom_sun_star_lib_uno_environments_java_Proxy.storeToURL(Unknown
Source)
at java.lang.reflect.Method.invoke(Native Method)
at
com.sun.star.lib.uno.environments.java.java_environment$HolderProxy.invoke(java_environment.java:163)
at
com.sun.star.lib.sandbox.generic.DispatcherAdapterBase.invokeSec(DispatcherAdapterBase.java:91)
at
com.sun.star.lib.sandbox.generic.DispatcherAdapterBase.invokeV(DispatcherAdapterBase.java:145)
at
JSGencom_sun_star_frame_XStorablecom_sun_star_lib_uno_environments_java_java_environment_HolderProxy.storeToURL(Unknown
Source)
at
com.intraspect.openoffice.utility.DocumentConverter.export(DocumentConverter.java:583)
at
com.intraspect.openoffice.utility.DocumentConverter.doConversion(DocumentConverter.java:374)
at
com.intraspect.openoffice.utility.DocumentConverter.main(DocumentConverter.java:798)
IOException: wrong parameter, or inproper filter type.
Adding data props



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



[api-dev] Up to date IDL and slots

2005-03-13 Thread Ian Laurenson
I would like to have up to date references for IDL and slots (for UNO
dispatch calls).

I have downloaded and extracted OOo_2.0beta_src.tar.gz but I can not
work out how to compile the IDL reference. Similarly, I can't work out
how to find what slots or UNO dispatch calls are available.

I would really appreciate being pointed in the right direction on how to
create this documentation.

Thanks, Ian Laurenson


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



Re: [api-dev] [code snippet] Drawing on Uno Dialogs

2005-03-14 Thread Tom Schindl
Paolo Mantovani wrote:
Hi Christian,
Alle 15:40, venerdì 11 marzo 2005, Christian Junker ha scritto:
Tom, or whoever is responsible that this codesnippet works, please
check the syntax before posting it online.
I quickly looked over it to see how Paolo managed to draw on a dialog,
but found this line
code
oPaintListener = CreateUnoListener(ThisDialog_,
com.sun.star.awt.XPaintListener
/code
There is no closing parenthesis.
-
http://codesnippets.services.openoffice.org/Office/Office.DrawingOnDialogs.
snip

Thank you for corrections.
...and shame on me!
I've attached an updated version of the snippet in the hope that Tom will 
upload it ASAP.

Done.
Tom

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


Re: [api-dev] Up to date IDL and slots

2005-03-14 Thread Christian Junker
Hi Ian,

it should be part of the odk module or sdk_oo, at least that's what it
used to be.
The API project page even tells us about the modules on its front page.
As for the slots (slots.sxc), I don't think it is part of the source code.

-- 
Best Regards
Christian Junker

On Mon, 14 Mar 2005 11:11:27 +1300, Ian Laurenson
[EMAIL PROTECTED] wrote:
 I would like to have up to date references for IDL and slots (for UNO
 dispatch calls).
 
 I have downloaded and extracted OOo_2.0beta_src.tar.gz but I can not
 work out how to compile the IDL reference. Similarly, I can't work out
 how to find what slots or UNO dispatch calls are available.
 
 I would really appreciate being pointed in the right direction on how to
 create this documentation.
 
 Thanks, Ian Laurenson
 
 -
 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]



Re: [api-dev] Search text and insert page break

2005-03-14 Thread Cristian Fonti
Hi,
Thank for the help,
i'm be able to do it, i use findFirst and findNext with TextRange, as 
you suggest to me!
I have only another question: in my program i use to import others 
documents (file RTF) in a new blank document, insertDocumentFromURL, all 
is ok, but, in the
new document, there are some rows white (i think some paragraph maybe...)
My code is:

XText xText = null;
XTextCursor TextCursor = nll;
.
xText = xTextDocument.getText();
xText.getStart();
TextCursor=xText.createTextCursor();
xd=(XDocumentInsertable) 
UnoRuntime.queryInterface(XDocumentInsertable.class,TextCursor);
xd.insertDocumentFromURL(file:///D:/Esempi/provaRTF.rtf,loadProps);

Why the system don't import form the TOP of the page??
Andrew Douglas Pitonyak ha scritto:
Hi Cristian,
I do all of my examples in Basic Sorry!
Cristian Fonti wrote:
Hi to all,
I'm a newbie in Api Open Office programmation with Java.
I have a writer document, and i want to search a particular string, 
when i found it, i want to insert a PAGE BREAK.

On my web site, I recently posted a font document that inserts a page 
break at every other instance that is found. You need to use the 
latest beta to read the document, but here is also a PDF version. My 
free macro document has examples of these things as well (there is a 
link in this email message).

How can i do it??

I recommend that first you do it in Basic and then translate it over 
at least until you become more proficient in the API. So, a simple 
test in Basic, and then move it over to Java for the complete program.

First, create the find descriptor. You can either do a Find All, as I 
did, or you can iterate through each found instance and use find next. 
The found object can be used as a text range, which has the ability to 
set the page break command. You start a new page by setting the 
paragraph page style. I usually set it to the value that it already 
has so that I do not change the page style. It is the act of setting 
the page style that causes a page break.

Mi first, and big problem is how to use the objects that the 
interface com.sun.star.util.XReplaceable returns when i use the 
method findAll...
Please someone help me!
Thanks
Dott. Cristian Fonti

If this is not a sufficient hint, please say so. I would post some 
small examples, but my wife tells me that it is time to go.

--
~~
Dott. Cristian Fonti
mailto: [EMAIL PROTECTED]
Centro Elaborazione Dati (CED) - Resp. Web Area
SCM Group S.p.a. http://www.scmgroup.com
via Emilia, 77 - 47900 Rimini (RN), Italy
Tel.: +39 0541 700163 Interno: 2163
~~ 

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


Re: [api-dev] [code snippet] Drawing on Uno Dialogs

2005-03-14 Thread Jürgen Schmidt
Kohei Yoshida wrote:
Hi Jürgen,
On Fri, 11 Mar 2005 15:56:37 +0100, Jürgen Schmidt
[EMAIL PROTECTED] wrote:
Hi,
yep, the awt API'S was deprecated in the past but in fact of a missing
alternative we removed the deprecated flag. But you should not expect
too much of this API.

Now does that imply that the awt API's will not be exteneded in the
future, or will it be replaced with a new set of dialog API's at some
point?
no, they will probably not extended and i hope that we will find an 
alternative (however it will look like) that it will be possible to 
implement own dialogs for extensions with the same look and feel as the 
rest of the office on all supported platforms. Easy to create (GUI 
editor, easy to handle (API), easy to deploy (with UNO packages), 
language independent, ... are only some of my wishes for the replacement ;-)

- Juergen
Kohei
-
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]


Re: [api-dev] Up to date IDL and slots

2005-03-14 Thread Jürgen Schmidt
Hi Ian,
an updated reference is part of the Beta SDK.
- Juergen
Ian Laurenson wrote:
I would like to have up to date references for IDL and slots (for UNO
dispatch calls).
I have downloaded and extracted OOo_2.0beta_src.tar.gz but I can not
work out how to compile the IDL reference. Similarly, I can't work out
how to find what slots or UNO dispatch calls are available.
I would really appreciate being pointed in the right direction on how to
create this documentation.
Thanks, Ian Laurenson
-
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]


Re: [api-dev] contributing to the SDK Example Collection

2005-03-14 Thread Jürgen Schmidt
Hi Paolo,
examples are always welcome.
Let me say some words to the SDK. In general i would like to reduce the 
examples in the SDK (e.g. remove redundant examples) and reduce the 
examples in the SDK to the DevGuide related samples + some bigger real 
life scenarios or complex examples. The reason for that is the QA effort 
 . On the other hand i would like to have a big example collection on 
the net. A good start was the code snippet base and of course a 
collection with complete examples (e.g. client applications, UNO 
packages) are also important and necessary. I hope that we can combine 
both things but maybe it is not possible.
We can at least create a section on api.openoffice.org where we can 
store the example code and maybe a binary version. The structure can 
similar to the code snippets and maybe we can reuse the code snippet 
mechanism to provide some info about the examples and can use this 
mechanisms to provide a well defined and structured access to the examples.
What do you think Tom, is it possible to reuse the code snippet work 
flow for complete examples?

- Juergen
Paolo Mantovani wrote:
Hi all,
I'm reading here:
http://api.openoffice.org/SDK/example_collection.html
-
Example Collection
[]
You can help us to improve this example collection by contributing own 
examples or code snippets.
-

I would like to contribute an example, not as simple code-snippet but a uno 
package.
Is this possible? how?

Thank you
Paolo M.
-
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]



Re: [api-dev] Up to date IDL and slots

2005-03-14 Thread Jürgen Schmidt
Hi Ian,
mmh, i thought that a Beta SDK was available!? The IDL reference for the 
SDK is built in the sdk_oo (using autodoc).

Creation of an usable overview of all slots (with some useful 
description) is as far as i know not so easy possible. I am not very 
familar with the dispatch API and the slots because i don't like it and 
always prefer the real UNO API where possible but i will investigate in 
the creation of a usable slot documentation.

- Juergen
Ian Laurenson wrote:
On Mon, 2005-03-14 at 22:42, Jürgen Schmidt wrote:
an updated reference is part of the Beta SDK.

But where can I get the Beta SDK from?
It would be useful information to know how to compile the IDL
documentation, and how to find out what slots/uno dispatch commands are
available.
Thanks, Ian
-
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]


Re: [api-dev] [code snippet] Drawing on Uno Dialogs

2005-03-14 Thread Kohei Yoshida
On Mon, 14 Mar 2005 10:28:26 +0100, Jürgen Schmidt
[EMAIL PROTECTED] wrote:
 Kohei Yoshida wrote:
  Hi Jürgen,
 
  On Fri, 11 Mar 2005 15:56:37 +0100, Jürgen Schmidt
  [EMAIL PROTECTED] wrote:
 
 Hi,
 
 yep, the awt API'S was deprecated in the past but in fact of a missing
 alternative we removed the deprecated flag. But you should not expect
 too much of this API.
 
 
  Now does that imply that the awt API's will not be exteneded in the
  future, or will it be replaced with a new set of dialog API's at some
  point?
 
 no, they will probably not extended and i hope that we will find an
 alternative (however it will look like) that it will be possible to
 implement own dialogs for extensions with the same look and feel as the
 rest of the office on all supported platforms. Easy to create (GUI
 editor, easy to handle (API), easy to deploy (with UNO packages),
 language independent, ... are only some of my wishes for the replacement ;-)

Speaking of wishes... ;-)

It would be cool to have an API compatible to Swing API.  That way for
Java coders the migration effort is nearly zero, and even for non-Java
coders, the migration toward Java Swing after UNO (if they so desire)
would be relatively painless.

The rest of the UNO API already looks like Java API anyway, so it only
makes sense.

Just my wishful thinking. ;-)

Kohei

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



Re: [api-dev] Problem with insertDocumentFromURL

2005-03-15 Thread Cristian Fonti

Andrew Douglas Pitonyak ha scritto:
Cristian Fonti wrote:
Hi to all,
i have a problem using the method insertDocumentFromURL:  when i use 
it to insert some formatted text (font size, font color,etc...) from 
another document, in the destination file appear at the top of the 
document 2-3 blank row... the code snipplets is:

xTextDocument = 
(XTextDocument)UnoRuntime.queryInterface(XTextDocument.class, 
xcomponent);
xText = xTextDocument.getText();
TextCursor=xText.createTextCursor();
xd=(XDocumentInsertable) 
UnoRuntime.queryInterface(XDocumentInsertable.class,TextCursor);
xd.insertDocumentFromURL(file:///C:/file1.rtf,loadProps);
TextCursor=xText.createTextCursor();
xd=(XDocumentInsertable) 
UnoRuntime.queryInterface(XDocumentInsertable.class,TextCursor);
xd.insertDocumentFromURL(file:///C:/file2.rtf,loadProps);

If i add 3,4,5,6 documents the number of white rows increase...
Please someone help me
Thanks
Cristian Fonti

I ran the following test:
 Dim sURL$
 Dim oText
 Dim oCurs
 sURL = file:///andrew0/home/andy/film.txt
 oText = ThisComponent.getText()
 oCurs = oText.createTextCursor()
 oCurs.gotoStart(False)
 oCurs.insertDocumentFromURL(sURL, Array())
The film.txt file, contains NO extra spaces. I did NOT see the 
problems that you mention.
Notice that I did use the 2.0 Beta.
I suspect that margins from the RTF file are inserted, but this is 
ONLY a guess. What happens with your code when you sue text files with 
NO top or bottom margins?

To correct the problem, i have insert 
TextCursor.gotoEnd(false);
after the insertDocumentFromURL

Another Question: it's possibile to insert some text (a string) between 
two documents RTF that i import with insertDocumentFromURL
Thanks
Cristian Fonti

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


Re: [api-dev] Problem with insertDocumentFromURL

2005-03-15 Thread Mathias Bauer
Cristian Fonti wrote:
 Hi to all,
 i have a problem using the method insertDocumentFromURL:  when i use it 
 to insert some formatted text (font size, font color,etc...) from 
 another document, in the destination file appear at the top of the 
 document 2-3 blank row... the code snipplets is:
 
  xTextDocument = 
 (XTextDocument)UnoRuntime.queryInterface(XTextDocument.class, xcomponent);
  xText = xTextDocument.getText();
  TextCursor=xText.createTextCursor();
  xd=(XDocumentInsertable) 
 UnoRuntime.queryInterface(XDocumentInsertable.class,TextCursor);
  xd.insertDocumentFromURL(file:///C:/file1.rtf,loadProps);
  TextCursor=xText.createTextCursor();
  xd=(XDocumentInsertable) 
 UnoRuntime.queryInterface(XDocumentInsertable.class,TextCursor);
  xd.insertDocumentFromURL(file:///C:/file2.rtf,loadProps);
 
 If i add 3,4,5,6 documents the number of white rows increase...

First you should check if the same happens when you insert the file from
the GUI. In that case you could file and issue against the Writer
component. Otherwise I hope that a Writer API expert has an idea what is
going wrong.

Best regards,
Mathias

-- 
Mathias Bauer - OpenOffice.org Application Framework Project Lead
Please reply to the list only, [EMAIL PROTECTED] is a spam sink.


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



Re: [api-dev] Up to date IDL and slots

2005-03-15 Thread Mathias Bauer
Christian Junker wrote:
 Hi Ian,
 
 it should be part of the odk module or sdk_oo, at least that's what it
 used to be.
 The API project page even tells us about the modules on its front page.
 As for the slots (slots.sxc), I don't think it is part of the source code.

... and it needs an update for OOo2.0. Will be done pretty soon.

Best regards,
Mathias

-- 
Mathias Bauer - OpenOffice.org Application Framework Project Lead
Please reply to the list only, [EMAIL PROTECTED] is a spam sink.



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



Re: [api-dev] contributing to the SDK Example Collection

2005-03-15 Thread Tom Schindl
Jürgen Schmidt wrote:
Hi Paolo,
[...]
What do you think Tom, is it possible to reuse the code snippet work 
flow for complete examples?

- Juergen

Yes to some extend. I need more time to think about it more thoroughly. 
I'll come up with something it the next days. I think we should try to 
bring this altougheter with the IDE-Plugin(e.g. Eclipse), Codesnippets, 
Example-Collection and finally the addon-manager.

I think we should start with an requirements definition what we would 
like to handle. This new and fabulous DevCenter I think of which 
includes everything to help people create things for OpenOffice :-)

Should we open an issue for this?
Tom
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [api-dev] [code snippet] Property Browser Controller

2005-03-15 Thread Laurent Godard
Hi Paolo,
That's great
Thanks for feeding us with such intrresting things
a question about dealing with framles and windows.
Do you have an idea how to make a windows dockable as the stylist or the 
navigator ?

Thanks again for the snippet
Laurent
--
Laurent Godard [EMAIL PROTECTED] - Ingénierie OpenOffice.org
Indesko  http://www.indesko.com
Nuxeo CPS  http://www.nuxeo.com - http://www.cps-project.org
Livre Programmation OpenOffice.org, Eyrolles 2004
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [api-dev] [code snippet] Property Browser Controller

2005-03-15 Thread Tom Schindl
Paolo Mantovani wrote:
Hi Tom,
Alle 11:09, martedì 15 marzo 2005, Tom Schindl ha scritto:
Hi Paolo,
Paolo Mantovani wrote:
[...]
For Tom:
I've tried to use the new extensions:
{see $IDL_Reference}
{link $IDL_Reference}
I hope to have done it correctly, but please, have a look before to put
the snippet in the repository.
the new Linking feature is looks really nice with your snippet. Great
job Paolo.
http://codesnippets.services.openoffice.org/Office/Office.PropertyBrowserCo
ntroller.snip

Thank you Tom, but perhaps I misunderstood something, because there's a 
problem with API constants and enums.

For example:
{see com.sun.star.awt.WindowClass.TOP}
is converted as
http://api.openoffice.org/docs/common/ref/com/sun/star/awt/WindowClass/TOP.html
that results uncorrect.
I see two solutions:
1) modify the snippet source - f.e.:
{see com.sun.star.awt.WindowClass}.TOP
Not good. See below.
2) modify the engine on your side to recognize and cut the UPPER ending part 
before to build the link

Great catch Paolo haven't looked that exactly i must admit and haven't 
thought about this when creating the linking stuff. To be more reusable 
for other codesnippet pages (as already said I want to release the 
snippet-page as a standalone application which can be used by any 
OS-project around the world).

The reference to attributes and methods is now the following:
[EMAIL PROTECTED] com.sun.star.awt.WindowAttribute/BORDER} this translates into:
a href=https://.../com/sun/star/awt/WindowAttribute.html#BORDER; 
style=color: inherit 
target=_newcom.sun.star.awt.WindowAttribute.BORDER/a

I wanted to use the # instead of / but that interfered with my 
syntax-highlighter (in some languages a # has a meaning where as / is 
used in almost all languages as an operator and thus is not 
highlighted). Any other suggestions are welcome :-)

I have updated your snippet already please take a look at it.
http://codesnippets.services.openoffice.org/Office/Office.PropertyBrowserController.snip
Tom
let me know
Ciao
Paolo M


-
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]


Re: [api-dev] [code snippet] Property Browser Controller

2005-03-15 Thread Jürgen Schmidt
Hi Tom,
Tom Schindl wrote:
Paolo Mantovani wrote:
Hi Tom,
Alle 11:09, martedì 15 marzo 2005, Tom Schindl ha scritto:
Hi Paolo,
Paolo Mantovani wrote:

[...]
For Tom:
I've tried to use the new extensions:
{see $IDL_Reference}
{link $IDL_Reference}
I hope to have done it correctly, but please, have a look before to put
the snippet in the repository.

the new Linking feature is looks really nice with your snippet. Great
job Paolo.
http://codesnippets.services.openoffice.org/Office/Office.PropertyBrowserCo 

ntroller.snip

Thank you Tom, but perhaps I misunderstood something, because there's 
a problem with API constants and enums.

For example:
{see com.sun.star.awt.WindowClass.TOP}
is converted as
http://api.openoffice.org/docs/common/ref/com/sun/star/awt/WindowClass/TOP.html 

that results uncorrect.
I see two solutions:
1) modify the snippet source - f.e.:
{see com.sun.star.awt.WindowClass}.TOP

Not good. See below.
2) modify the engine on your side to recognize and cut the UPPER 
ending part before to build the link

Great catch Paolo haven't looked that exactly i must admit and haven't 
thought about this when creating the linking stuff. To be more reusable 
for other codesnippet pages (as already said I want to release the 
snippet-page as a standalone application which can be used by any 
OS-project around the world).

The reference to attributes and methods is now the following:
[EMAIL PROTECTED] com.sun.star.awt.WindowAttribute/BORDER} this translates into:
a href=https://.../com/sun/star/awt/WindowAttribute.html#BORDER; 
style=color: inherit 
target=_newcom.sun.star.awt.WindowAttribute.BORDER/a

only a minor comment. For me [EMAIL PROTECTED] 
com.sun.star.awt.windowAttribute:BORDER} would be more natural. I can't 
say why but i would prefer to use a ':' instead of '/' to identify 
members of a type (methods, properties, ...).
Maybe because we use the same notation in the DevGuide ;-)

- Juergen

I wanted to use the # instead of / but that interfered with my 
syntax-highlighter (in some languages a # has a meaning where as / is 
used in almost all languages as an operator and thus is not 
highlighted). Any other suggestions are welcome :-)

I have updated your snippet already please take a look at it.
http://codesnippets.services.openoffice.org/Office/Office.PropertyBrowserController.snip 

Tom
let me know
Ciao
Paolo M


-
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]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


[api-dev] TabStop

2005-03-15 Thread Cristian Fonti
Hi,
Someone can help me in the implementation of TabStop with Java and the 
OOo Api??
Thank to all.
Cristian Fonti



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


[api-dev] TabStop...

2005-03-15 Thread Cristian Fonti
Sorry for the similar message,
but the first was wrong.
I use this code to create 2 tabStop:
TabStop tb[]=new TabStop[2];
 tb[0]=new TabStop();
 tb[0].Position=8500;
 tb[0].Alignment=com.sun.star.style.TabAlign.CENTER;
 tb[1]=new TabStop();
 tb[1].Position=17000;
 tb[1].Alignment=com.sun.star.style.TabAlign.RIGHT;
 xCursorProps.setPropertyValue(ParaTabStops,tb);
Now, how can i go in the tabstop(like using the key tab)
I use this code, but nothing (but no error):
XTextCursor xt = 
(XTextCursor)UnoRuntime.queryInterface(XTextCursor.class,tb[0]);
XText xTextheader = (XText) UnoRuntime.queryInterface(XText.class, 
xPropertySetStyle.getPropertyValue(HeaderText));
xTextheader.insertString(xt, CENTER TEXT IN THE HEADER,false);

Thanks to all...
Cristian Fonti
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [api-dev] [code snippet] Property Browser Controller

2005-03-15 Thread Paolo Mantovani
Alle 12:25, martedì 15 marzo 2005, Laurent Godard ha scritto:
 Hi Paolo,

 That's great
 Thanks for feeding us with such intrresting things

 a question about dealing with framles and windows.
 Do you have an idea how to make a windows dockable as the stylist or the
 navigator ?

I'm trying from years! but with any success ;-(
No sorry no idea...

some strange things can probably be done with the _beamer :

Open the datasource (F4)
in the OOBasic IDE add a new dialog and run the following code:

-
REM  *  BASIC  *

Sub Main
 oFrames = ThisComponent.CurrentController.Frame.getFrames
 
 For I = 0 To oFrames.Count - 1
  
  oFrame = oFrames.getByIndex(I)
  if oFrame.Name = _beamer Then
 ' Create the Property Browser Controller
 oPropBrowser = 
CreateUnoService(com.sun.star.form.PropertyBrowserController)
 oPropBrowser.attachFrame(oFrame)

 ' Retrieve an UNO Control Model
 oDlg = CreateUnoDialog(DialogLibraries.Standard.Dialog1)
 oCtrlModel = oDlg.getModel
 
 'also Form Controls works well(obvious)
 '   oCtrlModel = ThisComponent.DrawPage.Forms.Standard.PushButton
 
 ' Show Control properties in the browser
 oPropBrowser.introspectedObject = oCtrlModel
 
  End If
 Next I

End Sub
-

Unfortunately, I've not been able to attach the beamer to the controller of a 
normal document.
This would be very nice but causes ooo to close without any messages.


ciao
Paolo M.








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



Re: [api-dev] Problem with insertDocumentFromURL

2005-03-15 Thread Andrew Douglas Pitonyak

Cristian Fonti wrote:

Andrew Douglas Pitonyak ha scritto:
Cristian Fonti wrote:
Hi to all,
i have a problem using the method insertDocumentFromURL:  when i use 
it to insert some formatted text (font size, font color,etc...) from 
another document, in the destination file appear at the top of the 
document 2-3 blank row... the code snipplets is:

xTextDocument = 
(XTextDocument)UnoRuntime.queryInterface(XTextDocument.class, 
xcomponent);
xText = xTextDocument.getText();
TextCursor=xText.createTextCursor();
xd=(XDocumentInsertable) 
UnoRuntime.queryInterface(XDocumentInsertable.class,TextCursor);
xd.insertDocumentFromURL(file:///C:/file1.rtf,loadProps);
TextCursor=xText.createTextCursor();
xd=(XDocumentInsertable) 
UnoRuntime.queryInterface(XDocumentInsertable.class,TextCursor);
xd.insertDocumentFromURL(file:///C:/file2.rtf,loadProps);

If i add 3,4,5,6 documents the number of white rows increase...
Please someone help me
Thanks
Cristian Fonti

I ran the following test:
 Dim sURL$
 Dim oText
 Dim oCurs
 sURL = file:///andrew0/home/andy/film.txt
 oText = ThisComponent.getText()
 oCurs = oText.createTextCursor()
 oCurs.gotoStart(False)
 oCurs.insertDocumentFromURL(sURL, Array())
The film.txt file, contains NO extra spaces. I did NOT see the 
problems that you mention.
Notice that I did use the 2.0 Beta.
I suspect that margins from the RTF file are inserted, but this is 
ONLY a guess. What happens with your code when you sue text files 
with NO top or bottom margins?

To correct the problem, i have insert TextCursor.gotoEnd(false);
after the insertDocumentFromURL
Another Question: it's possibile to insert some text (a string) 
between two documents RTF that i import with insertDocumentFromURL
Thanks
Cristian Fonti
Use something similar to the following:
oCursor.getText().insertString(oCursor, text to insert, False)
--
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.sxw
My Macro Book: http://www.hentzenwerke.com/catalog/oome.htm
Free Info:  http://www.pitonyak.org/oo.php
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [api-dev] setting OOo options

2005-03-15 Thread Markus Plessing
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Jorge Marques Pelizzoni wrote:
| Hi, all!
|
| I'd like to write a macro setting some of OOo's options (Menu
| Tools-Options) programatically. Can this be done?
|
| So far, by means of recording a macro, I've just got to:
|
| dispatcher =
| createUnoService(com.sun.star.frame.DispatchHelper)
| dispatcher.executeDispatch(document, .uno:OptionsTreeDialog,
| , 0, Array())
|
| which displays the options dialog. I guess using the right
| command URLs might do it, but I cannot find this sort of info in
| the docs.
Hi, i've written some time ago a macro that creates a datasource
with values taken from a drawing designed as a form.
Danny Brewer also did an example to alter some Settings.
I'm sure you will find other appropriate examples at
http://www.ooomacros.org/
Maybe you can get a short view into the way of doing changes to
the OpenOffice - Options. Most of the names of the services can
be retrieved out of the xml-files where the Options will be saved.
They are located at OOoPath/share/registry/data/org/openoffice/
Have a look at the structure of these xml-files.
The code without the form-handlings:
Sub CreateDataSource (cDatabaseURL, cDatabaseUser, cDriverClass,
cDatabaseName)
Dim oContext as object, oNewSource as object
Dim InfoProperties(4) as New com.sun.star.beans.PropertyValue
~   'Get database context
~   oContext = createUnoService(com.sun.star.sdb.DatabaseContext)
~   'Create new data source instance
~   oNewSource = oContext.createInstance()
~   'Set up parameters
~   'URL includes type of database (MySQL, ODBC, spreadsheet, etc).
This is as it appears
~   'in the Data Source URL box of the Data Source Administration
dialogue
~   oNewSource.URL = cDatabaseURL
~   'Password required?
~   oNewSource.IsPasswordRequired = True
~   'User name
~   oNewSource.User = cDatabaseUser
~   ' THe InfoProperties are located in subnotes of the DataSource Node
~   ' We're not able to create them via the createInstance-method
~   InfoProperties(0).Name = AutoIncrementCreation
~   InfoProperties(0).Value = 
~   InfoProperties(1).Name = AutoRetrievingStatement
~   InfoProperties(1).Value = 
~   InfoProperties(2).Name = EnableSQL92Check
~   InfoProperties(2).Value = False
~   InfoProperties(3).Name = IsAutoRetrievingEnabled
~   InfoProperties(3).Value = False
~   InfoProperties(4).Name = JavaDriverClass
~   InfoProperties(4).Value = cDriverClass
~   oNewSource.Info = InfoProperties()
~   'Register new data source. First parameter is data source name, as
it will appear
~   'in the Data Source Administration dialogue, second one is the
complete Information
~   'in the node
~   oContext.RegisterObject (cDatabaseName, oNewSource)
End Sub
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.5 (GNU/Linux)
iD8DBQFCN+IraXgUt+wiTuERAr4GAKCkG0lrbhlBkjiMBWiMCOxpCSyy5ACeOi/2
eBz/lT2Ve99fQcO2RR7iRgE=
=vH1u
-END PGP SIGNATURE-
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [api-dev] Problem with insertDocumentFromURL

2005-03-16 Thread Cristian Fonti
Andrew Douglas Pitonyak ha scritto:

Cristian Fonti wrote:

Andrew Douglas Pitonyak ha scritto:
Cristian Fonti wrote:
Hi to all,
i have a problem using the method insertDocumentFromURL:  when i 
use it to insert some formatted text (font size, font color,etc...) 
from another document, in the destination file appear at the top of 
the document 2-3 blank row... the code snipplets is:

xTextDocument = 
(XTextDocument)UnoRuntime.queryInterface(XTextDocument.class, 
xcomponent);
xText = xTextDocument.getText();
TextCursor=xText.createTextCursor();
xd=(XDocumentInsertable) 
UnoRuntime.queryInterface(XDocumentInsertable.class,TextCursor);
xd.insertDocumentFromURL(file:///C:/file1.rtf,loadProps);
TextCursor=xText.createTextCursor();
xd=(XDocumentInsertable) 
UnoRuntime.queryInterface(XDocumentInsertable.class,TextCursor);
xd.insertDocumentFromURL(file:///C:/file2.rtf,loadProps);

If i add 3,4,5,6 documents the number of white rows increase...
Please someone help me
Thanks
Cristian Fonti


I ran the following test:
 Dim sURL$
 Dim oText
 Dim oCurs
 sURL = file:///andrew0/home/andy/film.txt
 oText = ThisComponent.getText()
 oCurs = oText.createTextCursor()
 oCurs.gotoStart(False)
 oCurs.insertDocumentFromURL(sURL, Array())
The film.txt file, contains NO extra spaces. I did NOT see the 
problems that you mention.
Notice that I did use the 2.0 Beta.
I suspect that margins from the RTF file are inserted, but this is 
ONLY a guess. What happens with your code when you sue text files 
with NO top or bottom margins?

To correct the problem, i have insert TextCursor.gotoEnd(false);
after the insertDocumentFromURL
Another Question: it's possibile to insert some text (a string) 
between two documents RTF that i import with insertDocumentFromURL
Thanks
Cristian Fonti

Use something similar to the following:
oCursor.getText().insertString(oCursor, text to insert, False)
I try, but so the text to insert is append at the end of the document 
after all the RTF and not between them...
The code is like this: [docs is an array of documentURL]

 for (int i=0;idocs.length;i++) {
   TextCursor=xText.createTextCursor();
   xd=(XDocumentInsertable) 
UnoRuntime.queryInterface(XDocumentInsertable.class,TextCursor);
   xd.insertDocumentFromURL(docs[i],loadProps);
   TextCursor.gotoEnd(false);
   
TextCursor.getText().insertString(TextCursor,-,false);

}

Thanks to all...
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [api-dev] Test: Undeliverable Mails von der Liste?

2005-03-16 Thread Markus Plessing
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Nochmal Hallo,
| Hallo,
|
| dies soll ein Test sein, da ich gerade auf eine Mail, die ich an
| die Liste geschickt habe 5 Undeliverable Mail-Meldungen
| zurückbekommen habe mit meiner Nachricht, die aber auf der Liste
| bereits angekommen ist, als Anhang.
|
| Die Adressen waren:
|
| [EMAIL PROTECTED] [EMAIL PROTECTED]
| [EMAIL PROTECTED] [EMAIL PROTECTED]
| [EMAIL PROTECTED]
|
| Mal sehen ob das bei jeder Mail an die Liste so ist, bei anderen
| Empfängern kamen bisher zumindest keine Mails zurück ;) Ich kann
| jetzt natürlich nicht warten bis ich wieder jemandem antworte,
| deshalb dieser Test.
|
| Grüße
|
| Markus
Selbes Spiel.
Kann sich jemand denken woran das liegt?
Markus
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.5 (GNU/Linux)
iD8DBQFCN/q4aXgUt+wiTuERAni6AKCWDkpm7B8J8m2QFvQxKVjg1sORMQCfcQax
y2Vyw4/eFHzRRiWlEhHYhwQ=
=FvlD
-END PGP SIGNATURE-
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [api-dev] Test: Undeliverable Mails von der Liste?

2005-03-16 Thread Tom Schindl
yes. because your mail-header includes
-8-
...
Errors-To: [EMAIL PROTECTED]
...
-8-
I'm not sure who is inserting this header but maybe check your 
mail-client. Other mails do not include this header thus don't receive 
these messages ;-)

Tom
Markus Plessing wrote:
Nochmal Hallo,
| Hallo,
|
| dies soll ein Test sein, da ich gerade auf eine Mail, die ich an
| die Liste geschickt habe 5 Undeliverable Mail-Meldungen
| zurückbekommen habe mit meiner Nachricht, die aber auf der Liste
| bereits angekommen ist, als Anhang.
|
| Die Adressen waren:
|
| [EMAIL PROTECTED] [EMAIL PROTECTED]
| [EMAIL PROTECTED] [EMAIL PROTECTED]
| [EMAIL PROTECTED]
|
| Mal sehen ob das bei jeder Mail an die Liste so ist, bei anderen
| Empfängern kamen bisher zumindest keine Mails zurück ;) Ich kann
| jetzt natürlich nicht warten bis ich wieder jemandem antworte,
| deshalb dieser Test.
|
| Grüße
|
| Markus
Selbes Spiel.
Kann sich jemand denken woran das liegt?
Markus
-
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]


Re: [api-dev] Create a blank sheet into a clac document

2005-03-16 Thread Niklas Nebel
babar wrote:
I would like to know how to create a newblank sheet into an existing
spreadsheet document, I'm using basic language for now.
I've tried to use (and first understand ;) this :
http://codesnippets.services.openoffice.org/Calc/Calc.CopySheet.snip
Inserting a blank sheet is much easier than that. Just use 
insertNewByName from the XSpreadsheets interface, in Basic it's 
something like
oDoc.Sheets.insertNewByName(new,0)

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


Re: [api-dev] Test: Undeliverable Mails von der Liste?

2005-03-16 Thread Markus Plessing
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hello Tom, *,
| yes. because your mail-header includes
|
| -8- ... Errors-To:
| [EMAIL PROTECTED] ...
| -8-
[...]
|
| I'm not sure who is inserting this header but maybe check your
| mail-client. Other mails do not include this header thus don't
| receive these messages ;-)
Ok, to be official replying in english now ;-)
Obviously this header-entry is inserted by the smtp-server we use.
Untill now, nobody was able to switch this config off ...
Well, using another smtp-server solved the problem for me :-)
Thanks Tom,
Markus
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.5 (GNU/Linux)
iD8DBQFCOAPDaXgUt+wiTuERAh/0AJ4osMVc6mQKbNHrSGjUKJK/jPloaACgwA3G
npLS2usn8xw5jem9hoSBO6k=
=AH/E
-END PGP SIGNATURE-
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [api-dev] Create a blank sheet into a clac document

2005-03-16 Thread Tom Schindl
Nevertheless the snippet is now working with copy and paste.
http://codesnippets.services.openoffice.org/Calc/Calc.CopySheet.snip
Tom
Niklas Nebel wrote:
babar wrote:
I would like to know how to create a newblank sheet into an existing
spreadsheet document, I'm using basic language for now.
I've tried to use (and first understand ;) this :
http://codesnippets.services.openoffice.org/Calc/Calc.CopySheet.snip

Inserting a blank sheet is much easier than that. Just use 
insertNewByName from the XSpreadsheets interface, in Basic it's 
something like
oDoc.Sheets.insertNewByName(new,0)

Niklas
-
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]


Re: [api-dev] Closing a Document

2005-03-16 Thread Tom Schindl
I'm not completely sure but I think you have to register a terminate 
listener like this:

http://api.openoffice.org/docs/DevelopersGuide/OfficeDev/OfficeDev.htm#1+1+2+Using+the+Desktop
Only a wild guess though.
Tom
Ines Pfauch wrote:
Hi
I just searched the mailing list archive for a method to close an open 
document. I found something with XStoreable - close and XComponent - 
dispose. I tried it, but the whole OOo window closes. But I need the OOo 
window opened, and just want to close the document within the window... 
How can I do this?

Thanks in Advance
-
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]


[api-dev] How to protect from disposed exception?

2005-03-16 Thread Bob Crothers








Hi,



We have a multi-threaded Java environment. We are using
OpenOffice.org 1.1.3. There are times when we make a series of UNO calls
(mostly setting properties, save, and call macros) and also get a series of
exceptions. The exceptions follow: 



com.sun.star.lib.uno.protocols.urp.Unmarshal.readboolean -
unexpected:java.io.EOFException

com.sun.star.io.IOException: java.net.SocketException: Socket
closed

java_remote_bridge
[EMAIL PROTECTED] is disposed



How can we defend against these exceptions?



Thanks

Bob Crothers












Re: [api-dev] TabStop...

2005-03-16 Thread Michael Hoennig
Hi Cristian,

 Now, how can i go in the tabstop(like using the key tab)

Just use a TAB (ASCII 9) in your string.  Too simple?

  XTextCursor xt = 
 (XTextCursor)UnoRuntime.queryInterface(XTextCursor.class,tb[0]);

Here you query an XTextCursorfrom a TabStop struct? That should throw an
exception or at least return null, don't know the UNO spec for the case
where queryInterface is used on a non interface.

  XText xTextheader = (XText) UnoRuntime.queryInterface(XText.class, 
 xPropertySetStyle.getPropertyValue(HeaderText));
  xTextheader.insertString(xt, CENTER TEXT IN THE
  HEADER,false);

And this should at latest throw a null pointer exception.  It does not?

Michael

-- 
Michael Hoennig [EMAIL PROTECTED]
project lead OpenOffice.org API
http://api.openoffice.org

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



Re: [api-dev] How to protect from disposed exception?

2005-03-16 Thread Thomas Schindl
Hi,

I don't know if these exceptions are related to that but OO is not thread
save thus you have to serialize calls to it in your java-app.

Tom

 Hi,
  
 We have a multi-threaded Java environment. We are using OpenOffice.org
 1.1.3. There are times when we make a series of UNO calls (mostly
 setting properties, save, and call macros) and also get a series of
 exceptions. The exceptions follow: 
  
 com.sun.star.lib.uno.protocols.urp.Unmarshal.readboolean -
 unexpected:java.io.EOFException
 com.sun.star.io.IOException: java.net.SocketException: Socket closed
 java_remote_bridge
 [EMAIL PROTECTED] is
 disposed
  
 How can we defend against these exceptions?
  
 Thanks
 Bob Crothers
  
  
 

-- 
SMS bei wichtigen e-mails und Ihre Gedanken sind frei ...
Alle Infos zur SMS-Benachrichtigung: http://www.gmx.net/de/go/sms

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



Re: [api-dev] [code snippet] Drawing on Uno Dialogs

2005-03-16 Thread Michael Hoennig
Hi Kohei,

  no, they will probably not extended and i hope that we will find an
  alternative (however it will look like) that it will be possible to
  implement own dialogs for extensions with the same look and feel as
  the rest of the office on all supported platforms. Easy to create (GUI
  editor, easy to handle (API), easy to deploy (with UNO packages),
  language independent, ... are only some of my wishes for the
  replacement ;-)
 
 Speaking of wishes... ;-)
 
 It would be cool to have an API compatible to Swing API.  That way for
 Java coders the migration effort is nearly zero, and even for non-Java
 coders, the migration toward Java Swing after UNO (if they so desire)
 would be relatively painless.

I would like to see Swing itself be integrated.  Of course, that only
works for Java.  This needed two issues fixed:

1st: A portable and official way of adding Swing components to non-Java
parent windows.

2nd: Getting the OOo and Swing look and feel the same for the different
planforms.

Michael


-- 
Michael Hoennig [EMAIL PROTECTED]
project lead OpenOffice.org API
http://api.openoffice.org

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



Re: [api-dev] [code snippet] Drawing on Uno Dialogs

2005-03-16 Thread Thomas Schindl
Hi,

would it be easier to use SWT?

Tom

 Hi Kohei,
 
   no, they will probably not extended and i hope that we will find an
   alternative (however it will look like) that it will be possible to
   implement own dialogs for extensions with the same look and feel as
   the rest of the office on all supported platforms. Easy to create (GUI
   editor, easy to handle (API), easy to deploy (with UNO packages),
   language independent, ... are only some of my wishes for the
   replacement ;-)
  
  Speaking of wishes... ;-)
  
  It would be cool to have an API compatible to Swing API.  That way for
  Java coders the migration effort is nearly zero, and even for non-Java
  coders, the migration toward Java Swing after UNO (if they so desire)
  would be relatively painless.
 
 I would like to see Swing itself be integrated.  Of course, that only
 works for Java.  This needed two issues fixed:
 
 1st: A portable and official way of adding Swing components to non-Java
 parent windows.
 
 2nd: Getting the OOo and Swing look and feel the same for the different
 planforms.
 
   Michael
 
 
 -- 
 Michael Hoennig [EMAIL PROTECTED]
 project lead OpenOffice.org API
 http://api.openoffice.org
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 

-- 
DSL Komplett von GMX +++ Supergünstig und stressfrei einsteigen!
AKTION Kein Einrichtungspreis nutzen: http://www.gmx.net/de/go/dsl

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



Re: [api-dev] Problem with insertDocumentFromURL

2005-03-16 Thread Marc Santhoff
Am Mi, den 16.03.2005 schrieb Michael Hoennig um 21:22:
[...]
 For the second usage of gotoEnd(), also collapseToEnd() should work.  See
 reference manual for more information.
 
 And better do not use view cursors for model based functionality, as Marc
 suggested.

You're right, I assumed the moving functions are only accessible through
the view cursor (hold true only for pagination and the like), which was
false. Next time I'll think a little longer ... ;)

Marc



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



Re: [api-dev] IDL-Reference

2005-03-16 Thread Michael Hoennig
Hi Tom,

 I suppose that the IDL-Reference Properties are ordered at the moment 
 using the occurrence of the properties in the IDL-File. The good point 
 about this is that you can group together things like RightMargin and 
 LeftMargin but for someone who is looking for a property it would be 
 much more useful to have the properties sorted alphabetically.
 
 What do the others think about it?

Nobody seems to have an opionion about it.  Ok, my opinion is also not
helpful.  Either way can be useful.  Grouping logically (meaning like in
the IDL file) or alphabetically both have their advantages.  I don't know
what's better.

Ideally we would have a dynamic online reference manual where you can
select both orders and the sorting is done as you choose.  Any volunteers?
;-)

Michael

-- 
Michael Hoennig [EMAIL PROTECTED]
project lead OpenOffice.org API
http://api.openoffice.org

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



Re: [api-dev] Closing a Document

2005-03-16 Thread Mathias Bauer
Ines Pfauch wrote:
 Hi
 
 I just searched the mailing list archive for a method to close an open 
 document. I found something with XStoreable - close and XComponent - 
 dispose. I tried it, but the whole OOo window closes. But I need the 
 OOo window opened, and just want to close the document within the 
 window... How can I do this?

You should get access to a frame that contains the document.
If you want to have it simple, use its DispatchProvider API to dispatch
.uno:CloseDoc to the frame. If you prefer handcrafted work:

(1) First check if other child frames of the Desktop service are open.
(2) If yes: just close the frame by calling close(True).
(2) If No: ask controller if it can be closed by calling suspend(True)
(2) If controller agrees, call setCompontent(0,0) at the frame.

Best regards,
Mathias

-- 
Mathias Bauer - OpenOffice.org Application Framework Project Lead
Please reply to the list only, [EMAIL PROTECTED] is a spam sink.


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



Re: [api-dev] How to protect from disposed exception?

2005-03-16 Thread Stephan Bergmann
Bob Crothers wrote:
Hi,
 

We have a multi-threaded Java environment. We are using OpenOffice.org 
1.1.3. There are times when we make a series of UNO calls (mostly 
setting properties, save, and call macros) and also get a series of 
exceptions. The exceptions follow:

 

com.sun.star.lib.uno.protocols.urp.Unmarshal.readboolean - 
unexpected:java.io.EOFException

com.sun.star.io.IOException: java.net.SocketException: Socket closed
java_remote_bridge 
[EMAIL PROTECTED] is 
disposed
Hm, this means the remote side of the bridge is closing the connection 
while the local side of the bridge thinks it still has to read data.  Do 
you have an idea how many synchronous UNO requests from your local Java 
side are outstanding (have not yet received a reply from the remote OOo 
side) when the exception occurs---none, one (i.e., on a single Java 
thread), or multiple (i.e., on multiple Java threads simultaneously)? 
What requests are you sending exactly?

-Stephan
How can we defend against these exceptions?
 

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


Re: [api-dev] IDL-Reference

2005-03-16 Thread Thomas Schindl
Hi,

How is the IDL created? Maybe we could switch to output format to XML and
then do the same the codesnippet page does? 
XML = HTML 
* once sorted alphabetically 
* once grouped like it is now

According to the what the user desires? We could even create other output
formats from this point on e.g. PDF, ... .

I just needed to know how to create the IDL-page-creation is done at the
moment (hopefully some template mechanism) ;-)

Tom

 Hi Tom,
 
  I suppose that the IDL-Reference Properties are ordered at the moment 
  using the occurrence of the properties in the IDL-File. The good point 
  about this is that you can group together things like RightMargin and 
  LeftMargin but for someone who is looking for a property it would be 
  much more useful to have the properties sorted alphabetically.
  
  What do the others think about it?
 
 Nobody seems to have an opionion about it.  Ok, my opinion is also not
 helpful.  Either way can be useful.  Grouping logically (meaning like in
 the IDL file) or alphabetically both have their advantages.  I don't know
 what's better.
 
 Ideally we would have a dynamic online reference manual where you can
 select both orders and the sorting is done as you choose.  Any volunteers?
 ;-)
 
   Michael
 
 -- 
 Michael Hoennig [EMAIL PROTECTED]
 project lead OpenOffice.org API
 http://api.openoffice.org
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 

-- 
DSL Komplett von GMX +++ Supergünstig und stressfrei einsteigen!
AKTION Kein Einrichtungspreis nutzen: http://www.gmx.net/de/go/dsl

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



Re: [api-dev] IDL-Reference

2005-03-17 Thread Michael Hoennig
Hi Thomas,

 How is the IDL created? 

For my case, using vim ;-)

 Maybe we could switch to output format to XML
 and then do the same the codesnippet page does? 
 XML = HTML 
 * once sorted alphabetically 
 * once grouped like it is now

Oh, you meant how the HTML is generated from the IDL. Ok, that's done with
autodoc, a tool which also can be found in the OOo CVS.  I have no idea
how much work it would be to change it to XML output of a certain kind. 
I'll send this in BCC to the author. Nikolai: It's about sorting or not
sorting lists of properties etc.

 I just needed to know how to create the IDL-page-creation is done at the
 moment (hopefully some template mechanism) ;-)

As far as I know, no template mechanism.

Michael

-- 
Michael Hoennig [EMAIL PROTECTED]
project lead OpenOffice.org API
http://api.openoffice.org

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



Re: [api-dev] Closing a Document

2005-03-17 Thread Michael Hoennig
Hi Mathias,

  I just searched the mailing list archive for a method to close an open
  document. I found something with XStoreable - close and XComponent - 
  dispose. I tried it, but the whole OOo window closes. But I need the 
  OOo window opened, and just want to close the document within the 
  window... How can I do this?
 
 You should get access to a frame that contains the document.
 If you want to have it simple, use its DispatchProvider API to dispatch
 .uno:CloseDoc to the frame. If you prefer handcrafted work:
 
 (1) First check if other child frames of the Desktop service are open.
 (2) If yes: just close the frame by calling close(True).
 (2) If No: ask controller if it can be closed by calling suspend(True)
 (2) If controller agrees, call setCompontent(0,0) at the frame.

This brought up some thoughts:  In the OOoBean when clearing (there are
OOoBean methods for this), simply the whole Frame is closed.  The
OOoBean can live without a Frame, all you can do than is loading a new
document of course.

But does it probably make sense, keeping the frame?  Any advantages or
disadvantages of either solution?

Michael



-- 
Michael Hoennig [EMAIL PROTECTED]
project lead OpenOffice.org API
http://api.openoffice.org

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



[api-dev] Bookmark...

2005-03-17 Thread Cristian Fonti
Hi to all,
can and eventually how, i select the text between two bookmarks???
Thanks
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [api-dev] [code snippet] Drawing on Uno Dialogs

2005-03-17 Thread Kohei Yoshida
On Thu, 17 Mar 2005 09:21:32 -0500, Kohei Yoshida
[EMAIL PROTECTED] wrote:
...
 My desire is to see UNO offer Swing compatible API (especially the
 layout support among other things), similar to how it offers AWT
 compatible API *today*, but the actual rendering is still done by VCL
 for platform dependent LF.

Not to mention it should not require a JVM to run it.

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



Re: [api-dev] IDL-Reference

2005-03-17 Thread Tom Schindl
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Nikolai Pretzell wrote:
| Hi Thomas,
|
[...]
| Actually creating XML ouput is planned to be realised already anyway.
|
Having XML would be enough form my point of view because one can do
sorting, ... with XSLT.
| Adding alphabetical lists like in one of the possibilities described
| above would be easy as well .
|
|
| Best regards,
| Nikolai
|
| --
| Nikolai PretzellSun Microsystems Inc.
| Software EngineerHamburg, Germany
|
| -
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
|
|
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.0 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFCOZspkVPeOFLgZFIRAnMNAJ9X+BgR2QYdlvbKJ9IJXZ4JraR6qQCfR0u+
da1PqH0l8dtZZcAVWczz+OY=
=Qjuj
-END PGP SIGNATURE-
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


[api-dev] error with pkgchk and windows

2005-03-17 Thread Ines Pfauch
Today I tried to use my java-addon (developed under linux) with OOo  
1.1.2 at windows.
After deploying the functions in the addon submenu were greyed out. In  
the log file from pkgchk I've found following error:

 warning: registering  
vnd.sun.star.expand:$UNO_USER_PACKAGES_CACHE/uno_packages/ 
OGoPlugin.uno.zip.059801/OGoPlugin.uno.jar into registry  
file:///C:/Programme/OpenOffice.org1.1.2/user/uno_packages/cache/ 
services.rdb: failed! (cannot register implementation: Could not create  
Java implementation loader)!

Can anyone tell my where this error comes from or how I get the addon  
installed correctly?

Thank you in advance
Ines
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [api-dev] Writer: position of elements on the page

2005-03-17 Thread sos
Yes they are stored as property values Hori and Vert  OrientPosition
Folowing code shows in basic how to uses postion and reposition a simple 
graphic, objects, frames etc uses the same services (i think)

oGraphic.AnchorType = lAnchor
oGraphic.PositionProtected = True
oGraphic.SizeProtected = True
oGraphic.ContentProtected = True
 oGraphic.width = iFotW
 oGraphic.height = iFotH
 oGraphic.HoriOrient = NONE
 oGraphic.VertOrient = NONE
 oGraphic.VertOrientRelation = PAGE_PRINT_AREA
 oGraphic.HoriOrientRelation = PAGE_PRINT_AREA
 oGraphic.SetPropertyValue(AnchorPageNo, iPagenr)
 oGraphic.HoriOrientPosition = iHCpos - AflpL + 900  'left Pagemargin
 oGraphic.VertOrientPosition = iVCpos - AflpB + 
iif(oDialog.Model.viaCursor.State = 1, 1080, 1100)  'top Pagemargin + 
linefeed als via cursor
 aCrop.Left = (((iOriFotW - iFotW)/2) +((iMoveH*3)/2/96*2540))
 aCrop.Right = (iOriFotW - iFotW - aCrop.Left )
 aCrop.Top =  (((iOriFotH - iFotH)/2) + ((iMoveV*3)/2/96*2540))
 aCrop.Bottom =  (iOriFotH - iFotH - aCrop.Top)
 oGraphic.SetPropertyValue(GraphicCrop , aCrop)
 dim SFilename as string
  sFilename = FileNameoutofPath(sGraphicURL , /)
  oGraphic.SetPropertyValue(HyperLinkName ,  sFilename)
 oGraphic.Name = Fot + _ + iPagenr + _ + iHCpos +_ + iVCpos + _ 
+ (tot + 1) ' moet telkens uniek zijn

Fernand
At 14:42 17/03/05, you wrote:
Michael Hoennig wrote:
I was wondering if there is a way of getting the position of elements
(graphics objects, embedded objects, drawing elements, frames) in a Writer
document relative to the page?
All these are Shapes, but getPosition() is not implemented, most likely
because it is not known on the model level (just on the view level).
Is there another way, I don't know about?  Like through accessibility API?
Michael
This is just a guess, but. Can you position the view cursor to the 
anchor and then figure out where the view cursor is? I have not tried it 
and a I doubt that it will work with all types of anchors.

--
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.sxw
My Macro Book: http://www.hentzenwerke.com/catalog/oome.htm
Free Info:  http://www.pitonyak.org/oo.php
-
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]


Re: [api-dev] XDispatch, oo macro parameters, macro libraries

2005-03-18 Thread Mathias Bauer
John Sisson wrote:
 Hello,
 Documentation for oo development implies that soffice macros invoked
 from a (connected) client by the client-side method:
myXDispatch.dispatch(myMacroUrl, myPropertyValueArray)
 can receive method parameters, but it does not state how this is done.
 Given a method 'MyLib.MyModule.Foo' it seems there are 2 options:
 Option.1
   Sub Foo
 Dim oParam as Object
 oParam = [some oo method for getting XDispatch PropertyValues]
 
 ... operations
   End Sub
 
 Option.2
   Sub Foo(oParam as Object)
 ... operations
   End Sub

Option 2 is correct. Parameters are passed as strings.

I can't answer your second question (forcing a lib to be loaded when
macro called via XDispatch) safely, so I better wait for somebody else.

Best regards,
Mathias

-- 
Mathias Bauer - OpenOffice.org Application Framework Project Lead
Please reply to the list only, [EMAIL PROTECTED] is a spam sink.


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



Re: [api-dev] IDL-Reference

2005-03-18 Thread Michael Hoennig

 I like the javadoc approach, where all the methods [fields, 
 constructors] of a class are listed alphabetically in the overview 
 section, but in textual order in the detailed list that follows the 
 overview.

That's a good idea to follow.

Michael

-- 
Michael Hoennig [EMAIL PROTECTED]
project lead OpenOffice.org API
http://api.openoffice.org

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



Re: [api-dev] IDL-Reference

2005-03-18 Thread Tom Schindl
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Michael Hoennig wrote:
|I like the javadoc approach, where all the methods [fields,
|constructors] of a class are listed alphabetically in the overview
|section, but in textual order in the detailed list that follows the
|overview.
|
|
| That's a good idea to follow.
I also like this idea. I must admit that I have never recognized this
java-doc behaviour but it makes really sense to me.
Tom
|
|   Michael
|
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.0 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFCOrhDkVPeOFLgZFIRAhRtAKC7S0U12U5ZwT69aghQoBfKPNpc/QCfcDC4
SMYXMoa3xCE1BzdAq+k5q3g=
=KFsA
-END PGP SIGNATURE-
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [api-dev] IDL-Reference

2005-03-18 Thread Nikolai Pretzell
Stephan Bergmann wrote:
I like the javadoc approach, where all the methods [fields, 
constructors] of a class are listed alphabetically in the overview 
section, but in textual order in the detailed list that follows the 
overview.
Sounds good to me!
Make a task from it?
Nikolai
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [api-dev] Table width

2005-03-18 Thread Cristian Fonti
Nothing to do...
i try your code but nothing, the table remain into the page margin... 
(if i use TextFrame all is ok, but it create into the Frame a paragraph 
break after the table, pratically a blank line after the table, 
eventually, i can remove it??)...
This is my Java code:
 Object table = 
xWriterFactory.createInstance(com.sun.star.text.TextTable);
XTextContent xTextContentTable = 
(XTextContent)UnoRuntime.queryInterface(XTextContent.class, table);
   XPropertySet 
xTableProps=(XPropertySet)UnoRuntime.queryInterface(XPropertySet.class,table);  

   xTableProps.setPropertyValue(HoriOrient,new 
Integer(com.sun.star.text.HoriOrientation.LEFT_AND_WIDTH));
 xTableProps.setPropertyValue(LeftMargin,new Integer(-1000));
 xTableProps.setPropertyValue(Width,new Integer(18000));

Thanks to all
Stephan Wunderlich ha scritto:
Hi Cristian,
i have a question:
there is a way to set the width of a table (i want to exceed the 
margin of the page)??
I try with the property Width but nothing
Thanks to all

lets say you have a XTextTable in your document, then
atable = thisComponent.TextTables(0)   
atable.HoriOrient = com.sun.star.text.HoriOrientation.LEFT_AND_WIDTH
atable.width=18000

should set the width of it to 18cm
Hope that helps
Regards
Stephan
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
~~
Dott. Cristian Fonti
mailto: [EMAIL PROTECTED]
Centro Elaborazione Dati (CED) - Resp. Web Area
SCM Group S.p.a. http://www.scmgroup.com
via Emilia, 77 - 47900 Rimini (RN), Italy
Tel.: +39 0541 700163 Interno: 2163
~~ 

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


Re: [api-dev] Table width

2005-03-18 Thread Stephan Wunderlich
Hi Cristian,
This is my Java code:
 Object table = 
xWriterFactory.createInstance(com.sun.star.text.TextTable);
XTextContent xTextContentTable = 
(XTextContent)UnoRuntime.queryInterface(XTextContent.class, table);
   XPropertySet 
xTableProps=(XPropertySet)UnoRuntime.queryInterface(XPropertySet.class,table);  

   xTableProps.setPropertyValue(HoriOrient,new 
Integer(com.sun.star.text.HoriOrientation.LEFT_AND_WIDTH));
 xTableProps.setPropertyValue(LeftMargin,new Integer(-1000));
 xTableProps.setPropertyValue(Width,new Integer(18000));

Thanks to all
mmm ... strange ... the macro
aTable = thisComponent.TextTables(0)
aTable.HoriOrient = com.sun.star.text.HoriOrientation.LEFT_AND_WIDTH
aTable.LeftMargin=-1000
aTable.Width=18000
works like a charm for me.
Do you change the properties before you insert the table or after you 
insert the table ?

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


Re: [api-dev] Table width

2005-03-18 Thread Cristian Fonti
I try to set the properties also after that before, but nothing...
I have another problems: i want to change the column width values, and i 
suppose that he only way to change them is use TextColumnSeparator.
But,the value that you must insert, what is? is a formula of what?? is 
the distance from left margin or  is the real width of the column??
Thanks to all

Stephan Wunderlich ha scritto:
Hi Cristian,
This is my Java code:
 Object table = 
xWriterFactory.createInstance(com.sun.star.text.TextTable);
XTextContent xTextContentTable = 
(XTextContent)UnoRuntime.queryInterface(XTextContent.class, table);
   XPropertySet 
xTableProps=(XPropertySet)UnoRuntime.queryInterface(XPropertySet.class,table);  

   xTableProps.setPropertyValue(HoriOrient,new 
Integer(com.sun.star.text.HoriOrientation.LEFT_AND_WIDTH));
 xTableProps.setPropertyValue(LeftMargin,new Integer(-1000));
 xTableProps.setPropertyValue(Width,new Integer(18000));

Thanks to all

mmm ... strange ... the macro
aTable = thisComponent.TextTables(0)   
aTable.HoriOrient = com.sun.star.text.HoriOrientation.LEFT_AND_WIDTH
aTable.LeftMargin=-1000
aTable.Width=18000

works like a charm for me.
Do you change the properties before you insert the table or after you 
insert the table ?

Regards
Stephan
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
~~
Dott. Cristian Fonti
mailto: [EMAIL PROTECTED]
Centro Elaborazione Dati (CED) - Resp. Web Area
SCM Group S.p.a. http://www.scmgroup.com
via Emilia, 77 - 47900 Rimini (RN), Italy
Tel.: +39 0541 700163 Interno: 2163
~~ 

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


Re: [api-dev] Table width

2005-03-18 Thread Steffen Grund
Hi there.


Right, it's the property TableColumnSeparators.
Please see chapter 7.3.4 Tables of the Developer's Guide:
http://api.openoffice.org/docs/DevelopersGuide/Text/Text.htm#1+3+4+Tables

The TextColumnSeparator describes the distance between the column
separator and the left margin of the table. This value is not the real
value, but related to the relative table width.

Hope that helps, Steffen


Cristian Fonti wrote:
 I try to set the properties also after that before, but nothing...
 I have another problems: i want to change the column width values, and i 
 suppose that he only way to change them is use TextColumnSeparator.
 But,the value that you must insert, what is? is a formula of what?? is 
 the distance from left margin or  is the real width of the column??
 Thanks to all
 
 


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



[api-dev] Problem with TableColumnSeparators

2005-03-18 Thread Cristian Fonti
Hi to all,
i have a problems with the width of the column in a table (with Writer), 
i use Java, and i found that the only method is TableColumnSeparators.
I try it but i don't understand what is the value that must be set...

--This is an example of my code with a table (1,4):
TableColumnSeparator [] t  =(TableColumnSeparator []) 
xTableProps.getPropertyValue(TableColumnSeparators);
 t[0].Position = (short)(1430); 
 t[0].IsVisible=true;
 t[1].Position = (short)(8000);
 t[1].IsVisible=true;
 t[2].Position = (short)(1360);
 t[2].IsVisible=true;
xTableProps.setPropertyValue(TableColumnSeparators, t);
This code don't run correctly.  (I obtain the values after many attempts)
The most fun thing is that, if i use a table (1,3) with only 2 
separators (deleting the third) the code run correctly.

Thanks to all
Cristian


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


<    1   2   3   4   5   6   7   8   9   10   >