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
c5e30759
Commit
c5e30759
authored
Aug 18, 2017
by
GoshaZotov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix error: add text from Symbol Table plugin into shape
parent
2b427a1d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
11 deletions
+43
-11
cell/model/clipboard.js
cell/model/clipboard.js
+39
-9
common/wordcopypaste.js
common/wordcopypaste.js
+4
-2
No files found.
cell/model/clipboard.js
View file @
c5e30759
...
...
@@ -387,6 +387,10 @@
var
t
=
this
;
t
.
pasteProcessor
.
clean
();
if
(
!
window
[
'
AscCommon
'
].
g_clipboardBase
.
specialPasteStart
)
{
ws
.
model
.
workbook
.
handlers
.
trigger
(
"
hideSpecialPasteOptions
"
);
}
window
[
'
AscCommon
'
].
g_clipboardBase
.
Paste_Process_Start
();
if
(
!
bIsSpecialPaste
)
...
...
@@ -1407,6 +1411,11 @@
History
.
EndTransaction
();
//for special paste
this
.
_setShapeSpecialPasteProperties
(
worksheet
,
isIntoShape
);
},
_setShapeSpecialPasteProperties
:
function
(
worksheet
,
isIntoShape
)
{
//TODO пока выключаю специальную ставку внутри math, позже доработать и включить
var
oInfo
=
new
CSelectedElementsInfo
();
var
selectedElementsInfo
=
isIntoShape
.
GetSelectedElementsInfo
(
oInfo
);
...
...
@@ -1415,30 +1424,30 @@
{
var
sProps
=
Asc
.
c_oSpecialPasteProps
;
var
curShape
=
isIntoShape
.
Parent
.
parent
;
var
asc_getcvt
=
Asc
.
getCvtRatio
;
var
mmToPx
=
asc_getcvt
(
3
/*px*/
,
0
/*pt*/
,
worksheet
.
_getPPIX
());
var
ptToPx
=
asc_getcvt
(
1
/*px*/
,
0
/*pt*/
,
worksheet
.
_getPPIX
());
var
cellsLeft
=
worksheet
.
cellsLeft
*
ptToPx
;
var
cellsTop
=
worksheet
.
cellsTop
*
ptToPx
;
var
cursorPos
=
target_doc_content
.
GetCursorPosXY
();
var
cursorPos
=
isIntoShape
.
GetCursorPosXY
();
var
offsetX
=
worksheet
.
cols
[
worksheet
.
visibleRange
.
c1
].
left
*
ptToPx
-
cellsLeft
;
var
offsetY
=
worksheet
.
rows
[
worksheet
.
visibleRange
.
r1
].
top
*
ptToPx
-
cellsTop
;
var
posX
=
curShape
.
transformText
.
TransformPointX
(
cursorPos
.
X
,
cursorPos
.
Y
)
*
mmToPx
-
offsetX
+
cellsLeft
;
var
posY
=
curShape
.
transformText
.
TransformPointY
(
cursorPos
.
X
,
cursorPos
.
Y
)
*
mmToPx
-
offsetY
+
cellsTop
;
var
position
=
{
x
:
posX
,
y
:
posY
};
var
allowedSpecialPasteProps
=
[
sProps
.
sourceformatting
,
sProps
.
destinationFormatting
];
window
[
'
AscCommon
'
].
g_clipboardBase
.
specialPasteButtonProps
=
{};
window
[
'
AscCommon
'
].
g_clipboardBase
.
specialPasteButtonProps
.
props
=
{
props
:
allowedSpecialPasteProps
,
position
:
position
};
window
[
'
AscCommon
'
].
g_clipboardBase
.
specialPasteButtonProps
.
range
=
cursorPos
;
window
[
'
AscCommon
'
].
g_clipboardBase
.
specialPasteButtonProps
.
shapeId
=
isIntoShape
.
Id
;
}
},
_convertBeforeInsertIntoShapeContent
:
function
(
worksheet
,
content
,
isConvertToPPTX
,
target_doc_content
)
{
var
elements
=
[],
selectedElement
,
element
;
...
...
@@ -1906,9 +1915,13 @@
var
callback
=
function
(
isSuccess
)
{
if
(
isSuccess
)
{
t
.
_pasteInShape
(
worksheet
,
node
,
isIntoShape
);
window
[
'
AscCommon
'
].
g_clipboardBase
.
Paste_Process_End
();
}
else
{
window
[
'
AscCommon
'
].
g_clipboardBase
.
Paste_Process_End
();
}
};
worksheet
.
objectRender
.
controller
.
checkSelectedObjectsAndCallback2
(
callback
);
...
...
@@ -2368,6 +2381,7 @@
_pasteInShape
:
function
(
worksheet
,
node
,
targetDocContent
)
{
var
t
=
this
;
targetDocContent
.
DrawingDocument
.
m_oLogicDocument
=
null
;
var
oPasteProcessor
=
new
AscCommon
.
PasteProcessor
({
WordControl
:{
m_oLogicDocument
:
targetDocContent
},
FontLoader
:
{}},
false
,
false
,
true
,
true
);
...
...
@@ -2394,6 +2408,7 @@
if
(
!
oPasteProcessor
.
aContent
||
!
oPasteProcessor
.
aContent
.
length
)
{
History
.
EndTransaction
();
window
[
'
AscCommon
'
].
g_clipboardBase
.
Paste_Process_End
();
return
false
;
}
...
...
@@ -2401,12 +2416,26 @@
targetContent
.
Remove
(
1
,
true
,
true
);
worksheet
.
_loadFonts
(
newFonts
,
function
()
{
//TODO конвертирую в текст без форматирую. пеесмотреть!
var
specialPasteProps
=
window
[
'
AscCommon
'
].
g_clipboardBase
.
specialPasteProps
;
if
(
specialPasteProps
&&
!
specialPasteProps
.
format
)
{
for
(
var
i
=
0
;
i
<
oPasteProcessor
.
aContent
.
length
;
i
++
)
{
oPasteProcessor
.
aContent
[
i
].
Clear_TextFormatting
();
}
}
oPasteProcessor
.
InsertInPlace
(
targetContent
,
oPasteProcessor
.
aContent
);
var
oTargetTextObject
=
AscFormat
.
getTargetTextObject
(
worksheet
.
objectRender
.
controller
);
oTargetTextObject
&&
oTargetTextObject
.
checkExtentsByDocContent
&&
oTargetTextObject
.
checkExtentsByDocContent
();
worksheet
.
objectRender
.
controller
.
startRecalculate
();
worksheet
.
objectRender
.
controller
.
cursorMoveRight
(
false
,
false
);
History
.
EndTransaction
();
t
.
_setShapeSpecialPasteProperties
(
worksheet
,
targetContent
);
window
[
'
AscCommon
'
].
g_clipboardBase
.
Paste_Process_End
();
});
return
true
;
...
...
@@ -2634,6 +2663,7 @@
isIntoShape
.
AddToParagraph
(
new
ParaText
(
_char
));
}
window
[
'
AscCommon
'
].
g_clipboardBase
.
specialPasteButtonProps
=
{};
window
[
'
AscCommon
'
].
g_clipboardBase
.
Paste_Process_End
();
//for special paste
...
...
common/wordcopypaste.js
View file @
c5e30759
...
...
@@ -2124,8 +2124,10 @@ PasteProcessor.prototype =
if
(
oSelectedContent
.
Elements
.
length
===
1
)
{
var
curDocSelection
=
this
.
curDocSelection
;
window
[
'
AscCommon
'
].
g_clipboardBase
.
showButtonIdParagraph
=
this
.
oDocument
.
Content
[
curDocSelection
[
1
].
CurPos
.
ContentPos
].
Id
;
if
(
curDocSelection
)
{
window
[
'
AscCommon
'
].
g_clipboardBase
.
showButtonIdParagraph
=
this
.
oDocument
.
Content
[
curDocSelection
[
1
].
CurPos
.
ContentPos
].
Id
;
}
}
else
{
...
...
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