Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
KDiff3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
6
Issues
6
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SDK
KDiff3
Commits
69c205c1
Commit
69c205c1
authored
May 03, 2014
by
Joachim Eibl
Committed by
Michael Reeves
Jan 18, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed crash on resize with word wrap.
Signed-off-by:
joachim99
<
joachim.eibl@gmx.de
>
parent
58dac647
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
7 deletions
+13
-7
src/difftextwindow.cpp
src/difftextwindow.cpp
+11
-5
src/kdiff3.cpp
src/kdiff3.cpp
+2
-2
No files found.
src/difftextwindow.cpp
View file @
69c205c1
...
...
@@ -673,7 +673,7 @@ void DiffTextWindow::convertToLinePos( int x, int y, int& line, int& pos )
int
yOffset
=
-
d
->
m_firstLine
*
fontHeight
;
line
=
(
y
-
yOffset
)
/
fontHeight
;
if
(
line
>=
0
)
if
(
line
>=
0
&&
(
!
d
->
m_pOptions
->
m_bWordWrap
||
line
<
d
->
m_diff3WrapLineVector
.
count
())
)
{
QString
s
=
d
->
getLineString
(
line
);
QTextLayout
textLayout
(
s
,
font
(),
this
);
...
...
@@ -1226,8 +1226,13 @@ QString DiffTextWindowData::getLineString( int line )
{
if
(
m_bWordWrap
)
{
int
d3LIdx
=
m_pDiffTextWindow
->
convertLineToDiff3LineIdx
(
line
);
return
getString
(
d3LIdx
).
mid
(
m_diff3WrapLineVector
[
line
].
wrapLineOffset
,
m_diff3WrapLineVector
[
line
].
wrapLineLength
);
if
(
line
<
m_diff3WrapLineVector
.
count
()
)
{
int
d3LIdx
=
m_pDiffTextWindow
->
convertLineToDiff3LineIdx
(
line
);
return
getString
(
d3LIdx
).
mid
(
m_diff3WrapLineVector
[
line
].
wrapLineOffset
,
m_diff3WrapLineVector
[
line
].
wrapLineLength
);
}
else
return
QString
();
}
else
{
...
...
@@ -1632,13 +1637,13 @@ void DiffTextWindow::recalcWordWrapHelper( bool bWordWrap, int wrapLineVectorSiz
wrapLineCache
.
push_back
(
DiffTextWindowData
::
WrapLineCacheData
(
i
,
line
.
textStart
(),
line
.
textLength
())
);
}
}
else
if
(
wrapLineVectorSize
>
0
)
else
if
(
wrapLineVectorSize
>
0
&&
cacheListIdx2
<
d
->
m_wrapLineCacheList
.
count
()
)
{
DiffTextWindowData
::
WrapLineCacheData
*
pWrapLineCache
=
d
->
m_wrapLineCacheList
[
cacheListIdx2
].
data
();
int
cacheIdx
=
0
;
int
clc
=
d
->
m_wrapLineCacheList
.
count
()
-
1
;
int
cllc
=
d
->
m_wrapLineCacheList
.
last
().
count
()
;
int
curCount
=
d
->
m_wrapLineCacheList
[
0
].
count
()
-
1
;
int
curCount
=
d
->
m_wrapLineCacheList
[
cacheListIdx2
].
count
()
-
1
;
int
l
=
0
;
while
(
(
cacheListIdx2
<
clc
||
cacheListIdx2
==
clc
&&
cacheIdx
<
cllc
)
...
...
@@ -1672,6 +1677,7 @@ void DiffTextWindow::recalcWordWrapHelper( bool bWordWrap, int wrapLineVectorSiz
Diff3Line
&
d3l
=
*
(
*
d
->
m_pDiff3LineVector
)[
i
];
if
(
d3l
.
linesNeededForDisplay
<
linesNeeded
)
{
assert
(
wrapLineVectorSize
==
0
);
d3l
.
linesNeededForDisplay
=
linesNeeded
;
}
...
...
src/kdiff3.cpp
View file @
69c205c1
...
...
@@ -181,8 +181,8 @@ KDiff3App::KDiff3App( QWidget* pParent, const char* /*name*/, KDiff3Part* pKDiff
pDialog
->
exec
();
#if !defined(_WIN32) && !defined(Q_OS_OS2)
// A windows program has no console
f
printf
(
"%s
\n
"
,
title
.
toLatin1
().
constData
()
);
f
printf
(
"%s
\n
"
,
s
.
toLatin1
().
constData
()
);
printf
(
"%s
\n
"
,
title
.
toLatin1
().
constData
()
);
printf
(
"%s
\n
"
,
s
.
toLatin1
().
constData
()
);
#endif
exit
(
1
);
}
...
...
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