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
fc550e96
Commit
fc550e96
authored
Apr 27, 2017
by
GoshaZotov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use CClipboardBase for excel
parent
7a695ee6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
68 deletions
+48
-68
cell/model/History.js
cell/model/History.js
+2
-2
cell/model/clipboard.js
cell/model/clipboard.js
+20
-56
cell/view/WorksheetView.js
cell/view/WorksheetView.js
+9
-9
common/clipboard_base.js
common/clipboard_base.js
+17
-1
No files found.
cell/model/History.js
View file @
fc550e96
...
@@ -484,7 +484,7 @@ CHistory.prototype.UndoRedoEnd = function (Point, oRedoObjectParam, bUndo) {
...
@@ -484,7 +484,7 @@ CHistory.prototype.UndoRedoEnd = function (Point, oRedoObjectParam, bUndo) {
if
(
oRedoObjectParam
.
bIsOn
)
if
(
oRedoObjectParam
.
bIsOn
)
this
.
TurnOn
();
this
.
TurnOn
();
if
(
!
AscCommonExcel
.
g_clipboardExcel
.
pasteStart
)
if
(
!
window
[
'
AscCommon
'
].
g_clipboardBase
.
pasteStart
)
{
{
this
.
workbook
.
handlers
.
trigger
(
"
hideSpecialPasteOptions
"
);
this
.
workbook
.
handlers
.
trigger
(
"
hideSpecialPasteOptions
"
);
}
}
...
@@ -741,7 +741,7 @@ CHistory.prototype._sendCanUndoRedo = function()
...
@@ -741,7 +741,7 @@ CHistory.prototype._sendCanUndoRedo = function()
this
.
workbook
.
handlers
.
trigger
(
"
setDocumentModified
"
,
this
.
Have_Changes
());
this
.
workbook
.
handlers
.
trigger
(
"
setDocumentModified
"
,
this
.
Have_Changes
());
//скрываю кнопку специальной вставки при каждом действии/undoredo
//скрываю кнопку специальной вставки при каждом действии/undoredo
//при выполнении специальной вставки и при сохранении(-1 !== this.Index) не скрываю кнопку
//при выполнении специальной вставки и при сохранении(-1 !== this.Index) не скрываю кнопку
if
(
!
AscCommonExcel
.
g_clipboardExcel
.
pasteStart
&&
-
1
!==
this
.
Index
&&
!
(
this
.
workbook
.
bUndoChanges
||
this
.
workbook
.
bRedoChanges
))
if
(
!
window
[
'
AscCommon
'
].
g_clipboardBase
.
pasteStart
&&
-
1
!==
this
.
Index
&&
!
(
this
.
workbook
.
bUndoChanges
||
this
.
workbook
.
bRedoChanges
))
{
{
this
.
workbook
.
handlers
.
trigger
(
"
hideSpecialPasteOptions
"
);
this
.
workbook
.
handlers
.
trigger
(
"
hideSpecialPasteOptions
"
);
}
}
...
...
cell/model/clipboard.js
View file @
fc550e96
...
@@ -281,13 +281,7 @@
...
@@ -281,13 +281,7 @@
{
{
this
.
copyProcessor
=
new
CopyProcessorExcel
();
this
.
copyProcessor
=
new
CopyProcessorExcel
();
this
.
pasteProcessor
=
new
PasteProcessorExcel
();
this
.
pasteProcessor
=
new
PasteProcessorExcel
();
this
.
bIsEndTransaction
=
false
;
//если нужно сделать на end_paste endTransaction
//TODO возможно стоит перенести в clipboard_base
this
.
pasteStart
=
false
;
//если true - осуществляется вставка. false выставляется только по полному окончанию вставки(загрузки картинок и тд)
this
.
specialPasteStart
=
false
;
return
this
;
return
this
;
}
}
...
@@ -382,8 +376,8 @@
...
@@ -382,8 +376,8 @@
{
{
var
t
=
this
;
var
t
=
this
;
t
.
pasteProcessor
.
clean
();
t
.
pasteProcessor
.
clean
();
this
.
start_paste
();
window
[
'
AscCommon
'
].
g_clipboardBase
.
Paste_Process_Start
();
if
(
!
bIsSpecialPaste
)
if
(
!
bIsSpecialPaste
)
{
{
...
@@ -401,7 +395,7 @@
...
@@ -401,7 +395,7 @@
if
(
text
)
if
(
text
)
{
{
window
[
"
Asc
"
][
"
editor
"
].
wb
.
cellEditor
.
pasteText
(
text
);
window
[
"
Asc
"
][
"
editor
"
].
wb
.
cellEditor
.
pasteText
(
text
);
this
.
end_paste
();
window
[
'
AscCommon
'
].
g_clipboardBase
.
Paste_Process_End
();
}
}
}
}
else
else
...
@@ -426,7 +420,7 @@
...
@@ -426,7 +420,7 @@
if
(
text
)
if
(
text
)
{
{
window
[
"
Asc
"
][
"
editor
"
].
wb
.
cellEditor
.
pasteText
(
text
);
window
[
"
Asc
"
][
"
editor
"
].
wb
.
cellEditor
.
pasteText
(
text
);
this
.
end_paste
();
window
[
'
AscCommon
'
].
g_clipboardBase
.
Paste_Process_End
();
}
}
}
}
else
else
...
@@ -443,7 +437,7 @@
...
@@ -443,7 +437,7 @@
if
(
data1
)
if
(
data1
)
{
{
window
[
"
Asc
"
][
"
editor
"
].
wb
.
cellEditor
.
pasteText
(
data1
);
window
[
"
Asc
"
][
"
editor
"
].
wb
.
cellEditor
.
pasteText
(
data1
);
this
.
end_paste
();
window
[
'
AscCommon
'
].
g_clipboardBase
.
Paste_Process_End
();
}
}
}
}
else
else
...
@@ -462,35 +456,6 @@
...
@@ -462,35 +456,6 @@
window
[
'
AscCommon
'
].
g_clipboardBase
.
specialPasteData
.
data2
=
data2
;
window
[
'
AscCommon
'
].
g_clipboardBase
.
specialPasteData
.
data2
=
data2
;
window
[
'
AscCommon
'
].
g_clipboardBase
.
specialPasteData
.
text_data
=
text_data
;
window
[
'
AscCommon
'
].
g_clipboardBase
.
specialPasteData
.
text_data
=
text_data
;
}
}
},
start_paste
:
function
()
{
this
.
pasteStart
=
true
;
},
end_paste
:
function
()
{
this
.
pasteStart
=
false
;
if
(
this
.
specialPasteStart
)
{
this
.
specialPasteStart
=
false
;
}
if
(
this
.
bIsEndTransaction
)
{
this
.
bIsEndTransaction
=
false
;
History
.
EndTransaction
();
}
window
[
'
AscCommon
'
].
g_clipboardBase
.
specialPasteProps
=
null
;
},
start_specialpaste
:
function
()
{
//TODO переделать на методы, которые в clipboardBase specialPasteStart/specialPasteEnd
this
.
specialPasteStart
=
true
;
}
}
};
};
...
@@ -1171,7 +1136,7 @@
...
@@ -1171,7 +1136,7 @@
{
{
t
.
_insertBinaryIntoShapeContent
(
worksheet
,
[
docContent
]);
t
.
_insertBinaryIntoShapeContent
(
worksheet
,
[
docContent
]);
}
}
AscCommonExcel
.
g_clipboardExcel
.
end_paste
();
window
[
'
AscCommon
'
].
g_clipboardBase
.
Paste_Process_End
();
};
};
worksheet
.
objectRender
.
controller
.
checkSelectedObjectsAndCallback2
(
callback
);
worksheet
.
objectRender
.
controller
.
checkSelectedObjectsAndCallback2
(
callback
);
...
@@ -1211,7 +1176,7 @@
...
@@ -1211,7 +1176,7 @@
{
{
t
.
_insertBinaryIntoShapeContent
(
worksheet
,
pasteData
.
content
,
true
);
t
.
_insertBinaryIntoShapeContent
(
worksheet
,
pasteData
.
content
,
true
);
}
}
AscCommonExcel
.
g_clipboardExcel
.
end_paste
();
window
[
'
AscCommon
'
].
g_clipboardBase
.
Paste_Process_End
();
};
};
worksheet
.
objectRender
.
controller
.
checkSelectedObjectsAndCallback2
(
callback
);
worksheet
.
objectRender
.
controller
.
checkSelectedObjectsAndCallback2
(
callback
);
...
@@ -1248,7 +1213,7 @@
...
@@ -1248,7 +1213,7 @@
if
(
isCellEditMode
)
if
(
isCellEditMode
)
{
{
var
text
=
this
.
_getTextFromWord
(
docContent
);
var
text
=
this
.
_getTextFromWord
(
docContent
);
AscCommonExcel
.
g_clipboardExcel
.
end_paste
();
window
[
'
AscCommon
'
].
g_clipboardBase
.
Paste_Process_End
();
return
text
;
return
text
;
}
}
else
if
(
isIntoShape
)
else
if
(
isIntoShape
)
...
@@ -1259,7 +1224,7 @@
...
@@ -1259,7 +1224,7 @@
{
{
t
.
_insertBinaryIntoShapeContent
(
worksheet
,
docContent
);
t
.
_insertBinaryIntoShapeContent
(
worksheet
,
docContent
);
}
}
AscCommonExcel
.
g_clipboardExcel
.
end_paste
();
window
[
'
AscCommon
'
].
g_clipboardBase
.
Paste_Process_End
();
};
};
worksheet
.
objectRender
.
controller
.
checkSelectedObjectsAndCallback2
(
callback
);
worksheet
.
objectRender
.
controller
.
checkSelectedObjectsAndCallback2
(
callback
);
...
@@ -1421,7 +1386,7 @@
...
@@ -1421,7 +1386,7 @@
var
oInfo
=
new
CSelectedElementsInfo
();
var
oInfo
=
new
CSelectedElementsInfo
();
var
selectedElementsInfo
=
isIntoShape
.
GetSelectedElementsInfo
(
oInfo
);
var
selectedElementsInfo
=
isIntoShape
.
GetSelectedElementsInfo
(
oInfo
);
var
mathObj
=
oInfo
.
Get_Math
();
var
mathObj
=
oInfo
.
Get_Math
();
if
(
!
AscCommonExcel
.
g_clipboardExcel
.
specialPasteStart
&&
null
===
mathObj
)
if
(
!
window
[
'
AscCommon
'
].
g_clipboardBase
.
specialPasteStart
&&
null
===
mathObj
)
{
{
var
sProps
=
Asc
.
c_oSpecialPasteProps
;
var
sProps
=
Asc
.
c_oSpecialPasteProps
;
var
curShape
=
isIntoShape
.
Parent
.
parent
;
var
curShape
=
isIntoShape
.
Parent
.
parent
;
...
@@ -1696,9 +1661,8 @@
...
@@ -1696,9 +1661,8 @@
ws
.
objectRender
.
controller
.
getGraphicObjectProps
();
ws
.
objectRender
.
controller
.
getGraphicObjectProps
();
});
});
}
}
AscCommonExcel
.
g_clipboardExcel
.
end_paste
();
window
[
'
AscCommon
'
].
g_clipboardBase
.
Paste_Process_End
();
},
},
_insertImagesFromBinaryWord
:
function
(
ws
,
data
,
aImagesSync
)
_insertImagesFromBinaryWord
:
function
(
ws
,
data
,
aImagesSync
)
...
@@ -1906,8 +1870,8 @@
...
@@ -1906,8 +1870,8 @@
{
{
if
(
isSuccess
)
if
(
isSuccess
)
t
.
_pasteInShape
(
worksheet
,
node
,
isIntoShape
);
t
.
_pasteInShape
(
worksheet
,
node
,
isIntoShape
);
AscCommonExcel
.
g_clipboardExcel
.
end_paste
();
window
[
'
AscCommon
'
].
g_clipboardBase
.
Paste_Process_End
();
};
};
worksheet
.
objectRender
.
controller
.
checkSelectedObjectsAndCallback2
(
callback
);
worksheet
.
objectRender
.
controller
.
checkSelectedObjectsAndCallback2
(
callback
);
...
@@ -1952,7 +1916,7 @@
...
@@ -1952,7 +1916,7 @@
//при специальной вставке в firefox _getComputedStyle возвращает null
//при специальной вставке в firefox _getComputedStyle возвращает null
//TODO пересмотреть функцию _getComputedStyle
//TODO пересмотреть функцию _getComputedStyle
if
(
AscCommonExcel
.
g_clipboardExcel
.
specialPasteStart
&&
window
[
'
AscCommon
'
].
g_clipboardBase
.
specialPasteData
.
aContent
)
if
(
window
[
'
AscCommon
'
].
g_clipboardBase
.
specialPasteStart
&&
window
[
'
AscCommon
'
].
g_clipboardBase
.
specialPasteData
.
aContent
)
{
{
oPasteProcessor
.
aContent
=
window
[
'
AscCommon
'
].
g_clipboardBase
.
specialPasteData
.
aContent
;
oPasteProcessor
.
aContent
=
window
[
'
AscCommon
'
].
g_clipboardBase
.
specialPasteData
.
aContent
;
}
}
...
@@ -2603,7 +2567,7 @@
...
@@ -2603,7 +2567,7 @@
{
{
if
(
!
text
||
(
text
&&
!
text
.
length
))
if
(
!
text
||
(
text
&&
!
text
.
length
))
{
{
AscCommonExcel
.
g_clipboardExcel
.
end_paste
();
window
[
'
AscCommon
'
].
g_clipboardBase
.
Paste_Process_End
();
return
;
return
;
}
}
...
@@ -2630,11 +2594,11 @@
...
@@ -2630,11 +2594,11 @@
else
else
isIntoShape
.
Paragraph_Add
(
new
ParaText
(
_char
));
isIntoShape
.
Paragraph_Add
(
new
ParaText
(
_char
));
}
}
AscCommonExcel
.
g_clipboardExcel
.
end_paste
();
window
[
'
AscCommon
'
].
g_clipboardBase
.
Paste_Process_End
();
//for special paste
//for special paste
if
(
!
AscCommonExcel
.
g_clipboardExcel
.
specialPasteStart
)
if
(
!
window
[
'
AscCommon
'
].
g_clipboardBase
.
specialPasteStart
)
{
{
var
sProps
=
Asc
.
c_oSpecialPasteProps
;
var
sProps
=
Asc
.
c_oSpecialPasteProps
;
var
allowedSpecialPasteProps
=
[
sProps
.
sourceformatting
,
sProps
.
destinationFormatting
];
var
allowedSpecialPasteProps
=
[
sProps
.
sourceformatting
,
sProps
.
destinationFormatting
];
...
...
cell/view/WorksheetView.js
View file @
fc550e96
...
@@ -8776,7 +8776,7 @@
...
@@ -8776,7 +8776,7 @@
//в случае, если вставляем из глобального буфера, транзакцию закрываем внутри функции _loadDataBeforePaste на callbacks от загрузки шрифтов и картинок
//в случае, если вставляем из глобального буфера, транзакцию закрываем внутри функции _loadDataBeforePaste на callbacks от загрузки шрифтов и картинок
if
(
prop
!==
"
paste
"
||
(
prop
===
"
paste
"
&&
fromBinary
))
{
if
(
prop
!==
"
paste
"
||
(
prop
===
"
paste
"
&&
fromBinary
))
{
History
.
EndTransaction
();
History
.
EndTransaction
();
AscCommonExcel
.
g_clipboardExcel
.
end_paste
();
window
[
'
AscCommon
'
].
g_clipboardBase
.
Paste_Process_End
();
}
}
};
};
...
@@ -8818,8 +8818,8 @@
...
@@ -8818,8 +8818,8 @@
return
false
;
return
false
;
}
}
AscCommonExcel
.
g_clipboardExcel
.
start_specialpaste
();
window
[
'
AscCommon
'
].
g_clipboardBase
.
Paste_Process_Start
();
AscCommonExcel
.
g_clipboardExcel
.
start_paste
();
window
[
'
AscCommon
'
].
g_clipboardBase
.
Special_Paste_Start
();
api
.
asc_Undo
();
api
.
asc_Undo
();
...
@@ -8830,7 +8830,7 @@
...
@@ -8830,7 +8830,7 @@
//далее специальная вставка
//далее специальная вставка
clipboard_base
.
specialPasteProps
=
props
;
clipboard_base
.
specialPasteProps
=
props
;
//TODO пока для закрытия транзации выставляю флаг. пересмотреть!
//TODO пока для закрытия транзации выставляю флаг. пересмотреть!
AscCommonExcel
.
g_clipboardExcel
.
bIsEndTransaction
=
true
;
window
[
'
AscCommon
'
].
g_clipboardBase
.
bIsEndTransaction
=
true
;
AscCommonExcel
.
g_clipboardExcel
.
pasteData
(
t
,
specialPasteData
.
_format
,
specialPasteData
.
data1
,
specialPasteData
.
data2
,
specialPasteData
.
text_data
,
true
);
AscCommonExcel
.
g_clipboardExcel
.
pasteData
(
t
,
specialPasteData
.
_format
,
specialPasteData
.
data1
,
specialPasteData
.
data2
,
specialPasteData
.
text_data
,
true
);
};
};
...
@@ -8850,7 +8850,7 @@
...
@@ -8850,7 +8850,7 @@
var
specialPasteProps
=
g_clipboardBase
.
specialPasteProps
;
var
specialPasteProps
=
g_clipboardBase
.
specialPasteProps
;
if
(
val
.
props
&&
val
.
props
.
onlyImages
===
true
)
{
if
(
val
.
props
&&
val
.
props
.
onlyImages
===
true
)
{
if
(
!
AscCommonExcel
.
g_clipboardExcel
.
specialPasteStart
)
if
(
!
window
[
'
AscCommon
'
].
g_clipboardBase
.
specialPasteStart
)
{
{
this
.
handlers
.
trigger
(
"
showSpecialPasteOptions
"
,
[
Asc
.
c_oSpecialPasteProps
.
picture
]);
this
.
handlers
.
trigger
(
"
showSpecialPasteOptions
"
,
[
Asc
.
c_oSpecialPasteProps
.
picture
]);
}
}
...
@@ -8984,7 +8984,7 @@
...
@@ -8984,7 +8984,7 @@
}
}
//for special paste
//for special paste
if
(
!
AscCommonExcel
.
g_clipboardExcel
.
specialPasteStart
)
if
(
!
window
[
'
AscCommon
'
].
g_clipboardBase
.
specialPasteStart
)
{
{
//var specialPasteShowOptions = new Asc.SpecialPasteShowOptions();
//var specialPasteShowOptions = new Asc.SpecialPasteShowOptions();
var
allowedSpecialPasteProps
;
var
allowedSpecialPasteProps
;
...
@@ -9088,7 +9088,7 @@
...
@@ -9088,7 +9088,7 @@
//закрываем транзакцию, поскольку в setSelectionInfo она не закроется
//закрываем транзакцию, поскольку в setSelectionInfo она не закроется
History
.
EndTransaction
();
History
.
EndTransaction
();
AscCommonExcel
.
g_clipboardExcel
.
end_paste
();
window
[
'
AscCommon
'
].
g_clipboardBase
.
Paste_Process_End
();
},
true
);
},
true
);
}
}
...
@@ -9104,7 +9104,7 @@
...
@@ -9104,7 +9104,7 @@
if
(
isEndTransaction
)
if
(
isEndTransaction
)
{
{
History
.
EndTransaction
();
History
.
EndTransaction
();
AscCommonExcel
.
g_clipboardExcel
.
end_paste
();
window
[
'
AscCommon
'
].
g_clipboardBase
.
Paste_Process_End
();
}
}
};
};
...
@@ -10043,7 +10043,7 @@
...
@@ -10043,7 +10043,7 @@
specialPasteShowOptions
.
asc_setOptions
(
props
);
specialPasteShowOptions
.
asc_setOptions
(
props
);
specialPasteShowOptions
.
asc_setCellCoord
(
cellCoord
);
specialPasteShowOptions
.
asc_setCellCoord
(
cellCoord
);
this
.
handlers
.
trigger
(
"
showSpecialPasteOptions
"
,
specialPasteShowOptions
);
this
.
handlers
.
trigger
(
"
showSpecialPasteOptions
"
,
specialPasteShowOptions
);
}
,
}
;
WorksheetView
.
prototype
.
updateSpecialPasteOptionsPosition
=
function
(
changeActiveRange
)
WorksheetView
.
prototype
.
updateSpecialPasteOptionsPosition
=
function
(
changeActiveRange
)
{
{
...
...
common/clipboard_base.js
View file @
fc550e96
...
@@ -105,6 +105,8 @@
...
@@ -105,6 +105,8 @@
this
.
specialPasteStart
=
false
;
//если true, то в данный момент выполняется специальная вставка
this
.
specialPasteStart
=
false
;
//если true, то в данный момент выполняется специальная вставка
this
.
pasteStart
=
false
;
//идет процесс вставки, выставится в false только после полного ее окончания(загрузка картинок и шрифтов)
this
.
pasteStart
=
false
;
//идет процесс вставки, выставится в false только после полного ее окончания(загрузка картинок и шрифтов)
this
.
bIsEndTransaction
=
false
;
//временный флаг для excel. TODO пересмотреть!
}
}
CClipboardBase
.
prototype
=
CClipboardBase
.
prototype
=
...
@@ -971,12 +973,26 @@
...
@@ -971,12 +973,26 @@
}
}
else
//если не было специальной вставки, необходимо показать кнопку специальной вставки
else
//если не было специальной вставки, необходимо показать кнопку специальной вставки
{
{
this
.
SpecialPasteButton_Show
();
this
.
specialPasteProps
=
null
;
//this.SpecialPasteButton_Show();
}
//TODO для excel заглушка. пересмотреть!
if
(
this
.
bIsEndTransaction
)
{
this
.
bIsEndTransaction
=
false
;
History
.
EndTransaction
();
}
}
},
},
SpecialPasteButton_Show
:
function
(
props
)
SpecialPasteButton_Show
:
function
(
props
)
{
{
//при быстром совместном редактировании отключаем возможность специальной вставки
if
(
AscCommon
.
CollaborativeEditing
&&
AscCommon
.
CollaborativeEditing
.
m_bFast
)
{
return
;
}
if
(
!
props
)
if
(
!
props
)
{
{
props
=
this
.
specialPasteButtonProps
.
props
;
props
=
this
.
specialPasteButtonProps
.
props
;
...
...
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