Re: copy part of text from api

2024-04-13 Thread Andrew Pitonyak
I will not have access to check (probably only my phone for a week or two), but 
can you pull xtransferable content from a cursor or range?

⁣Get BlueMail for Android ​

On Apr 13, 2024, 12:35 PM, at 12:35 PM, Zorg  wrote:
>Hello
>
>Hope some can help us here
>
>Here is the  problem
>
>
>We are developing our software using the uno api python
>(https://github.com/Probesys/lotemplate)
>
>We try to copy a text in a odt file and paste it without loosing the
>format of the text and without using the clipboard
>
>We know how to paste html
>
>https://github.com/Probesys/lotemplate/blob/master/lotemplate/classes.py
>
>(line 165-185)
>
>but we don't know how we can't copy a selected text without loosing
>format
>
>Actually we use .insertString
>
>https://github.com/Probesys/lotemplate/blob/master/lotemplate/Statement/ForStatement.py
>
>(line 286)
>
>
>I know it's possible to do it  using
>com.sun.star.datatransfer.clipboard.SystemClipboard
>
>But in that case we must embed a Xserver inside the docker container
>what we want to avoid
>
>So if anyone wants to give us a solution or a hint on how to do this
>
>thanks
>
>Zorg


Re: paste html using API

2023-03-26 Thread Andrew Pitonyak

I have no idea if this will be of any use to you or not, but...

I do not generally use the API using Python so I cannot comment on using 
Python. 

I have also not used headless mode so I cannot comment on what is and is not 
available other than knowing that dispatches are not available. 

Finally, I have done almost nothing using the clipboard, but... 

First note that the clipboard should have content of different varieties. I 
assume that you are aware of this because you have a line as follows: 

 copy_with_format(value, 'text/html')
 
 And if I look at the clipboard I see this as an available type
 
   Dim sClipName As String
  Dim oClip As Object
  Dim oFlavors As Variant
  Dim oFlavor As Variant
  Dim i as Integer
  Dim s as String
  
  sClipName = "com.sun.star.datatransfer.clipboard.SystemClipboard"
  oClip = createUnoService(sClipName)
  oFlavors = oClip.getContents().getTransferDataFlavors()
  s = ""
  For i = LBound(oFlavors) To UBound(oFlavors)
    oFlavor = oFlavors(i)
    s = s & i & " : " & oFlavor.MimeType
    s = s & CHR$(10)
  Next
  MsgBox s
  
  
  I see that method defined in this code here: 
  
  
https://github.com/Probesys/lotemplate/blob/html_formatting/lotemplate/utils.py
  
  I see that you open a pipe. 
  
  I did some experiments and I am extracting the actual HTML. I assume that 
this is not really what you want, but this is how I extract it and display it. 
I was simply playing around with it out of curiousity.
  
    Dim sClipName As String
  Dim oClip As Object
  Dim oFlavors As Variant
  Dim oFlavor As Variant
  Dim i as Integer
  Dim idx as Integer
  Dim s as String
  
  sClipName = "com.sun.star.datatransfer.clipboard.SystemClipboard"
  oClip = createUnoService(sClipName)
  oFlavors = oClip.getContents().getTransferDataFlavors()
  s = ""
  idx = -1
  For i = LBound(oFlavors) To UBound(oFlavors)
    oFlavor = oFlavors(i)
    s = s & i & " : " & oFlavor.MimeType
    If oFlavor.MimeType = "text/html" Then
      idx = i
    End If
    s = s & CHR$(10)
  Next
  'MsgBox s
  
  If idx < 0 Then
    Print "text/html mime type not found"
    Exit Sub
   End If
  
  ' Now print the actual HMTL as a string!
  Dim oData As Variant
  oData = oClip.getContents().getTransferData(oFlavors(idx))
  s = ""
  For i = LBound(oData) To UBound(oData)
    s = s & CHR$(oData(i))
  Next
  MsgBox s

If I kept going, then I would attempt to then use the transferable content 
directly, which is obtained from oClip.getContents() I believe. But, one of the 
real questions is Does the clipboard have the contents shown in the correct 
format? I assume it does. 

So, perhaps this helps a little anyway. 

Andrew Pitonyak


On Sunday, March 26, 2023 06:06 EDT, Zorg  wrote:
  
Hello
Hope some can help me here
Here is my  problem

We are developing our software using the uno api python
We re trying to to copy a string formatted in html in a libreoffice odt
We manage to do it but using dispatcher
The problem is that dispatcher not working in headless mode so il force us to 
use a xserver (xvfb) et Xclip.
It work but it's far from being optimized.
here is the code 
https://github.com/Probesys/lotemplate/blob/html_formatting/lotemplate/classes.py
 line 349-355
We have try using XTransferable but without any success.
Thanks in advance for your help
Sorg   

 


Re: Bug 81720

2022-08-19 Thread Andrew Pitonyak
Phil,

You surely do NOT need my approval :-)

I was just asking since it seems consistent with other things in libre office.

Now I am curious about a field as the last thing in a document.  :-)

Had not considered using ESC to put the cursor out of a field, on the surface 
it feels like a really smart solution, but to be clear, if the devs choose to 
simply have an adjacent chair always be outside the field I would not complain, 
it would solve the end of document problem but makes it more difficult to 
append text in a field or deal with a one character looking field.

The zero length field... Uggg. Had not considered that one.

I am very happy to see how thoroughly y'all are working to get a correct 
solution.

Andrew.

⁣Get BlueMail for Android ​

On Aug 19, 2022, 7:26 PM, at 7:26 PM, Phillips Rogfield  
wrote:
>Hello,
>
>You are right that by putting the cursor to the left it writes normal
>text. It only happens when you put the cursor to the right of the
>field.
>
>It is not necessary that the field is the last thing in a file. It is
>sufficient it is the last thing in a paragraph. In this case you won't
>be able to insert text after the field without expanding the field. At
>least it will be not so simple. You will have to press Enter, space,
>left arrow, backspace, right arrow, and type.
>
>I also noticed an exception: if you don't select anything, and do
>Insert
>-> Cross Reference ->  Set Reference, type a name, press Insert and
>then
>Close, it will insert an empty reference (which I have no idea why it
>differs conceptually from a bookmark?). This empty reference will be
>not
>modifiable: nor by putting the cursor to the left nor to the right, the
>
>text of the reference will stay empty.
>
>So exception aside, I think maybe a good compromise would be that, if
>the user put the cursor on the right of a field, and press "Esc", it
>will start to type outside of the field, without expanding the field?
>Would that work?
>
>Best,
>
>Phil
>
>On 19/08/2022 16:04, Andrew Pitonyak wrote:
>> The general expected behavior in libre office, at least for me, is
>> that if I place the cursor and start typing, that it will continue
>> using the same attributes and properties of the character directly to
>
>> the left of the cursor. So, if I have bold text, and I placed the
>> cursor to the left of the bold text and I type, it will not be bold,
>> it will be whatever is to the left of the cursor. If the cursor is
>> immediately to the right of the bold text however then it will be
>bold.
>>
>> In this case, I assume, but have not verified or checked in anyway, 
>> references are a field. So the intent of this is to make certain that
>
>> when the cursor is sitting directly to the left or right of, whatever
>
>> is typed does not end up inside of that field. One side effect of
>this
>> I expect, is that if you have a field with only one character you
>will
>> have no way of modifying the text inside the field unless there is
>> some special case when the text of the field is selected. I did not
>> even check, can I select the text in a field? So what if the
>selection
>> is partially in a field?
>>
>> I would never have considered this a bug, I would have just
>considered
>> it an extension of expected behavior. The annoying part is that if
>the
>> field is the last thing in a file you have no way to add text after
>> the field unless you do it programmatically, but that is also true
>> last I checked of text tables.
>>
>> I hope other contributors to comments in the bugs are correct that it
>
>> is an easy fix, but I am skeptical.
>>
>> Get BlueMail for Android <https://bluemail.me>
>> On Aug 19, 2022, at 9:41 AM, Phillips Rogfield
>
>> wrote:
>>
>> Dear developers,
>>
>> I would like to fix bug 81720
>> <https://bugs.documentfoundation.org/show_bug.cgi?id=81720#c22>.
>>
>> Basically when you insert a ReferenceMark, if you put the cursor
>> at the edge of it (start or end), and type something, it will
>> expand on the reference mark instead of writing it as a “normal
>text”.
>>
>> You can find how to reproduce it in comment 22
>> <https://bugs.documentfoundation.org/show_bug.cgi?id=81720#c22>.
>>
>> I have set up my environment, but I’m not sure where is the code
>> that “checks” if something is a ReferenceMark, if anything.
>>
>> Can you point me in the right direction, please?
>>
>> Best,
>>
>> Phil
>>
>> ​
>>


Re: Bug 81720

2022-08-19 Thread Andrew Pitonyak
The general expected behavior in libre office, at least for me, is that if I 
place the cursor and start typing, that it will continue using the same 
attributes and properties of the character directly to the left of the cursor. 
So, if I have bold text, and I placed the cursor to the left of the bold text 
and I type, it will not be bold, it will be whatever is to the left of the 
cursor. If the cursor is immediately to the right of the bold text however then 
it will be bold.

In this case, I assume, but have not verified or checked in anyway,  references 
are a field. So the intent of this is to make certain that when the cursor is 
sitting directly to the left or right of, whatever is typed does not end up 
inside of that field. One side effect of this I expect, is that if you have a 
field with only one character you will have no way of modifying the text inside 
the field unless there is some special case when the text of the field is 
selected. I did not even check, can I select the text in a field? So what if 
the selection is partially in a field?

I would never have considered this a bug, I would have just considered it an 
extension of expected behavior. The annoying part is that if the field is the 
last thing in a file you have no way to add text after the field unless you do 
it programmatically, but that is also true last I checked of text tables.

I hope other contributors to comments in the bugs are correct that it is an 
easy fix, but I am skeptical.

⁣Get BlueMail for Android ​

On Aug 19, 2022, 9:41 AM, at 9:41 AM, Phillips Rogfield  
wrote:
>Dear developers,
>
>I would like to fix bug 81720
>.
>
>Basically when you insert a ReferenceMark, if you put the cursor at the
>
>edge of it (start or end), and type something, it will expand on the
>reference mark instead of writing it as a “normal text”.
>
>You can find how to reproduce it in comment 22
>.
>
>I have set up my environment, but I’m not sure where is the code that
>“checks” if something is a ReferenceMark, if anything.
>
>Can you point me in the right direction, please?
>
>Best,
>
>Phil
>
>​


Re: Headless mail merge

2022-04-06 Thread Andrew Pitonyak
The first step is always do it without a script until you like the result. Then 
you try to automate it.

I did it a few times many years ago and do not remember the process.

⁣Get BlueMail for Android ​

On Apr 6, 2022, 3:37 PM, at 3:37 PM, Marco Marinello  
wrote:
>Hi Andew,
>
>
>thank you for your answer. I'll take a look at the links you pointed
>to.
>
>The idea is, starting from a template in odt/doc/docx, to "fill in the
>gaps" and save the filled document. Is there any other way rather than
>mail merge?
>
>
>All the best,
>
>Marco
>
>
>Il 06/04/22 18:19, Andrew Pitonyak ha scritto:
>>
>> I had planned on documenting how to do this some years back and
>> AndrewBase.odt, and my only notes say that I should document the new
>> e-mail merge API released in OpenOffice.org version 2.01; that was a
>> long time ago. 
>>
>> I generally do not have reason to use mailmerge, but did you want to
>> send something by email or to print? 
>>
>> Someone posted a question about using mail merge with UNO in Basic
>here: 
>>
>>
>https://ask.libreoffice.org/t/syntax-for-using-spreadsheet-as-data-source-in-emailmerge-macro/24831
>>
>> From my perspective, the fact that they used the
>> server com.sun.star.text.MailMerge is useful in that it provides a
>> pointer to the service to look at. 
>>
>> Another request for help here: 
>>
>> https://forum.openoffice.org/en/forum/viewtopic.php?f=20=59312
>>
>> No answer; sadly. 
>>
>> In AndrewMacro.odt, there is an example that merges a bunch of
>> documents from a directory into a single document and it is listed as
>> being related to "mail merge", so I assume that somebody had run a
>> mail merge and this processes created many documents. But again, I
>> have not run a mail merge in many years. 
>>
>> On Wednesday, April 06, 2022 06:47 EDT, Marco Marinello
>>  wrote:
>>  
>>> Hi all,
>>>
>>>
>>> what's the easiest way to perform a mail-merge with libreoffice by
>>> passing arguments from an automated script? Should I use UNO?
>>>
>>> Do you have any reference?
>>>
>>>
>>> Thanks in advance,
>>>
>>> Best,
>>>
>>> Marco
>>>
>>>  
>>
>>
>>  


Re: Headless mail merge

2022-04-06 Thread Andrew Pitonyak

I had planned on documenting how to do this some years back and AndrewBase.odt, 
and my only notes say that I should document the new e-mail merge API released 
in OpenOffice.org version 2.01; that was a long time ago. 

I generally do not have reason to use mailmerge, but did you want to send 
something by email or to print? 

Someone posted a question about using mail merge with UNO in Basic here: 

https://ask.libreoffice.org/t/syntax-for-using-spreadsheet-as-data-source-in-emailmerge-macro/24831

>From my perspective, the fact that they used the server 
>com.sun.star.text.MailMerge is useful in that it provides a pointer to the 
>service to look at. 

Another request for help here: 

https://forum.openoffice.org/en/forum/viewtopic.php?f=20=59312

No answer; sadly. 

In AndrewMacro.odt, there is an example that merges a bunch of documents from a 
directory into a single document and it is listed as being related to "mail 
merge", so I assume that somebody had run a mail merge and this processes 
created many documents. But again, I have not run a mail merge in many years. 

On Wednesday, April 06, 2022 06:47 EDT, Marco Marinello 
 wrote:
 Hi all,


what's the easiest way to perform a mail-merge with libreoffice by
passing arguments from an automated script? Should I use UNO?

Do you have any reference?


Thanks in advance,

Best,

Marco

 

 


Re: tdf#140286 - CALC formula =INFO("OSVERSION") gives wrong output

2022-01-17 Thread Andrew Pitonyak

On Monday, January 17, 2022 17:17 EST, Wol  wrote:
 On 14/01/2022 22:24, Wols Lists wrote:
> On 14/01/2022 21:26, Chris Sherlock wrote:
>> I will work on a patch for Linux that parses /etc/os-release with a
>> fallback to just the kernel version if that is not available
>> (virtually all desktop systems use systemd now).
>
> Are you sure?
>
> Okay, it's mostly the mad hold-outs, but Devuan, funtoo, gentoo, that's
> three distros off the top of my head that don't default to systemd. And
> they're the ones (gentoo especially) that devs might well be running.
>
> I think a sane set of options from uname is much better. That's pretty
> much guaranteed to be universal, I believe, and you could even make the
> options a user-specified matter should they be mad enough to want to.
>
Just looked at /etc/os-release (as you may have guessed my gentoo system
does run systemd), and the ONLY useful information you'll get from it is
"Gentoo Linux".
So for those people who want more than just the distro name, os-release
is not enough.

anthony@thewolery ~/gitstuff/ScarletDME $ cat /etc/os-release
NAME=Gentoo
ID=gentoo
PRETTY_NAME="Gentoo/Linux"
ANSI_COLOR="1;32"
HOME_URL="https://www.gentoo.org/;
SUPPORT_URL="https://www.gentoo.org/support/;
BUG_REPORT_URL="https://bugs.gentoo.org/;
anthony@thewolery ~/gitstuff/ScarletDME $

Cheers,
WolI like the "PRETTY_NAME" and VERSION_ID as provided by /etc/os-release, and 
this is usually enough for most people. I commonly ask people which version of 
their OS they are running, but I rarely ask for more details than that; 
although I will admit that a certain Windows 10 release was not supporting 
something I was doing. 

What do you show from /proc/version? Lots of useful information ther, but, I 
need to work harder to recognize that my primary computer is running FEDORA. 

[andy@DESKTOP-6U3CUIF ~]$ cat /proc/version
Linux version 5.15.13-200.fc35.x86_64 
(mockbu...@bkernel01.iad2.fedoraproject.org) (gcc (GCC) 11.2.1 20211203 (Red 
Hat 11.2.1-7), GNU ld version 2.37-10.fc35) #1 SMP Wed Jan 5 16:39:13 UTC 2022



 


Re: ConfigManager warning

2021-12-26 Thread Andrew Pitonyak
Not that it helps your problem, but this is how I do it in basic

https://www.pitonyak.org/AndrewFontMacro.odt


⁣Get BlueMail for Android ​

On Dec 26, 2021, 2:08 PM, at 2:08 PM, Chris Sherlock 
 wrote:
>Hi all,
>
>I'm writing a basic utility to list font details, but I'm getting the
>following warning when I invoke the program:
>
>warn:unotools.config:79699:79699:unotools/source/config/configmgr.cxx:147:
>ConfigManager not empty
>
>Gerrit change is here:
>
>https://gerrit.libreoffice.org/c/core/+/127365
>
>Anyone know why this warning occurs? And how would I prevent it?
>
>Chris


bug related to how Basic handles arrays of Structures, location suggestions

2021-12-06 Thread Andrew Pitonyak

Wolfgang,
I verified that there is a bug related to how Basic handles arrays of 
Structures.
I tested against LibreOffice 7.2.2.2 on Fedora Linux as well as Windows 7.1.2.2 
and 7.2.4.1 so I filed a bug report:
https://bugs.documentfoundation.org/show_bug.cgi?id=146082
Note that a Structure copies by value, not be reference.
A work around until the bug is fixed, is to not use a notation such as:
 
Dim p(1 To 2) As PersonType
Dim p(1 To 2) As New com.sun.star.awt.Point
 
Instead, define the array as an Object or Variant and then initialize each entry
 
p(1) = CreateUnoStruct( "com.sun.star.awt.Point" )
p(2) = CreateUnoStruct( "com.sun.star.awt.Point" )
 
Use CreateObject("PersonType") for user defined types.
 
Developers,
 
Any suggestions as to where I might find the code where an array is 
“initialized” or where to look for handling to suggest what might cause the 
really strange behavior? I have not looked at LibreOffice code or built it for 
a while now.
 
Clearly there are differences in how an UNO struct and a user defined structure 
is created and stored since an array value might show as different depending on 
whether or not we copy it after access it. And how different solutions vary 
depending on the type after passed as an argument.
 
For those who are interested but too lazy to look up the bug referenced above:
 
This bug was originally noted with a user defined type so I wrote a test using 
a built-in UNO Struct com.sun.star.awt.Point
 
Test using User type “PersonType”
 
Type PersonType
FirstName As String
LastName As String
End Type
 
Sub PrintPersons(s, x)
Print "Expect (" & s & ") found (" & x.FirstName & " " & x.LastName & ")"
End Sub
 
Sub PrintPoint(s, x)
Print "Expect " & s & " Found (" & x.X & ", " & x.Y & ")"
End Sub
 
This is the original disturbing code. Attempting to copy an element from the 
array causes problems. The same when trying to assign back into to the array.
 
 
Sub otherExampleCreateNewType
REM Producing very strange errors.
REM Inspect the two array elements and h at the same time
REM down to the inside variables while executing lines 19 through 21 stepwise.
 
Dim Person(1 To 2) As PersonType
Person(1).FirstName = "Andrew"
Person(1).LastName = "Pitonyak"
Person(2).FirstName = "Funny"
Person(2).LastName = "Lupp"
 
PrintPersons("Andrew", Person(1)) ' Andrew (correct)
PrintPersons("Funny", Person(2)) ' Funny (correct)
 
Dim h As PersonType
h = Person(1)
Person(1) = Person(2)
Person(2) = h
PrintPersons("Funny", Person(1)) ' Andrew (wrong)
PrintPersons("Andrew", Person(2)) ' Funny (wrong)
 
REM Now look at the prints, and frown.
Dim h1 As PersonType, h2 As PersonType
h1 = Person(1)
h2 = Person(2)
PrintPersons("Funny", h1) ' Funny (correct)
PrintPersons("Andrew", h2) ' Funny (wrong)
 
End Sub
 
Next I run this using a built-in UNO type and have exactly the same incorrect 
behaviors
Sub otherExampleCreateAWTPoint
 
Dim p(1 To 2) As New com.sun.star.awt.Point
p(1).X = 1
p(1).Y = 2
p(2).X = 3
p(2).Y = 4
 
PrintPoint("(1, 2)", p(1)) ' Correct
PrintPoint("(3, 4)", p(2)) ' Correct
 
Dim h As New com.sun.star.awt.Point
h = p(1)
p(1) = p(2)
p(2) = h
PrintPoint("(3, 4)", p(1)) ' wrong
PrintPoint("(1, 2)", p(2)) ' wrong
 
REM Now look at the prints, and frown.
Dim h1 As New com.sun.star.awt.Point, h2 As New com.sun.star.awt.Point
h1 = p(1)
h2 = p(2)
PrintPoint("(3, 4)", h1) ' Correct
PrintPoint("(1, 2)", h2) ' Wrong
 
End Sub
 
I then changed how the array is declared as shown below and this fixed the 
problematic
 
Dim p(1 To 2) As Object
p(1) = CreateUnoStruct( "com.sun.star.awt.Point" )
p(2) = CreateUnoStruct( "com.sun.star.awt.Point" )
 
Doing the same for the PersonType also causes it to work as expected:
 
Dim Person(1 To 2) As Object
Person(1) = CreateObject("PersonType")
Person(2) = CreateObject("PersonType")
 
It gets worse. If I modify the subroutine to always make a copy of the object 
and then use the object that is passed to the subroutine, then suddenly the 
first program works for points, but the same fix does not work when done for 
PersonType.
 
Sub PrintPoint(s, y)
Dim x
x = y
Print "Expect " & s & " Found (" & x.X & ", " & x.Y & ")"
End Sub
 
Clearly something is wrong / inconsistent.
 
 
 


Re: Added some information about Qt Creator IDE integration to the wiki

2021-02-10 Thread Andrew Pitonyak

Very nice, appreciated by my anyway!

On Wednesday, February 10, 2021 09:25 EST, Hossein Noorikhah 
 wrote:
 Hi,

I have added some information about how to use Qt Creator for
building, running and debugging LibreOffice in the appropriate section
of the wiki:
https://wiki.documentfoundation.org/Development/IDE#Qt_Creator

I think other sections related to other IDEs also need to be revised
and improved, because not everything works out of the box in the IDEs.

Regards,
Hossein
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


 
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: FastSaxParser ans XFastParser

2020-11-26 Thread Andrew Pitonyak
I think that it is an external package. Search for libxml c++

so does my expectation that you need to install it and then make sure that your 
library includes no to look where it is installed. The latter part might come 
for free depending on your environment. For example, I'm Linux I probably could 
use dnf install  libXML and then everything would just work. But I'm just 
guessing.

Hopefully this at least gives you a place to look

⁣Sent from BlueMail ​

On Nov 26, 2020, 5:38 PM, at 5:38 PM, "Dante Doménech" 
 wrote:
>Hello.
>I'm sorry for asking stuff like this, but I'm not a full fledged
>developer
>and stuff like this is quite hard for me.
>
>Starmath mathml is supposed to use FastSaxParser (or I understand
>that). At
>least changes on FastSaxParserImpl will have repercussions on it.
>However,
>on mathmlimport.cxx we do use XFastParser. However FastSaxParser is a
>child
>class of XFastParser, so changes on it should not have repercussions on
>it's parent.
>
>So, what are we actually doing? And how has this stuff to be treated?
>Or at least some kind of documentation emplaining which kind of process
>are
>we using.
>
>If you try to copy paste the code outside to do some customized parser,
>it
>will break. There is that #*include* 
>
>which there is nowhere to be found (opengrok also fails in looking for
>it).
>There is no such file inside the only libxml directory to be found and
>the
>others files with that name don't seem to be related by the stuff that
>breaks when removed: xmlEntity, xmlEntityPtr, xmlChar, ... xml basic
>definitions.
>
>So, does anyone know which file is it?
>
>
>
>
>___
>LibreOffice mailing list
>LibreOffice@lists.freedesktop.org
>https://lists.freedesktop.org/mailman/listinfo/libreoffice
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


RE: calc: jumbo sheets on windows (never gonna happen)

2020-10-06 Thread Andrew Pitonyak
I think that the important point is that people do it in excel. They then try 
to open the file and they cannot. I have certainly been handled really large 
files perhaps it is simply a CSV file with lots of rows and I know how to deal 
with the spreadsheet so that's how I open it. Quick and dirty and off we go.

In general, these types of files come from a client so what are you going to 
do. I cannot tell you the number of times that someone has said hey we want to 
be able to open that in a spreadsheet program.

how often I see it is highly dependent on which projects I happen to be working 
at the time period. I think it's crazy? Yes. Do people do it successfully? Yes.

⁣Sent from BlueMail ​

On Oct 6, 2020, 6:22 PM, at 6:22 PM, nicholas ferguson 
 wrote:
>Can I ask what kind of platform would you use for 16 million rows that
>involve calculations?
>
>From: LibreOffice [mailto:libreoffice-boun...@lists.freedesktop.org] On
>Behalf Of Dan Lewis
>Sent: Tuesday, October 06, 2020 2:59 PM
>To: libreoffice@lists.freedesktop.org
>Subject: Re: calc: jumbo sheets on windows (never gonna happen)
>
>From my perspective, one needs to learn how to create a database in
>Base including tables, queries, forms and report when working with this
>much data. It is designed to handle large amounts of it. MySQL,
>Postgresql, and Oracle can be used as a backend  for Base being the
>front end.
>Dan
>On 10/6/20 12:09, Noel Grandin wrote:
>Hi
>
>i.e. very large spreadsheets of up to 16 million rows.
>
>So I did some more investigation into this. In various places, we need
>to accumulate things like row-heights and other things, numbers which,
>with jumbo sheets, easily exceed 32-bits.
>
>HOWEVER
>
>All over the place, we pass these values through
>sal_uLong/sal_Long/long/unsigned long.
>
>Which is 32-bits on Windows. Doh!
>
>Honestly, the only solution I can think of (and one I confidently
>expect us to reject), is that we declare a flag day, and search and
>replace sal_Long/sal_uLong/long/unsigned long with a 64-bit type across
>the ENTIRE code base.
>
>Regards, Noel Grandin.
>
>
>
>
>___
>LibreOffice mailing list
>LibreOffice@lists.freedesktop.org
>https://lists.freedesktop.org/mailman/listinfo/libreoffice
>
>
>
>
>___
>LibreOffice mailing list
>LibreOffice@lists.freedesktop.org
>https://lists.freedesktop.org/mailman/listinfo/libreoffice
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


Re[2]: Enabling Calc macro recording

2020-08-18 Thread Andrew Pitonyak

I guess if it will end up in the documentation, I should be more specific and 
not just go from memory!

The most versatile method to manipulate an LO document is to get the internal 
UNO objects and manipulate them. Using the model provides significant control, 
but you must understand much about the different services and interfaces. 
Another method, which requires very little understanding of the LO internals, 
is to use a UNO dispatcher. The macro recorder uses the dispatcher for all 
commands. The dispatcher requires (1) the command to dispatch such as 
".uno:Undo", (2) arguments that control the dispatch, and (3) an object capable 
of performing the dispatch. When writing your own macros, it is usually better 
to use the object model rather than the dispatcher. That said, some things are 
best handled by the dispatcher; for example, controlling the clipboard. The 
problem with using the macro recorder are that: 

1. The dispatches are not documented and are stated to be subject to change; 
although I have not seen them change over time. 
2. The recorder ignores some values from dialogs that are opened while 
recording a macro. It is possible, therefore, that you will record a 
complicated macro that will not actually playback everything that you did. One 
example is CSV import, the generated macro does nothing. I just verified that 
this is true. 


Side note, my book OOME, which is available as a free download, contains a 
macro that will enumerate the supported dispatches. Last time I ran it, it 
generated over 300,000 rows of dispatch commands. 

On Tuesday, August 18, 2020 14:40 EDT, "Steve (GMail)" 
 wrote:
  Thanks Andrew. I feel a need to put a brief clarification in Chapter 12 of 
the 7.0 Calc Guide. Regards, Steve  -- Original Message --From: "Andrew 
Pitonyak" To: "Steve (GMail)" 
Cc: "Development List" 
Sent: 18/08/2020 19:31:34Subject: Re: 
Enabling Calc macro recording It may not record input from a dialog. As an 
example, if you import a CSV file, I think that it does not remember the 
parameters that you used for the import. 

The macro it produces does not use commands that directly modify the underlying 
object model but instead build an object to encapsulate each call and send that 
object. This can make it more difficult to modify the created macro. 

On Tuesday, August 18, 2020 14:00 EDT, "Steve (GMail)" 
 wrote:
  All, In Calc, I notice the option to enable macro recording at Tools > 
Options > LibreOffice > Advanced is entitled "Enable macro recording (may be 
limited)".  Can anybody advise what to "(may be limited)" caveat refers to? 
Regards,
Steve Fanning 


 


 
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Enabling Calc macro recording

2020-08-18 Thread Andrew Pitonyak

It may not record input from a dialog. As an example, if you import a CSV file, 
I think that it does not remember the parameters that you used for the import. 

The macro it produces does not use commands that directly modify the underlying 
object model but instead build an object to encapsulate each call and send that 
object. This can make it more difficult to modify the created macro. 

On Tuesday, August 18, 2020 14:00 EDT, "Steve (GMail)" 
 wrote:
  All, In Calc, I notice the option to enable macro recording at Tools > 
Options > LibreOffice > Advanced is entitled "Enable macro recording (may be 
limited)".  Can anybody advise what to "(may be limited)" caveat refers to? 
Regards,
Steve Fanning 


 
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Forced Updates? WTF?

2020-06-09 Thread Andrew Pitonyak
Ten computers, have not seen this behavior even though I want it on a few of 
them. Did not even know LO could do it.

⁣Sent from BlueMail ​

On Jun 9, 2020, 6:49 PM, at 6:49 PM, "Christoph Schäfer" 
 wrote:
>
>
>> Gesendet: Dienstag, 09. Juni 2020 um 09:36 Uhr
>> Von: "Mike Kaganski" 
>> An: "Christoph Schäfer" ,
>LibreOffice@lists.freedesktop.org
>> Betreff: Re: Forced Updates? WTF?
>>
>> On 09.06.2020 3:22, Christoph Schäfer wrote:
>> > I never thought this was possible with LO, but it looks like the
>developers have chosen to override my default settings (notification,
>but no automatic updates). Yet, an update from 6.3 to 6.4 (Windows 10)
>has been enforced on me, which also led to data loss, as well as losing
>the "Recently Used" entries in the File dialogue.
>> >
>> >
>> > If this wasn't an attempt by Microsoft to damage LO (I'm on Windows
>10), I have to ask: What the hell were you thinking?
>> >
>> >
>> > This is unacceptable.
>>
>> ... so re-wording all that, "I don't know what had happened; and I
>don't
>> tell you all the details (like how had I installed LO in the first
>place
>> - e.g. from MSI taken from TDF site, or from Windows Store); and
>which
>> "helpful software" might be installed on my system helping to keep
>> software "up-to-date"; and I even don't know if that was some
>deliberate
>> decision, or a bug, - but I choose to be rude from start."
>>
>> I doubt it being acceptable.
>>
>> --
>
>Hi,
>
>It's true, I don't know what happened. I originally installed LO via
>the MSI installers from the TDF site, and I have no other "helpful
>software" regarding updates on my computers. Oh, wait, on my laptop I
>have installed a Windows update blocker, and yet the LO update happened
>in the background. At least on the laptop the "Recently Used" list
>wasn't lost, but the icon set reverted to the default setting. On my PC
>even the list was lost, the icon set was also changed, and the document
>restauration didn't work after the PC was forced to reboot, so I lost
>some work.
>
>If TDF is responsible for this (and I added a qualifier to my original
>post), I actually consider this to be rude behaviour.
>
>Christoph
>
>
>___
>LibreOffice mailing list
>LibreOffice@lists.freedesktop.org
>https://lists.freedesktop.org/mailman/listinfo/libreoffice
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: How do I get rid of this error? Macro file requires OpenOffice but I would like to use Libreoffice

2020-03-11 Thread Andrew Pitonyak
Not able to test for at least a week, but am curious what this causes an error.

where it fails, it verifies is something by that name is there and then it 
tries to remove it. If I was able to run a test I could check to make sure that 
the method is exist, but the real question, is do you have write access to 
whatever it is is trying to modify?

⁣Sent from BlueMail ​

On Mar 11, 2020, 3:00 PM, at 3:00 PM, Patrick Kariuki 
 wrote:
>I'm running a macro file on LibreOffice 6.2.8.2 and keep getting this
>- https://imgur.com/a/tpDocIu
>
>Error is on this code - https://pastebin.com/S9RtUWVK at Line 1327
>
>Please assist (I can send more information if required)
>
>Thanks.
>___
>LibreOffice mailing list
>LibreOffice@lists.freedesktop.org
>https://lists.freedesktop.org/mailman/listinfo/libreoffice
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Writing a LibreOffice extension that logs user (and other) events in real-time

2019-11-28 Thread Andrew Pitonyak
Take a look at event listeners to see what they can do

the biggest problems will probably be related to things such as understanding 
which event listeners get called in which orders and also things like what will 
cause an event listener to disappear such as changing from a print view to a 
regular view

and finally some of that information could be really tricky such as 
understanding that they have selected a particular region when what you really 
have access to is things like mouse clicks and down and up and that sort of 
thing.



⁣Sent from BlueMail ​

On Nov 28, 2019, 7:20 PM, at 7:20 PM, Chide Groenouwe  wrote:
>Hi,
>
>I'm new to LibreOffice extension development. To prevent my team and I
>investing too much time in studying how to write LibreOffice
>extensions, I want to pose a question:
>
>Is it possible to capture/intercept all - or at least most - user
>events that occur within LibreOffice by means of an extension, in real-
>time? For example, suppose that someone
>
>0) opens a new document in Writer by using the drop-down menu item "New
>-> Text Document",
>1) types a text,
>2) selects a region using the mouse,
>3) presses the Italic button (so that the region becomes Italic), and
>4) saves the text by pressing Ctrl-s.
>
>Can you log all this information in real-time? Could you even log each
>keypress of the user when this user is writing the text? And can you
>also differentiate between the different methods that have been used to
>accomplish a certain task? For example, can one distinquish between
>saving a file by selecting a drop-down menu item, or saving a file by
>using the short-cut key Ctrl-s?
>
>Can this also be done for *other* extensions? Can you also log events
>that occur within these?
>
>Or should we use another approach to accomplish this all?
>
>(Although not needed for answering the question: If you wonder - the
>context has something to do with process mining (
>https://en.wikipedia.org/wiki/Process_mining) --  in this case to
>optimise software usage...)
>
>Thank you so much in advance,
>
>Chide Groenouwe
>
>
>
>
>___
>LibreOffice mailing list
>LibreOffice@lists.freedesktop.org
>https://lists.freedesktop.org/mailman/listinfo/libreoffice
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice

RE: need help to insert an image with a caption with the Libo java API

2019-09-06 Thread Andrew Pitonyak
Expression")
oField.NumberingType = com.sun.star.style.NumberingType.ARABIC
oField.NumberFormat = FindCreateNumberFormatStyle("###0", oDoc)
oField.attachTextFieldMaster(oMasterField)
oField.Content = name & " + 1"
Constants used to set the numbering type are set as shown in the Table 150.

Things to note.

1. The document creates field that you want to insert. 
2. The SetExpression field itself is directly attached to the associated Master 
field (attachTextFieldMaster). 
3. I actually create my own numbering style, I don't know what the default is 
or what happens if you do not set the style.  I just don't remember. 
4. This little snippet does not actually show you inserting the field. You do 
this by inserting text content with a text cursor. 
5. You will not see anything displayed, at least not correctly, until after you 
update fields from the menu. In the example I posted, i used a dispatch to do 
this for you. 

There is a full example that replaces text references for figures with actual 
fields such as this. I had a document with a bunch of manually entered values 
and I wanted to use fields. It was created before I knew how to do that using 
the UI. 

So, I hope this helps some. 

I am overdue for pushing a new copy of OOME4.odt; I made some changes in other 
areas, I just need to push it. 



On Friday, September 06, 2019 09:51 EDT, LORENZO Vincent 
 wrote:
  
Hi Andrew,

   Thank you for your answer. In fact I want to create a numbered caption 
(something like « Figure 1 : my nice caption ») under an inserted image and I 
want to create a table of figure with these captions to list all images.

-  The image is well inserted

-  The Table Of Figure is created and works fine when I add manually an 
image with a caption in the generated document.

-  This table of Figure doesn’t work for the image inserted 
programmatically, probably, because I don’t know how to create properly a 
numbered caption.


 
I’m a bit confused about the SetExpression, DependentField, field master, … I 
will continue to investigate about that, but if you have some references for 
me, please don’t hesitate.


 
Regards,

/Vincent Lorenzo


 
De : Andrew Pitonyak 
Envoyé : jeudi 5 septembre 2019 22:57
À : LORENZO Vincent 
Cc : Kaganski Mike ; Miklos Vajna 
; sos ; libreoffice@lists.freedesktop.org
Objet : RE: need help to insert an image with a caption with the Libo java API 
 wrote:
 

Hello everybody,
Since my last question, I switched task. Now I come back to my LibreOffice task 
to resolve my caption problem.
I'm still blocked on this problem. I get a different result compared to my last 
email, but the reference for the caption is still not found.
I replace Illustration by Figure, but the problem keeps the same.

I obtain a text:sequence-ref instead of a text:sequence. Does someone know why 
or which is the API to use to generate a text:sequence...

My result for the numbering of the caption:
Erreur : source de la référence non 
trouvée (the french text said "reference not found")

I would like to get :
1

My java code for that :

Object oReference = 
xMultiServiceFactory.createInstance("com.sun.star.text.textfield.GetReference");
XPropertySet oReferencePropertySet = 
UnoRuntime.queryInterface(XPropertySet.class, oReference);
oReferencePropertySet.setPropertyValue("SourceName", "Figure");// I get 
 De la part de 
LORENZO Vincent
Envoyé : vendredi 15 février 2019 14:37
À : Kaganski Mike ; Miklos Vajna 
; sos 
Cc : libreoffice@lists.freedesktop.org
Objet : [PROVENANCE INTERNET] RE: need help to insert an image with a caption 
with the Libo java API

Hello everybody,
I thank you for your answers. Yes I want to add an image with a caption 
programmatically and I want a caption like this "Illustration 1 : My caption"
To my mind, it would be better/cleaner if I was able to generate the same thing 
than I do the UI. Thanks to you, I succeed to build the expected structure for 
the image and to set a text below it, but I still have some problems, mainly 
with the GetReference.

The GetReference generates :
Erreur : source de la référence non 
trouvée (sorry my Libo is in French, it is written "Sorry 
: source of the reference not found").

And I would like to get a text:sequence instead of a text:reference, to get 
this result:
1

Please, do you know how I can build a text:sequence ?

Please found in attachment the java code I wrote [1], the expect xml structure 
[2] and the current xml structure [3].
I know I have some difference between [2] and [3] with the width/height 
properties and inside the draw frame, but it is not the subject of this thread.

[1] insertImage.java
[2] expectedResult.xml
[3] currentResult.xml

In addition, I have more generic question, do you know if it exists a 
documentation, indicating mapping, between the xml elements and how to 
get/create them from java ? For example, in xml svg:width

RE: need help to insert an image with a caption with the Libo java API

2019-09-05 Thread Andrew Pitonyak

Are you looking to insert the caption, or the reference to the caption? I think 
you want to insert a reference to a dependent field for a text field master. 
Does this sound correct? 

The text field master, which is of type: 

com.sun.star.text.fieldmaster.SetExpression.Figure

But you want to reference a Dependent field. If my guess is correct, this is 
how I insert a reference to the first Figure using Basic. Note that there is 
almost no error checking, so, this could go very wrong. 

Sub Main
  Dim oField
  Dim oNewField
  Dim oText
  Dim oCurs
  Dim oReferencedField
  Dim oEnum
  Dim oDispatcher      ' Dispatcher object.
  Dim oFrame

 ' Setup to perform a dispatch.
  oFrame = ThisComponent.CurrentController.Frame
  oDispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

  oText = ThisComponent.getText()
  oCurs = ThisComponent.CurrentController.getViewCursor()

    oEnum = ThisComponent.getTextFields().createEnumeration()
    If Not IsNull(oEnum) Then
    Do While oEnum.hasMoreElements()


      oField = oEnum.nextElement()
      'Inspect oField
      If oField.supportsService("com.sun.star.text.TextField.SetExpression") 
Then
        If oField.VariableName = "Figure" Then
          Print "Found one"
          Exit Do
        End If
      End If
    Loop
  End If

  ' No error checking, I just assume that I found one. DANGER DANGER DANGER


  oNewField = 
ThisComponent.createInstance("com.sun.star.text.textfield.GetReference")
  oNewField.ReferenceFieldPart = 
com.sun.star.text.ReferenceFieldPart.CATEGORY_AND_NUMBER
  oNewField.ReferenceFieldSource = 
com.sun.star.text.ReferenceFieldSource.SEQUENCE_FIELD
  oNewField.SequenceNumber = oField.SequenceValue
  oNewField.SourceName = "Figure"
  oText.insertTextContent(oCurs, oNewField, True)
  
  ' This next part will NOT work until after all of the fields have updated.
  ' So, force an update.
  oDispatcher.executeDispatch(oFrame, ".uno:UpdateFields", "", 0, Array())
End Sub


On Thursday, September 05, 2019 10:59 EDT, LORENZO Vincent 
 wrote:
 Hello everybody,
Since my last question, I switched task. Now I come back to my LibreOffice task 
to resolve my caption problem.
I'm still blocked on this problem. I get a different result compared to my last 
email, but the reference for the caption is still not found.
I replace Illustration by Figure, but the problem keeps the same.

I obtain a text:sequence-ref instead of a text:sequence. Does someone know why 
or which is the API to use to generate a text:sequence...

My result for the numbering of the caption:
Erreur : source de la référence non 
trouvée (the french text said "reference not found")

I would like to get :
1

My java code for that :

Object oReference = 
xMultiServiceFactory.createInstance("com.sun.star.text.textfield.GetReference");
XPropertySet oReferencePropertySet = 
UnoRuntime.queryInterface(XPropertySet.class, oReference);
oReferencePropertySet.setPropertyValue("SourceName", "Figure");// I get 
 De la part de 
LORENZO Vincent
Envoyé : vendredi 15 février 2019 14:37
À : Kaganski Mike ; Miklos Vajna 
; sos 
Cc : libreoffice@lists.freedesktop.org
Objet : [PROVENANCE INTERNET] RE: need help to insert an image with a caption 
with the Libo java API

Hello everybody,
I thank you for your answers. Yes I want to add an image with a caption 
programmatically and I want a caption like this "Illustration 1 : My caption"
To my mind, it would be better/cleaner if I was able to generate the same thing 
than I do the UI. Thanks to you, I succeed to build the expected structure for 
the image and to set a text below it, but I still have some problems, mainly 
with the GetReference.

The GetReference generates :
Erreur : source de la référence non 
trouvée (sorry my Libo is in French, it is written "Sorry 
: source of the reference not found").

And I would like to get a text:sequence instead of a text:reference, to get 
this result:
1

Please, do you know how I can build a text:sequence ?

Please found in attachment the java code I wrote [1], the expect xml structure 
[2] and the current xml structure [3].
I know I have some difference between [2] and [3] with the width/height 
properties and inside the draw frame, but it is not the subject of this thread.

[1] insertImage.java
[2] expectedResult.xml
[3] currentResult.xml

In addition, I have more generic question, do you know if it exists a 
documentation, indicating mapping, between the xml elements and how to 
get/create them from java ? For example, in xml svg:width is called Height in 
the java API, and my Textframe becomes mailto:mikekagan...@hotmail.com]
Envoyé : mercredi 13 février 2019 11:42
À : Miklos Vajna ; LORENZO Vincent 

Cc : libreoffice@lists.freedesktop.org
Objet : Re: need help to insert an image with a caption with the Libo java API

On 13.02.2019 12:45, Miklos Vajna via LibreOffice wrote:
> Hi,
>
> On Tue, Feb 12, 2019 at 09:27:15AM +, LORENZO Vincent 
>  wrote:
>> I would like to add a caption, to an inserted 

Re: Reveal Codes macros now works

2019-07-11 Thread Andrew Pitonyak

I expect that if I add GPL code to my code, then my code becomes GPL. I think 
that is why LGPL was developed because if I linked to a GPL library there was 
concern that then your entire code base became GPL. 

I am not a lawyer, but it is why I won't use GPL code in my code unless I 
intend to release it as such. 

In this case, I added a few lines of code to code that is labeled GPL. This is 
not significant code, it is a few fixes. It can stay as GPL. Normally I release 
my code as open. 

On Thursday, July 11, 2019 02:32 EDT, Uwe Brauer  wrote:
 
> On 10/07/19 17:54, Andrew Pitonyak wrote:

> I would also appreciate having a copy of them to try. Unfortunately, I
> am likely to be highly critical, but then, I hope those comments will be
> helpful.

Please take in mind, that Andrew is not the original author. I find it
very generous of him to provide his help to make these macros work. My
hope is, as I said elsewhere, that others developer get and idea of the
feature and might generalize it to not read only.

> Please do email them directly ...

> No your changes are NOT GPL if you don't want them to be. Please mark
> your changes as being under the LO MPL licence. Okay, the resultant file
> can only be *distributed* under the GPL, but if somebody then rewrites
> the GPL stuff out, the file will change to LO licence.

I am not sure I understand (I am no lawyer, but I have contributed over
the years to GPL software).
I thought GPL is a rather capitalistic license, you obtain something
(code) you have to pay for it (by your code).

So if you modify a existing program under GPL (and I think modify means
here more than 5 lines of code, either add functionality or modify it),
you must release the code under the same license. You are not allowed to
release them under stay CC, or MIT or whatsoever. So when you say your
code, do you mean these 5 lines and whether you can release these 5
lines under the license of your choice. Is that what you mean?

Regards

Uwe


 
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice

Re: Reveal Codes macros now works

2019-07-10 Thread Andrew Pitonyak

On Wednesday, July 10, 2019 10:52 EDT, Uwe Brauer  wrote:
 >>> "AP" == Andrew Pitonyak  writes:

> There was so much static related to the orginal question, that I opted to 
> simply started a new thread. 
> I was provided with a linke to the orignal documents:

> https://web.archive.org/web/20180326030224/http://homepages.paradise.net.nz/hillview/OOo/

> There are three documents and I have the original description listed below, 
> but, this is what I did. 
> I ignored the original document. I have working copies of documents 2
> and 3. They are not well tested, but, they are in the ODT format, and
> they seem to do what they are supposed. I don't think i can attach
> them. I can post them to my own site later tonight, or, I can post
> them in some other suggested location. 

I would very much appreciate having a copy of these three files.

As for the site, I can't come up with any solution I have tested.
Dropbox is out of question I presume.

Thanks again for you work.

UweI only worked through two of the documents (number 2 and number 3). I can 
post them to my personal web site if we have no common place to put such 
things; I just need to take the time to do it. If you don't mind if I email 
them directly,  i can make that happen even faster than posting them on my web 
site. 

Side note: The macros are marked GPL, which is kind of viral in nature, which 
makes my changes (which are clearly marked with " ' ADP " in the comments) 
under the same license.  My expectation is that any changes I made will be very 
similar for the first document, which I did not touch or try. The things that I 
needed to change were as follows: 

1. An UNO enum was TypeClass.String (or something similar) and it needed to 
be TypeClass.STRING. I don't know if it changed, or, if something else changed. 
Last time I concerned myself with such things, the first use of an enum had to 
be the same case, but subsiquent uses were case insensitive. 

2. In a few places, there were some array access errors, so, I added "On Error 
ResumeNext" and then I primed the return value with something specific, made 
the call, then I used "On Error GoTo 0" to disable error trapping. 

3. Very similar to 2, but some integer (nProperty I think) was -1 rather than a 
valid value, so, I tested for it. I did not work hard to understand the 
impliciations. 

The odd errors that I received last time I looked at this did not appear, not 
sure why. I never did figure out why the third document did not have an obvious 
way to call the configure dialog, but (1) I did not spend a lot of time looking 
for it and (2) I think it was intended to be installed and I did not install it 
or even look at how to install it. My primary focus was to make the macros not 
fail. My expectation is that I missed something, but, it is probably easily 
fixed if you see the pattern. 

Andrew Pitonyak
and...@pitonyak.org




 
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice

Reveal Codes macros now works

2019-07-09 Thread Andrew Pitonyak

There was so much static related to the orginal question, that I opted to 
simply started a new thread. 
I was provided with a linke to the orignal documents:

https://web.archive.org/web/20180326030224/http://homepages.paradise.net.nz/hillview/OOo/

There are three documents and I have the original description listed below, 
but, this is what I did. 
I ignored the original document. I have working copies of documents 2 and 3. 
They are not well tested, but, they are in the ODT format, and they seem to do 
what they are supposed. I don't think i can attach them. I can post them to my 
own site later tonight, or, I can post them in some other suggested location. 

This is the originally posted description. 

RevealCodes.sxw - This is very much a work in progress that I need some 
feedback on. The concept is to try and provide the sort of functionality that 
WordPerfect's RevealCodes. At this stage it is fairly primitive - I need 
feedback as to what people want so that I can improve it. Last updated 10 June 
2004.

RevealCodes2.sxw - This is an alternative to the above RevealCodes and is, 
perhaps, closer to the way WordPerfect works. If you want this macro to be 
improved then give me feedback! Either directly or via the forum thread: 
http://www.oooforum.org/forum/viewtopic.php?p=36976. Last updated 06 Oct 2004.

RevealCodes3.sxw - A third alternative. This macro requires to be installed to 
be able to use it - therefore it doesn't have a Demo button. Use RevealCodes2 
above for a general concept demo. This version is configurable, including 
button colours and what happens when you click a button. Last updated 
12-Nov-2004.

 
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice

Re: Reveal code, old macros convert them to LO

2019-07-04 Thread Andrew Pitonyak
So I read your response to say...

If it is a read only display them it is not worth the time to bother with it...

That is certainly easier than trying to make it work :-)

⁣Sent from BlueMail ​

On Jul 4, 2019, 10:26 PM, at 10:26 PM, Wols Lists  
wrote:
>On 05/07/19 03:15, Wol's lists wrote:
>> On 04/07/2019 11:08, Uwe Brauer wrote:
>>>
>>>  From time to time the question pops up whether LO could support
>>> Wordperfects reveal code. Sometimes it is stated that this feature
>could
>>> be implemented by a macro/extension.
>>
>> Bear in mind that "reveal codes" is an EDITING window. That was what
>was
>> wrong with MS's pale imitation. So if your macros merely display the
>> formatting of a paragraph, that is NOT NOT NOT "reveal codes", and
>any
>> WordPerfect lover will simply ignore it.
>
>As a quick example - which illustrates its power - I seem to remember a
>post to this list a week or so ago which said "if the first thing in a
>writer document is a table, how do I put something in front of it?".
>Word struggles with this, writer struggles with it ...
>
>In WordPerfect, in RevealCodes, just click *in front* of the [table-on]
>code, and start typing ... easy peasy !!!
>
>Cheers,
>Wol
>___
>LibreOffice mailing list
>LibreOffice@lists.freedesktop.org
>https://lists.freedesktop.org/mailman/listinfo/libreoffice
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice

Re: Writer TextTable access via the UNO API

2019-06-21 Thread Andrew Pitonyak

In OOME, I do not really discuss this, but, I do in AndrewMacro.odt where I 
claim (in the section "Enumerating cells in any text table" that you need to 
first use getCellNames() and then use getCellByName(aName).

If you want to be even more complete, you may need to worry about things such 
as sections, floating frames, etc. Annoying, right? I don't think that I have 
ever written code that attempts to enumerate all of these things to get every 
XText object. Luckily, some of these things you can simplify by enumerating 
certain objects independtly; for example, you could enumerate a Single XText 
object in a single method, and then get all of the text tables using 
oDoc.getTextTables() and have a method to specifically handle text tables 
rather than recognizing them as you traverse the text; if you did not need to 
retain locality or something. 



On Friday, June 21, 2019 09:56 EDT, Michael Stahl  wrote:
 On 21.06.19 13:22, Adomas Venčkauskas wrote:
> Hello,
>
> I need my Java extension to iterate over all hyperlinks in a Writer
> document. This is fine with Paragraph TextPortion enumeration, but no
> portion enumeration is available in TextTables. What would be the best
> way to enumerate all hyperlinks in TextTables?

you first need to enumerate the cells in the table, then the cells
implement XText so you can enumerate the paragraphs in the cells like
the paragraphs in the top-level body text.

to enumerate the cells i guess you can use getCellNames().
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


 
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice

Re: When file truncation happens by Basic's Open statement

2018-12-21 Thread Andrew Pitonyak

I evaluated the behavior from Basic for all of the different modes based on a 
specific build on a specific Linux platform. I did not read the code, nor did I 
test different platforms. I documented all of this in OOME on my web site. 
Don't remember the direct link, but, it is on http://www.pitonyak.org under my 
macros page. 

I also loop at a few other methods for opening files using a service that might 
be useful to you. 

On Friday, December 21, 2018 14:15 EST, Kaganski Mike 
 wrote:
 Hi!

On 21.12.2018 20:37, Takeshi Abe wrote:
> In order to tell whether the behavior reported in tdf#119102 [1] is a bug
> or not, I would like to understand the specification of LibO Basic's Open
> statement [2].
>
> The following table summarizes what current (master) LibO does, which I read
> from SbiStream::Open() in basic/source/runtime/iosys.cxx.
>
> ACCESS\FOR | APPEND | BINARY | INPUT | OUTPUT | RANDOM |
> --+++---+++
> default | - | - | - | X | - |
> READ ("read only") | - | - | - | - | - |
> WRITE ("write only") | - | -(*) | X | X | -(**) |
> READ WRITE ("both") | - | -(*) | X | X | -(**) |
>
> "X": the runtime deletes the file of given path first if already exists;
> "-": it does not.
> (*) requested in i#18638 ;
> see commit 23b49669ab70cac72d5f6d955e7d2af617e6934e.
> (**) requested in i#61277 ;
> see commit 42a63dd0e81f13a84a5f551e03ede685e2bf34c7.
>
> So here is a couple of questions popping up on a confused soul:
>
> (1) What does the default ACCESS mode mean?
> Is it just the same as READ, WRITE, or READ WRITE?
> Or does it depends on given FOR mode?
>
> (2) Does 'FOR INPUT + ACCESS WRITE' or 'FOR OUTPUT + ACCESS READ' make
> any sense?

Cannot answer the questions; just for completeness, something you could
already know:

the current handling of BINARY opened for write was defined in commit
23b49669ab70cac72d5f6d955e7d2af617e6934e [1] for #i18638 [2].

[1]
https://git.libreoffice.org/core/+/23b49669ab70cac72d5f6d955e7d2af617e6934e%5E%21/
[2] https://bz.apache.org/ooo/show_bug.cgi?id=18638

--
Best regards,
Mike Kaganski
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


 
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: How to insert extra and hidden information for each element of document via LibreOffice API?

2018-07-26 Thread Andrew Pitonyak
 

When I think of UML, I think of a graphical representation. Your
description leads me to believe that you will have a "text"
representation. 

My first thought was user defined attributes


https://api.libreoffice.org/docs/idl/ref/servicecom_1_1sun_1_1star_1_1xml_1_1UserDefinedAttributesSupplier.html


OK, so what supports that? I did not look into it, but, some
possibilities might include (assuming that my guesses from the link
above are accurate), 

1. A text section. I was hoping that a paragraph
and it seems that it does NOT. You could create a new text section for
each bit, since it looks like text section would contain this (but I did
not verify). 

2. Paragraph Style. The bad thing is that it looks like
it would be on a style, so, you would need to create a new style for
each item of interest. I have two comments on this. First, you could
embed an XML UserDefinedAttributes for each paragraph style that you
create. Second, you could embed simple information (maybe) into the
style name. 

3. You could place the UML into a text table with a "cell"
for each identifiable part and place an attribute into each cell
properties object. I have a simple example of this for a a Calc cell in
OOME4, but I have not test run it against a text table cell. 

Is the
user expected to edit this data in any way? If not, then you could embed
the entire original UML as a user defined attribute as a single user
defined attribute attached to some element (such as a style that is not
otherwise used). 

Your comments lead me to believe that you are not
able to choose some formatted text method to embed the data of interest
that might be bale to parse from regular text. 

No idea if this is of
any use, but maybe. I have not tried any of these suggestions to
make sure that they work. HTH. 

On 2018-07-24 7:20, MUNOZ JULHO
Yupanqui wrote: 

> Hi everyone, 
> 
> I am working with the Eclipse
Papyrus team on a UML to odt generator. Besides one way generating, it
should be able to handle bidirectional synchronization between these two
"worlds". 
> For reaching this goal, I need to map each model element
with its respective doc element. For example, a package name will be
transformed to a section in a document or a comment in a paragraph. I am
looking for a way to reference the UML element from the odt document,
for example adding the ID of the UML element to an odt "paragraph". 
>

> In the users mailing list, Regina Henschel, suggested me to use
bookmarks. It is a good idea, but, if is possible, I want to hide this
information.
> 
> Does anyone have another suggestion? 
> 
> Best
regards, 
> 
> Yupanqui 
> 
>
___
> LibreOffice mailing
list
> LibreOffice@lists.freedesktop.org
>
https://lists.freedesktop.org/mailman/listinfo/libreoffice [1]




Links:
--
[1]
https://lists.freedesktop.org/mailman/listinfo/libreoffice
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


String Length and Array Indexes in macros

2018-05-15 Thread Andrew Pitonyak


Last time I documented Strings and arrays, an array index was limited 
to +/-32K and a string was similarly limited.


I am now documenting them again and I am hoping that someone knows off 
hand what the new limitations are so that I do not need to scour the 
code to find out. My best guess is that this now uses a 32-bit long, so, 
+/- 2G.




Andrew Pitonyak


___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Association between ToC index object and its paragraph content

2017-12-12 Thread Andrew Pitonyak


Disclaimer: I have not taken the time to look at the problem, but, if 
you have a text range, or have the ability to get a text range out of 
what you have, then you can compare the starting and ending positions. 
You might need to create a text cursor from the range to do this. I do 
not have the ability to test this at the moment, but that is where I 
would look if I needed to answer a similar question. Note also that with 
an appropriate cursor, you can do things such as jump to the start and 
end of a paragraph.


If a paragraph contains content that uses a different Text object, or 
you happen to be trying to compare content that lives in different text 
objects, this will fail; for example, each cell in a Text Table uses its 
own Text object if my memory serves me correctly. This means that you 
cannot compare the location of an object in one cell with that in 
another cell or outside the text table.


On 2017-12-12 5:04, Jens Tröger wrote:

Thanks Miklos!

Interesting detail though: for any number of XTextContent objects
(i.e. paragraphs with implementationName=SwXParagraph) which 
represent

_the same_ paragraph in the document, there’s no real way to tell
that these objects do, in fact, represent the same paragraph?

Huh. Cheers,
Jens


On Dec 12, 2017, at 19:37, Miklos Vajna  
wrote:


https://lists.freedesktop.org/archives/libreoffice/2017-December/079050.html
has code samples on how the reference-to-bookmark is represented as 
a
HyperlinkURL property, and how the bookmark is a Bookmark text 
portion.

There is no closer connection between these two, I think.

Regards,
Miklos


--
Jens Tröger
http://savage.light-speed.de/

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Open web page from dialog

2016-06-11 Thread Andrew Pitonyak
I think this is usually done by invoking a command to the operating system. 
Cannot easily lookup how this is done right now

It is likely os dependent. 

Sent from BlueMail



On Jun 11, 2016, 3:24 PM, at 3:24 PM, "Jan Rheinländer"  
wrote:
>Hi,
>
>is it possible to open a website in the user's preferred browser from a
>dialog (or from a Basic macro, or through the UNO API)?
>
>I see that the "Help" - "About" dialog does this, but it is defined in
>the source in Glade format, different to the Basic dialogs.
>
>Thanks for any ideas!
>
>Jan
>
>___
>LibreOffice mailing list
>LibreOffice@lists.freedesktop.org
>https://lists.freedesktop.org/mailman/listinfo/libreoffice
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: suggested method to create LibreOffice Extensions

2015-11-16 Thread Andrew Pitonyak
If you email me directly I can send you a copy of my macro formatter stuff with 
the document I use to generate the OXT file. Won't have access until Thursday 
or Friday.

On Nov 16, 2015 3:52 AM, Andrea Castellani  wrote:
>
> Hello everyone, 
> almost three years ago I received help from this mailing list to create 
> an extension for LibreOffice, which became "FirmaconDike" (thanks!): 
> http://extensions.libreoffice.org/extension-center/firmacondike-1 
>
> Today I have to re-examine this issue in a LibreOffice lesson, in witch 
> I would like to explain how to create an extension "from scratch". 
>
> I thought to write a simple macro with students, such as "Hello world", 
> and explain step by step how to generate the oxt file. 
>
> Seeking documentation, I saw a lot of confusion on the subject and the 
> argument (as you know) is only present on the site of AOO. 
>
> I tried to use BAB Paolo Mantovani, both in the new version that in the 
> previous one, and it seemed a very good macro to create extensions. 
>
> The Extension oxt who created BAB does not work, then I fear that BAB is 
> incompatible with LibreOffice (I have the 5.0.2.2). Opening it, it gives 
> me an error: 
> (Com.sun.star.deployment.DeploymentException) {{Message = "You \ X00e8 
> an error occurred while enabling: HelloWorld" Context = 
> (com.sun.star.uno.XInterface) @ 7f2fec3ef8b0}, Cause = ( any) 
> {(com.sun.star.lang.IllegalArgumentException) {{{Message = "" Context = 
> (com.sun.star.uno.XInterface) @ 0}}, ArgumentPosition = (short) 0}}} 
>
> Here you can find the extension generated by BAB: 
> http://www.libreitalia.it/cloud/public.php?service=files=77d91958fb91ecab19ec2b0b62844d63
>  
>
> I have not tried a "reverse engineering" of oxt file to understand what 
> it changes from another oxt  (such as "FirmaconDike"), looking for 
> suggestions from you, who are much more experienced than me. 
>
> Does anyone have experience with BAB and LibreOffice? 
> What is the official method (or recommended one) to create extensions 
> for LibreOffice? 
>
> I apologize if you have already solved this problem in another thread 
>
> Thank you, 
>
> Andrea Castellani 
> www.libreitalia.it 
> ___ 
> LibreOffice mailing list 
> LibreOffice@lists.freedesktop.org 
> http://lists.freedesktop.org/mailman/listinfo/libreoffice 
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


LibreOffice 4.x copyright date is 2014

2015-07-06 Thread Andrew Pitonyak

Latest release of LO 4.x

Help  About

Shows the a copyright date of 2014.

I just installed the latest release candidate (2) and it has a 2015 
copyright, so this probably only matters if there is another release of 
4.x for some reason. I thought that the latest 4.x release was 2015.


Andrew Pitonyak





___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Q: How to get the path of all opened spreadsheet documents

2015-06-06 Thread Andrew Pitonyak
No time to find the solution now But I have done this sort of thing in 
basic.

You enumerate the open components from the desktop object and check of the 
component is a calc document.

In your case do you only care about documents that have been saved... Ignoring 
new never saved to disk docs?

Think I can find a basic example of it helps

On Jun 4, 2015 10:35 PM, Zhang, William william.zh...@ptn.advantest.com 
wrote:

 Hi,

  

 Request:

 In RedHat7, I want to get the path of all opened spreadsheet documents with 
 Java.

  

 What I’ve done:

 1.   I used Runtime.exec(cmd…) with Java code, the ‘cmd’ was defined with 
 “ps –ef | grep xxx”

 -if only one spreadsheet document opened, the returned info list the correct 
 document, I can parse it and get the file path

 -but if multi spreadsheet documents opened, the returned process still only 
 list the first document, I cannot get other documents.

    2.  I also test in bash, it seems “ps -ef” cannot list all files.

  

 So , I want to know is there any other way to do it. such as using UNO 
 service with libreoffice API to get it.

 Anyone who knows it is much appreciate.

  

 Best Regards

 William

  
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Loading LaTeX document results in odd output

2015-04-09 Thread Andrew Pitonyak
What happens of you rename the file to have a .txt file extension?

On Apr 9, 2015 3:44 AM, =?ISO-8859-1?Q?Jens_Tr=F6ger?= 
jens.troe...@light-speed.de wrote:

 Hi, 

 I'm not sure if this is the right place to post this.  After running LO 
 I loaded a LaTeX file: 

   http://www.math.duke.edu/computing/tex/templates/samplefile.tex 

 which gave me the following terminal output: 

   savage@pooh ~  /Applications/LibreOffice64.app/Contents/MacOS/soffice 
   :1: parser error : Document is empty 
   \documentclass{article} 
   ^ 

 I have noticed similar and more on Linux LO.  What's that about?  Can 
 and should I ignore this? 

 Cheers, 
 Jens 

 -- 
 Jens Tröger 
 http://savage.light-speed.de/ 
 ___ 
 LibreOffice mailing list 
 LibreOffice@lists.freedesktop.org 
 http://lists.freedesktop.org/mailman/listinfo/libreoffice 
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: How do I tear down soffice cleanly?

2015-02-25 Thread Andrew Pitonyak
Test your coffee against the basic IDE and a help window, one might not support 
close if my memory is correct.

On Feb 25, 2015 7:16 PM, =?ISO-8859-1?Q?Jens_Tr=F6ger?= 
jens.troe...@light-speed.de wrote:

 Thanks Michael.  Looking at 13. in this FAQ 

   http://www.openoffice.org/udk/python/python-bridge.html#faq 

 it seems that queryInterface() is not needed.  Thus, I'm using the 
 following code now 

     document.close(True) 
     document.dispose() 

 and that seems to work too. 
 Jens 


 On Wed, Feb 25, 2015 at 09:18:38PM +0100, Michael Stahl wrote: 
  On 24.02.2015 18:41, Jens Tröger wrote: 
   Supporting documentation: 
   
     
  http://www.openoffice.org/api/docs/common/ref/com/sun/star/util/XCloseable.html
   
     
  https://wiki.openoffice.org/wiki/Documentation/DevGuide/OfficeDev/Closing_Documents
   
   
   I've now used this code: 
   
   if document.supportsService(com.sun.star.util.XCloseable) :    
   document.close(True) 
   office.document.dispose() 
    
   
  
  dispose() needs to go into an else branch. 
  
  i don't think supportsService will work here - it is not a service but 
  an interface, usually you check that with queryInterface() but since 
  Python is dynamically typed i don't know off-hand what the most 
  idiomatic way to check for it would be. 
  
  but i would assume that all LO application document types implement 
  XCloseable. 

 -- 
 Jens Tröger 
 http://savage.light-speed.de/ 
 ___ 
 LibreOffice mailing list 
 LibreOffice@lists.freedesktop.org 
 http://lists.freedesktop.org/mailman/listinfo/libreoffice 
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Ask for help, Young developer request

2015-02-20 Thread Andrew Pitonyak
First use XModifiable and if
isModified is true call
setModified to set to false.

See of that helps.

On Feb 20, 2015 3:12 AM, =?UTF-8?Q?Bart=C5=82omiej_Mikos_PrimeSoft_Polska?= 
bartlomiej.mi...@primesoft.pl wrote:

 Good Morning, 

 I have problem with use of java LibreOffice Api 4.3 

 Is a possible way to close XComponent (xlsx type) in save way?. 

 I have converting to pdf method. I use XStorable.storeToURL() The 
 converting works fine, but when I try to close like this: 

  if (xStorable != null) { 
  XCloseable closeable = 
 UnoRuntime.queryInterface(XCloseable.class, xStorable); 
  if (closeable != null) { 
  try { 
  closeable.close(true); 
  } catch (CloseVetoException closeVetoException) { 
  //problem with xlsx files, always occure 
  } 
  } else { 
  XComponent xComp = 
 UnoRuntime.queryInterface(XComponent.class, xStorable); 
  xComp.dispose(); 
  } 
  } 

 I tried to dispose a XController and the XFrame. In that case window is 
 closed, but in next time XComponentLoader cannot load the XComponent, 
 problem with socket etc. 

 Can You tell me what i should do to make it work fine?. Maybe i should 
 know more about something or You had some simillar problems?. 

 I hope You will find time to answer, 
 Have a nice day. 


 ___ 
 LibreOffice mailing list 
 LibreOffice@lists.freedesktop.org 
 http://lists.freedesktop.org/mailman/listinfo/libreoffice 
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Java sidebar extensions and LibreOffice

2015-02-10 Thread Andrew Pitonyak
I see where you go to the end of the document, but I don't see you placing the 
cursor at the start.

I expect you to first go to the start with no selection and then Juno to the 
end with selection.

I suspect that you are simply setting  paragraph properties on the last  
paragraph.

That said, it is difficult for me to read the code on my phone

You may need  to enumerate the content (paragraphs) and set each paragraph or 
supported text content areas especially of your content is complex; for 
example, containing tables or frames.

On Feb 10, 2015 8:52 AM, fma fma3...@gmail.com wrote:

 I found it!!! 
 Still don't know what's going on behind the scenes, but at least the panel 
 is now visible. 
 In the build path of the extension, I changed the pointing of *unoil.jar* 
 from the file included in the path of AOO installation ( 
 /aoo_installation_path\program\classes/ ) to the one in the installation 
 path of LO ( /aoo_installation_path\program\classes/ ). 
 This raised an error in *AnalogClockPanel.java*, which was asking for adding 
 the unimplemented method *getMinimalWidth()*: I added it, generated the oxt 
 file and...  Voila!... the extension now runs fine on LO 4.4 too. 
 Unfortunately, I have now two problems with my custom extension, which 
 manipulates in several ways the active text document. 
 In details, I have two operations running fine in AOO 4.1.1 but having 
 unexpected results in LO 4.4; here they are: 

 *Code snippet 1 *- expected behaviour: formatting the whole document with 
 font Arial Black, size 14, justified; current behaviour: only the last 
 paragraph is formatted 

 /// active writer document 
 XTextDocument xTextDocument = (XTextDocument) 
 UnoRuntime.queryInterface(XTextDocument.class, xCurrentComponent); 

 // creating text range and cursor 
 XText xText = xTextDocument.getText(); 
 XTextRange xTextRange = xText.createTextCursor(); 

 // going to the end of document 
 ((XTextCursor)xTextRange).gotoEnd(true); 

 // getting properties 
 XPropertySet xTextProps = (XPropertySet) 
 UnoRuntime.queryInterface(XPropertySet.class, xTextRange); 

 // setting font size 
 xTextProps.setPropertyValue(CharHeight, new Float(14)); 

 // justifying 
 xTextProps.setPropertyValue(ParaAdjust,com.sun.star.style.ParagraphAdjust.BLOCK);
  

 // setting font 
 xTextProps.setPropertyValue(CharFontName, Arial Black); 
 / 

 *Code snippet 2* - expected behaviour: inserting a page break just before 
 each paragraph starting with the word Chapter; current behaviour: nothing 
 happens 

 /XTextCursor xTextCursor = xText.createTextCursor(); 

 // using a search descriptor to perform insert operations 
 XSearchable xSearchable = (XSearchable) 
 UnoRuntime.queryInterface(XSearchable.class, xTextDocument); 
 XSearchDescriptor xSearchDescriptor = xSearchable.createSearchDescriptor(); 

 xSearchDescriptor.setPropertyValue(SearchRegularExpression, new 
 Boolean(true)); 
 xSearchDescriptor.setPropertyValue(SearchCaseSensitive, new 
 Boolean(true)); 
 xSearchDescriptor.setSearchString(Chapter); 

 XInterface xInterface= (XInterface) 
 xSearchable.findFirst(xSearchDescriptor); 
 while (xInterface != null){ 

 XTextRange xStart = (com.sun.star.text.XTextRange) 
 UnoRuntime.queryInterface(com.sun.star.text.XTextRange.class, xInterface); 

 xTextCursor.gotoRange(xStart, false); 

 XPropertySet cursorProperty = UnoRuntime.queryInterface(XPropertySet.class, 
 xTextCursor);    

 cursorProperty.setPropertyValue(BreakType, BreakType.PAGE_BEFORE); 
 //$NON-NLS-1$ 

 xInterface = (XInterface) xSearchable.findNext(xInterface, 
 xSearchDescriptor); 
 } / 

 Any ideas about the reasons of the misbehaviour? 
 Thanks in advance and best regards 



 -- 
 View this message in context: 
 http://nabble.documentfoundation.org/Java-sidebar-extensions-and-LibreOffice-tp4139084p4139618.html
  
 Sent from the Dev mailing list archive at Nabble.com. 
 ___ 
 LibreOffice mailing list 
 LibreOffice@lists.freedesktop.org 
 http://lists.freedesktop.org/mailman/listinfo/libreoffice 
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Inserting a value into a XComponentContext

2014-12-03 Thread Andrew Pitonyak
Guessing from memory and not east for me to verify at the Moment, but I thought 
that the context was read only. I think that of you want to add values you need 
to create a new one with the desired named value pairs.

Are you able to inspect an object to see of it supports setting values... 

I have done very little in this area and don't remember...

Chris Sherlock chris.sherloc...@gmail.com wrote:

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Inserting a value into a XComponentContext

2014-11-30 Thread Andrew Pitonyak
Anything I have done has been in basic, which abstracts ask the hard bits of 
casting away. 

Of Han that looks to be correct based on my memory. More specifically, that you 
add the values (or pad the values) on creation. 

Chris Sherlock chris.sherloc...@gmail.com wrote:

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Inserting a value into a XComponentContext

2014-11-30 Thread Andrew Pitonyak
No stress on the number of mails.

I did not think that you could change a context after it was created... But I 
would certainly try if I had a need. I know very little about this specifically.

Chris Sherlock chris.sherloc...@gmail.com wrote:

Oh, and sorry for the number of emails, but I guess I'm assuming that you can 
add a new property key at any point by insertByName()... 


Thanks in advance, UNO is a little tricky at this level. At least that's what 
I find... from what I can tell, it really comes down to the 
cppuhelper::ComponentContext class which implements the XNameContainer 
interface. *Please* correct me if I'm wrong :-)


Chris


On Mon, Dec 1, 2014 at 10:29 AM, Chris Sherlock chris.sherloc...@gmail.com 
wrote:

So what about the following approach:


Reference XComponentContext  xContext = 
::comphelper::getProcessComponentContext();
::cppu::ContextEntry_Init aContextInfo[] =
{
    ::cppu::ContextEntry_Init(testkey, uno::Any() ),
}

xNewContext = ::cppu::createComponentContext(aContextInfo, 
sizeof(aContextInfo) / sizeof (aHandlerContextInfo[0]), xContext);


Then to get access to the container, I use something like this:


Reference container::XNameContainer  xNameContainer( xContext, UNO_QUERY );


Is this the right approach? Will the delegate ComponentContext work?


Chris



On Mon, Dec 1, 2014 at 12:25 AM, Andrew Pitonyak and...@pitonyak.org wrote:

Guessing from memory and not east for me to verify at the Moment, but I 
thought that the context was read only. I think that of you want to add values 
you need to create a new one with the desired named value pairs.

Are you able to inspect an object to see of it supports setting values... 

I have done very little in this area and don't remember...



Chris Sherlock chris.sherloc...@gmail.com wrote:

Hi all, 


How do you insert a value to be retrieved later into an XComponentContext 
reference?


I see there is a XNameContainer, which is created by 
comphelper::NameContainer_createInstance(::cppu::UnoTypesal_Int32::get()) or 
whatever value you want. From here you then do insertByName. 


However, how do you then insert this into the component context?


Chris



___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Please verify regression bug in latest release candidate

2013-02-07 Thread Andrew Pitonyak


Is anyone running the latest release candidate (LO version 4 RC3)?

I am currently unable to download this release candidate, and I can 
currently only test on 64-bit Linux (Fedora)


https://www.libreoffice.org/bugzilla/show_bug.cgi?id=60371

This simple macro should work


Sub Main
   Dim oPropertyValue As New com.sun.star.beans.PropertyValue
   Dim noLocale As New com.sun.star.lang.Locale
   Dim cName As String

   cName = name
   noLocale.Country = 
   noLocale.Language = zxx

   oPropertyValue.Name = cName
   oPropertyValue.Value = noLocale
End Sub

In fact, it has always worked on every version of OO I have ever used; 
until now.


I would like to know if this breaks on version 4 RC3, and also 
specifically on Windows since I am unable to test there.


I will likely then ask that this be marked as a blocker.

Andrew Pitonyak



___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [Libreoffice] BASIC IDE code completion

2011-08-20 Thread Andrew Pitonyak

When I write a macro, I am usually using a loosely typed object so the
type is not fully known. Even worse, based on the execution path, the
object type may be completely different than expected. Unless your
variables are explicitly stated as to type, it would likely not be possible
to implement.


___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice