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
47115f37
Commit
47115f37
authored
Mar 28, 2016
by
Anna Pavlova
Committed by
Alexander.Trofimov
May 19, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Файлы с SVN : branch Math_ForcedBreak
parent
9ff89124
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
129 additions
and
177 deletions
+129
-177
word/Editor/Math.js
word/Editor/Math.js
+44
-111
word/Math/base.js
word/Math/base.js
+0
-1
word/Math/degree.js
word/Math/degree.js
+12
-8
word/Math/fraction.js
word/Math/fraction.js
+17
-5
word/Math/limit.js
word/Math/limit.js
+10
-6
word/Math/mathContent.js
word/Math/mathContent.js
+6
-21
word/Math/matrix.js
word/Math/matrix.js
+5
-8
word/Math/nary.js
word/Math/nary.js
+27
-16
word/Math/radical.js
word/Math/radical.js
+8
-1
No files found.
word/Editor/Math.js
View file @
47115f37
This diff is collapsed.
Click to expand it.
word/Math/base.js
View file @
47115f37
...
...
@@ -23,7 +23,6 @@ function CMathBase(bInside)
this
.
CtrPrp
=
new
CTextPr
();
this
.
CompiledCtrPrp
=
new
CTextPr
();
this
.
TextPrControlLetter
=
new
CTextPr
();
//this.CtrPr = new CCtrPr();
this
.
ArgSize
=
new
CMathArgSize
();
...
...
word/Math/degree.js
View file @
47115f37
...
...
@@ -85,12 +85,14 @@ CDegreeBase.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI, GapsI
var
ArgSzDegr
=
ArgSize
.
Copy
();
ArgSzDegr
.
Decrease
();
var
RPIDegr
=
RPI
.
Copy
();
RPIDegr
.
bDecreasedComp
=
true
;
this
.
bNaryInline
=
RPI
.
bNaryInline
;
this
.
iterContent
.
PreRecalc
(
this
,
ParaMath
,
ArgSzDegr
,
RPIDegr
);
var
bDecreasedComp
=
RPI
.
bDecreasedComp
;
RPI
.
bDecreasedComp
=
true
;
this
.
iterContent
.
PreRecalc
(
this
,
ParaMath
,
ArgSzDegr
,
RPI
);
RPI
.
bDecreasedComp
=
bDecreasedComp
;
};
CDegreeBase
.
prototype
.
Resize
=
function
(
oMeasure
,
RPI
)
{
...
...
@@ -536,11 +538,13 @@ CIterators.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI, GapsIn
this
.
Set_CompiledCtrPrp
(
Parent
,
ParaMath
,
RPI
);
var
RPI_ITER
=
RPI
.
Copy
();
RPI_ITER
.
bDecreasedComp
=
true
;
var
bDecreasedComp
=
RPI
.
bDecreasedComp
;
RPI
.
bDecreasedComp
=
true
;
this
.
iterUp
.
PreRecalc
(
this
,
ParaMath
,
ArgSzIters
,
RPI
);
this
.
iterDn
.
PreRecalc
(
this
,
ParaMath
,
ArgSzIters
,
RPI
);
this
.
iterUp
.
PreRecalc
(
this
,
ParaMath
,
ArgSzIters
,
RPI_ITER
);
this
.
iterDn
.
PreRecalc
(
this
,
ParaMath
,
ArgSzIters
,
RPI_ITER
);
RPI
.
bDecreasedComp
=
bDecreasedComp
;
};
CIterators
.
prototype
.
recalculateSize
=
function
(
oMeasure
,
dH
,
ascent
)
{
...
...
word/Math/fraction.js
View file @
47115f37
...
...
@@ -303,7 +303,12 @@ CFraction.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI, GapsInf
var
ArgSzNumDen
=
ArgSize
.
Copy
();
if
(
RPI
.
bInline
==
true
&&
(
this
.
Pr
.
type
===
BAR_FRACTION
||
this
.
Pr
.
type
==
NO_BAR_FRACTION
))
// уменьшае размер числителя и знаменателя
var
oMathSettings
=
Get_WordDocumentDefaultMathSettings
();
var
bInlineBarFaction
=
RPI
.
bInline
==
true
&&
(
this
.
Pr
.
type
===
BAR_FRACTION
||
this
.
Pr
.
type
==
NO_BAR_FRACTION
),
bReduceSize
=
(
RPI
.
bSmallFraction
||
RPI
.
bDecreasedComp
==
true
)
&&
true
==
oMathSettings
.
Get_SmallFrac
();
if
(
bInlineBarFaction
||
bReduceSize
)
// уменьшае размер числителя и знаменателя
{
ArgSzNumDen
.
Decrease
();
// для контентов числителя и знаменателя
this
.
ArgSize
.
SetValue
(
-
1
);
// для CtrPrp
...
...
@@ -322,17 +327,24 @@ CFraction.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI, GapsInf
this
.
ApplyProperties
(
RPI
);
var
NewRPI
=
RPI
.
Copy
();
var
bDecreasedComp
=
RPI
.
bDecreasedComp
,
bSmallFraction
=
RPI
.
bSmallFraction
;
if
(
this
.
Pr
.
type
!==
LINEAR_FRACTION
)
NewRPI
.
bDecreasedComp
=
true
;
RPI
.
bDecreasedComp
=
true
;
RPI
.
bSmallFraction
=
true
;
// setGaps обязательно после того как смержили CtrPrp (Set_CompiledCtrPrp)
if
(
this
.
bInside
==
false
)
GapsInfo
.
setGaps
(
this
,
this
.
TextPrControlLetter
.
FontSize
);
this
.
Numerator
.
PreRecalc
(
this
,
ParaMath
,
ArgSzNumDen
,
NewRPI
);
this
.
Denominator
.
PreRecalc
(
this
,
ParaMath
,
ArgSzNumDen
,
NewRPI
);
this
.
Numerator
.
PreRecalc
(
this
,
ParaMath
,
ArgSzNumDen
,
RPI
);
this
.
Denominator
.
PreRecalc
(
this
,
ParaMath
,
ArgSzNumDen
,
RPI
);
RPI
.
bDecreasedComp
=
bDecreasedComp
;
RPI
.
bSmallFraction
=
bSmallFraction
;
};
CFraction
.
prototype
.
recalculateSize
=
function
(
oMeasure
)
{
...
...
word/Math/limit.js
View file @
47115f37
...
...
@@ -87,10 +87,12 @@ CLimitPrimary.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI, Gap
var
ArgSzIter
=
ArgSize
.
Copy
();
ArgSzIter
.
Decrease
();
var
NewRPI
=
RPI
.
Copy
()
;
New
RPI
.
bDecreasedComp
=
true
;
var
bDecreasedComp
=
RPI
.
bDecreasedComp
;
RPI
.
bDecreasedComp
=
true
;
this
.
Iterator
.
PreRecalc
(
this
,
ParaMath
,
ArgSzIter
,
NewRPI
);
this
.
Iterator
.
PreRecalc
(
this
,
ParaMath
,
ArgSzIter
,
RPI
);
RPI
.
bDecreasedComp
=
bDecreasedComp
;
};
CLimitPrimary
.
prototype
.
Resize
=
function
(
oMeasure
,
RPI
)
{
...
...
@@ -343,10 +345,12 @@ CMathFunc.prototype.init = function(props)
};
CMathFunc
.
prototype
.
PreRecalc
=
function
(
Parent
,
ParaMath
,
ArgSize
,
RPI
,
GapsInfo
)
{
var
NewRPI
=
RPI
.
Copy
();
NewRPI
.
bMathFunc
=
true
;
var
bMathFunc
=
RPI
.
bMathFunc
;
RPI
.
bMathFunc
=
true
;
CMathFunc
.
superclass
.
PreRecalc
.
call
(
this
,
Parent
,
ParaMath
,
ArgSize
,
RPI
,
GapsInfo
);
CMathFunc
.
superclass
.
PreRecalc
.
call
(
this
,
Parent
,
ParaMath
,
ArgSize
,
NewRPI
,
GapsInfo
)
;
RPI
.
bMathFunc
=
bMathFunc
;
};
CMathFunc
.
prototype
.
GetLastElement
=
function
()
{
...
...
word/Math/mathContent.js
View file @
47115f37
...
...
@@ -10,22 +10,8 @@ function CRPI()
this
.
bMathFunc
=
false
;
this
.
bRecalcCtrPrp
=
false
;
// пересчет ctrPrp нужен, когда на Undo и тп изменился размер первого Run, а ctrPrp уже для мат объектов пересчитались
this
.
bCorrect_ConvertFontSize
=
false
;
this
.
bSmallFraction
=
false
;
}
CRPI
.
prototype
.
Copy
=
function
()
{
var
RPI
=
new
CRPI
();
RPI
.
bInline
=
this
.
bInline
;
RPI
.
bDecreasedComp
=
this
.
bDecreasedComp
;
RPI
.
bChangeInline
=
this
.
bChangeInline
;
RPI
.
bNaryInline
=
this
.
bNaryInline
;
RPI
.
bEqArray
=
this
.
bEqArray
;
RPI
.
bMathFunc
=
this
.
bMathFunc
;
RPI
.
bRecalcCtrPrp
=
this
.
bRecalcCtrPrp
;
RPI
.
bCorrect_ConvertFontSize
=
this
.
bCorrect_ConvertFontSize
;
return
RPI
;
};
CRPI
.
prototype
.
MergeMathInfo
=
function
(
MathInfo
)
{
this
.
bInline
=
MathInfo
.
bInline
||
(
MathInfo
.
bInternalRanges
==
true
&&
MathInfo
.
bStartRanges
==
false
);
...
...
@@ -1307,10 +1293,9 @@ CMathContent.prototype.Correct_Content = function(bInnerCorrection)
{
bEmptyContent
=
false
;
}
}
if
(
bEmptyContent
)
if
(
bEmptyContent
==
true
&&
this
.
bRoot
==
false
)
{
this
.
Content
[
0
].
fillPlaceholders
();
this
.
Content
[
0
].
Recalc_CompiledPr
(
true
);
...
...
@@ -1473,7 +1458,7 @@ CMathContent.prototype.GetMathTextPrForMenu = function(ContentPos, Depth)
return
this
.
Content
[
pos
].
GetMathTextPrForMenu
(
ContentPos
,
Depth
+
1
);
};
CMathContent
.
prototype
.
Apply_TextPr
=
function
(
TextPr
,
IncFontSize
,
ApplyToAll
,
PosForMenu
)
CMathContent
.
prototype
.
Apply_TextPr
=
function
(
TextPr
,
IncFontSize
,
ApplyToAll
,
StartPos
,
EndPos
)
{
if
(
true
===
ApplyToAll
)
{
...
...
@@ -1484,10 +1469,10 @@ CMathContent.prototype.Apply_TextPr = function(TextPr, IncFontSize, ApplyToAll,
{
var
StartPos
,
EndPos
,
bMenu
=
false
;
if
(
PosForMenu
!==
undefined
)
if
(
StartPos
!==
undefined
&&
EndPos
!==
undefined
)
{
StartPos
=
PosForMenu
.
StartPos
;
EndPos
=
PosForMenu
.
EndPos
;
StartPos
=
StartPos
;
EndPos
=
EndPos
;
bMenu
=
true
;
}
...
...
word/Math/matrix.js
View file @
47115f37
...
...
@@ -1323,17 +1323,15 @@ CEqArray.prototype.getColsCount = function()
};
CEqArray
.
prototype
.
Resize
=
function
(
oMeasure
,
RPI
)
{
// на случай, чтобы не затереть массив
//var CurrAmperWPoints = RPI.AmperWPoints,
// CurrEqArray = RPI.bEqArray;
var
NewRPI
=
RPI
.
Copy
();
NewRPI
.
bEqArray
=
true
;
var
bEqArray
=
RPI
.
bEqArray
;
RPI
.
bEqArray
=
true
;
for
(
var
i
=
0
;
i
<
this
.
nRow
;
i
++
)
this
.
elements
[
i
][
0
].
Resize
(
oMeasure
,
New
RPI
);
this
.
elements
[
i
][
0
].
Resize
(
oMeasure
,
RPI
);
this
.
recalculateSize
(
oMeasure
);
RPI
.
bEqArray
=
bEqArray
;
};
CEqArray
.
prototype
.
getMetrics
=
function
()
{
...
...
@@ -1343,7 +1341,6 @@ CEqArray.prototype.getMetrics = function()
// нумерация начинается с нуля, поэтому все четные точки идут с нечетными номерами в массиве
//var lngW = RPI.Widths.length; // this.nRow
var
EndWidths
=
0
;
var
even
,
// четная точка
...
...
word/Math/nary.js
View file @
47115f37
...
...
@@ -305,12 +305,14 @@ CNary.prototype.private_GetLimLoc = function()
};
CNary
.
prototype
.
PreRecalc
=
function
(
Parent
,
ParaMath
,
ArgSize
,
RPI
,
GapsInfo
)
{
var
NewRPI
=
RPI
.
Copy
()
;
var
bNaryInline
=
RPI
.
bNaryInline
;
if
(
RPI
.
bInline
||
RPI
.
bDecreasedComp
)
New
RPI
.
bNaryInline
=
true
;
RPI
.
bNaryInline
=
true
;
CNary
.
superclass
.
PreRecalc
.
call
(
this
,
Parent
,
ParaMath
,
ArgSize
,
NewRPI
,
GapsInfo
);
CNary
.
superclass
.
PreRecalc
.
call
(
this
,
Parent
,
ParaMath
,
ArgSize
,
RPI
,
GapsInfo
);
RPI
.
bNaryInline
=
bNaryInline
;
};
CNary
.
prototype
.
getSign
=
function
(
chrCode
,
chrType
)
{
...
...
@@ -871,11 +873,14 @@ CNaryUnd.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI)
var
ArgSzUnd
=
ArgSize
.
Copy
();
ArgSzUnd
.
Decrease
();
var
RPIUnd
=
RPI
.
Copy
();
RPIUnd
.
bDecreasedComp
=
true
;
this
.
elements
[
0
][
0
].
PreRecalc
(
this
,
ParaMath
,
ArgSzUnd
,
RPIUnd
);
this
.
elements
[
1
][
0
].
PreRecalc
(
this
,
ParaMath
,
ArgSize
,
RPI
);
var
bDecreasedComp
=
RPI
.
bDecreasedComp
;
RPI
.
bDecreasedComp
=
true
;
this
.
elements
[
0
][
0
].
PreRecalc
(
this
,
ParaMath
,
ArgSzUnd
,
RPI
);
RPI
.
bDecreasedComp
=
bDecreasedComp
;
};
CNaryUnd
.
prototype
.
setBase
=
function
(
base
)
{
...
...
@@ -909,11 +914,14 @@ CNaryOvr.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI)
var
ArgSzOvr
=
ArgSize
.
Copy
();
ArgSzOvr
.
Decrease
();
var
RPIOvr
=
RPI
.
Copy
();
RPIOvr
.
bDecreasedComp
=
true
;
this
.
elements
[
0
][
0
].
PreRecalc
(
this
,
ParaMath
,
ArgSize
,
RPI
);
this
.
elements
[
1
][
0
].
PreRecalc
(
this
,
ParaMath
,
ArgSzOvr
,
RPIOvr
);
var
bDecreasedComp
=
RPI
.
bDecreasedComp
;
RPI
.
bDecreasedComp
=
true
;
this
.
elements
[
1
][
0
].
PreRecalc
(
this
,
ParaMath
,
ArgSzOvr
,
RPI
);
RPI
.
bDecreasedComp
=
bDecreasedComp
;
};
CNaryOvr
.
prototype
.
recalculateSize
=
function
()
{
...
...
@@ -976,13 +984,16 @@ CNaryUndOvr.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI)
var
ArgSzIter
=
ArgSize
.
Copy
();
ArgSzIter
.
Decrease
();
var
RPI_Iter
=
RPI
.
Copy
();
RPI_Iter
.
bDecreasedComp
=
true
;
this
.
elements
[
1
][
0
].
PreRecalc
(
this
,
ParaMath
,
ArgSize
,
RPI
);
var
bDecreasedComp
=
RPI
.
bDecreasedComp
;
RPI
.
bDecreasedComp
=
true
;
this
.
elements
[
0
][
0
].
PreRecalc
(
this
,
ParaMath
,
ArgSzIter
,
RPI
);
this
.
elements
[
0
][
0
].
PreRecalc
(
this
,
ParaMath
,
ArgSzIter
,
RPI_Iter
);
this
.
elements
[
1
][
0
].
PreRecalc
(
this
,
ParaMath
,
ArgSize
,
RPI
);
this
.
elements
[
2
][
0
].
PreRecalc
(
this
,
ParaMath
,
ArgSzIter
,
RPI_Iter
)
;
this
.
elements
[
2
][
0
].
PreRecalc
(
this
,
ParaMath
,
ArgSzIter
,
RPI
);
RPI
.
bDecreasedComp
=
bDecreasedComp
;
};
CNaryUndOvr
.
prototype
.
recalculateSize
=
function
()
{
...
...
word/Math/radical.js
View file @
47115f37
...
...
@@ -418,9 +418,16 @@ CRadical.prototype.PreRecalc = function(Parent, ParaMath, ArgSize, RPI, GapsInfo
var
ArgSzIter
=
new
CMathArgSize
();
ArgSzIter
.
SetValue
(
-
2
);
this
.
Iterator
.
PreRecalc
(
this
,
ParaMath
,
ArgSzIter
,
RPI
);
this
.
RealBase
.
PreRecalc
(
this
,
ParaMath
,
ArgSize
,
RPI
);
var
bDecreasedComp
=
RPI
.
bDecreasedComp
;
RPI
.
bDecreasedComp
=
true
;
this
.
Iterator
.
PreRecalc
(
this
,
ParaMath
,
ArgSzIter
,
RPI
);
RPI
.
bDecreasedComp
=
bDecreasedComp
;
if
(
this
.
bInside
==
false
)
GapsInfo
.
setGaps
(
this
,
this
.
TextPrControlLetter
.
FontSize
);
};
...
...
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