Re: [dev] com.sun.star.packages.zip.ZipIOException

2009-12-09 Thread Michele Zarri
2009/12/9 Mikhail Voytenko :
> Hi Michele,
[snip]
>
> It could be that the repairing mechanics should be improved. But you have
> mentioned gunzip, is the archive in gzip format? In this case the office can
> not handle it at all, since only zip-format is supported.
>
The file is a .zip but gunzip can handle them with the -S switch. I
used it also to test the archive and I got OK, this is why I wrote
about my surprise on how strict the check OOo makes is.
OTOH I am probably misusing the package service which is intended for
odf documents so I will stop using it even if it was rather
convenient.

As I wrote the files I am working with are publicly available you can
download some samples here:
http://www.3gpp.org/ftp/tsg_sa/TSG_SA/TSGS_46/Docs/


Thanks again for the clarifications,

Cheers,

Michele

-
To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org



Re: [dev] com.sun.star.packages.zip.ZipIOException

2009-12-07 Thread Michele Zarri

Thanks for the quick reply Mikhail,

I did what you suggested and it now works in most of the cases: thanks!

I now have a different problem since in many cases when I create the 
zipPackageFolder with the method getByHierarchicalName("") I discover 
that this is empty even if gunzip, file-roller, Karc, winzip 7zip tell 
me that there is at least a file in the archive. No big deal since all I 
had to do was to add a test for empty archives which should have been 
there in the first place, but I still wonder why OOo has to be s 
strict :-)
The zip files I am working on are publicly available in case you want to 
take a look at a couple of them.


Cheers,

Michele

Mikhail Voytenko wrote:

Hi Michele,

The implementation of the package checks the zip format more strictly 
starting from OOo3.2, this is why some files that could be handled in 
OOo3.1.1 can not be handled any more directly. But it is correct so, 
because the file is indeed broken, if the package throws the exception.


I must confess, I do not quite understand what kind of documentation 
would you expect. Improvement of the broken zip file check is a 
bug-fix and is definitely no new feature.


In case you would like to repair the file please try to insert object 
of type NamedValue into the arguments ( args(1) ), with the values

aNamedValue.Name = "RepairPackage"
aNamedValue.Value = true

That will let the package ignore the errors in the broken zip file and 
try to repair it.


Hope that helps.

Best regards,
Mikhail.




-
To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org



[dev] com.sun.star.packages.zip.ZipIOException

2009-12-06 Thread Michele Zarri

Hello,

I have downloaded the snapshot OOo-Dev_m7 and I get an error when I run 
a macro that inspects a zip file using the com.sun.star.packages.zip 
service. 
The same macro trying to work on the same file works fine on OOo3.1.1


This is the StarBasic code I use and it dies on 
oZipService.initialize(args()):


Function fnGetArchivedFileFullName( sArchiveWithFullPath As String ) As 
String

   Dim args(0) As Variant
   Dim oZipService As Object
   Dim oTestArchive As Object
  
   oZipService = createUnoService("com.sun.star.packages.Package") 
   args(0) = ConvertToURL( sArchiveWithFullPath ) 
   oZipService.initialize(args())


[etc...]
 
End Function


The error message is as follows:
BASIC runtime error.
An exception occurred
Type: com.sun.star.packages.zip.ZipIOException
Message: /so/ws/OOO320/ooo/package/source/zippackage/ZipPackage.cxx: 
:766; Bad Zip File..




So my two questions:
1. has something changed in the zip package between OOo3.1.1 and OOo3.2? 
if so is there any documentation of such change?


2. if the answer to the first question is no, I will file a new issue. 
would it be possible for someone to confirm it?


Thanks in advance for your help.

Cheers,

Michele

-
To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org



[dev] Dialogs in OOoBasic on DEV300_m5

2008-04-06 Thread Michele Zarri
Hello,

I have a problem with the size of the dialogs in my macros. I created
the macros and dialog with OOo2.x and lately I imported them in OOo3.0
(copy & paste of the basic directory /openoffice.org2/user/basic in the
corresponding user directory of OOo3.0

All the dialogs are resized to a default size and even if I change them
in the OOoBasic IDE, the changes don't stick. Note that changing other
parameters (e.g. the background colour) works fine. 

Is there an easy solution to this problem?

Thanks in advance for any suggestion,

Michele


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



Re: [dev] New refresh of windows for Ooo2.0.4 under WinXP

2006-10-24 Thread Michele Zarri

Hello Cor,

Thanks for the reply, my answers inline :)

Cheers,

Michele

On 10/24/06, Cor Nouws <[EMAIL PROTECTED]> wrote:


Hi Michele,


> I have installed version 2.0.4 on WinXP and I noticed already a strange
> flickering in the buttons which I created with a macro. It is very easy
to
> reproduce this behaviour: just create a dialog, add a couple of
oversized
> buttons with some light background colour, then execute the dialog. You
> will
> see that the buttons flicker quite heavily. I reported this as a bug
> already.
When I adjust some buttons on an already existing dialog to appr. 2 x
3", I see no problem.
You mean just buttons as 'OK' and 'Cancel'


In my case every button produces the undesired effect, but only when the
dialog box is called, not when it is designed in the IDE.
The flickering occurs both on my PC and on my laptop.



Recently however I was using OOo Writer with a beamer (projector) and I
> noticed that whenever winXP was refreshing the windows (even simply
because
> of a mouse movement, or by opening a new window, or switching to another
> application...) the beamer was losing the synch and the image flickered
or
> disappeared completely.
Do you mean with 'image', that what is projected on the screen?
Today I gave a presentation with 2.0.4 on XP. With no probs...
Mind: I've no specs of the beamer used.



Yes, sorry for not being sufficiently clear. I am referring to the image
projected by the beamer. As I said, there has been definitely a change
between OOo 2.0.3 and OOo2.04 because the same equipment and hardware works
perfectly with OOo 2.0.3.

Just to give additional clarifications on the set up:
I work with 3 screens: my laptop screen, a TFT monitor and the beamer.
My laptop graphic card allows the extension of the windows desktop to a
secondary monitor and this is the image I project. The VGA output to the
beamer is split between the beamer and a TFT monitor that I keep on my desk
so that I can see a copy of what I am projecting and have something
completely different on my laptop screen.
The image on the TFT monitor (which is the same image going to the beamer)
is ok (100MHz refresh rate) while the one going to the beamer gets
corrupted.
The flickering of the buttons is instead visible on the TFT monitor, on the
projector and also on the laptop screen.


[dev] New refresh of windows for Ooo2.0.4 under WinXP

2006-10-24 Thread Michele Zarri

Dear Dev,

I have installed version 2.0.4 on WinXP and I noticed already a strange
flickering in the buttons which I created with a macro. It is very easy to
reproduce this behaviour: just create a dialog, add a couple of oversized
buttons with some light background colour, then execute the dialog. You will
see that the buttons flicker quite heavily. I reported this as a bug
already.

Recently however I was using OOo Writer with a beamer (projector) and I
noticed that whenever winXP was refreshing the windows (even simply because
of a mouse movement, or by opening a new window, or switching to another
application...) the beamer was losing the synch and the image flickered or
disappeared completely. The maximum refresh rate of the projector was 60Hz.
I have reverted to OOo 2.0.3 and the problem disappeared so I can rule out a
problem with the projector.
So my question: was there a major change in the way windows are invalidated
and refreshed between OOo 2.0.3 and OOo 2.0.4? Has this something to do with
the new functionality enabling impress presentations to be projected on a
secondary monitor? I would like to file a bug report, but I don't want to
waste the precious time of the developers.

Regards,

Michele Zarri


Re: [dev] Re: open office drawings

2006-05-12 Thread Michele Zarri

On 12/05/06, Franco A. Bignone <[EMAIL PROTECTED]> wrote:


Hello !

I am new to this list and I would like to ask a question. I have been
using the 'drawing' program for some time and I have found it,
aside from the lack of some capabilities, very powerful for large
and complex drawings. I would like to use it as an automatic
system to draw, so my question is  is there any possibility to
give the program a file with a list of instructions in order to
build a drawing ? How much is it difficult to change it in order
to do so ?

Regards

Franco

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

Hello Franco,


You can certainly program macros to automate your drawing, and there are
some quite impressive (at least for me) examples here:
http://www.ooomacros.org/user.php#91518

Finally, note that there is also an Italian list of users that you may
consider joining:
utenti@it.openoffice.org

Cheers,

Michele


[dev] How to capture the use of the mouse wheel event

2006-04-13 Thread Michele Zarri
Hello All,

I would be interested in capturing (using StarBasic) the event "the user
rotated the mouse wheel". Is there a way?

Regards,

Michele


[dev] Treeview control

2006-04-03 Thread Michele Zarri
Hello All,

I wanted to insert a treeview control in a dialog box similar to the one
used to manage the OOo options or keyboard customisation, or macro organizer
and so on...
Is it possible to access this control with StarBasic?

Actually I have already written (also in StarBasic) all the code to expand
and collapse branches, double clicks management etc... for the application I
have in mind using a list box, so as an alternative I would like to know if
it is possible to draw in a ListBox control (so that I can add the + and -
icons as well as the connectors for sub-branches).

As stated above I would like to continue using StarBasic (if possible)

Cheers,

Michele


Re: [dev] Example of use of the configuration

2005-10-20 Thread Michele Zarri
Joerg,

Thanks a lot for your explanation. Not being a programmer but just an
amateur who likes to write the odd macro, I doubt I will be able to do it,
nevertheless I will try.

Cheers,

Michele

On 13/10/05, Joerg Barfurth <[EMAIL PROTECTED]> wrote:
>
> Hi Michele,
>
> Michele Zarri wrote:
> > Thanks Andrew,
> >
> > took a look at your examples, but I am not sure anymore if the
> configuration
> > service is really what I want...
> >
> > I guess that what I want is similar to creating a registry entry under
> > windows XP.
>
> The configuration is the OOo equivalent of the Windows registry. Like
> the registry it is a hierarchical database. It differs from the Windows
> registry in that we require keeping track of what entries can go where
> by means of a schema. You can't simply create a value of any type
> anywhere within the hierarchy; instead you need to have a schema that
> describes your value, its data type and possibly default value (or a
> container where you can put arbitrary values).
>
> > When OOo is opened (ideally already with the quick start) a
> > string (i.e. the path to the file I want to open) is made available to
> the
> > macros. (How/where the macros will read it will be the subject of a
> > subsequent email :) )
> >
>
> Unless you can accomodate you data within an existing OOo configuration
> schema, you need to install a configuration schema of your own with your
> macro (you can deploy configuration schemas as part of UNO packages).
> When the schema is installed, you can have your macro read or write the
> data at any time. The data is loaded when it is first read and then kept
> in memory (unless it isn't referenced in 15 minutes, in which case it
> may get unloaded).
>
> HTH, Joerg
>
> --
> Joerg Barfurth Sun Microsystems - Desktop - Hamburg
> >>>>>>>>>>>>>>>>>> using std::disclaimer <<<<<<<<<<<<<<<<<<<<<<<
> Software Engineer [EMAIL PROTECTED]
> OpenOffice.org Configuration http://util.openoffice.org
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


[dev] Global variables in OOo - What is a OOo session?

2005-10-20 Thread Michele Zarri
Hello,

I know that global variables are the devil, but I am not a programmer and I
really need to use a couple of those things. The OOo basic help file states
that a global variable is available for the [quote]current session[/quote].

I have created a small macro "subPrepareEnvironment" that runs when a
document is opened, reads a file and loads the values in the global
variables. The global variables are declared in the same module where the
sub is. I used a message box to make sure that the values are loaded
correctly.

Unfortunately, when I later call a macro (in the same library where the
above mentioned sub is) and try to use the global variable, the value is no
longer set.
I think the problem may be that I do not know what a current session is.

Could someone be so kind to explain it to me? Alternatively, am I making a
huge mistake and not realising it (quite possible)

Cheers,

Michele


Re: [dev] Example of use of the configuration

2005-10-13 Thread Michele Zarri
Thanks Andrew,

took a look at your examples, but I am not sure anymore if the configuration
service is really what I want...

I guess that what I want is similar to creating a registry entry under
windows XP. When OOo is opened (ideally already with the quick start) a
string (i.e. the path to the file I want to open) is made available to the
macros. (How/where the macros will read it will be the subject of a
subsequent email :) )

Cheers,

Michele

On 11/10/05, Andrew Douglas Pitonyak <[EMAIL PROTECTED]> wrote:
>
> Michele Zarri wrote:
>
> >Hi,
> >
> >I hope this is the right list, if not, apologies.
> >I have written a macro that relies on a configuration file where I store
> >some parameters. I would like to avoid to re-open the file every time the
> >macro is executed so I would like writer to "remember" whether the file
> has
> >been opened or not for a given session. I cannot use global constants
> >because from time to time I need to change the configuration parameters
> (I
> >have also created the macros to do it).
> >Although the file is quite small and it takes no time to open it and
> parse
> >it, I would still like to use a more generic approac.
> >Not knowing the Java language I gave up on the developer's guide
> paragraph
> >on configuration, so my questions are:
> >1) is there a place where the developers guide examples are "translated"
> in
> >OOoBasic?
> >2) is there somewhere an example of storing configuration parameters?
> >
> >Cheers,
> >
> >Michele
> >
> >
> I have some old examples in section 5.5 and 5.7 of my free macro document.
>
> --
> Andrew Pitonyak
> My Macro Document: http://www.pitonyak.org/AndrewMacro.sxw
> 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]
>
>


[dev] Example of use of the configuration

2005-10-10 Thread Michele Zarri
Hi,

I hope this is the right list, if not, apologies.
I have written a macro that relies on a configuration file where I store
some parameters. I would like to avoid to re-open the file every time the
macro is executed so I would like writer to "remember" whether the file has
been opened or not for a given session. I cannot use global constants
because from time to time I need to change the configuration parameters (I
have also created the macros to do it).
Although the file is quite small and it takes no time to open it and parse
it, I would still like to use a more generic approac.
Not knowing the Java language I gave up on the developer's guide paragraph
on configuration, so my questions are:
1) is there a place where the developers guide examples are "translated" in
OOoBasic?
2) is there somewhere an example of storing configuration parameters?

Cheers,

Michele


[dev] Programmatic use of the navigator

2005-10-07 Thread Michele Zarri
All,

I have written a macro for write that moves a cursor to the first TextTable
above and one below the view cursor. This is dead easy to do using the
navigator, however I could not figure out how to invoke it from a macro. As
a result the code I have written is horribly long and complex. So is there a
way to ask the navigator to do the job?

Cheers,

Michele


Re: [dev] suggestion

2005-10-07 Thread Michele Zarri
Hello Paul,

I actually liked this function quite a lot too so I created a couple of
macros that I then associated to the keyboard combination.
Some of the gurus here will be able to tell you how to do it properly, but
this code does the trick for me ;-)

Note though that also the functionality of moving up and down the paragraph
(currently associated with CTRL+UP andn CTRL+DOWN) is rather useful.

Sub subJumpToNextParagraph()
Dim oViewCursor ' the visible cursor
Dim oWorkCursor ' a cursor to move around the text
Dim oText

oViewCursor = thisComponent.getCurrentController().getViewCursor()
oText = oViewCursor.getText()

' create the work cursor and place it where the view cursor is
oWorkCursor = oText.createTextCursorByRange(oViewCursor.getStart())
' go to the beginning of the next paragraph
oWorkCursor.gotoNextparagraph(False)
oWorkCursor.gotoStartOfParagraph(False)
' move the visible cursor there
oViewCursor.gotoRange(oWorkCursor.getStart(False), False)
End Sub

On 05/10/05, Paul Belanger <[EMAIL PROTECTED]> wrote:
>
> I've been playing around with Open Office and am enjoying it. I'm so
> tired of dealing with Microsoft it's not funny. But, as I bounce around
> in a Text Document I'm finding a handy MS feature missing from your
> program. I use CTRL keys frequently and CTRL-UParrow & CTRL-DOWNarrow
> don't jump to the beginning of the paragraphs in question, depending
> upon direction. It's a nice way to quickly get somewhere needed. Keep up
> the great work!
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


[dev] Extra files in zip pack

2005-07-25 Thread Michele Zarri
Hello there,

 

I already posted this message in the users mailing list, but I was advised
that this list was more appropriate for this kind of questions, so here we
go. 

I have written a macro using the service com.sun.star.packages.Package. The
problem I am having is that when the zip pack is created a directory called
META-INF as well as a file called mimetype appear alongside the zipped file
(or files). 

Under some circumstances, trying to delete these files with a zip manager
results in an error and eventually in the corruption of the archive.

 

Since some of my colleagues don't appreciate the extra files, I was
wondering if it was possible to remove them. 

 

Best Regards,

 

Michele