Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
KDiff3
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
5
Issues
5
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
KDE
KDiff3
Commits
64a06257
Commit
64a06257
authored
Sep 22, 2019
by
Michael Reeves
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Missed one.
parent
371e105d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
src/Utils.h
src/Utils.h
+4
-4
src/kdiff3.cpp
src/kdiff3.cpp
+1
-1
No files found.
src/Utils.h
View file @
64a06257
...
...
@@ -32,13 +32,13 @@ class Utils{
inline
static
bool
isEndOfLine
(
QChar
c
)
{
return
c
==
'\n'
||
c
==
'\r'
||
c
==
'\x0b'
;
}
//Where posiable use QTextLayout in place of these functions especially when dealing with non-latin scripts.
inline
static
int
getHorizontalAdvance
(
const
QFontMetrics
&
metrics
,
const
QString
&
s
)
inline
static
int
getHorizontalAdvance
(
const
QFontMetrics
&
metrics
,
const
QString
&
s
,
int
len
=
-
1
)
{
//Warning: The Qt API used here is not accurate for some non-latin characters.
#if QT_VERSION < QT_VERSION_CHECK(5,12,0)
return
metrics
.
width
(
s
);
return
metrics
.
width
(
s
,
len
);
#else
return
metrics
.
horizontalAdvance
(
s
);
return
metrics
.
horizontalAdvance
(
s
,
len
);
#endif
}
...
...
@@ -46,7 +46,7 @@ class Utils{
{
//Warning: The Qt API used here is not accurate for some non-latin characters.
#if QT_VERSION < QT_VERSION_CHECK(5,12,0)
return
metrics
.
width
(
s
);
return
metrics
.
width
(
c
);
#else
return
metrics
.
horizontalAdvance
(
c
);
#endif
...
...
src/kdiff3.cpp
View file @
64a06257
...
...
@@ -800,7 +800,7 @@ void printDiffTextWindow(RLPainter& painter, const QRect& view, const QString& h
QString
s
=
headerText
.
mid
(
p
);
int
i
;
for
(
i
=
2
;
i
<
s
.
length
();
++
i
)
if
(
fm
.
width
(
s
,
i
)
>
view
.
width
())
if
(
Utils
::
getHorizontalAdvance
(
fm
,
s
,
i
)
>
view
.
width
())
{
--
i
;
break
;
...
...
Write
Preview
Markdown
is supported
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