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
695f6e52
Commit
695f6e52
authored
Apr 06, 2016
by
Oleg Korshul
Committed by
Alexander.Trofimov
May 19, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
пункты в линейках
parent
445387fb
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
175 additions
and
25 deletions
+175
-25
common/commonDefines.js
common/commonDefines.js
+3
-2
slide/Drawing/HtmlPage.js
slide/Drawing/HtmlPage.js
+8
-8
slide/api.js
slide/api.js
+2
-0
word/Drawing/HtmlPage.js
word/Drawing/HtmlPage.js
+5
-5
word/Drawing/Rulers.js
word/Drawing/Rulers.js
+155
-10
word/api.js
word/api.js
+2
-0
No files found.
common/commonDefines.js
View file @
695f6e52
...
@@ -793,7 +793,8 @@ var contentchanges_Remove = 2;
...
@@ -793,7 +793,8 @@ var contentchanges_Remove = 2;
var
offlineMode
=
'
_offline_
'
;
var
offlineMode
=
'
_offline_
'
;
var
c_oAsc
Ruler
Units
=
{
var
c_oAsc
Document
Units
=
{
Millimeter
:
0
,
Millimeter
:
0
,
Inch
:
1
Inch
:
1
,
Point
:
2
};
};
\ No newline at end of file
slide/Drawing/HtmlPage.js
View file @
695f6e52
...
@@ -3193,26 +3193,26 @@ function CEditorPage(api)
...
@@ -3193,26 +3193,26 @@ function CEditorPage(api)
this
.
m_oApi
.
sync_currentPageCallback
(
drDoc
.
m_lCurrentPage
);
this
.
m_oApi
.
sync_currentPageCallback
(
drDoc
.
m_lCurrentPage
);
}
}
this
.
UpdateHorRulerBack
=
function
()
this
.
UpdateHorRulerBack
=
function
(
isattack
)
{
{
var
drDoc
=
this
.
m_oDrawingDocument
;
var
drDoc
=
this
.
m_oDrawingDocument
;
if
(
0
<=
drDoc
.
SlideCurrent
&&
drDoc
.
SlideCurrent
<
drDoc
.
SlidesCount
)
if
(
0
<=
drDoc
.
SlideCurrent
&&
drDoc
.
SlideCurrent
<
drDoc
.
SlidesCount
)
{
{
this
.
CreateBackgroundHorRuler
();
this
.
CreateBackgroundHorRuler
(
undefined
,
isattack
);
}
}
this
.
UpdateHorRuler
();
this
.
UpdateHorRuler
();
}
}
this
.
UpdateVerRulerBack
=
function
()
this
.
UpdateVerRulerBack
=
function
(
isattack
)
{
{
var
drDoc
=
this
.
m_oDrawingDocument
;
var
drDoc
=
this
.
m_oDrawingDocument
;
if
(
0
<=
drDoc
.
SlideCurrent
&&
drDoc
.
SlideCurrent
<
drDoc
.
SlidesCount
)
if
(
0
<=
drDoc
.
SlideCurrent
&&
drDoc
.
SlideCurrent
<
drDoc
.
SlidesCount
)
{
{
this
.
CreateBackgroundVerRuler
();
this
.
CreateBackgroundVerRuler
(
undefined
,
isattack
);
}
}
this
.
UpdateVerRuler
();
this
.
UpdateVerRuler
();
}
}
this
.
CreateBackgroundHorRuler
=
function
(
margins
)
this
.
CreateBackgroundHorRuler
=
function
(
margins
,
isattack
)
{
{
var
cachedPage
=
{};
var
cachedPage
=
{};
cachedPage
.
width_mm
=
this
.
m_oLogicDocument
.
Width
;
cachedPage
.
width_mm
=
this
.
m_oLogicDocument
.
Width
;
...
@@ -3233,9 +3233,9 @@ function CEditorPage(api)
...
@@ -3233,9 +3233,9 @@ function CEditorPage(api)
cachedPage
.
margin_bottom
=
this
.
m_oLogicDocument
.
Height
;
cachedPage
.
margin_bottom
=
this
.
m_oLogicDocument
.
Height
;
}
}
this
.
m_oHorRuler
.
CreateBackground
(
cachedPage
);
this
.
m_oHorRuler
.
CreateBackground
(
cachedPage
,
isattack
);
}
}
this
.
CreateBackgroundVerRuler
=
function
(
margins
)
this
.
CreateBackgroundVerRuler
=
function
(
margins
,
isattack
)
{
{
var
cachedPage
=
{};
var
cachedPage
=
{};
cachedPage
.
width_mm
=
this
.
m_oLogicDocument
.
Width
;
cachedPage
.
width_mm
=
this
.
m_oLogicDocument
.
Width
;
...
@@ -3256,7 +3256,7 @@ function CEditorPage(api)
...
@@ -3256,7 +3256,7 @@ function CEditorPage(api)
cachedPage
.
margin_bottom
=
this
.
m_oLogicDocument
.
Height
;
cachedPage
.
margin_bottom
=
this
.
m_oLogicDocument
.
Height
;
}
}
this
.
m_oVerRuler
.
CreateBackground
(
cachedPage
);
this
.
m_oVerRuler
.
CreateBackground
(
cachedPage
,
isattack
);
}
}
this
.
ThemeGenerateThumbnails
=
function
(
_master
)
this
.
ThemeGenerateThumbnails
=
function
(
_master
)
...
...
slide/api.js
View file @
695f6e52
...
@@ -3794,6 +3794,8 @@ asc_docs_api.prototype.asc_SetDocumentUnits = function(_units)
...
@@ -3794,6 +3794,8 @@ asc_docs_api.prototype.asc_SetDocumentUnits = function(_units)
{
{
this
.
WordControl
.
m_oHorRuler
.
Units
=
_units
;
this
.
WordControl
.
m_oHorRuler
.
Units
=
_units
;
this
.
WordControl
.
m_oVerRuler
.
Units
=
_units
;
this
.
WordControl
.
m_oVerRuler
.
Units
=
_units
;
this
.
WordControl
.
UpdateHorRulerBack
(
true
);
this
.
WordControl
.
UpdateVerRulerBack
(
true
);
}
}
};
};
...
...
word/Drawing/HtmlPage.js
View file @
695f6e52
"
use strict
"
;
"
use strict
"
;
var
g_dDpiX
=
96.0
;
var
g_dDpiX
=
96.0
;
var
g_dDpiY
=
96.0
;
var
g_dDpiY
=
96.0
;
...
@@ -3894,21 +3894,21 @@ function CEditorPage(api)
...
@@ -3894,21 +3894,21 @@ function CEditorPage(api)
this
.
m_oApi
.
sync_currentPageCallback
(
drDoc
.
m_lCurrentPage
);
this
.
m_oApi
.
sync_currentPageCallback
(
drDoc
.
m_lCurrentPage
);
}
}
this
.
UpdateHorRulerBack
=
function
()
this
.
UpdateHorRulerBack
=
function
(
isattack
)
{
{
var
drDoc
=
this
.
m_oDrawingDocument
;
var
drDoc
=
this
.
m_oDrawingDocument
;
if
(
0
<=
drDoc
.
m_lCurrentPage
&&
drDoc
.
m_lCurrentPage
<
drDoc
.
m_lPagesCount
)
if
(
0
<=
drDoc
.
m_lCurrentPage
&&
drDoc
.
m_lCurrentPage
<
drDoc
.
m_lPagesCount
)
{
{
this
.
m_oHorRuler
.
CreateBackground
(
drDoc
.
m_arrPages
[
drDoc
.
m_lCurrentPage
]);
this
.
m_oHorRuler
.
CreateBackground
(
drDoc
.
m_arrPages
[
drDoc
.
m_lCurrentPage
]
,
isattack
);
}
}
this
.
UpdateHorRuler
();
this
.
UpdateHorRuler
();
}
}
this
.
UpdateVerRulerBack
=
function
()
this
.
UpdateVerRulerBack
=
function
(
isattack
)
{
{
var
drDoc
=
this
.
m_oDrawingDocument
;
var
drDoc
=
this
.
m_oDrawingDocument
;
if
(
0
<=
drDoc
.
m_lCurrentPage
&&
drDoc
.
m_lCurrentPage
<
drDoc
.
m_lPagesCount
)
if
(
0
<=
drDoc
.
m_lCurrentPage
&&
drDoc
.
m_lCurrentPage
<
drDoc
.
m_lPagesCount
)
{
{
this
.
m_oVerRuler
.
CreateBackground
(
drDoc
.
m_arrPages
[
drDoc
.
m_lCurrentPage
]);
this
.
m_oVerRuler
.
CreateBackground
(
drDoc
.
m_arrPages
[
drDoc
.
m_lCurrentPage
]
,
isattack
);
}
}
this
.
UpdateVerRuler
();
this
.
UpdateVerRuler
();
}
}
...
...
word/Drawing/Rulers.js
View file @
695f6e52
...
@@ -185,7 +185,7 @@ function CHorRuler()
...
@@ -185,7 +185,7 @@ function CHorRuler()
this
.
SimpleChanges
=
new
RulerCheckSimpleChanges
();
this
.
SimpleChanges
=
new
RulerCheckSimpleChanges
();
this
.
Units
=
c_oAsc
RulerUnits
.
Inch
;
this
.
Units
=
c_oAsc
DocumentUnits
.
Millimeter
;
this
.
InitTablePict
=
function
()
this
.
InitTablePict
=
function
()
{
{
...
@@ -354,7 +354,7 @@ function CHorRuler()
...
@@ -354,7 +354,7 @@ function CHorRuler()
return
widthNew
;
return
widthNew
;
}
}
this
.
CreateBackground
=
function
(
cachedPage
)
this
.
CreateBackground
=
function
(
cachedPage
,
isattack
)
{
{
if
(
window
[
"
NATIVE_EDITOR_ENJINE
"
])
if
(
window
[
"
NATIVE_EDITOR_ENJINE
"
])
return
;
return
;
...
@@ -380,7 +380,7 @@ function CHorRuler()
...
@@ -380,7 +380,7 @@ function CHorRuler()
if
(
this
.
CurrentObjectType
==
RULER_OBJECT_TYPE_COLUMNS
)
if
(
this
.
CurrentObjectType
==
RULER_OBJECT_TYPE_COLUMNS
)
markup
=
this
.
m_oColumnMarkup
;
markup
=
this
.
m_oColumnMarkup
;
if
(
this
.
CurrentObjectType
==
checker
.
Type
&&
width
==
checker
.
Width
)
if
(
isattack
!==
true
&&
this
.
CurrentObjectType
==
checker
.
Type
&&
width
==
checker
.
Width
)
{
{
if
(
this
.
CurrentObjectType
==
RULER_OBJECT_TYPE_PARAGRAPH
)
if
(
this
.
CurrentObjectType
==
RULER_OBJECT_TYPE_PARAGRAPH
)
{
{
...
@@ -586,7 +586,7 @@ function CHorRuler()
...
@@ -586,7 +586,7 @@ function CHorRuler()
context
.
font
=
"
7pt Arial
"
;
context
.
font
=
"
7pt Arial
"
;
if
(
this
.
Units
==
c_oAsc
Ruler
Units
.
Millimeter
)
if
(
this
.
Units
==
c_oAsc
Document
Units
.
Millimeter
)
{
{
var
lCount1
=
((
width
-
left_margin
)
/
mm_1_4
)
>>
0
;
var
lCount1
=
((
width
-
left_margin
)
/
mm_1_4
)
>>
0
;
var
lCount2
=
(
left_margin
/
mm_1_4
)
>>
0
;
var
lCount2
=
(
left_margin
/
mm_1_4
)
>>
0
;
...
@@ -681,7 +681,7 @@ function CHorRuler()
...
@@ -681,7 +681,7 @@ function CHorRuler()
}
}
}
}
}
}
else
if
(
this
.
Units
==
c_oAsc
Ruler
Units
.
Inch
)
else
if
(
this
.
Units
==
c_oAsc
Document
Units
.
Inch
)
{
{
var
lCount1
=
((
width
-
left_margin
)
/
inch_1_8
)
>>
0
;
var
lCount1
=
((
width
-
left_margin
)
/
inch_1_8
)
>>
0
;
var
lCount2
=
(
left_margin
/
inch_1_8
)
>>
0
;
var
lCount2
=
(
left_margin
/
inch_1_8
)
>>
0
;
...
@@ -760,6 +760,71 @@ function CHorRuler()
...
@@ -760,6 +760,71 @@ function CHorRuler()
}
}
}
}
}
}
else
if
(
this
.
Units
==
c_oAscDocumentUnits
.
Point
)
{
var
point_1_12
=
25.4
*
dKoef_mm_to_pix
/
12
;
var
lCount1
=
((
width
-
left_margin
)
/
point_1_12
)
>>
0
;
var
lCount2
=
(
left_margin
/
point_1_12
)
>>
0
;
var
index
=
0
;
var
num
=
0
;
for
(
var
i
=
1
;
i
<
lCount1
;
i
++
)
{
var
lXPos
=
((
left_margin
+
i
*
point_1_12
)
>>
0
)
+
0.5
;
index
++
;
if
(
index
==
12
)
index
=
0
;
if
(
0
==
index
||
6
==
index
)
{
num
++
;
// number
var
strNum
=
""
+
(
num
*
36
);
var
lWidthText
=
context
.
measureText
(
strNum
).
width
;
lXPos
-=
(
lWidthText
/
2.0
);
context
.
fillText
(
strNum
,
lXPos
,
this
.
m_nBottom
-
3
);
}
else
if
(
point_1_12
>
5
)
{
// 1/12
context
.
beginPath
();
context
.
moveTo
(
lXPos
,
middleVert
-
part1
);
context
.
lineTo
(
lXPos
,
middleVert
+
part1
);
context
.
stroke
();
}
}
index
=
0
;
num
=
0
;
for
(
var
i
=
1
;
i
<=
lCount2
;
i
++
)
{
var
lXPos
=
((
left_margin
-
i
*
point_1_12
)
>>
0
)
+
0.5
;
index
++
;
if
(
index
==
12
)
index
=
0
;
if
(
0
==
index
||
6
==
index
)
{
num
++
;
// number
var
strNum
=
""
+
(
num
*
36
);
var
lWidthText
=
context
.
measureText
(
strNum
).
width
;
lXPos
-=
(
lWidthText
/
2.0
);
context
.
fillText
(
strNum
,
lXPos
,
this
.
m_nBottom
-
3
);
}
else
if
(
point_1_12
>
5
)
{
// 1/12
context
.
beginPath
();
context
.
moveTo
(
lXPos
,
middleVert
-
part1
);
context
.
lineTo
(
lXPos
,
middleVert
+
part1
);
context
.
stroke
();
}
}
}
if
(
null
!=
markup
&&
this
.
CurrentObjectType
==
RULER_OBJECT_TYPE_TABLE
)
if
(
null
!=
markup
&&
this
.
CurrentObjectType
==
RULER_OBJECT_TYPE_TABLE
)
{
{
...
@@ -2566,7 +2631,7 @@ function CVerRuler()
...
@@ -2566,7 +2631,7 @@ function CVerRuler()
this
.
SimpleChanges
=
new
RulerCheckSimpleChanges
();
this
.
SimpleChanges
=
new
RulerCheckSimpleChanges
();
this
.
Units
=
c_oAsc
RulerUnits
.
Inch
;
this
.
Units
=
c_oAsc
DocumentUnits
.
Millimeter
;
this
.
CheckCanvas
=
function
()
this
.
CheckCanvas
=
function
()
{
{
...
@@ -2612,7 +2677,7 @@ function CVerRuler()
...
@@ -2612,7 +2677,7 @@ function CVerRuler()
return
heightNew
;
return
heightNew
;
}
}
this
.
CreateBackground
=
function
(
cachedPage
)
this
.
CreateBackground
=
function
(
cachedPage
,
isattack
)
{
{
if
(
window
[
"
NATIVE_EDITOR_ENJINE
"
])
if
(
window
[
"
NATIVE_EDITOR_ENJINE
"
])
return
;
return
;
...
@@ -2636,7 +2701,7 @@ function CVerRuler()
...
@@ -2636,7 +2701,7 @@ function CVerRuler()
var
checker
=
this
.
RepaintChecker
;
var
checker
=
this
.
RepaintChecker
;
var
markup
=
this
.
m_oTableMarkup
;
var
markup
=
this
.
m_oTableMarkup
;
if
(
this
.
CurrentObjectType
==
checker
.
Type
&&
height
==
checker
.
Height
)
if
(
isattack
!==
true
&&
this
.
CurrentObjectType
==
checker
.
Type
&&
height
==
checker
.
Height
)
{
{
if
(
this
.
CurrentObjectType
==
RULER_OBJECT_TYPE_PARAGRAPH
)
if
(
this
.
CurrentObjectType
==
RULER_OBJECT_TYPE_PARAGRAPH
)
{
{
...
@@ -2787,7 +2852,7 @@ function CVerRuler()
...
@@ -2787,7 +2852,7 @@ function CVerRuler()
context
.
font
=
"
7pt Arial
"
;
context
.
font
=
"
7pt Arial
"
;
if
(
this
.
Units
==
c_oAsc
Ruler
Units
.
Millimeter
)
if
(
this
.
Units
==
c_oAsc
Document
Units
.
Millimeter
)
{
{
var
lCount1
=
((
height
-
top_margin
)
/
mm_1_4
)
>>
0
;
var
lCount1
=
((
height
-
top_margin
)
/
mm_1_4
)
>>
0
;
var
lCount2
=
(
top_margin
/
mm_1_4
)
>>
0
;
var
lCount2
=
(
top_margin
/
mm_1_4
)
>>
0
;
...
@@ -2897,7 +2962,7 @@ function CVerRuler()
...
@@ -2897,7 +2962,7 @@ function CVerRuler()
}
}
}
}
}
}
else
if
(
this
.
Units
==
c_oAsc
Ruler
Units
.
Inch
)
else
if
(
this
.
Units
==
c_oAsc
Document
Units
.
Inch
)
{
{
var
lCount1
=
((
height
-
top_margin
)
/
inch_1_8
)
>>
0
;
var
lCount1
=
((
height
-
top_margin
)
/
inch_1_8
)
>>
0
;
var
lCount2
=
(
top_margin
/
inch_1_8
)
>>
0
;
var
lCount2
=
(
top_margin
/
inch_1_8
)
>>
0
;
...
@@ -2991,6 +3056,86 @@ function CVerRuler()
...
@@ -2991,6 +3056,86 @@ function CVerRuler()
}
}
}
}
}
}
else
if
(
this
.
Units
==
c_oAscDocumentUnits
.
Point
)
{
var
point_1_12
=
25.4
*
dKoef_mm_to_pix
/
12
;
var
lCount1
=
((
height
-
top_margin
)
/
point_1_12
)
>>
0
;
var
lCount2
=
(
top_margin
/
point_1_12
)
>>
0
;
var
index
=
0
;
var
num
=
0
;
for
(
var
i
=
1
;
i
<
lCount1
;
i
++
)
{
var
lYPos
=
((
top_margin
+
i
*
point_1_12
)
>>
0
)
+
0.5
;
index
++
;
if
(
index
==
12
)
index
=
0
;
if
(
0
==
index
||
6
==
index
)
{
num
++
;
// number
var
strNum
=
""
+
(
num
*
36
);
var
lWidthText
=
context
.
measureText
(
strNum
).
width
;
context
.
translate
(
middleHor
,
lYPos
);
context
.
rotate
(
-
Math
.
PI
/
2
);
context
.
fillText
(
strNum
,
-
lWidthText
/
2.0
,
4
);
if
(
!
this
.
IsRetina
)
context
.
setTransform
(
1
,
0
,
0
,
1
,
0
,
5
);
else
context
.
setTransform
(
2
,
0
,
0
,
2
,
0
,
10
);
}
else
if
(
point_1_12
>
5
)
{
// 1/8
context
.
beginPath
();
context
.
moveTo
(
middleHor
-
part1
,
lYPos
);
context
.
lineTo
(
middleHor
+
part1
,
lYPos
);
context
.
stroke
();
}
}
index
=
0
;
num
=
0
;
for
(
var
i
=
1
;
i
<=
lCount2
;
i
++
)
{
var
lYPos
=
((
top_margin
-
i
*
point_1_12
)
>>
0
)
+
0.5
;
index
++
;
if
(
index
==
12
)
index
=
0
;
if
(
0
==
index
||
6
==
index
)
{
num
++
;
// number
var
strNum
=
""
+
(
num
*
36
);
var
lWidthText
=
context
.
measureText
(
strNum
).
width
;
context
.
translate
(
middleHor
,
lYPos
);
context
.
rotate
(
-
Math
.
PI
/
2
);
context
.
fillText
(
strNum
,
-
lWidthText
/
2.0
,
4
);
if
(
!
this
.
IsRetina
)
context
.
setTransform
(
1
,
0
,
0
,
1
,
0
,
5
);
else
context
.
setTransform
(
2
,
0
,
0
,
2
,
0
,
10
);
}
else
if
(
point_1_12
>
5
)
{
// 1/8
context
.
beginPath
();
context
.
moveTo
(
middleHor
-
part1
,
lYPos
);
context
.
lineTo
(
middleHor
+
part1
,
lYPos
);
context
.
stroke
();
}
}
}
if
((
this
.
CurrentObjectType
==
RULER_OBJECT_TYPE_TABLE
)
&&
(
null
!=
markup
))
if
((
this
.
CurrentObjectType
==
RULER_OBJECT_TYPE_TABLE
)
&&
(
null
!=
markup
))
{
{
...
...
word/api.js
View file @
695f6e52
...
@@ -6333,6 +6333,8 @@ asc_docs_api.prototype.asc_SetDocumentUnits = function(_units)
...
@@ -6333,6 +6333,8 @@ asc_docs_api.prototype.asc_SetDocumentUnits = function(_units)
{
{
this
.
WordControl
.
m_oHorRuler
.
Units
=
_units
;
this
.
WordControl
.
m_oHorRuler
.
Units
=
_units
;
this
.
WordControl
.
m_oVerRuler
.
Units
=
_units
;
this
.
WordControl
.
m_oVerRuler
.
Units
=
_units
;
this
.
WordControl
.
UpdateHorRulerBack
(
true
);
this
.
WordControl
.
UpdateVerRulerBack
(
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