# writer print current page

For years, I have use a macro to print the current page of a writer document, as advocated by Andrew Pitonyak and others. Recently, instead of printing the page, it calls up the print dialogue. Any reason why this would be?

sub PrintPage
Dim oVC as Object, CurrentPage\$, Props(1) As New com.sun.star.beans.PropertyValue
oVC = ThisComponent.CurrentController.getViewCursor
CurrentPage = trim(Str(oVC.getPage))
Props(0).Name = "Pages" : Props(0).Value = CurrentPage
ThisComponent.print(Props)
end sub 'PrintPage

edit retag close merge delete

Looks like regression deserving a bug report. Likely related to print dialog rework.

( 2020-04-08 12:30:01 +0100 )edit

I also use the same macro. However, it works for me in LO 6.4.0.3, thus, the question is recently in your report?

Looks like regression

Oh, there are so many things in macros, in extensions broken by LO developers…

( 2020-04-08 13:16:50 +0100 )edit

Oh, there are so many things in macros, in extensions broken by LO developers…

I guess so. Sometimes the changes are intentional, and then they go to the release notes as incompatible changes. Often they are accidental regressions though; I myself remember fixing several. For each such fix, I create a unit test, to make it harder to break that function in the future. So filing bugs is as essential to avoid regressions in API, as with other bugs.

( 2020-04-08 13:21:10 +0100 )edit

The problem is that sometimes it is difficult to determine if a report is justified and will be accepted by developers. For example, if a DOCX file opens with lost/garbled formatting, it is a sure case for a report because LibreOffice claims to be compatible with the DOCX format. However (a real-life case), if LibreOffice rejects an extension that installs and runs in Apache OpenOffice, is it enough for a report? LibreOffice does not claim to accept any particular extension. Or if my macro, that used to run fine since OOo 1.0 up to the last 3.4, does not run in the present LibreOffice, is it a case? Again, LibreOffice does not claim to run my macro.

( 2020-04-08 16:40:02 +0100 )edit

@gabix: IMO any such case should be reported. It worked, then it doesn't work anymore. That's it. No claims are required to be entitled to report.

(I realize that you are experienced person, so writing the following just for completeness:)

What should be noted is the correct expectations. When one reports to bugzilla, it is great contribution; yet to avoid grief, one needs to realize that closed bug report (e.g. WONTFIX or NOTABUG) is a valid result, and is not an offence. (Me personally has many issues reported, that were eventually closed like that; and of course, I closed quite a few others' reports with those resolutions.) So it's essential to be prepared that a report is closed that way, and not be depressed because of that, and continue filing bugs in positive way.

( 2020-04-08 17:50:14 +0100 )edit

Thanks to both for this commentary. I should have said I'm using LO6.4.3.2 on Ubuntu 18.04. I'm not certain which version last worked, but but 6.4.1 didn't work, and I've just checked 6.3.2 appimage which works. I'll report it.

( 2020-04-09 22:43:21 +0100 )edit

On further investigation, resetting the profile fixes this problem. This is actually quite annoying. I've had issues like this before, and the solution is to reset the whole profile, or perhaps delete registrymodifications.xcu. But a lot of things, settings and macros in particular, are lost which are probably problem free. Is there a way to track down what part of the profile is causing the problem?

( 2020-04-13 13:40:55 +0100 )edit