Calligra Words for some reason sets any document it loads to the state "Modified" right from the start. This results in the the "Save or Discard?" dialog on closing the document, even if the user did not change anything herself. This is especially annoying when running Jos' odfautotests, btw, because though they are run with "--roundtrip-filename" the dialog box pops up and "Discard" has to be selected :/
Created attachment 74888 [details] Backtrace to point where setModified results in document set as modified after loading
Seems like StyleDocker/StrokeFillWidget is the culprit: it creates a command for some reason on a KoShapeManager::selectionChanged() coming in on the end of loading and setup. While StyleDocker::updateWidget() only gets 0 for firstSelectedShape(); and then updates the StrokeFillWidget to reset to default values, the change on the opacity slider results in the slot StyleDocker::updateOpacity(...) being called, which for some reason then creates a command. See backtrace.
(In reply to comment #2) > Seems like StyleDocker/StrokeFillWidget is the culprit: > it creates a command for some reason on a KoShapeManager::selectionChanged() > coming in on the end of loading and setup. While StyleDocker::updateWidget() > only gets 0 for firstSelectedShape(); Wrong, gets a shape, which also has no stroke (0 pointer), no background (0 pointer) and no transparency (100 opacity), but that is not the problem. The problem seems to be that updating the widget always results in commands, as at least KoSliderCombo* m_opacity always emits the signal valueChanged(), like when called with m_opacity->setValue(opacity); in StrokeFillWidget::updateWidget(...) So it seems the fix needed is to not listen to signals if the UI is just updated to reflect the state of the selected shape(s). I hope Inge may have some ideas here and can drop a proper patch right out of his sleeves faster than e.g. I could :)
Git commit e07ccbb4d52e609a14aacbddb62f4c74edb59028 by Inge Wallin. Committed on 13/11/2012 at 15:28. Pushed by ingwa into branch 'master'. Fix bug 309109: CWOP: Opening a document sets it to Modified M +5 -0 plugins/dockers/styledocker/StrokeFillWidget.cpp http://commits.kde.org/calligra/e07ccbb4d52e609a14aacbddb62f4c74edb59028
Git commit da4e2fe352488775985f7f9c81141bbb92d6df58 by Friedrich W. H. Kossebau, on behalf of Inge Wallin. Committed on 13/11/2012 at 15:28. Pushed by kossebau into branch 'calligra/2.6'. Fix bug 309109: CWOP: Opening a document sets it to Modified M +5 -0 plugins/dockers/styledocker/StrokeFillWidget.cpp http://commits.kde.org/calligra/da4e2fe352488775985f7f9c81141bbb92d6df58