Issue 110370 - Duplex Option Not Saved In Document (printer settings stored in document ignored on reopening document)
Summary: Duplex Option Not Saved In Document (printer settings stored in document igno...
Status: CLOSED FIXED
Alias: None
Product: Calc
Classification: Application
Component: printing (show other issues)
Version: OOo 3.2
Hardware: PC All
: P3 Trivial (vote)
Target Milestone: ---
Assignee: oc
QA Contact: issues@sc
URL:
Keywords: oooqa, regression
Depends on:
Blocks: 111112
  Show dependency tree
 
Reported: 2010-03-24 20:22 UTC by drichard
Modified: 2017-05-20 10:33 UTC (History)
4 users (show)

See Also:
Issue Type: PATCH
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
clean up whitespace mess (tab vs spaces) (30.15 KB, patch)
2010-07-16 10:52 UTC, lohmaier
no flags Details | Diff
the real fix - only create a new printer if the name of the existing one doesn't match the new one (1.41 KB, patch)
2010-07-16 10:53 UTC, lohmaier
no flags Details | Diff
translate two german comments (727 bytes, patch)
2010-07-16 10:53 UTC, lohmaier
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description drichard 2010-03-24 20:22:09 UTC
Our users have reported this issue and I have been able to replicate it.  If you
go into Calc and create a new multi-page spreadsheet and then go into File >>
Printer Settings and pick a duplexing printer and select "Long Edge" this should
stick in the document. However, when the document is re-opened it's back to "None".

What is interesting is that this same technique in Writer works.  If I create a
new document in that module, set the Duplex...close and re-open the document it
sticks.

I'm told this worked fine in 3.1.   Tested only on Linux.
Comment 1 Oliver Brinzing 2010-03-25 18:04:30 UTC
.
Comment 2 lohmaier 2010-07-15 21:14:50 UTC
confirmed - while the options are saved in the document (in the PrinterSetup 
base64binary blurp in settings.xml), those settings are ignored on reloading the 
document.

As written: works without problem in Writer.
Comment 3 lohmaier 2010-07-15 22:08:50 UTC
error can be "wordarounded" by modifying the document so that the PrinterSetup 
entry comes after the PrinterName setting. 

Apparently the error is in parsing the options / reading the printerName creates 
a new printer object, throwing away the one that was already created when reading 
the printerSetup stream.
Comment 4 lohmaier 2010-07-15 22:44:52 UTC
PrinterName block clones GetOptions, but the stuff stored (and restored on 
loading) is the JobSetup (than then is lost when replacing the previous printer 
object by the one created in the PrinterName block)

# printer created by cloning the options, but omitting JobSetup
http://pumbaa.ooodev.org:59145/source/xref/sc/source/ui/unoobj/confuno.cxx#196
# PrinterSetup stream ends up in JobSetup
http://pumbaa.ooodev.org:59145/source/xref/sfx2/source/view/printer.cxx#200

So (untested yet): replacing

SfxPrinter* pNewPrinter = new SfxPrinter( pPrinter->GetOptions().Clone(), 
aString );

by

SfxPrinter* pNewPrinter = new SfxPrinter( pPrinter->GetOptions().Clone(), 
aString, pPrinter->GetOrigJobSetup );

should do the trick

But it probably would be better to check whether the already existing printer 
already has the same name.
Comment 5 lohmaier 2010-07-16 10:51:28 UTC
type → PATCH
Comment 6 lohmaier 2010-07-16 10:52:27 UTC
Created attachment 70637 [details]
clean up whitespace mess (tab vs spaces)
Comment 7 lohmaier 2010-07-16 10:53:20 UTC
Created attachment 70638 [details]
the real fix - only create a new printer if the name of the existing one doesn't match the new one
Comment 8 lohmaier 2010-07-16 10:53:52 UTC
Created attachment 70639 [details]
translate two german comments
Comment 9 lohmaier 2010-07-16 10:59:57 UTC
The reason for checking the printer name instead of copying the JobSetup is my 
assumption that a jobSetup of a different printer will be useless on a printer 
with a different name. As saving Print settings (using File|Printer settings, 
then saving the document) will also set the printerName property, the JobSetup's 
printername should always match the printername anyway.
Thus PrinterName will now only trigger creation of new printer in case 
PrinterSetup has empty value/when no JobSetup is defined in the document.
Comment 10 stefan.baltzer 2010-07-19 11:52:56 UTC
Worked in OOo 3.1 => Set keyword "regression". 
Printer info gets lost on Windows, too => Set OS to "All"
sba -> nn: As discussed, please have a look, thanks.
Comment 11 niklas.nebel 2010-07-19 13:32:47 UTC
The patch looks right.
Comment 12 uwe.luebbers 2010-07-22 13:22:41 UTC
Adjusted target
Comment 13 niklas.nebel 2010-07-28 16:41:50 UTC
Fixed in CWS "calc57".
Comment 14 ooo 2010-08-06 14:05:09 UTC
Reassigning to QA for verification.
Comment 15 oc 2010-08-09 10:47:19 UTC
verified in internal build cws_calc57