Bug 125207 - extend "css:awt:XPrinterServer" with method getDefaultPrinterName()
Summary: extend "css:awt:XPrinterServer" with method getDefaultPrinterName()
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: framework (show other bugs)
Version:
(earliest affected)
6.3.0.0.alpha0+
Hardware: All All
: medium enhancement
Assignee: Oliver Brinzing
URL:
Whiteboard: target:6.3.0
Keywords:
Depends on:
Blocks:
 
Reported: 2019-05-10 17:31 UTC by Oliver Brinzing
Modified: 2019-05-23 17:10 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
XPrinterServer Basic Test Script (322 bytes, text/plain)
2019-05-11 07:28 UTC, Oliver Brinzing
Details
XPrinterServer2 BeanShell Test Script (1.41 KB, text/plain)
2019-05-11 07:29 UTC, Oliver Brinzing
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Brinzing 2019-05-10 17:31:13 UTC
css:awt:XPrinterServer has a method to get a list of available printer names,
but there is no method to get the current default printer name.
https://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1awt_1_1XPrinterServer.html

"Printer::GetDefaultPrinterName()" is already available in "vclxprinter.cxx".

steps to implement new interface "css::awt::XPrinterServer2":

- change "toolkit\awt\vclxprinter.cxx":
  +OUString VCLXPrinterServer::getDefaultPrinterName()
  +{
  +    return Printer::GetDefaultPrinterName();
  +}

- change "include\toolkit\awt\vclxprinter.cxx":
  +OUString SAL_CALL getDefaultPrinterName() override;

- add "offapi\com\sun\star\awt\XPrinterServer2.idl"
  +published interface XPrinterServer2: ::com::sun::star::awt::XPrinterServer
  +{
  +   string getDefaultPrinterName();
  +};

- change "offapi\com\sun\star\awt\PrinterServer.idl"
  -service PrinterServer: com::sun::star::awt::XPrinterServer;
  +service PrinterServer: com::sun::star::awt::XPrinterServer2;

- change "\offapi\type_reference\offapi.idl"
  +published interface XPrinterServer2 {
  +  interface ::com::sun::star::awt::XPrinterServer;
  +  string getDefaultPrinterName();
  +};

- change "\offapi\unoApi_offapi.mk"
  + XPrinterServer2 \
Comment 1 Oliver Brinzing 2019-05-10 17:32:48 UTC
assigning to me, will try to implement
Comment 2 Oliver Brinzing 2019-05-11 07:28:36 UTC
Created attachment 151302 [details]
XPrinterServer Basic Test Script
Comment 3 Oliver Brinzing 2019-05-11 07:29:35 UTC
Created attachment 151303 [details]
XPrinterServer2 BeanShell Test Script

committed patch, 
https://gerrit.libreoffice.org/#/c/72135/

needs code review
Comment 4 Commit Notification 2019-05-19 18:37:20 UTC
brinzing committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/0f55127195a897ca7b13c25ded2208476dba3a08%5E%21

tdf#125207 [API CHANGE] extend css.awt.PrinterServer: XPrinterServer2

It will be available in 6.3.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.