Issue 116136 - Writer file closes unsaved after File|Send|Outline to presentation
Summary: Writer file closes unsaved after File|Send|Outline to presentation
Status: CLOSED FIXED
Alias: None
Product: Writer
Classification: Application
Component: code (show other issues)
Version: OOo 3.3 RC8
Hardware: All All
: P2 Trivial (vote)
Target Milestone: 3.4.0
Assignee: michael.ruess
QA Contact: issues@sw
URL:
Keywords: data_loss
Depends on:
Blocks:
 
Reported: 2010-12-15 16:46 UTC by cno
Modified: 2017-05-20 10:30 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description cno 2010-12-15 16:46:00 UTC
Steps to reproduce:
- new writer document
- add some headers (heading 1, 2, etc)
- File|Send|Outline to presentation
 New presentation opens
- close presentation
 Question for saving or not (choise does not matter here)
- close writer document
 > closed directly, without Question for saving or not
 Expected is the question for saving or not.

(same problem in 3.2.1 (maybe earlier, didn't try that), so no regression)
Comment 1 Marcus 2011-02-02 08:52:35 UTC
confirmed on Solaris Sparc with OOo 3.3.0

at least on Solaris Sparc: after choosing "File - Send - Outline to
Presentation" the Save icon is grayed-out and the "*" indicator in the statusbar
is also not shown, although the modified Writer document is not saved. So, the
user cannot see and may not know that there are still changes to save

@mav:
please have a look
Comment 2 mikhail.voytenko 2011-02-02 09:58:46 UTC
Adjusting the target.
Comment 3 Mathias_Bauer 2011-03-23 13:28:18 UTC
It seems that the culprit is that the "modified" flag of the Writer document is reset when the outline is exported to rtf. The simplest fix could be to prevent the change:

    case FN_OUTLINE_TO_CLIPBOARD:
    case FN_OUTLINE_TO_IMPRESS:
    {
        sal_Bool bEnabled = IsEnableSetModified();
        EnableSetModified(sal_False);
        WriterRef xWrt;
        ::GetRTFWriter( 'O', String(), xWrt );
        SvMemoryStream *pStrm = new SvMemoryStream();
	pStrm->SetBufferSize( 16348 );
	SwWriter aWrt( *pStrm, *GetDoc() );
	ErrCode eErr = aWrt.Write( xWrt );

        // etc. etc.

        EnableSetModified(bEnabled);

Or something like that.

Oliver, do you agree?
Comment 4 Oliver Specht 2011-03-23 14:48:17 UTC
Fixed in the proposed way in cws os151 in
http://hg.services.openoffice.org/cws/os151/rev/9275efc533e9
Comment 5 michael.ruess 2011-03-24 07:48:13 UTC
MRU->OS: I think, it was not your intention to reassign this issue to "writerneedsconfirm"... F*** default option "reset assignee to default"... ;-)
Comment 6 Oliver Specht 2011-03-28 12:26:37 UTC
reassigned to mru for verification
Comment 7 michael.ruess 2011-03-30 17:09:12 UTC
Verified fix in CWS os151.