Re: [dev] about: rename cells

2006-05-17 Thread Stephan Wunderlich

Hi,

 I'd like to know how the set the names of cells of spreadsheets through 
Java Program ?

eg.rename  the cell(A1) as example


you can't rename a Cell ... could it be that you want to add a named 
Range consisting of one Cell ?


something like

Dim sBase As New com.sun.star.table.CellAddress

oDoc = ThisComponent
oNamedRanges = oDoc.getPropertyValue(NamedRanges)

sBase.sheet = 0
sBase.Column = 0
sBase.Row = 0

oNamedRanges.addNewByName(MyRange, A1:B3, sBase, 0)

Regards

Stephan

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



Re: [dev] Using pdf output filters from Java

2006-05-03 Thread Stephan Wunderlich

Hi Paul,

For every PDF filter type a com.sun.star.task.ErrorCodeIOException is  
thrown but not when using the HTML (StarWriter) filter.


Is there something obvious that I'm missing? Do I need to add any  extra 
jars to the classpath?


if you opened the documents you plan to store to PDF in hidden mode 
than this is a known issue which will be fixed in OOo 2.0.3 ... as a 
workaround you could open your documents visible before converting them.


Hope that helps

Regards

Stephan

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



Re: [dev] delete the next charakter on cursor-position - join paragraphs

2006-05-03 Thread Stephan Wunderlich

Hi Christoph,


I think this is very strange... bug or feature?


I think the two cursors should behave in the same way ... so I'd say it 
is worth an issue for further investigation :-)


Regards

Stephan

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



Re: [dev] How do I determine which services an object supports?

2006-04-05 Thread Stephan Wunderlich

Hi Emil,


I want to get a list of all services a particular object supports so that I
can later recognize it by calling 'supportsService'.
I am using OOo basic.


every UNO-Object supports the Interface XServiceInfo, which has a method 
getSupportedServiceNames().


Hope that helps

Regards

Stephan

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



Re: [dev] A bug revealed !

2006-04-05 Thread Stephan Wunderlich

Hi Stefan,


First of all I am glad to work with your office suit, but I found an algebraic bug in 
OpenOffice.org Calc, ver.2.02. So: What we suppose to expect when subtract 67,10 value in a 
sell  from 540,00 value in a sell (540,00-67,10 - for exaple M5sell =M4-M3 when 
M4=540,00 and M3=67,10) we expect 479,10, but Calc presents 472,91) I am curious what's 
going on ?! Please help, I will hope not to use emulating final result ROUND 
command(;1) for correcting this issue.


mmm ... works like a charm for me ... if I type 540 in one Cell (B3) and 
67.1 in another (C3) then the third Cell, which contains the formula 
=B3-C3 shows the desired 472.9


Are the values of the Cells you look it results of a calculation and 
maybe the format of them obscures their real value ?


Regards

Stephan

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



Re: [dev] how to insert an image into a cell (table cell)

2006-03-01 Thread Stephan Wunderlich

Hi,


I can insert an image into a doc at a given bookmart. That's fine.

But when I try to insert an image at a given bookmart that is inside a
table cell I got an excepcion. Reading the OO doc I understand that it's
not possible.

I appreciate any help or idea regarding how to insert an image into a table
cell.


The problem is the way you gain your XText ... something like

xText = bookmark.getAnchor().getText();
xTextCursor = xText.createTextCursor();
xText.insertTextContent(xTextCursor,picture, false);

should do the trick.

Hope that helps

Regards

Stephan

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



Re: [dev] OO 2.0 behaves different than OO 1.5

2006-02-22 Thread Stephan Wunderlich

Hi Bernhard,

 I have a small Java application that uses OO (started with parameter 
-invisible) to open or print OO - Files without user interaction. The user 
normally edits the opened document and closes it after he/she finished 
his/her work. Here is my problem! In OO1 the application disappeared after 
the user closed (menu file/close) the last document. In OO2 the application 
stays visible. 
 
 Can I make OO2 to behave like OO1? Can I make OO invisible by API calls? 
 I tried to cast my desktop object to XFrame and called 
 
 ooDesktop.getXFrame().getComponentWindow().setVisible(false); 
 
 but this ended OO instead of making it invisible and my next API call gets 
this exception: 
 
 Exception in thread AWT-EventQueue-0 com.sun.star.lang.DisposedException: 
java_remote_bridge 
[EMAIL PROTECTED] is 
disposed 
 
 What can I do? 


you could start the office with the parameter -headless instead of 
-invisible ... this should also work with OOo1.x


Hope that helps

Regards

Stephan

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



Re: [dev] OO 2.0 behaves different than OO 1.5

2006-02-22 Thread Stephan Wunderlich

Hi Bernhard

No! I just want OO invisible if no documents are open. OO1.0 got visible at 
the time I opened a document via Java/UNO and got invisible at the time the 
user closed the document. 


when you open OOo with

./soffice -headless

it will be invisible.

When you afterwards connect to this office via java and open a document, 
this document will be visible unless you open it hidden ;-)


I thought that is what you wanted.

Regards

Stephan

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



Re: [dev] how to get a list of suported filters -code snippet-

2006-02-09 Thread Stephan Wunderlich

Hi,


I need a code (in Java) that lists all the suppoted filters by  my OO
server (version 2.0).

Ok, I guess there are some files in org\openoffice\TypeDetection\*.xcu that
have similar infomation but I'd rather get it at runtime -using a java
code-.

I appreciate any help.


you could create an instance of com.sun.star.document.FilterFactory at 
the ServiceFactory. This supports a NameAccess to give you the names of 
the supported filters.


Hope that helps

Regards

Stephan

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



Re: [dev] Antwort: Re: [dev] check if a XTextRange contains a text table

2006-01-19 Thread Stephan Wunderlich

Hi Tobias,


Thank you very much,


ymw


I will try to translate this into Java. Maybe anybody already got a
solution for Java?


 ... something like the following should do the same ... xTextDoc is 
supposed to be your writer document ...


public static void main(String[] args) {

 XTextDocument xTextDoc = 

 XIndexAccess Ranges = (XIndexAccess)
 UnoRuntime.queryInterface(XIndexAccess.class,
  xTextDoc.getCurrentSeletion());

 XEnumerationAccess aRange = (XEnumerationAccess)
 UnoRuntime.queryInterface(XEnumerationAccess.class,
  Ranges.getByIndex(0));

 if (containsTable(aRange)) {
System.out.println(selected Range contains a TextTable);
 } else {
System.out.println(selected Range doesn't contain a
  TextTable);
 }

}

private boolean containsRange(XEnumerationAccess aRange) {
   boolean ret = false;
   XEnumeration aEnum = aRange.createEnumeration();
   while aEnum.hasMoreElements() {
aPortion = (XServiceInfo)
   UnoRuntime.queryInterface(
XServiceInfo.class,aEnum.nextElement());

if aPortion.supportsService(com.sun.star.text.TextTable) {
 ret=true;
}
   }
   return ret;
}




the following basic macro checks the current selection in a writer
document for TextTables ...



Sub Main
  Ranges = thiscomponent.currentcontroller.selection
  aRange = Ranges(0)
  if containsTable(aRange) then
 msgbox selected Range contains a TextTable
  else
 msgbox selected Range doesn't contain a TextTable
  endif
End Sub

function containsTable(aRange) as Boolean
  ret = false
  aEnum = aRange.createEnumeration
  while aEnum.hasMoreElements
   aPortion = aEnum.nextElement
   if aPortion.supportsService(com.sun.star.text.TextTable) then
ret=true
   endif
  wend
  containsTable=ret
end function



hope that helps

Regards

Stephan

-
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: [dev] check if a XTextRange contains a text table

2006-01-18 Thread Stephan Wunderlich

Hi Tobias,


I know how to check if a XTextRange is within a Cell of a text table. But
how do I evaluate if a
specific XTextRange CONTAINS a text table?

Any help is very appreciated!


the following basic macro checks the current selection in a writer 
document for TextTables ...




Sub Main
 Ranges = thiscomponent.currentcontroller.selection
 aRange = Ranges(0) 
 if containsTable(aRange) then
msgbox selected Range contains a TextTable
 else
msgbox selected Range doesn't contain a TextTable   
 endif  
End Sub

function containsTable(aRange) as Boolean
 ret = false
 aEnum = aRange.createEnumeration
 while aEnum.hasMoreElements
  aPortion = aEnum.nextElement
  if aPortion.supportsService(com.sun.star.text.TextTable) then
   ret=true
  endif
 wend
 containsTable=ret
end function



hope that helps

Regards

Stephan

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



Re: [dev] using netBeans 4.1

2006-01-16 Thread Stephan Wunderlich

Hi Andrew,


Hi I am using NetBeans 4.1 and want to use the sample code given in the
SDK named DocumentLoder.java which allows you to load a document. The
problem is that I don’t know how to load the relevant libraries so the
code will compile and run. I would be very grateful if you could mail me
some instructions on how to do this.


just add the jars ... juh, jurt, unoil and ridl from the 
office_installationpath/program/classes to your project, then it 
should compile and run from the ide.


Hope that helps

Regards

Stephan

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



Re: [dev] Newbie: com.sun.star.comp.helper.BootstrapException: no office executable found!

2006-01-16 Thread Stephan Wunderlich

Hi Tobias,


Just when I started the sdk Developer Guide for OO2 I experienced
problems with the first application.

First my system information: I use Debian Linux. My IDE is Eclipse. I
installed OpenOffice2 and the OO2 sdk. I use blackdown java 1.4.2.03.


, never tried if it works with the blackdown java, but normally the 
bootstrap mechanism should find a running office instance.


What you could try is

1. ensure that office_install/program is in the PATH
2. call your java class with parameter, like
   java -Dcom.sun.star.lib.loader.unopath=/opt/OpenOffice.org/program ..


Hope that helps

Regards

Stephan

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



Re: [dev] inserting text in current Frame

2005-11-02 Thread Stephan Wunderlich - Sun Germany - ham02 - Hamburg

Hi Daniel,

I can now insert text, image, diagrams and links inside openoffice, all 
that from my external java-programm. Thats really nice:)
The strange thing is that it does that only on the Writer-frame that I 
opened first.
I would like to also be able to insert things in a new opened docuemnt. 
And I would like to allow the user to edit several document with 
OpenOffice.org, and only operate (i.e. : insert Tex, images, diagramms 
or links) on the the frame, that is currently on top.
so... What I am doing wrong ? Why can I only use the first opened frame 
? (i.e.: How to get the frame that is currently in use?)


mmm ... not sure what you try to achieve ... your code opens a text
document and then inserts a text in this just opened document.

Looks to me like the expected behaviour.

Regards

Stephan

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



Re: [dev] inserting text in current Frame

2005-11-02 Thread Stephan Wunderlich - Sun Germany - ham02 - Hamburg

Hi Daniel

The problem is that I want to insert text in the document the user is 
actually editing, and not in the Frame the programm opened.
Imagine the user opens an already existent file. This would open a new 
frame. Then inserting text from my java application, the text will 
appear in  the Frame he opened first, and not in the frame he is 
actually editing - which is not the expected behaviour.

So, I wanted to now how to get the current frame ...


h, now the shades of confusion lift :-)

You can query the XDesktop interface from an instance of the service
com.sun.star.frame.Desktop, which you can create at the
MultiServiceFactory of the office.

The interface XDesktop has a method getCurrentComponent() which should
return the currently active StarOffice component.
To ensure that the component you get is a TextDocument you can check if
it supports the service com.sun.star.text.TextDocument by querying the
XServiceInfo interface and use the method supportsService from it.

Hope that helps

Regards

Stephan

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



Re: [dev] Automate export to PDF

2005-10-04 Thread Stephan Wunderlich - Sun Germany - ham02 - Hamburg

Hi Cameron,

I want to be able to automate on a server the exporting of OpenDocuments 
to PDF. Can someone point me to resources that would help me in doing so?


you could use the UNO API ... for example to store a given xTextDoc to 
pdf, the following java-snippet should be useful


PropertyValue[] PDFArgs = new com.sun.star.beans.PropertyValue[1];
PropertyValue PDFArgs[0] = new com.sun.star.beans.PropertyValue;
PDFArgs[0].Name = FilterName;
PDFArgs[0].Value = writer_pdf_Export;

XStrorable store = (XStorable)
UnRuntime.queryInterface(XStorable.class, xTextDoc);
store.storeToURL(/path/to/your/destination/nicename.pdf,PDFArgs);

Hope that helps

Regards

Stephan

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



Re: [dev] PowerPoint vs Impress Rendering Inquiry

2005-09-15 Thread Stephan Wunderlich - Sun Germany - ham02 - Hamburg

Hi Joseph,

Here are two observations with questions. 

1. When I render 10,000 EllipseShapes and minimize the main Impress window, 
the rendering time rapdily decreases. It takes about one minute and fifteen 
seconds on my machine. It would probably take an hour if I kept the window 
up watched it. 
?- Is there a way to pause rendering in Impress and start it after all 
shapes have been generated? Otherwise stated, is there a method that can 
toggle refreshing? 

2. As the images are rendering, I noticed that the time to add each 
additional EllipseShape to my xShapes object slightly increases as more and 
more images appear on the slide. 
?- Are there any pipelines within OO that could possibly avoid whatever 
overhead is being incurred during this add process?


Any insight on the topic is greatly appreciated. If you would like a copy of 
the test code, send me an email. 


Thank You in Advance for your time


The XModel which you can gain from your document has the methods 
lockControllers and unlockControllers ... the first will ensure that 
no painting is done in the view and the second then will make painting 
possible again. Not sure if that works for you, but it was the first 
thought that came to my mind :-)


Regards

Stephan

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



Re: [dev] How to get TextTable from Cell

2005-09-12 Thread Stephan Wunderlich - Sun Germany - ham02 - Hamburg

Hi Matthias


bookmark.getAnchor().getPropertyValue(TextTable)

but the TextTable property in question seems to be undocumented for the 
service TextRange. Is there a better (documented) way?


That is the only way I'm aware of and the fact that it isn't documented 
sound like an issue to me.


Regards

Stephan

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



Re: [dev] starbasic strcmp function

2005-08-29 Thread Stephan Wunderlich - Sun Germany - ham02 - Hamburg

Hi Sven,


Could someone point me to the correct usages of StrCmp in StarBasic?
With:
	strcmp(s1,s2) 


that is a typo I suppose.


I get the following error:

Basic syntax error. Symbol StrComp already defined differently.

But where is it defined?


StrComp is a basic-runtime function and something like

s1 = openoffice.org
s2 = writer
s3 = openoffice.org
msgbox strcomp(s1,s2) '-1
msgbox strcomp(s2,s1) '1
msgbox strcomp(s1,s3) '0

works just fine for me.

Regards

Stephan

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



Re: [dev] Re: IllegalArgumentException when using PushButtonType enum

2005-07-29 Thread Stephan Wunderlich

Hi James,


When I try the following lines, when it gets to the setPropertyValue
below I get an IllegalS

There are more properties than what I have here, and it works if I don't
 set the property 'PushButtonType'.

Object buttonModel = xMultiServiceFactory.createInstance(
com.sun.star.awt.UnoControlButtonModel );
XPropertySet xPSetButton = ( XPropertySet
)UnoRuntime.queryInterface(
XPropertySet.class, buttonModel );
xPSetButton.setPropertyValue(PushButtonType, PushButtonType.OK);

I get:
com.sun.star.lang.IllegalArgumentException: Unable to convert the given
value for the property PushButtonType

What did I do wrong?


Looks like an issue to me ... the Property PushButtonType expects a 
Short and css.awt.PushButtonType.OK can obviously not be converted to 
this.


As workaround

xPSetButton.setPropertyValue(PushButtonType, new 
Short((short)PushButtonType.OK_value));


should do the trick.

Hope that helps

Regards

Stephan

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



Re: [dev] How to pass a NULL as an array argument

2005-03-10 Thread Stephan Wunderlich
Hi Andrew,
Well, under windows, I simply use
Dim oNull As Object
oMeta.getTables(oNull, %, %, oNull)
haven't tried it, but since an Array is expected maybe using DimArray() 
instead of oNull would do the trick.

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