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
67b11d9e
Commit
67b11d9e
authored
Aug 30, 2016
by
Oleg Korshul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
paste on viewer
parent
7b080386
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
73 additions
and
4 deletions
+73
-4
common/Drawings/Format/DrawingContent.js
common/Drawings/Format/DrawingContent.js
+66
-3
slide/api.js
slide/api.js
+3
-0
word/Drawing/DrawingDocument.js
word/Drawing/DrawingDocument.js
+1
-1
word/api.js
word/api.js
+3
-0
No files found.
common/Drawings/Format/DrawingContent.js
View file @
67b11d9e
...
...
@@ -33,7 +33,11 @@
(
function
(
window
,
undefined
){
/**
* CDrawingDocContent
* @constructor
* @extends {CDocumentContent}
*/
function
CDrawingDocContent
(
Parent
,
DrawingDocument
,
X
,
Y
,
XLimit
,
YLimit
)
{
CDrawingDocContent
.
superclass
.
constructor
.
call
(
this
,
Parent
,
DrawingDocument
,
X
,
Y
,
XLimit
,
YLimit
,
false
,
false
,
true
);
this
.
FullRecalc
=
new
CDocumentRecalculateState
();
...
...
@@ -558,12 +562,11 @@
CDrawingDocContent
.
prototype
.
private_GetElementPageIndexByXY
=
function
(
ElementPos
,
X
,
Y
,
PageIndex
){
if
(
this
.
Pages
.
length
>
0
){
if
(
this
.
Pages
[
0
].
Sections
.
length
>
0
){
return
CDocument
.
prototype
.
private_GetElementPageIndexByXY
.
call
(
this
,
ElementPos
,
X
,
Y
,
PageIndex
);
return
CDocument
_prototype_
private_GetElementPageIndexByXY
.
call
(
this
,
ElementPos
,
X
,
Y
,
PageIndex
);
}
}
return
CDocumentContent
.
prototype
.
private_GetElementPageIndexByXY
.
call
(
this
,
ElementPos
,
X
,
Y
,
PageIndex
);
};
CDrawingDocContent
.
prototype
.
Copy
=
function
(
Parent
,
DrawingDocument
)
{
var
DC
=
new
CDrawingDocContent
(
Parent
,
DrawingDocument
?
DrawingDocument
:
this
.
DrawingDocument
,
0
,
0
,
0
,
0
,
this
.
Split
,
this
.
TurnOffInnerWrap
,
this
.
bPresentation
);
...
...
@@ -594,5 +597,65 @@
return
DC
;
};
// TODO: сделать по-нормальному!!!
function
CDocument_prototype_private_GetElementPageIndexByXY
(
ElementPos
,
X
,
Y
,
PageIndex
)
{
var
Element
=
this
.
Content
[
ElementPos
];
if
(
!
Element
)
return
0
;
var
Page
=
this
.
Pages
[
PageIndex
];
if
(
!
Page
)
return
0
;
var
PageSection
=
null
;
for
(
var
SectionIndex
=
0
,
SectionsCount
=
Page
.
Sections
.
length
;
SectionIndex
<
SectionsCount
;
++
SectionIndex
)
{
if
(
Page
.
Sections
[
SectionIndex
].
Pos
<=
ElementPos
&&
ElementPos
<=
Page
.
Sections
[
SectionIndex
].
EndPos
)
{
PageSection
=
Page
.
Sections
[
SectionIndex
];
break
;
}
}
if
(
!
PageSection
)
return
0
;
var
ElementStartPage
=
Element
.
Get_StartPage_Relative
();
var
ElementStartColumn
=
Element
.
Get_StartColumn
();
var
ElementPagesCount
=
Element
.
Get_PagesCount
();
var
ColumnsCount
=
PageSection
.
Columns
.
length
;
var
StartColumn
=
0
;
var
EndColumn
=
ColumnsCount
-
1
;
if
(
PageIndex
===
ElementStartPage
)
{
StartColumn
=
Element
.
Get_StartColumn
();
EndColumn
=
Math
.
min
(
ElementStartColumn
+
ElementPagesCount
-
1
,
ColumnsCount
-
1
);
}
else
{
StartColumn
=
0
;
EndColumn
=
Math
.
min
(
ElementPagesCount
-
ElementStartColumn
+
(
PageIndex
-
ElementStartPage
)
*
ColumnsCount
,
ColumnsCount
-
1
);
}
// TODO: Разобраться с ситуацией, когда пустые колонки стоят не только в конце
while
(
true
===
PageSection
.
Columns
[
EndColumn
].
Empty
&&
EndColumn
>
StartColumn
)
EndColumn
--
;
var
ResultColumn
=
EndColumn
;
for
(
var
ColumnIndex
=
StartColumn
;
ColumnIndex
<
EndColumn
;
++
ColumnIndex
)
{
if
(
X
<
(
PageSection
.
Columns
[
ColumnIndex
].
XLimit
+
PageSection
.
Columns
[
ColumnIndex
+
1
].
X
)
/
2
)
{
ResultColumn
=
ColumnIndex
;
break
;
}
}
return
this
.
private_GetElementPageIndex
(
ElementPos
,
PageIndex
,
ResultColumn
,
ColumnsCount
);
}
AscFormat
.
CDrawingDocContent
=
CDrawingDocContent
;
})(
window
);
\ No newline at end of file
slide/api.js
View file @
67b11d9e
...
...
@@ -1919,6 +1919,9 @@ background-repeat: no-repeat;\
asc_docs_api
.
prototype
.
asc_PasteData
=
function
(
_format
,
data1
,
data2
)
{
if
(
this
.
getViewMode
())
return
;
this
.
WordControl
.
m_oLogicDocument
.
Create_NewHistoryPoint
(
AscDFH
.
historydescription_Document_PasteHotKey
);
switch
(
_format
)
{
...
...
word/Drawing/DrawingDocument.js
View file @
67b11d9e
...
...
@@ -1952,7 +1952,7 @@ function CDrawingDocument()
{
// Пути указаны относительно html в меню, не надо их исправлять
// и коммитить на пути относительно тестового меню
this
.
cursorMarkerFormat
=
"
url(../../../
sdk/C
ommon/Images/marker_format.cur), pointer
"
;
this
.
cursorMarkerFormat
=
"
url(../../../
../sdkjs/c
ommon/Images/marker_format.cur), pointer
"
;
}
else
if
(
window
.
opera
)
{
...
...
word/api.js
View file @
67b11d9e
...
...
@@ -1970,6 +1970,9 @@ background-repeat: no-repeat;\
asc_docs_api
.
prototype
.
asc_PasteData
=
function
(
_format
,
data1
,
data2
)
{
if
(
AscCommon
.
CollaborativeEditing
.
m_bGlobalLock
)
return
;
this
.
WordControl
.
m_oLogicDocument
.
Create_NewHistoryPoint
(
AscDFH
.
historydescription_Document_PasteHotKey
);
switch
(
_format
)
{
...
...
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