Re: [api-dev] storing textrange to a stream

2005-02-04 Thread Christian Junker
Hi Marc,

the xmlcontent is what it says it is :). 
It's simply a string automatically put together in another function
that builds up a simple xml structure.

But as you're dealing with objectoutput and not textoutput you
wouldn't write strings into your file but dump actual OpenOffice
objects into it.

Best Regards
Christian Junker

On Fri, 04 Feb 2005 02:44:08 +0100, Marc Santhoff
[EMAIL PROTECTED] wrote:
 Am Fr, den 04.02.2005 schrieb Christian Junker um 01:21:
  Hi Marc, yes that is possible.
 
 Hi Christian,
 
 wow, that loks promising, thank you.
 
 Although it'll take some time for me to understand and adapt to my
 needs, there's one question left at once, see inline:
 
  I will give you some code that will show you how to deal with xml
  outputstreams (it's actually pretty similiar to Java's API):
  snip
   fileAccessService = createUnoService(com.sun.star.ucb.SimpleFileAccess)
   textOutputStream = createUnoService(com.sun.star.io.TextOutputStream)
 
   If fileAccessService.exists(SaveFileName) Then
If fileAccessService.isReadOnly(SaveFileName) Then
IOStreamXML = -2
Exit Function
End If
   End If
   'now open the file..
   outputStream = fileAccessService.openFileWrite(SaveFileName)
 
   outputStream.truncate()
   textOutputStream.setOutputStream(outputStream)
   textOutputStream.writeString(xmlcontent)
 
 What type of thing is this xmlcontent? That's the missing link to the
 documents content, I think. :)
 
   'Close the Xml File, no writing possible anymore
   textOutputStream.closeOutput()
 'msgbox xml saved under:   SaveFilename '[dbg]
  /snip
 
  Don't worry about the If statements and what is happening in there,
  because I took this code fragment out of a bigger macro that I have
  written.
  You can see that I use the [...]io.TextOutputStream, you would need to
  apply the [...].io.ObjectOutputStream service of course.
 
  I hope that the code is enough to give you the start. The IDL
  reference, the Developer's Guide - and in case you need advanced
  information about data sinks etc. the udk project page - should give
  you enough information to write a good working implementation.
 
  Hope this helps in some way.
 
  Best Regards
  Christian Junker
 
  On Thu, 03 Feb 2005 16:01:25 +0100, Marc Santhoff
  [EMAIL PROTECTED] wrote:
   Hi,
  
   is there any chance of storing arbitrary writer text snippets (mostly
   TextRange ojects) into an OutputStream (or to a TextOutputStream
   represented as XML)?
  
   Think of autotexts that are streamed away instead of being stored in any
   container file while not losing formatting ...
  
   TIA,
   Marc
  
   -
   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]
 


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



Re: [api-dev] insert a bunch of paragraphs into main text via API

2005-02-04 Thread Marc Santhoff
Am Fr, den 04.02.2005 schrieb Andrew Douglas Pitonyak um 04:18:
 Marc Santhoff wrote:
 
 Hi,
 
 I'm stuck with text portions again:
 
 The task is to insert a TextRange consisting of one or more paragraphs
 with complex char and paragraph formatting into a given text.
 
 How is this expected to be done?
 
 I read any type of docs, but found no direct method of doing so. I can
 insert a string without formatting or some special TextContent. But
 nothing inbetween. Okay, I can use the clipboard ...
 
 If this is missing from the api I think it's worth an RFE.
 
 TIA,
 Marc
   
 
 Hi Marc,

Hello Andrew

 I am not certain that I understand what you want to do Do you want 
 to COPY a range of text from one location to another? Of so, then you 
 probably want to copy to the clipboard and then paste.

No.

 Or, do you want to insert a lot of text that will contain special 
 formatting?

Yes, tht's what I'd like to achieve.

 If you want to insert text with special formatting, you 
 probably want to first insert the text as a string and then apply the 
 formatting. You are correct that this is not ideal You may want to 
 consider using a paragraph style. This will make it much easier to apply 
 formatting to sections of the text without setting individual properties.

This is no good way of doing it, because I have several preformatted
text pieces and I do not know, what formatting is involved. If there's
no other option I have to decompose any text snippet into it's atoms and
formattings before saving and reapply them afterwards. This is why I'm
asking about streaming in another thread.

In principle it is like using aututexts from another source.

I really think there is something missing from the API ...

Thanks,
Marc



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



[api-dev] Re: Creating a resizeable dialog.

2005-02-04 Thread Curtis Clauson
Curtis Clauson wrote:
How do you create a resizeable OOo Basic dialog?
There is no setting for this in the IDE form editor. I've tried setting 
the Sizeable property of the dialog Model to True before execution, 
but it has no effect.
Still no progress on this. Even if you create the UNO dialog by creating 
a com.sun.star.awt.UnoControlDialog service instance and setting the 
model to a created com.sun.star.awt.UnoControlDialogModel with the 
Sizeable property set to True, the dialog is still not resizeable.

Resizeable dialogs are such a fundamental requirement, there's got to be 
a way to do this. Anyone??

--

The Snake Pit - Development   www.TheSnakePitDev.com
Curtis Clauson[EMAIL PROTECTED]
Proprietor
Any sufficiently over-complicated magic is indistinguishable from 
technology. -- Llelan D.

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