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]