Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SDK
Umbrello
Commits
5f06e9ae
Commit
5f06e9ae
authored
Nov 21, 2013
by
Joris Steyn
Browse files
Fix integer overflow in associationwidget
CCBUG: 327834
parent
0f7746fc
Changes
1
Hide whitespace changes
Inline
Side-by-side
umbrello/widgets/associationwidget.cpp
View file @
5f06e9ae
...
...
@@ -2462,7 +2462,7 @@ QPointF AssociationWidget::calculateTextPosition(Uml::TextRole::Enum role)
p
=
m_associationLine
->
point
(
0
);
q
=
m_associationLine
->
point
(
1
);
}
else
if
(
role
==
TextRole
::
MultiB
||
role
==
TextRole
::
ChangeB
||
role
==
TextRole
::
RoleBName
)
{
const
u
int
lastSegment
=
m_associationLine
->
count
()
-
1
;
const
int
lastSegment
=
m_associationLine
->
count
()
-
1
;
p
=
m_associationLine
->
point
(
lastSegment
);
q
=
m_associationLine
->
point
(
lastSegment
-
1
);
}
else
if
(
role
!=
TextRole
::
Name
)
{
...
...
@@ -2565,7 +2565,7 @@ void AssociationWidget::constrainTextPos(qreal &textX, qreal &textY,
{
const
int
textCenterX
=
textX
+
textWidth
/
2
;
const
int
textCenterY
=
textY
+
textHeight
/
2
;
const
u
int
lastSegment
=
m_associationLine
->
count
()
-
1
;
const
int
lastSegment
=
m_associationLine
->
count
()
-
1
;
QPointF
p0
,
p1
;
switch
(
tr
)
{
case
TextRole
::
RoleAName
:
...
...
@@ -2596,7 +2596,7 @@ void AssociationWidget::constrainTextPos(qreal &textX, qreal &textY,
{
int
minDistSquare
=
100000
;
// utopian initial value
int
lpIndex
=
0
;
for
(
u
int
i
=
0
;
i
<
lastSegment
;
++
i
)
{
for
(
int
i
=
0
;
i
<
lastSegment
;
++
i
)
{
p0
=
m_associationLine
->
point
(
i
);
p1
=
m_associationLine
->
point
(
i
+
1
);
QPointF
midP
=
midPoint
(
p0
,
p1
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment