Bug 369464 - Data type with modifiers are space sensitive
Summary: Data type with modifiers are space sensitive
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: 2.20.1 (KDE Applications 16.08.1)
Platform: Other All
: NOR normal
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-28 10:10 UTC by Ralf Habacker
Modified: 2022-03-05 07:10 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf Habacker 2016-09-28 10:10:09 UTC
Data types having a modifier are space sensitive e.g. a type 'int *' is not the same as 'int*'

Reproducible: Always

Steps to Reproduce:
1. start umbrello
2. Add a new class
3. Add a new attribute and set type to 'int *'
4. Press ok, reedit and set type to 'int*' (without space)


Actual Results:  
A new data type is created.

Expected Results:  
Because logical both spellings are refering to the same type there should no new type been added.
Comment 1 Oliver Kellogg 2022-03-05 07:10:50 UTC
Git commit 999d6338f4c4baec178626fb3bff175e2bac7906 by Oliver Kellogg.
Committed on 05/03/2022 at 07:09.
Pushed by okellogg into branch 'master'.

Fix "Data type with modifiers are space sensitive"

umbrello/model_utils.{h,cpp}
- New function normalize(QString type) removes interspersed spaces from
  given type name where possible: Between word and non word, between non
  word and word, between non word and non word.  Space between word and
  word is left intact to preserve names such as "unsigned long long".
- In function findUMLObject:
  - On assigning to name apply normalize() to inName.
  - As a peripheral change, fix bug number in #ifdef TRY_BUGFIX_120862.

umbrello/codeimport/kdevcppparser/cpptree2uml.cpp
- In function typeOfDeclaration for-loop over ptrOpList, on assigning to
  `text' remove spaces from ptrOpList.at(i)->text() as done in loop over
  declarator->arrayDimensionList().

umbrello/dialogs/dialog_utils.cpp
- In function askName apply Model_Utils::normalize() on returned name.

umbrello/dialogs/widgets/umldatatypewidget.cpp
- In functions applyAttribute, applyEntityAttribute, applyOperation,
  applyParameter, on assigning to typeName apply Model_Utils::normalize
  on m_editField->currentText().

umbrello/umldoc.cpp
- In function findDatatype apply Model_Utils::normalize() to name before
  processing.
FIXED-IN:2.33.80 (KDE releases 22.03.80)

M  +4    -2    umbrello/codeimport/kdevcppparser/cpptree2uml.cpp
M  +4    -3    umbrello/dialogs/dialog_utils.cpp
M  +6    -5    umbrello/dialogs/widgets/umldatatypewidget.cpp
M  +32   -2    umbrello/model_utils.cpp
M  +2    -0    umbrello/model_utils.h
M  +1    -0    umbrello/umldoc.cpp

https://invent.kde.org/sdk/umbrello/commit/999d6338f4c4baec178626fb3bff175e2bac7906