The summary should be enough Reproducible: Always Steps to Reproduce: 1. Save a project 2. Close umbrello 3. Open it again Actual Results: Classes position is messed up when reopening the file Expected Results: The saved layout should be preserved
Please provide a related test xmi file.
Created attachment 96583 [details] Saved xmi file
Created attachment 96584 [details] The layout before saving project
Created attachment 96585 [details] After opening the project again
(In reply to milasudril from comment #4) > Created attachment 96585 [details] > After opening the project again I assume, you are using a self compiled version 2.17.2 (KDE 4) on ubuntu ? (Official version are older https://apps.ubuntu.com/cat/applications/saucy/umbrello/) I opened this xmi-file with self compiled 2.17.2 (KDE 4) and could not reproduce this issue. Can you please save the xmi file after reloading and append it also to this bug ?
Created attachment 96688 [details] Resaved broken file
(In reply to Ralf Habacker from comment #5) > (In reply to milasudril from comment #4) > > Created attachment 96585 [details] > > After opening the project again > > I assume, you are using a self compiled version 2.17.2 (KDE 4) on ubuntu ? > (Official version are older > https://apps.ubuntu.com/cat/applications/saucy/umbrello/) > > I opened this xmi-file with self compiled 2.17.2 (KDE 4) and could not > reproduce this issue. Can you please save the xmi file after reloading and > append it also to this bug ? I am not on Saucy, but Wily and the package is 4:15.08.2-0ubuntu1 from wily/universe not self compiled.
I tried to compile the git repo, but the bug is also present in Version 2.19.99-367c845. Can there be a broken library instead?
(In reply to milasudril from comment #6) > Created attachment 96688 [details] > Resaved broken file (In reply to milasudril from comment #8) > I tried to compile the git repo, but the bug is also present in Version > 2.19.99-367c845. Can there be a broken library instead? After looking into the broken file there are several x coordinates zero, which may happen with incorrect local settings eg ',' as decimal mark. I verifed this by changing the locale on my workstation to en_US (defaul de_DE), loaded classes.xmi again and saw the same issue. umbrello need to save coordinates to and load them from xmi file locale independently using '.' als decimal mark.
(In reply to Ralf Habacker from comment #9) > I verifed this by changing the locale on my workstation to en_US (defaul > de_DE), loaded classes.xmi again and saw the same issue. from http://doc.qt.io/qt-5/qstring.html#toFloat "... The string conversion will always happen in the 'C' locale. For locale dependent conversion use QLocale::toFloat() .." On a german linux opensuse os I can reproduce the issue with LC_NUMERIC=en_US.UTF-8 umbrello
Git commit 90517660d6a14da833ea6cb7c1641bcdfe6c1d2b by Ralf Habacker. Committed on 23/01/2016 at 21:10. Pushed by habacker into branch 'Applications/15.12'. Fix 'When opening a saved file, class positions are wrong'. The bug, which exists in Qt4 and 5, happens on saving xmi files using a locale dependent decimal point and is caused by a different implementation of void QDomElement::setAttribute(const QString& name, double value) not using the 'C' locale for converting floating point values to string as the other number related methods does. Therefore the bug fix is to use QString::number(), which uses the 'C' locale. Add related unit test. FIXED-IN:2.18.2 (KDE Applications 15.12.2) M +2 -2 umbrello/umlscene.cpp M +2 -2 umbrello/umlwidgets/associationline.cpp M +4 -4 umbrello/umlwidgets/umlwidget.cpp M +118 -1 unittests/TEST_basictypes.cpp M +4 -0 unittests/TEST_basictypes.h http://commits.kde.org/umbrello/90517660d6a14da833ea6cb7c1641bcdfe6c1d2b
For the record: The issue happens when opening an xmi file on a linux os with english locale, which has been generated with umbrello < 2.18.2 on a linux os with non english linux.
Git commit 65296dc299319e0ad4675353100e582054987f81 by Ralf Habacker. Committed on 23/01/2016 at 22:09. Pushed by habacker into branch 'Applications/15.12'. fixup of 90517660d6a14da833ea6cb7c1641bcdfe6c1d2b. M +4 -4 umbrello/umlwidgets/associationline.cpp http://commits.kde.org/umbrello/65296dc299319e0ad4675353100e582054987f81
Git commit 59ab483bac9104ec12dee4a98a0a9dcca4dd7636 by Ralf Habacker. Committed on 23/01/2016 at 22:33. Pushed by habacker into branch 'Applications/15.12'. Fix loading of XMI files on linux os generated with non english locale. XMI files generated on linux os with non english locale contains ',' as decimal point, which is not readable on os with english locale. M +21 -0 umbrello/basictypes.cpp M +2 -0 umbrello/basictypes.h M +6 -6 umbrello/umlwidgets/associationline.cpp M +3 -3 umbrello/umlwidgets/umlwidget.cpp http://commits.kde.org/umbrello/59ab483bac9104ec12dee4a98a0a9dcca4dd7636
Git commit 15117e4ca041b5d3241cd75edf900b8dd5d5163d by Ralf Habacker. Committed on 23/01/2016 at 22:45. Pushed by habacker into branch 'Applications/15.12'. Keep loading type of XMI file attributes "xclicked", "yclicked", "minY" and "maxY" in sync with saving. M +2 -2 umbrello/umlwidgets/floatingdashlinewidget.cpp M +2 -2 umbrello/umlwidgets/messagewidget.cpp http://commits.kde.org/umbrello/15117e4ca041b5d3241cd75edf900b8dd5d5163d