Issue 125174

Summary: Make edits, save file (increment name), close file, open new file, style edits gone
Product: Writer Reporter: ES <jim_away>
Component: editingAssignee: AOO issues mailing list <issues>
Status: UNCONFIRMED --- QA Contact:
Severity: Normal    
Priority: P3 CC: jim_away, mtishman2013, testanalyst
Version: 4.1.0Keywords: needmoreinfo
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---
Attachments:
Description Flags
Document I used for testing. Contains 26 pages with 418 paragraphs.
none
Incremented document-name with different styles
none
AdditionalSpecificTests
none
Screenprint_AllFilesSaved_DataOk none

Description ES 2014-06-28 18:24:19 UTC
Working on a file with several thousand lines.  Making simple style edits (Heading 1) at various locations -- maybe 25 to 50 at a time.  After doing a bunch of these simple edits a save is done to the same fileName suffix. After a period of time the file is SavedAs with a different fileName suffix.  The file is closed. The file with the new fileName suffix is opened to continue the editing.  Most, if not, all of these simple style edits are gone.

I have not noticed this before.  I am now using 4.1.0.  I began finding this problem.
Comment 1 Oliver-Rainer Wittmann 2014-07-02 08:27:00 UTC
@ES:
What do you mean by 'style edits ... may 25 to 50 at a time'?
Are you editing a certain Paragraph Style 25 to 50 times?
Or do you mean that you edited 25 to 50 Paragraphs which have a certain Paragraph Style applied?

Without a sample document it is hard to reproduce and to fix the issue.
Are you able to attach a sample document? If it is confidential, you can send it in private to me (orw@apache.org) - I assure that I will only use it for reproducing and fixing the defect.
Comment 2 Mike Tishman 2016-03-02 04:08:08 UTC
Environment used:
Windows 10 64-bit
OpenOffice version 4.1.0
build: AOO410m18(Build:9764)  -  Rev. 1589052

I was unable to replicate the bug using the steps provided. 
Here are the steps I took with the given information from your report:
1. Open new document (.odt)
2. Indent with tab to create a paragraph, and type out a line til it causes a new line.
3. Copy that paragraph and paste it with a return character between each paste until you reach a large number of lines to work with. ( In the attached document I pasted 1016 lines) 
4. Highlight 3 pages, or about 50 paragraphs, and change the style using the drop-down box next to the font drop down. I changed the style from Default to Heading1.

- For every 4 or 5 pages I would change the style again from Default to Heading2... heading3 etc, as shown in the attached document.

5. Save the document under the same name.
6. Waited a minute, then use SaveAs, and name it the original file name + “1”
      - For example: original file = “test.odt” new file = “test1.odt”
7. Restart OpenOffice Writer 
8. Open the new file (the incremented file : “test1.odt”)
      - Expected result – Some or all style changes missing
      - Actual result – all style changes made were still present.

I also preformed these steps on the newest Version:
V4.1.2    AOO412m3(Build:9782)  -  Rev. 1709696
And had the same result.
Comment 3 Mike Tishman 2016-03-02 04:10:33 UTC
Created attachment 85346 [details]
Document I used for testing. Contains 26 pages with 418 paragraphs.
Comment 4 Mike Tishman 2016-03-02 04:11:35 UTC
Created attachment 85347 [details]
Incremented document-name with different styles
Comment 5 Sandeep 2016-04-17 20:13:55 UTC
I am adding my comments based on my interpretation, reasoning and results from replication
------------------------------------------------------------------------------
Version: OO 4.2.0 AOO420m1(Build:9800)  -  Rev. 1692551
OS: Windows 7 Professional SP1
RAM : 8GB

Minimal programs running including Notepad++, Word 2010, OO Writer

I ran different tests
----------------------------------------------------------------------------------
Test 1: Objective is to replicate using the same idea as ES did in original bug report but with some helpful data points bout File extension, # of Lines, # of string styled, Time delay

Prerequisite: 

1. A file with .odt extension and lines ~20K is already created (CDTMyOOFile.odt). All text data is there copied pasted from notepaad++ file. So no default formatting
2. Data is chosen such that there are aat lest 50+ instances of different strings that can be styled
----------------------------------------------------------------------------------
Steps: 
1. Open OO Writer and the file CDTMyOOFile.odt
2. Use Ctrl+F open "Find & Replace" dialogue
3. In "Search For" box, enter a string of your choice say "11 Kaner, Cem, Improving the Maintainability of Automated Test SuitesA Context-Driven Approach to Automation in Testing"
4. click Find All, once the search string is selected (all such test strings in the file), close the "Find & Replace" dialogue.
5. Once dialogue gets closed, hit F11 (or from menu bar, select Format > Styles & Formatting ) to open Style and Formatting window, select 6th option which is "Heading1', click it.
6. Make sure that you see that currently selected string is styled as Heading1
7. Now close this window, Do not save and hit F5 to open Navigator (or from menu bar Select View > Navigator). You should see that all 50+ instances of the string under test are styled as Heading1
8. Hit Ctrl + S and save the document as .odt extension (CDTMyOOFileTest.odt) on a drive of your choice having sufficient space. Close the OO Writer
9. Wait for 60 seconds and reopen the OO and then open the CDTMyOOFileTest.odt file
10. Do not make changes and use "Save As" to save the file and name it as "CDTMyOOFileTest_001_NewSuffix.odt". Save it and close the OO
12. Reopen the document

As per user's observations:
----------------------------
1. Most of the styles shouldn't be there

As per test results:
-----------------------------:
All styles are there. Not a single style is changed


-- End Of Test 1-----

Test 2: Objective is to replicate using a modified idea as ES did in original bug report but with some helpful data points bout File extension, # of Lines, # of string styled, Time delay plus styling more lines in the file and then using save As + Reopen 
-------------------------------------------------------------------------------

Prerequisite: 

1. A file with .odt extension and lines ~20K is already created (CDTMyOOFile.odt). All text data is there copied pasted from notepaad++ file. So no default formatting
2. Data is chosen such that there are aat lest 50+ instances of different strings that can be styled
----------------------------------------------------------------------------------
Steps: 
1. Open OO Writer and the file CDTMyOOFile.odt
2. Use Ctrl+F open "Find & Replace" dialogue
3. In "Search For" box, enter a string of your choice say "11 Kaner, Cem, Improving the Maintainability of Automated Test SuitesA Context-Driven Approach to Automation in Testing"
4. click Find All, once the search string is selected (all such test strings in the file), close the "Find & Replace" dialogue.
5. Once dialogue gets closed, hit F11 (or from menu bar, select Format > Styles & Formatting ) to open Style and Formatting window, select 6th option which is "Heading1', click it.
6. Make sure that you see that currently selected string is styled as Heading1
7. Now close this window, Do not save and hit F5 to open Navigator (or from menu bar Select View > Navigator). You should see that all 50+ instances of the string under test are styled as Heading1
8. Hit Ctrl + S and save the document as .odt extension (CDTMyOOFileTest.odt) on a drive of your choice having sufficient space. Close the OO Writer
9. Wait for 60 seconds and reopen the OO and then open the CDTMyOOFileTest.odt file
10. Utilize steps 2 to 7 to have another string styled in 'Heading1'. 
11. Once confirmed that new string is also styled, use Save As to save the file and name it as "CDTMyOOFileTest_001_NewSuffix.odt". Save it and close the OO
12. Open the document using OO, now you have 100+ Heading1 styles

As per user's observations:
----------------------------
1. Most of the styles shouldn't be there

As per test results:
-----------------------------:
All styles are there. Not a single style is changed (neither earlier ones nor the new ones)

-- End Of Test 2-----

Test 3: Objective is to replicate based on assumption that in original bug report by ES, suffix may have meant a file extension change. 

Theory behind Test 3: 
----------------------
1. Formatting, Styles related issues may be observed when saving from one extension to another extension and usually not on just increasing the file name
2. Normally OO gives a warning  to the user when saving from one extension to another (probably incompatible) some formatting may be lost. 

If this is true and user did Save As. Did he looked into the message and made a correct choice of not losing the formatting, styles? Only Heading 1 lost or different kind of heading lost from different paragraphs?
-------------------------------------------------------------------------------

Prerequisite: 

1. A file with .odt extension and lines ~20K is already created (CDTMyOOFile.odt). All text data is there copied pasted from notepaad++ file. So no default formatting
2. Data is chosen such that there are aat lest 50+ instances of different strings that can be styled
----------------------------------------------------------------------------------
Steps: 
1. Open OO Writer and the file CDTMyOOFile.odt
2. Use Ctrl+F open "Find & Replace" dialogue
3. In "Search For" box, enter a string of your choice say "11 Kaner, Cem, Improving the Maintainability of Automated Test SuitesA Context-Driven Approach to Automation in Testing"
4. click Find All, once the search string is selected (all such test strings in the file), close the "Find & Replace" dialogue.
5. Once dialogue gets closed, hit F11 (or from menu bar, select Format > Styles & Formatting ) to open Style and Formatting window, select 6th option which is "Heading1', click it.
6. Make sure that you see that currently selected string is styled as Heading1
7. Now close this window, Do not save and hit F5 to open Navigator (or from menu bar Select View > Navigator). You should see that all 50+ instances of the string under test are styled as Heading1
8. Hit Ctrl + S and save the document as .odt extension (CDTMyOOFileTest.odt) on a drive of your choice having sufficient space. Close the OO Writer
9. Wait for 60 seconds and reopen the OO and then open the CDTMyOOFileTest.odt file
10. Utilize steps 2 to 7 to have another string styled in 'Heading1'. 
11. Once confirmed that new string is also styled, use Save As to save the file and name it as "CDTMyOOFileTest.doc". Accept the formatting loss relted warning and save the document
12. Now open the the .doc document using OO, now you have 100+ Heading1 styles

As per user's observations:
----------------------------
1. Most of the styles shouldn't be there

As per test results:
-----------------------------:
All styles are there. Not a single style is changed (neither earlier ones nor the new ones)



-- End Of Test 3-----
-- Attached evidences------
1. Test 1 - Test 2 - Test 3 Replication Results.doc
2. CDTMyOOFileTest.odt


Other Follow-up tests that could be run:

1.Vary the number of lines 50K+ and changing styles of 10% of paragraphs (e.g. 500) with Heading1, Heaading2 and others (equal distribution)
2. Stress the RAM to see if opening file when RAM is a constraint – However I cannot this test as of now
3. Save the file, do an un-install / install and Reopen
Comment 6 Sandeep 2016-04-17 20:22:53 UTC
Created attachment 85450 [details]
AdditionalSpecificTests
Comment 7 Sandeep 2016-04-17 20:26:56 UTC
Created attachment 85451 [details]
Screenprint_AllFilesSaved_DataOk

I could attach the test files. But size is a constraint. Attaching screenshot for successfully saved files with no data loss