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
232cd952
Commit
232cd952
authored
Jun 29, 2016
by
alexey.musinov
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of
https://github.com/ONLYOFFICE/sdkjs
into develop
parents
14324502
f2b176e7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
79 additions
and
15 deletions
+79
-15
cell/model/clipboard.js
cell/model/clipboard.js
+53
-2
common/wordcopypaste.js
common/wordcopypaste.js
+26
-13
No files found.
cell/model/clipboard.js
View file @
232cd952
...
@@ -158,7 +158,7 @@
...
@@ -158,7 +158,7 @@
}
}
else
else
{
{
t
.
pasteProcessor
.
editorPasteExec
(
ws
,
data1
,
true
);
t
.
pasteProcessor
.
pasteTextOnSheet
(
ws
,
data1
);
}
}
break
;
break
;
...
@@ -1038,7 +1038,7 @@
...
@@ -1038,7 +1038,7 @@
},
true
);
},
true
);
},
},
editorPasteExec
:
function
(
worksheet
,
node
,
isText
,
onlyFromLocalStorage
)
editorPasteExec
:
function
(
worksheet
,
node
,
isText
,
onlyFromLocalStorage
)
{
{
if
(
node
==
undefined
)
if
(
node
==
undefined
)
return
;
return
;
...
@@ -1726,6 +1726,57 @@
...
@@ -1726,6 +1726,57 @@
style
=
'
style = "text-decoration:
'
+
underline
+
"
;
"
+
"
font-style:
"
+
italic
+
"
;
"
+
"
font-weight:
"
+
bold
+
"
;
"
+
'
"
'
;
style
=
'
style = "text-decoration:
'
+
underline
+
"
;
"
+
"
font-style:
"
+
italic
+
"
;
"
+
"
font-weight:
"
+
bold
+
"
;
"
+
'
"
'
;
$
(
oldElem
).
replaceWith
(
"
<span
"
+
style
+
"
>
"
+
value
+
"
</span>
"
);
$
(
oldElem
).
replaceWith
(
"
<span
"
+
style
+
"
>
"
+
value
+
"
</span>
"
);
};
};
},
pasteTextOnSheet
:
function
(
worksheet
,
text
)
{
//TODO сделать вставку текста всегда через эту функцию
this
.
activeRange
=
worksheet
.
activeRange
.
clone
(
true
);
//если находимся внутри шейпа
var
isIntoShape
=
worksheet
.
objectRender
.
controller
.
getTargetDocContent
();
if
(
isIntoShape
)
{
var
callback
=
function
(
isSuccess
)
{
if
(
isSuccess
===
false
)
{
return
false
;
}
var
Count
=
text
.
length
;
for
(
var
Index
=
0
;
Index
<
Count
;
Index
++
)
{
var
_char
=
text
.
charAt
(
Index
);
if
(
"
"
==
_char
)
isIntoShape
.
Paragraph_Add
(
new
ParaSpace
());
else
isIntoShape
.
Paragraph_Add
(
new
ParaText
(
_char
));
}
};
worksheet
.
objectRender
.
controller
.
checkSelectedObjectsAndCallback2
(
callback
);
return
;
}
var
aResult
=
[];
aResult
[
this
.
activeRange
.
r1
]
=
[];
var
oNewItem
=
[];
oNewItem
[
0
]
=
this
.
_getDefaultCell
(
worksheet
);
aResult
[
this
.
activeRange
.
r1
][
this
.
activeRange
.
c1
]
=
oNewItem
;
oNewItem
[
0
][
0
].
text
=
text
;
aResult
.
fontsNew
=
[];
aResult
.
rowSpanSpCount
=
0
;
aResult
.
cellCount
=
1
;
aResult
.
_images
=
undefined
;
aResult
.
_aPastedImages
=
undefined
;
if
(
aResult
&&
!
(
aResult
.
onlyImages
&&
window
[
"
Asc
"
][
"
editor
"
]
&&
window
[
"
Asc
"
][
"
editor
"
].
isChartEditor
))
{
worksheet
.
setSelectionInfo
(
'
paste
'
,
aResult
,
this
);
}
}
}
};
};
...
...
common/wordcopypaste.js
View file @
232cd952
...
@@ -1298,18 +1298,18 @@ CopyProcessor.prototype =
...
@@ -1298,18 +1298,18 @@ CopyProcessor.prototype =
//TODO заглушка для презентационных параграфов(выделен текст внутри диаграммы) - пока не пишем в бинарник
//TODO заглушка для презентационных параграфов(выделен текст внутри диаграммы) - пока не пишем в бинарник
if
(
selectedContent
.
Elements
[
0
].
Element
&&
selectedContent
.
Elements
[
0
].
Element
.
bFromDocument
===
false
)
if
(
selectedContent
.
Elements
[
0
].
Element
&&
selectedContent
.
Elements
[
0
].
Element
.
bFromDocument
===
false
)
bFromPresentation
=
true
;
{
this
.
oBinaryFileWriter
.
Document
=
this
.
oDocument
;
//подменяем Document для копирования(если не подменить, то commentId будет не соответствовать)
}
this
.
oBinaryFileWriter
.
Document
=
elementsContent
[
0
].
Element
.
LogicDocument
;
else
{
if
(
!
bFromPresentation
)
//подменяем Document для копирования(если не подменить, то commentId будет не соответствовать)
this
.
oBinaryFileWriter
.
CopyStart
();
this
.
oBinaryFileWriter
.
Document
=
elementsContent
[
0
].
Element
.
LogicDocument
;
}
this
.
oBinaryFileWriter
.
CopyStart
();
this
.
CopyDocument2
(
this
.
oRoot
,
oDocument
,
elementsContent
,
bFromPresentation
);
this
.
CopyDocument2
(
this
.
oRoot
,
oDocument
,
elementsContent
,
bFromPresentation
);
this
.
oBinaryFileWriter
.
CopyEnd
();
if
(
!
bFromPresentation
)
this
.
oBinaryFileWriter
.
CopyEnd
();
}
}
else
else
{
{
...
@@ -2129,7 +2129,7 @@ PasteProcessor.prototype =
...
@@ -2129,7 +2129,7 @@ PasteProcessor.prototype =
ReadFromBinary
:
function
(
sBase64
)
ReadFromBinary
:
function
(
sBase64
)
{
{
var
openParams
=
{
checkFileSize
:
false
,
charCount
:
0
,
parCount
:
0
};
var
openParams
=
{
checkFileSize
:
false
,
charCount
:
0
,
parCount
:
0
};
var
oBinaryFileReader
=
new
AscCommonWord
.
BinaryFileReader
(
this
.
oDocument
,
openParams
);
var
oBinaryFileReader
=
new
AscCommonWord
.
BinaryFileReader
(
this
.
o
Logic
Document
,
openParams
);
var
oRes
=
oBinaryFileReader
.
ReadFromString
(
sBase64
,
true
);
var
oRes
=
oBinaryFileReader
.
ReadFromString
(
sBase64
,
true
);
this
.
bInBlock
=
oRes
.
bInBlock
;
this
.
bInBlock
=
oRes
.
bInBlock
;
return
oRes
;
return
oRes
;
...
@@ -2226,15 +2226,28 @@ PasteProcessor.prototype =
...
@@ -2226,15 +2226,28 @@ PasteProcessor.prototype =
}
}
else
if
(
this
.
oDocument
.
bPresentation
)
else
if
(
this
.
oDocument
.
bPresentation
)
{
{
base64
=
null
;
base64FromExcel
=
null
;
this
.
pasteInPresentationShape
=
true
;
this
.
pasteInPresentationShape
=
true
;
}
}
var
isImageInNode
=
node
&&
node
.
getElementsByTagName
(
'
img
'
)
&&
node
.
getElementsByTagName
(
'
img
'
).
length
?
true
:
false
;
var
isImageInNode
=
node
&&
node
.
getElementsByTagName
(
'
img
'
)
&&
node
.
getElementsByTagName
(
'
img
'
).
length
?
true
:
false
;
if
(
base64
!=
null
)
if
(
base64
!=
null
)
aContent
=
this
.
ReadFromBinary
(
base64
);
aContent
=
this
.
ReadFromBinary
(
base64
);
//вставляем в заголовок диаграммы, предварительно конвертируем все параграфы в презентационный формат
if
(
aContent
&&
aContent
.
content
&&
this
.
oDocument
.
bPresentation
&&
oThis
.
oDocument
&&
oThis
.
oDocument
.
Parent
&&
oThis
.
oDocument
.
Parent
.
parent
&&
oThis
.
oDocument
.
Parent
.
parent
.
parent
&&
oThis
.
oDocument
.
Parent
.
parent
.
parent
.
getObjectType
&&
oThis
.
oDocument
.
Parent
.
parent
.
parent
.
getObjectType
()
==
AscDFH
.
historyitem_type_Chart
)
{
var
newContent
=
[];
for
(
var
i
=
0
;
i
<
aContent
.
content
.
length
;
i
++
)
{
if
(
type_Paragraph
===
aContent
.
content
[
i
].
Get_Type
())
{
newContent
.
push
(
AscFormat
.
ConvertParagraphToPPTX
(
aContent
.
content
[
i
],
this
.
oDocument
.
DrawingDocument
,
this
.
oDocument
));
}
}
aContent
.
content
=
newContent
;
}
if
(
base64
!=
null
&&
aContent
)
if
(
base64
!=
null
&&
aContent
)
pasteFromBinary
=
true
;
pasteFromBinary
=
true
;
else
if
(
aContentExcel
!=
null
&&
aContent
&&
aContent
.
content
)
else
if
(
aContentExcel
!=
null
&&
aContent
&&
aContent
.
content
)
...
...
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