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
23b35366
Commit
23b35366
authored
Nov 21, 2016
by
GoshaZotov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug 32949
parent
fdace1b6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
56 deletions
+42
-56
cell/api.js
cell/api.js
+2
-2
cell/model/clipboard.js
cell/model/clipboard.js
+37
-51
cell/view/WorkbookView.js
cell/view/WorkbookView.js
+2
-2
common/clipboard_base.js
common/clipboard_base.js
+1
-1
No files found.
cell/api.js
View file @
23b35366
...
@@ -485,9 +485,9 @@ var editor;
...
@@ -485,9 +485,9 @@ var editor;
return
AscCommon
.
g_clipboardBase
.
Button_Cut
();
return
AscCommon
.
g_clipboardBase
.
Button_Cut
();
};
};
spreadsheet_api
.
prototype
.
asc_PasteData
=
function
(
_format
,
data1
,
data2
)
{
spreadsheet_api
.
prototype
.
asc_PasteData
=
function
(
_format
,
data1
,
data2
,
text_data
)
{
if
(
!
this
.
getViewMode
())
{
if
(
!
this
.
getViewMode
())
{
this
.
wb
.
pasteData
(
_format
,
data1
,
data2
);
this
.
wb
.
pasteData
(
_format
,
data1
,
data2
,
text_data
);
}
}
};
};
...
...
cell/model/clipboard.js
View file @
23b35366
...
@@ -142,7 +142,7 @@
...
@@ -142,7 +142,7 @@
}
}
},
},
pasteData
:
function
(
ws
,
_format
,
data1
,
data2
)
pasteData
:
function
(
ws
,
_format
,
data1
,
data2
,
text_data
)
{
{
var
t
=
this
;
var
t
=
this
;
t
.
pasteProcessor
.
clean
();
t
.
pasteProcessor
.
clean
();
...
@@ -161,7 +161,14 @@
...
@@ -161,7 +161,14 @@
}
}
else
else
{
{
t
.
pasteProcessor
.
editorPasteExec
(
ws
,
data1
);
if
(
text_data
)
{
t
.
pasteProcessor
.
pasteTextOnSheet
(
ws
,
text_data
);
}
else
{
t
.
pasteProcessor
.
editorPasteExec
(
ws
,
data1
);
}
}
}
break
;
break
;
...
@@ -2237,10 +2244,7 @@
...
@@ -2237,10 +2244,7 @@
return
;
return
;
}
}
//var aResult = this._getTableFromText(text);
var
aResult
=
this
.
_getTableFromText
(
worksheet
,
text
);
var
aResult
=
new
excelPasteContent
();
aResult
=
aResult
.
getDefaultPasteContent
(
worksheet
,
this
.
activeRange
.
r1
,
this
.
activeRange
.
c1
,
text
);
if
(
aResult
&&
!
(
aResult
.
onlyImages
&&
window
[
"
Asc
"
][
"
editor
"
]
&&
window
[
"
Asc
"
][
"
editor
"
].
isChartEditor
))
if
(
aResult
&&
!
(
aResult
.
onlyImages
&&
window
[
"
Asc
"
][
"
editor
"
]
&&
window
[
"
Asc
"
][
"
editor
"
].
isChartEditor
))
{
{
worksheet
.
setSelectionInfo
(
'
paste
'
,
aResult
,
this
);
worksheet
.
setSelectionInfo
(
'
paste
'
,
aResult
,
this
);
...
@@ -2447,15 +2451,23 @@
...
@@ -2447,15 +2451,23 @@
return
res
;
return
res
;
},
},
_getTableFromText
:
function
(
sText
)
_getTableFromText
:
function
(
worksheet
,
sText
)
{
{
var
activeRange
=
worksheet
.
model
.
selectionRange
.
getLast
().
clone
(
true
);
var
t
=
this
;
var
t
=
this
;
var
addTextIntoCell
=
function
(
row
,
col
,
text
)
{
var
cell
=
aResult
.
getCell
(
rowCounter
,
colCounter
);
cell
.
content
[
0
]
=
{
text
:
text
,
format
:
{}};
return
cell
;
};
var
aResult
=
new
excelPasteContent
();
var
aResult
=
new
excelPasteContent
();
var
width
=
0
;
var
width
=
0
;
var
colCounter
=
0
;
var
colCounter
=
activeRange
.
c1
;
var
rowCounter
=
0
;
var
rowCounter
=
activeRange
.
r1
;
var
sCurPar
=
""
;
var
sCurChar
=
""
;
var
sCurChar
=
""
;
for
(
var
i
=
0
,
length
=
sText
.
length
;
i
<
length
;
i
++
)
for
(
var
i
=
0
,
length
=
sText
.
length
;
i
<
length
;
i
++
)
{
{
...
@@ -2463,44 +2475,27 @@
...
@@ -2463,44 +2475,27 @@
var
Code
=
sText
.
charCodeAt
(
i
);
var
Code
=
sText
.
charCodeAt
(
i
);
var
Item
=
null
;
var
Item
=
null
;
if
(
colCounter
>
width
)
if
(
colCounter
-
activeRange
.
c1
>
width
)
{
{
width
=
colCounter
;
width
=
colCounter
-
activeRange
.
c1
;
}
}
if
(
'
\n
'
===
Char
)
if
(
'
\n
'
===
Char
)
{
{
if
(
""
==
sCurChar
)
if
(
""
==
sCurChar
)
{
{
var
cell
=
aResult
.
getCell
(
rowCounter
,
colCounter
);
addTextIntoCell
(
rowCounter
,
colCounter
,
sCurChar
);
cell
.
content
[
0
]
=
{
text
:
""
,
format
:
{}};
colCounter
=
activeRange
.
c1
;
colCounter
=
0
;
rowCounter
++
;
rowCounter
++
;
//sHtml += "<tr><td style='font-family:Calibri'> </td></tr>";
}
}
else
else
{
{
var
cell
=
aResult
.
getCell
(
rowCounter
,
colCounter
);
addTextIntoCell
(
rowCounter
,
colCounter
,
sCurChar
);
cell
.
content
[
0
]
=
{
text
:
sCurChar
,
format
:
{}};
colCounter
=
activeRange
.
c1
;
colCounter
=
0
;
rowCounter
++
;
//sHtml += "<tr><td><span style='font-family:Calibri;font-size:11pt;white-space:nowrap'>" + sCurChar + "</span></td></tr>";
sCurChar
=
""
;
}
/*else if(sCurPar != '')
{
var cell = aResult.getCell(rowCounter, colCounter);
cell.content[0] = {text: sCurChar, format: {}};
colCounter = 0;
rowCounter
++
;
rowCounter
++
;
//sCurPar += "<td><span style='font-family:Calibri;font-size:11pt;white-space:nowrap'>" + sCurChar + "</span></td>";
//sHtml += "<tr>" + sCurPar + "</tr>";
sCurChar
=
""
;
sCurChar
=
""
;
sCurPar = "";
}
}*/
}
}
else
if
(
13
===
Code
)
else
if
(
13
===
Code
)
{
{
...
@@ -2514,29 +2509,20 @@
...
@@ -2514,29 +2509,20 @@
}
}
else
if
(
9
===
Code
)
//tab
else
if
(
9
===
Code
)
//tab
{
{
var
cell
=
aResult
.
getCell
(
rowCounter
,
colCounte
r
);
addTextIntoCell
(
rowCounter
,
colCounter
,
sCurCha
r
);
cell
.
content
[
0
]
=
{
text
:
sCurChar
,
format
:
{}};
colCounter
++
;
colCounter
++
;
/*sCurPar += "<td><span style='font-family:Calibri;font-size:11pt;white-space:nowrap'>" + sCurChar + "</span></td>";
sCurChar
=
""
;
if(i == length - 1)
{
sHtml += "<tr>" + sCurPar + "</tr>";
}*/
sCurChar
=
''
;
}
}
else
else
{
{
sCurChar
+=
t
.
_copyPasteCorrectString
(
Char
);
sCurChar
+=
t
.
_copyPasteCorrectString
(
Char
);
if
(
i
==
length
-
1
)
{
var
cell
=
aResult
.
getCell
(
rowCounter
,
colCounter
);
cell
.
content
[
0
]
=
{
text
:
sCurChar
,
format
:
{}};
//sCurPar += "<td><span style='font-family:Calibri;font-size:11pt;white-space:nowrap'>" + sCurChar + "</span></td>";
//sHtml += "<tr>" + sCurPar + "</tr>";
}
}
}
if
(
i
==
length
-
1
)
{
addTextIntoCell
(
rowCounter
,
colCounter
,
sCurChar
);
}
}
}
}
}
...
...
cell/view/WorkbookView.js
View file @
23b35366
...
@@ -2025,10 +2025,10 @@
...
@@ -2025,10 +2025,10 @@
t
.
clipboard
.
checkCopyToClipboard
(
ws
,
_clipboard
,
_formats
);
t
.
clipboard
.
checkCopyToClipboard
(
ws
,
_clipboard
,
_formats
);
};
};
WorkbookView
.
prototype
.
pasteData
=
function
(
_format
,
data1
,
data2
)
{
WorkbookView
.
prototype
.
pasteData
=
function
(
_format
,
data1
,
data2
,
text_data
)
{
var
t
=
this
,
ws
;
var
t
=
this
,
ws
;
ws
=
t
.
getWorksheet
();
ws
=
t
.
getWorksheet
();
t
.
clipboard
.
pasteData
(
ws
,
_format
,
data1
,
data2
);
t
.
clipboard
.
pasteData
(
ws
,
_format
,
data1
,
data2
,
text_data
);
};
};
WorkbookView
.
prototype
.
selectionCut
=
function
()
{
WorkbookView
.
prototype
.
selectionCut
=
function
()
{
...
...
common/clipboard_base.js
View file @
23b35366
...
@@ -273,7 +273,7 @@
...
@@ -273,7 +273,7 @@
}
}
sHtml
+=
"
</body></html>
"
;
sHtml
+=
"
</body></html>
"
;
this
.
CommonIframe_PasteStart
(
sHtml
,
text_data
);
this
.
CommonIframe_PasteStart
(
sHtml
,
_text_format
);
return
false
;
return
false
;
}
}
...
...
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