Issue 28601

Summary: Print Text Selection: doesn't work in macro or via api
Product: Writer Reporter: winwaed <openoffice>
Component: uiAssignee: AOO issues mailing list <issues>
Status: CONFIRMED --- QA Contact:
Severity: Trivial    
Priority: P3 CC: issues
Version: OOo 1.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows 2000   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---

Description winwaed 2004-05-01 18:37:50 UTC
StarBasic 7.0; Windows 2000; Pentium4. StarBasic and COM (via C++).

Standard object API does not allow currently selected text to be printed.
Hence, I have tried to use dispatcher. The "Selected" property does not work
when using the dispatcher to print the current selected text (via StarBasic or COM).
To reproduce:
1.) Load text file, select some text. 
2.) Start recording macro
3.) Select print. Set print options as required, but set "Print Selected Text"
radio button.
4.) Perform the print. Stop recording macro.
    Printed text should be as required - ie. just the selected text.
5.) Rerun Macro.
    This then prints the entire document.

The same is seen when accessing the dispatcher through COM (from C++ in my
case), as well as StarBasic macro.
Changing other properties (eg. number of copies) demonstrates that my properties
are being passed correctly.
Comment 1 michael.ruess 2004-05-03 07:32:47 UTC
MRU->JSK: Macro recording...
Comment 2 joerg.skottke 2004-06-16 10:21:00 UTC
jsk->ab: is this something for you or rather mba?
Comment 3 ab 2004-06-16 10:38:01 UTC
Rather MBA... :-)
Comment 4 Mathias_Bauer 2004-06-22 15:02:09 UTC
.
Comment 5 Mathias_Bauer 2004-06-22 15:26:10 UTC
Please first try to confirm the issue, thanks.
Comment 6 joerg.skottke 2004-06-23 08:26:41 UTC
Must wait till a later time. No ressources left at this point.
Comment 7 joerg.skottke 2004-10-26 14:26:47 UTC
jsk->sw: Can you verify this for the API? Thanks!
Comment 8 stephan.wunderlich 2004-11-01 10:20:09 UTC
As winwaed already mentioned the only way to print the current selection is via
dispatch API. The macro-recorder produces the following macro:

sub Main
rem ----------------------------------------------------------------------
rem define variables
dim document   as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

rem ----------------------------------------------------------------------
dim args1(2) as new com.sun.star.beans.PropertyValue
args1(0).Name = "Copies"
args1(0).Value = 1
args1(1).Name = "Selection"
args1(1).Value = true
args1(2).Name = "Collate"
args1(2).Value = false

dispatcher.executeDispatch(document, ".uno:Print", "", 0, args1())

end sub

Unfortunately the whole text is printed when using this macro and not as
intended only the selected text.
Comment 9 Marcus 2017-05-20 11:22:05 UTC
Reset assigne to the default "issues@openoffice.apache.org".