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 \
assigning to me, will try to implement
Created attachment 151302 [details] XPrinterServer Basic Test Script
Created attachment 151303 [details] XPrinterServer2 BeanShell Test Script committed patch, https://gerrit.libreoffice.org/#/c/72135/ needs code review
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.