diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2019-11-21 14:03:05 +0100 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2019-11-21 19:30:19 +0100 |
commit | 46f8f48ebfe25e26b4d1c0718c772abbee70b889 (patch) | |
tree | 788778bcd77cd542b26b6645b1575fc994c02ac5 /unotools/IwyuFilter_unotools.yaml | |
parent | 0bd54ab69b52764a705637735b064f92d0772f8d (diff) |
tdf#118263 Take over doc print options for new printer
Take over the current document-specific print settings for
a newly created printer in 'sw::DocumentDeviceManager::Create_Printer_'.
This makes sure that the options of an 'SfxPrinter*' retrieved
by calling 'DocumentDeviceManager::getPrinter(true)' are in line
with the 'SwPrintData' currently set.
This among other fixes the issue described in tdf#118263,
comment 7, i.e. the options shown in "File" -> "Printer Settings"
-> "Options" were not properly initialized when the config option
for loading user-specific settings with the document was disabled.
(All checkboxes were unchecked in the UI in this case instead of
showing the default values.)
What happens is that when importing the document,
'bPrinterIndependentLayout' in 'SwXMLImport::SetConfigurationSettings'
is 'false', so that this block is entered there:
if( ! bPrinterIndependentLayout )
{
xProps->setPropertyValue( "PrinterIndependentLayout", Any(sal_Int16(document::PrinterIndependentLayout::DISABLED)) );
}
resulting in the following call stack where the printer is created and
set:
#0 sw::DocumentDeviceManager::setPrinter(SfxPrinter*, bool, bool)
#1 sw::DocumentDeviceManager::CreatePrinter_() const
#2 sw::DocumentDeviceManager::getPrinter(bool) const
#3 sw::DocumentDeviceManager::setReferenceDeviceType(bool, bool)
#4 SwXDocumentSettings::_setSingleValue(comphelper::PropertyInfo const&, com::sun::star::uno::Any const&)
#5 comphelper::MasterPropertySet::setPropertyValue(rtl::OUString const&, com::sun::star::uno::Any const&)
#6 SwXMLImport::SetConfigurationSettings(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&)
[...]
Writer's default settings were not applied in this case.
For the case where loading user-specific settings is enabled,
no printer is set at this stage, but it's later set in the call to
'SwView::GetPrinter', in which case there is already an explicit
call to 'SetAppPrintOptions' after the printer is created via
'DocumentDeviceManager::getPrinter(true)', so all was fine there
earlier as well.
(Apparently, the same issue could be reproduced with the config
option for loading user-specific options enabled, but an ODT
document that has "PrinterIndependentLayout" set to "disabled"
in it's settings.xml.)
Change-Id: I39fd300fb56b767e7103b65537b0eac1365e5fd7
Reviewed-on: https://gerrit.libreoffice.org/83394
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'unotools/IwyuFilter_unotools.yaml')
0 files changed, 0 insertions, 0 deletions