Re: [api-dev] New intermediate version 1.1.1 of the OpenOffice.org API plugin available

2008-02-12 Thread Tobias Krais
Hi Wouter,

> Installation goes like a charm, building my first client app with it too.
> Running the app from within NetBeans doesn't work ("no office executable 
> found")
> despite the plugin settings under Tools->Options->Misc. Running the jar with
> java -jar goes ok again.
> 
> Is the behaviour with not able to run from within NetBeans expected or would 
> you
> like me to file a bug?

Please tell me which Linux distribution and version you use. This "bug"
seems to be the same we discussed last week.

Greetings, Tobias

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



Re: [api-dev] New intermediate version 1.1.1 of the OpenOffice.org API plugin available

2008-02-12 Thread Wouter van Reeven
Hi Tobias,

On Tue, Feb 12, 2008 at 10:25:43AM +0100, Tobias Krais wrote:
> Please tell me which Linux distribution and version you use. This "bug"
> seems to be the same we discussed last week.

I am using Debian Lenny (testing) and OOo version 2.3.1. I don't think this is
the same bug as we discussed last week. Running the jar created by NetBeans
works just fine. I am, however, unable to run the project from within NetBeans.
It looks like the project settings are incorrect. I would have expected the
Loader class to be the main class in the project with my class as argument.
This is not the way the project is configured in NetBeans so I guess that's why
the error occurs.


Thanks for asking though :-)


Greets, Wouter

-- 

People: "If she weighs the same as a Duck, she's made of wood!"
Sir Bedevere: "And therefore...?"

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



Re: [api-dev] New intermediate version 1.1.1 of the OpenOffice.org API plugin available

2008-02-12 Thread Juergen Schmidt

Wouter van Reeven wrote:

Hi Tobias,

On Tue, Feb 12, 2008 at 10:25:43AM +0100, Tobias Krais wrote:

Please tell me which Linux distribution and version you use. This "bug"
seems to be the same we discussed last week.


I am using Debian Lenny (testing) and OOo version 2.3.1. I don't think this is
the same bug as we discussed last week. Running the jar created by NetBeans
works just fine. I am, however, unable to run the project from within NetBeans.
It looks like the project settings are incorrect. I would have expected the
Loader class to be the main class in the project with my class as argument.
This is not the way the project is configured in NetBeans so I guess that's why
the error occurs.


Thanks for asking though :-)
mmh, i am not sure what goes wrong here but i would say that it will not 
work with the old version and NB5.5.1 as well.


But the behaviour or the env is indeed a little bit different when you 
run the appliation from within NetBeans. We will check it. I assume that 
it depends on the slightly different installation on Debian. We normally 
test only the version that we build in Hamburg and that you ca download 
from the OO.org website.


Thanks

Juergen





Greets, Wouter





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



Re: [api-dev] Re: the meaning of "="

2008-02-12 Thread Paolo Mantovani
Hi,

Il lunedì 11 febbraio 2008 20:12:48 Jonathan Kaye ha scritto:
> Steffen Grund wrote:
> > Hello,
> >
> > I am not the Basic expert here, but wouldn't something like this work?
> >
> > While Position <> 
> >  Position = Instr(i, ProcessString, " ")
> >  etc. etc. etc.
> > Wend
> >
> > and just initialize Position before, so it does not have the exit value?
>
> Hi Steffen,
> In fact, no it wouldn't. I'm processing entries in a spreadsheet which may
> have an arbitrary number of spaces in them. The entries also contain
> numbers. The idea is that all the numbers within a given chunk have to wind
> up at the end of the chunk next to a following space or EOL. So the exit
> condition would be when there are no more spaces left in the entry. I do
> this by successively shrinking the value of ProcessString with each loop.

I'm not sure to understand what you're trying to archieve.
May you provide an example of the kind of data that you expect as input and 
the correspondig output that you would obtain from the function ?



> The actual code I wrote looks like this:
> Function cutspace(ProcessString) as String
[...]

> Lft = Lft + movetones(Chunk) + " "

What is "movetones" ?


ciao
Paolo M


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



[api-dev] [C++] TextEmbeddedObject for inserting spreadsheet into swriter

2008-02-12 Thread Ariel Constenla-Haile

Hi Andre,

Andre Heine escribió:

Hello Ariel,

I'm some steps higher:-)

But something strange happens...

I can compile your demo but I can see the string in the XCell ("This works!")
only two times. 
All other runs of the demo bring OOo to hang;()


Without any modifications on the source!

The same in my code...

The code, that cause the "hanging":

-- snip
Reference< XComponent > rEmbeddedObjectComponent = 
rEmbeddedObjectSupplier->getEmbeddedObject();

--


strange... the example is a C++ (in C style ;-) ) version of the same
example in Java and OOo Basic (quite the same you were trying to
translate). And for me works in the 3 versions.

XEmbeddedObjectSupplier / XEmbeddedObjectSupplier2 are supported by
::com::sun::star::text::TextEmbeddedObject, so at least getting the
reference and using XEmbeddedObjectSupplier::getEmbeddedObject() and
XEmbeddedObjectSupplier2::getExtendedControlOverEmbeddedObject() *must*
work; what I didn't mention you (as I didn't want to complicate your
things) is that XEmbeddedObjectSupplier::getEmbeddedObject() may return
a null reference because some embedded objects have no component, z.B.
Java Applets - in this case you must use
XEmbeddedObjectSupplier2::getExtendedControlOverEmbeddedObject().
But when you embedded an office document, you have a component and a
model, so getEmbeddedObject() returns it.

Nevetherless, they *both* (getEmbeddedObject() and
getExtendedControlOverEmbeddedObject() ) *must* work, although  - as
said - one may return null.

And they both are "published interfaces"; don't ask me since when,
because I have no idea, but they are used in the Dev's Guide examples,
which - in general rule - are quite old.

Did you try with other embedded objects? For example, use
"078B7ABA-54FC-457F-8551-6147e776a997" for an OOo Math formula,
"12dcae26-281f-416f-a234-c3086127382e" for an OOo Chart.

Thanks to you, checking one again the Dev's Guide, I discovered an
example in
http://api.openoffice.org/docs/DevelopersGuide/Text/Text.xhtml#1_3_10_3_Embedded_Objects 




that is not included in the SDK examples.
A preliminary C++ version can be found at

http://www.ArielConstenlaHaile.com.ar/ooo/temp/TextTableChart_cpp.zip

Try it and see what happens when embedding Chart instead of Calc (here
at least in Linux and Windows worked).

May be your problem is in/with your OOo/SDK installation:

I'm using OOoSDK2.0 and OOo 2.0.4 on suse linux 10.2...
May be, my SDK or linux is broken...


I am using openSUSE 10.3 (i586) (kernel 2.6.22.16-0.2-default i686) with
OOo 2.3.1 and SDK 2.3 (they both compiled by OOo == not downloaded from
SuSe repositories).



I got following warning from "ld":

/usr/bin/ld: warning: libstdc++.so.6, needed 
by /opt/openoffice.org2.0/program/libcppu.so, may conflict with 
libstdc++.so.5


if it is in /opt/openoffice.org I guess its OOo's build, not Suse's ...


I ignore that, it's generally a problem in our project. We must use
for some libs libstdc++.so.5;-\

The comic is, that the code works in some cases without any modifications.
When OOo hangs I must kill all "soffice.bin" manually. 


At this time I'm very confused, but I don't surrender:-)


as I can't find anything wrong on the code [though may be some else
reading this can ;-) more eyes can see more!], I assume may be something
is wrong with your software.

Can't you update to OOo 2.3.1 and SDK 2.3? Did you try if you can build
it/run it on Windows? (on Win XP with MS Visual C++ Express 2005 I had
no problem).


Concerning the libraries error, a few weeks ago someone asked me about a
very similar problem, but I couldn't find any solution: when trying to
run the example on
/opt/openoffice.org2.3_sdk/examples/DevelopersGuide/ProfUNO/SimpleBootstrap_cpp/
he got linking errors (quite similar to yours), the first one:

/opt/openoffice.org2.3/program/libstdc++.so.6: version `GLIBCXX_3.4.9'
not found (required by _SimpleBootstrap_cpp)
make: *** [SimpleBootstrap_cpp.run] Error 1

All proposals and corrections (symlinks missing, old libraries, etc)
didn't work.
May be it's related, and may be some one as a clue. Me, I was very lucky
compiling with the SDK from the beginning - well ... I had my days of
headache trying to make things work, sure that's why Java seems to be
the easy way.

Regards
Ariel.


--
Ariel Constenla-Haile
La Plata, Argentina

[EMAIL PROTECTED]
[EMAIL PROTECTED]

http://www.ArielConstenlaHaile.com.ar/ooo/



"Aus der Kriegsschule des Lebens
- Was mich nicht umbringt,
macht mich härter."
Nietzsche Götzendämmerung, Sprüche und Pfeile, 8.





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



Re: [api-dev] Macros: argument is not optional

2008-02-12 Thread Andrew Douglas Pitonyak

Download AndrewMacro.odt and take a look at chapter 9 Formatting macros


--
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.odt
My Book: http://www.hentzenwerke.com/catalog/oome.htm
Info:  http://www.pitonyak.org/oo.php
See Also: http://documentation.openoffice.org/HOW_TO/index.html


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



Re: [api-dev] How to set chapter numbering (OOBasic) ?

2008-02-12 Thread Noelson Duarte
Hi,

>
> I'd like to change the way the chapters are numbered in a document
> through an OOBasic macro, like having "I. Heading 1" for Heading 1,
"A.
> Heading 2" for heading 2 and so on...
> Although I explored the document through Xray (and searched the
web), I
> wasn't able to find a method to do this. All I found is the
> getChapterNumberingRules, but it's a read-only method.
>
> Has anyone a method please ?
>
> Thx
>

Look for chapter 9.7 into this (pt_BR) doc:
http://broffice.org/files/programando_broo.odt and you'll get some
Basic code.

HTH



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



[api-dev] How to set chapter numbering (OOBasic) ?

2008-02-12 Thread Boris Ratak

Hi,

I'd like to change the way the chapters are numbered in a document 
through an OOBasic macro, like having "I. Heading 1" for Heading 1, "A. 
Heading 2" for heading 2 and so on...
Although I explored the document through Xray (and searched the web), I 
wasn't able to find a method to do this. All I found is the 
getChapterNumberingRules, but it's a read-only method.


Has anyone a method please ?

Thx


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



[api-dev] RE: Re: the meaning of "="

2008-02-12 Thread Jonathan Kaye
John Sisson wrote:

> The great resource for OO-Basic programming is Andrew Pitonyak's
> "OpenOffice.org Macros Explained". In there is a lot of help on all
> aspects of ooBasic programming including String functions such as
> split() which along with trim() seems appropriate to your task.
> Thanx - John S
Hi John,
Thanks for the tip. Yes, I have all the online stuff by Andrew but not his
actual printed book which is said to be better but expensive. Trim, I know
about since it's similar to other Trim functions in other languages. Split
is potentially useful but I'll have to learn a bit more about working with
arrays to use it and I'm not sure it would be anymore compact or readable
than the code I've already got.
Cheers,
Jonathan

-- 
Registerd Linux user #445917 at http://counter.li.org/
Please do not send me copies of list mail. I read the lists. Thanks!


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



Re: [api-dev] [NOT SOLVED] [C++] TextEmbeddedObject for inserting spreadsheet into swriter

2008-02-12 Thread Andre Heine
Hello Ariel,

I'm some steps higher:-)

But something strange happens...

I can compile your demo but I can see the string in the XCell ("This works!")
only two times. 
All other runs of the demo bring OOo to hang;()

Without any modifications on the source!

The same in my code...

The code, that cause the "hanging":

-- snip
Reference< XComponent > rEmbeddedObjectComponent = 
rEmbeddedObjectSupplier->getEmbeddedObject();
--

I'm using OOoSDK2.0 and OOo 2.0.4 on suse linux 10.2...
May be, my SDK or linux is broken...

I got following warning from "ld":

/usr/bin/ld: warning: libstdc++.so.6, needed 
by /opt/openoffice.org2.0/program/libcppu.so, may conflict with 
libstdc++.so.5

I ignore that, it's generally a problem in our project. We must use
for some libs libstdc++.so.5;-\

The comic is, that the code works in some cases without any modifications.
When OOo hangs I must kill all "soffice.bin" manually. 

At this time I'm very confused, but I don't surrender:-)


Best regards

Andre



Am Montag, 11. Februar 2008 21:01 schrieb Andre Heine:
> Hi Andre, Peter, *,
>
> Peter Eberlein escribió:
> > Hi Andre,
> >
> > Andre Heine schrieb:
> >> Ok, the next problem...
> >>
> >> Am Montag, 11. Februar 2008 15:37 schrieb Andre Heine:
> >>
> >>
> >> Ok, I can see the SpreadsheetDocument in my writer, but how can I
> >> access them?
> >>
> >> XTextContent has not any methods like getObject() or setObject()?
> >>
> >> How can I get the Object from XTextContent?
> >
> > An untested Java snippet:
> >
> > XTextEmbeddedObjectsSupplier xes = (XTextEmbeddedObjectsSupplier)
> > UnoRuntime.queryInterface(XTextEmbeddedObjectsSupplier.class, document);
> >
> > XNameAccess xna = xes.getEmbeddedObjects();
> >
> > if (xna.hasByName("Objekt1")) {
> >     XEmbeddedObjectSupplier xeo;
> >     try {
> >         embeddedObject
> > =(XTextContent)UnoRuntime.queryInterface(XTextContent.class,
> > xna.getByName("Objekt1"));
> >         xeo = (XEmbeddedObjectSupplier)
> > UnoRuntime.queryInterface(XEmbeddedObjectSupplier.class, embeddedObject);
> >         XComponent xComponent = xeo.getEmbeddedObject();
> >
> >
> > and so on...
>
> there is no need to browse all the embedded object collection of the
> document, and get it by name: you have already inserted it, so use
> XEmbeddedObjectSupplier, as follows:
>
>
> //***
> #include 
>
> #include 
> #include 
>
> #include 
> #include 
> #include 
> #include 
> #include 
> #include 
> #include 
> #include 
> #include 
> #include 
> #include 
> #include 
> #include 
> #include 
> #include 
> #include 
> #include 
> #include 
>
> using namespace std;
> using namespace rtl;
> using namespace com::sun::star::beans;
> using namespace com::sun::star::container;
> using namespace com::sun::star::document;
> using namespace com::sun::star::frame;
> using namespace com::sun::star::lang;
> using namespace com::sun::star::sheet;
> using namespace com::sun::star::table;
> using namespace com::sun::star::text;
> using namespace com::sun::star::uno;
>
>
> int SAL_CALL main( int argc, char* argv[] ) {
> try {
> // bootstrap the office
> Reference< XComponentContext > rContext (
> ::cppu::bootstrap() );
>
> Reference< XMultiComponentFactory > rMCF =
> rContext->getServiceManager();
>
> // instantiate the Desktop and get a reference to
> XComponentLoader Reference < XComponentLoader > rComponentLoader(
> rMCF->createInstanceWithContext( OUString(
> RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" ) ), rContext ),
> UNO_QUERY_THROW );
>
> // load a new empty OOo Writer document
> Reference< XTextDocument > rTextDocument (
> rComponentLoader->loadComponentFromURL(
> OUString( RTL_CONSTASCII_USTRINGPARAM(
> "private:factory/swriter" ) ), OUString( RTL_CONSTASCII_USTRINGPARAM(
> "_blank" ) ), 0,
> Sequence < ::com::sun::star::beans::PropertyValue
> >() ), UNO_QUERY );
>
> // get the XText interface
> Reference< XText > rText = rTextDocument->getText();
>
> // create a text cursor
> Reference< XTextCursor > rTextCursor =
> rText->createTextCursor(); rTextCursor->gotoStart( sal_False );
> // insert a paragraph brake
> rText->insertControlCharacter(
> rTextCursor->getEnd(),
> ControlCharacter::PARAGRAPH_BREAK, sal_False);
>
> // get the document's factory
> Reference< XMultiServiceFactory > rDocFactory (
> rTextDocument, UNO_QUERY );
>
> // create an embedded object
> // get its XTextContent interface
> Reference< XTextContent > rTextContent (
> rDocFactory->createInstance( OUString(
> RTL_CONSTASCII_USTRINGPARAM( "co