Bug 443679 - Exiting color change popup via "Cancel" modifies the selected diagram object
Summary: Exiting color change popup via "Cancel" modifies the selected diagram object
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: Git
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-13 20:34 UTC by Oliver Kellogg
Modified: 2022-02-14 18:57 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 2.33.80 (KDE releases 22.03.80)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Kellogg 2021-10-13 20:34:20 UTC
SUMMARY

Exiting color change popup via "Cancel" modifies the selected diagram object.

STEPS TO REPRODUCE

1. Start Umbrello, create or load a class in the class diagram.
2. In the class diagram right click on class and select Color -
   Line Color or Fill Color.
3. In the color selection dialog that pops up, press Cancel.

OBSERVED RESULT

The selected item color will change to black.
In the case of Fill Color this is quite bad - the whole class will turn black.

EXPECTED RESULT

When exiting the color popup via Cancel, nothing shall change.

SOFTWARE/OS VERSIONS
Linux: openSuSE Tumbleweed 20210902
KDE Plasma Version: 5.22.4
KDE Frameworks Version: 5.85.0
Qt Version: 5.15.2
Umbrello version: Git master commit 50ef037 (2021-09-18)
Comment 1 Oliver Kellogg 2021-10-13 20:53:23 UTC
Git commit eac23da83da18c4f966e4a01b948be7404156123 by Oliver Kellogg.
Committed on 13/10/2021 at 20:52.
Pushed by okellogg into branch 'master'.

Fix "Exiting color change popup via Cancel modifies the selected diagram object"

umbrello/umlwidgets/associationwidget.cpp
- In function slotMenuSelection case ListPopupMenu::mt_Line_Color, after
  returning from QColorDialog::getColor() require newColor.isValid() to
  return true as precondition for modifying the line color.

umbrello/umlwidgets/widgetbase.cpp
- In function slotMenuSelection cases mt_Line_Color_Selection and
  mt_Fill_Color_Selection, after returning from QColorDialog::getColor()
  require newColor.isValid() to return true as precondition for
  modifying the color.
- Move opening brace outside #if / #else / #endif to avoid imbalance
  with closing brace.

M  +3    -2    umbrello/umlwidgets/associationwidget.cpp
M  +9    -6    umbrello/umlwidgets/widgetbase.cpp

https://invent.kde.org/sdk/umbrello/commit/eac23da83da18c4f966e4a01b948be7404156123