Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sdkjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
sdkjs
Commits
d8118033
Commit
d8118033
authored
Oct 17, 2016
by
Alexander.Trofimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug 29021
parent
a06ffc6d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
36 deletions
+38
-36
cell/view/WorksheetView.js
cell/view/WorksheetView.js
+38
-36
No files found.
cell/view/WorksheetView.js
View file @
d8118033
...
...
@@ -4269,34 +4269,38 @@
* Обновляет общий кэш и кэширует метрики текста ячеек для указанного диапазона
* @param {Asc.Range} [range] Диапазон кэширования текта
*/
WorksheetView
.
prototype
.
_prepareCellTextMetricsCache
=
function
(
range
)
{
WorksheetView
.
prototype
.
_prepareCellTextMetricsCache
=
function
(
range
)
{
var
firstUpdateRow
=
null
;
if
(
!
range
)
{
if
(
!
range
)
{
range
=
this
.
visibleRange
;
if
(
this
.
topLeftFrozenCell
)
{
if
(
this
.
topLeftFrozenCell
)
{
var
row
=
this
.
topLeftFrozenCell
.
getRow0
();
var
col
=
this
.
topLeftFrozenCell
.
getCol0
();
if
(
0
<
row
&&
0
<
col
)
{
firstUpdateRow
=
asc
.
getMinValueOrNull
(
firstUpdateRow
,
this
.
_prepareCellTextMetricsCache2
(
new
Asc
.
Range
(
0
,
0
,
col
-
1
,
row
-
1
)
)
);
if
(
0
<
row
&&
0
<
col
)
{
firstUpdateRow
=
asc
.
getMinValueOrNull
(
firstUpdateRow
,
this
.
_prepareCellTextMetricsCache2
(
new
Asc
.
Range
(
0
,
0
,
col
-
1
,
row
-
1
)));
}
if
(
0
<
row
)
{
firstUpdateRow
=
asc
.
getMinValueOrNull
(
firstUpdateRow
,
this
.
_prepareCellTextMetricsCache2
(
new
Asc
.
Range
(
this
.
visibleRange
.
c1
,
0
,
this
.
visibleRange
.
c2
,
row
-
1
)
)
);
if
(
0
<
row
)
{
firstUpdateRow
=
asc
.
getMinValueOrNull
(
firstUpdateRow
,
this
.
_prepareCellTextMetricsCache2
(
new
Asc
.
Range
(
this
.
visibleRange
.
c1
,
0
,
this
.
visibleRange
.
c2
,
row
-
1
)));
}
if
(
0
<
col
)
{
firstUpdateRow
=
asc
.
getMinValueOrNull
(
firstUpdateRow
,
this
.
_prepareCellTextMetricsCache2
(
new
Asc
.
Range
(
0
,
this
.
visibleRange
.
r1
,
col
-
1
,
this
.
visibleRange
.
r2
)
)
);
if
(
0
<
col
)
{
firstUpdateRow
=
asc
.
getMinValueOrNull
(
firstUpdateRow
,
this
.
_prepareCellTextMetricsCache2
(
new
Asc
.
Range
(
0
,
this
.
visibleRange
.
r1
,
col
-
1
,
this
.
visibleRange
.
r2
)));
}
}
}
firstUpdateRow
=
asc
.
getMinValueOrNull
(
firstUpdateRow
,
this
.
_prepareCellTextMetricsCache2
(
range
)
);
if
(
null
!==
firstUpdateRow
||
this
.
isChanged
)
{
firstUpdateRow
=
asc
.
getMinValueOrNull
(
firstUpdateRow
,
this
.
_prepareCellTextMetricsCache2
(
range
)
);
if
(
null
!==
firstUpdateRow
||
this
.
isChanged
)
{
// Убрал это из _calcCellsTextMetrics, т.к. вызов был для каждого сектора(добавляло тормоза: баг 20388)
// Код нужен для бага http://bugzilla.onlyoffice.com/show_bug.cgi?id=13875
this
.
_updateRowPositions
();
this
.
_calcVisibleRows
();
if
(
this
.
objectRender
)
{
this
.
objectRender
.
updateSizeDrawingObjects
(
{
target
:
c_oTargetType
.
RowResize
,
row
:
firstUpdateRow
},
true
);
if
(
this
.
objectRender
)
{
this
.
objectRender
.
updateSizeDrawingObjects
({
target
:
c_oTargetType
.
RowResize
,
row
:
firstUpdateRow
},
true
);
}
}
};
...
...
@@ -4638,7 +4642,9 @@
this
.
_addErasedBordersToCache
(
col
-
cto
.
leftSide
,
col
+
cto
.
rightSide
,
row
);
}
this
.
_updateRowHeight
(
tm
,
col
,
row
,
fl
,
isMerged
,
fMergedRows
,
va
,
ha
,
angle
,
maxW
,
colWidth
,
textBound
);
fMergedRows
=
fMergedRows
||
(
isMerged
&&
fl
.
wrapText
);
this
.
_updateRowHeight
(
tm
,
col
,
row
,
fl
,
isMerged
,
fMergedRows
,
va
,
ha
,
angle
,
maxW
,
colWidth
,
textBound
);
return
mc
?
mc
.
c2
:
col
;
};
...
...
@@ -4654,34 +4660,30 @@
rowHeight
=
rowInfo
.
height
;
// update row's height
if
(
!
rowInfo
.
isCustomHeight
&&
!
(
window
[
"
NATIVE_EDITOR_ENJINE
"
]
&&
this
.
notUpdateRowHeight
))
{
// Замерженная ячейка (с 2-мя или более строками) не влияет на высоту строк!
if
(
!
fMergedRows
)
{
var
newHeight
=
tm
.
height
;
if
(
angle
&&
textBound
)
{
newHeight
=
Math
.
max
(
rowInfo
.
height
,
textBound
.
height
);
}
rowInfo
.
heightReal
=
rowInfo
.
height
=
Math
.
min
(
this
.
maxRowHeight
,
Math
.
max
(
rowInfo
.
height
,
newHeight
));
if
(
rowHeight
!==
rowInfo
.
height
)
{
this
.
model
.
setRowHeight
(
rowInfo
.
height
,
row
,
row
,
false
);
if
(
angle
)
{
// Замерженная ячейка (с 2-мя или более строками) не влияет на высоту строк!
if
(
!
rowInfo
.
isCustomHeight
&&
!
(
window
[
"
NATIVE_EDITOR_ENJINE
"
]
&&
this
.
notUpdateRowHeight
)
&&
!
fMergedRows
)
{
var
newHeight
=
tm
.
height
;
if
(
angle
&&
textBound
)
{
newHeight
=
Math
.
max
(
rowInfo
.
height
,
textBound
.
height
);
}
if
(
flags
.
wrapText
&&
!
rowInfo
.
isCustomHeight
)
{
maxW
=
tm
.
width
;
}
rowInfo
.
heightReal
=
rowInfo
.
height
=
Math
.
min
(
this
.
maxRowHeight
,
Math
.
max
(
rowInfo
.
height
,
newHeight
));
if
(
rowHeight
!==
rowInfo
.
height
)
{
this
.
model
.
setRowHeight
(
rowInfo
.
height
,
row
,
row
,
false
);
textBound
=
this
.
stringRender
.
getTransformBound
(
angle
,
colWidth
,
rowInfo
.
height
,
tm
.
width
,
ha
,
va
,
maxW
);
if
(
angle
)
{
this
.
_fetchCellCache
(
col
,
row
).
text
.
textBound
=
textBound
;
if
(
flags
.
wrapText
&&
!
rowInfo
.
isCustomHeight
)
{
maxW
=
tm
.
width
;
}
this
.
isChanged
=
true
;
textBound
=
this
.
stringRender
.
getTransformBound
(
angle
,
colWidth
,
rowInfo
.
height
,
tm
.
width
,
ha
,
va
,
maxW
);
this
.
_fetchCellCache
(
col
,
row
).
text
.
textBound
=
textBound
;
}
this
.
isChanged
=
true
;
}
}
};
...
...
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