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
2e9a959e
Commit
2e9a959e
authored
Jul 21, 2017
by
SergeyLuzyanin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix Bug 35018
parent
bab5349a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
176 additions
and
80 deletions
+176
-80
common/Drawings/CommonController.js
common/Drawings/CommonController.js
+4
-11
common/Drawings/States.js
common/Drawings/States.js
+155
-65
common/Drawings/TrackObjects/ResizeTracks.js
common/Drawings/TrackObjects/ResizeTracks.js
+1
-1
common/Private/Locks.js
common/Private/Locks.js
+14
-1
slide/Editor/DrawingObjectsController.js
slide/Editor/DrawingObjectsController.js
+2
-2
No files found.
common/Drawings/CommonController.js
View file @
2e9a959e
...
...
@@ -8191,24 +8191,17 @@ DrawingObjectsController.prototype =
}
},
checkSelectedObjectsAndCallback
:
function
(
callback
,
args
,
bNoSendProps
,
nHistoryPointType
,
bCheckConnector
s
)
checkSelectedObjectsAndCallback
:
function
(
callback
,
args
,
bNoSendProps
,
nHistoryPointType
,
aAdditionalObject
s
)
{
var
selection_state
=
this
.
getSelectionState
();
this
.
drawingObjects
.
objectLocker
.
reset
();
var
oMapId
=
{};
for
(
var
i
=
0
;
i
<
this
.
selectedObjects
.
length
;
++
i
)
{
this
.
drawingObjects
.
objectLocker
.
addObjectId
(
this
.
selectedObjects
[
i
].
Get_Id
());
oMapId
[
this
.
selectedObjects
[
i
].
Get_Id
()]
=
true
;
}
if
(
bCheckConnectors
){
var
_aDrawings
=
this
.
selection
.
groupSelection
?
this
.
selection
.
groupSelection
.
selectedObjects
:
this
.
selectedObjects
;
var
_aConnectors
=
[];
this
.
getAllConnectorsByDrawings
(
_aDrawings
,
_aConnectors
,
undefined
,
true
);
for
(
var
i
=
0
;
i
<
_aConnectors
.
length
;
++
i
){
if
(
!
oMapId
[
_aConnectors
[
i
].
Get_Id
()]){
this
.
drawingObjects
.
objectLocker
.
addObjectId
(
_aConnectors
[
i
].
Get_Id
());
}
if
(
aAdditionalObjects
){
for
(
var
i
=
0
;
i
<
aAdditionalObjects
.
length
;
++
i
){
this
.
drawingObjects
.
objectLocker
.
addObjectId
(
aAdditionalObjects
[
i
].
Get_Id
());
}
}
var
_this
=
this
;
...
...
common/Drawings/States.js
View file @
2e9a959e
...
...
@@ -652,77 +652,36 @@ RotateState.prototype =
}
else
{
this
.
drawingObjects
.
checkSelectedObjectsAndCallback
(
function
()
{
var
i
,
j
;
if
(
e
.
CtrlKey
&&
oThis
instanceof
MoveInGroupState
)
var
i
,
j
;
if
(
e
.
CtrlKey
&&
oThis
instanceof
MoveInGroupState
)
{
this
.
drawingObjects
.
checkSelectedObjectsAndCallback
(
function
(){
var
oIdMap
=
{};
var
aCopies
=
[];
group
.
resetSelection
();
for
(
i
=
0
;
i
<
tracks
.
length
;
++
i
)
{
if
(
tracks
[
i
].
originalObject
.
getObjectType
()
===
AscDFH
.
historyitem_type_GroupShape
){
var
oIdMap
=
{};
var
aCopies
=
[];
group
.
resetSelection
();
for
(
i
=
0
;
i
<
tracks
.
length
;
++
i
)
{
if
(
tracks
[
i
].
originalObject
.
getObjectType
()
===
AscDFH
.
historyitem_type_GroupShape
){
copy
=
tracks
[
i
].
originalObject
.
copy
(
oIdMap
);
}
else
{
copy
=
tracks
[
i
].
originalObject
.
copy
(
oIdMap
);
}
else
{
copy
=
tracks
[
i
].
originalObject
.
copy
();
}
aCopies
.
push
(
copy
);
oThis
.
drawingObjects
.
drawingObjects
.
getWorksheetModel
&&
copy
.
setWorksheet
(
oThis
.
drawingObjects
.
drawingObjects
.
getWorksheetModel
());
if
(
oThis
.
drawingObjects
.
drawingObjects
&&
oThis
.
drawingObjects
.
drawingObjects
.
cSld
)
{
copy
.
setParent2
(
oThis
.
drawingObjects
.
drawingObjects
);
}
copy
.
setGroup
(
tracks
[
i
].
originalObject
.
group
);
copy
.
group
.
addToSpTree
(
copy
.
group
.
length
,
copy
);
tracks
[
i
].
originalObject
=
copy
;
tracks
[
i
].
trackEnd
(
false
);
group
.
selectObject
(
copy
,
0
);
copy
=
tracks
[
i
].
originalObject
.
copy
();
}
AscFormat
.
fResetConnectorsIds
(
aCopies
,
oIdMap
);
}
else
{
var
oOriginalObjects
=
[];
var
oMapOriginalsId
=
{};
for
(
i
=
0
;
i
<
tracks
.
length
;
++
i
)
aCopies
.
push
(
copy
);
oThis
.
drawingObjects
.
drawingObjects
.
getWorksheetModel
&&
copy
.
setWorksheet
(
oThis
.
drawingObjects
.
drawingObjects
.
getWorksheetModel
());
if
(
oThis
.
drawingObjects
.
drawingObjects
&&
oThis
.
drawingObjects
.
drawingObjects
.
cSld
)
{
tracks
[
i
].
trackEnd
(
false
,
false
);
if
(
tracks
[
i
].
originalObject
&&
!
tracks
[
i
].
processor3D
){
oOriginalObjects
.
push
(
tracks
[
i
].
originalObject
);
oMapOriginalsId
[
tracks
[
i
].
originalObject
.
Get_Id
()]
=
true
;
if
(
Array
.
isArray
(
tracks
[
i
].
originalObject
.
arrGraphicObjects
)){
for
(
j
=
0
;
j
<
tracks
[
i
].
originalObject
.
arrGraphicObjects
.
length
;
++
j
){
oMapOriginalsId
[
tracks
[
i
].
originalObject
.
arrGraphicObjects
[
j
].
Get_Id
()]
=
true
;
}
}
}
}
var
aAllConnectors
=
drawingObjects
.
getAllConnectorsByDrawings
(
oOriginalObjects
,
[],
undefined
,
true
);
var
oGroupMaps
=
{};
for
(
i
=
0
;
i
<
aAllConnectors
.
length
;
++
i
){
var
stSp
=
AscCommon
.
g_oTableId
.
Get_ById
(
aAllConnectors
[
i
].
getStCxnId
());
var
endSp
=
AscCommon
.
g_oTableId
.
Get_ById
(
aAllConnectors
[
i
].
getEndCxnId
());
if
((
stSp
&&
!
oMapOriginalsId
[
stSp
.
Get_Id
()])
||
(
endSp
&&
!
oMapOriginalsId
[
endSp
.
Get_Id
()])
||
!
oMapOriginalsId
[
aAllConnectors
[
i
].
Get_Id
()]){
aAllConnectors
[
i
].
calculateTransform
(((
oThis
instanceof
MoveInGroupState
)
||
(
oThis
instanceof
MoveState
)));
var
oGroup
=
aAllConnectors
[
i
].
getMainGroup
();
if
(
oGroup
){
oGroupMaps
[
oGroup
.
Id
]
=
oGroup
;
}
}
}
for
(
var
key
in
oGroupMaps
){
if
(
oGroupMaps
.
hasOwnProperty
(
key
)){
oGroupMaps
[
key
].
updateCoordinatesAfterInternalResize
();
}
copy
.
setParent2
(
oThis
.
drawingObjects
.
drawingObjects
);
}
copy
.
setGroup
(
tracks
[
i
].
originalObject
.
group
);
copy
.
group
.
addToSpTree
(
copy
.
group
.
length
,
copy
);
tracks
[
i
].
originalObject
=
copy
;
tracks
[
i
].
trackEnd
(
false
);
group
.
selectObject
(
copy
,
0
);
}
AscFormat
.
fResetConnectorsIds
(
aCopies
,
oIdMap
);
if
(
group
)
{
group
.
updateCoordinatesAfterInternalResize
();
...
...
@@ -775,7 +734,138 @@ RotateState.prototype =
}
oThis
.
drawingObjects
.
drawingObjects
.
checkGraphicObjectPosition
(
0
,
0
,
Math
.
max
.
apply
(
Math
,
arr_x2
),
Math
.
max
.
apply
(
Math
,
arr_y2
));
}
},
[],
false
,
AscDFH
.
historydescription_CommonDrawings_EndTrack
);
},
[],
false
,
AscDFH
.
historydescription_CommonDrawings_EndTrack
)
}
else
{
var
oOriginalObjects
=
[];
var
oMapOriginalsId
=
{};
var
oMapAdditionalForCheck
=
{};
for
(
i
=
0
;
i
<
tracks
.
length
;
++
i
)
{
if
(
tracks
[
i
].
originalObject
&&
!
tracks
[
i
].
processor3D
){
oOriginalObjects
.
push
(
tracks
[
i
].
originalObject
);
oMapOriginalsId
[
tracks
[
i
].
originalObject
.
Get_Id
()]
=
true
;
var
oGroup
=
tracks
[
i
].
originalObject
.
getMainGroup
();
if
(
oGroup
){
if
(
!
oGroup
.
selected
){
oMapAdditionalForCheck
[
oGroup
.
Get_Id
()]
=
oGroup
;
}
}
else
{
if
(
!
tracks
[
i
].
originalObject
.
selected
){
oMapAdditionalForCheck
[
tracks
[
i
].
originalObject
.
Get_Id
()]
=
tracks
[
i
].
originalObject
;
}
}
if
(
Array
.
isArray
(
tracks
[
i
].
originalObject
.
arrGraphicObjects
)){
for
(
j
=
0
;
j
<
tracks
[
i
].
originalObject
.
arrGraphicObjects
.
length
;
++
j
){
oMapOriginalsId
[
tracks
[
i
].
originalObject
.
arrGraphicObjects
[
j
].
Get_Id
()]
=
true
;
}
}
}
}
var
aAllConnectors
=
drawingObjects
.
getAllConnectorsByDrawings
(
oOriginalObjects
,
[],
undefined
,
true
);
var
bFlag
=
((
oThis
instanceof
MoveInGroupState
)
||
(
oThis
instanceof
MoveState
));
var
aConnectors
=
[];
for
(
i
=
0
;
i
<
aAllConnectors
.
length
;
++
i
){
var
stSp
=
AscCommon
.
g_oTableId
.
Get_ById
(
aAllConnectors
[
i
].
getStCxnId
());
var
endSp
=
AscCommon
.
g_oTableId
.
Get_ById
(
aAllConnectors
[
i
].
getEndCxnId
());
if
((
stSp
&&
!
oMapOriginalsId
[
stSp
.
Get_Id
()])
||
(
endSp
&&
!
oMapOriginalsId
[
endSp
.
Get_Id
()])
||
!
oMapOriginalsId
[
aAllConnectors
[
i
].
Get_Id
()]){
var
oGroup
=
aAllConnectors
[
i
].
getMainGroup
();
aConnectors
.
push
(
aAllConnectors
[
i
]);
if
(
oGroup
){
oMapAdditionalForCheck
[
oGroup
.
Id
]
=
oGroup
;
}
else
{
oMapAdditionalForCheck
[
aAllConnectors
[
i
].
Get_Id
()]
=
aAllConnectors
[
i
];
}
}
}
var
aAdditionalForCheck
=
[];
for
(
i
in
oMapAdditionalForCheck
){
if
(
oMapAdditionalForCheck
.
hasOwnProperty
(
i
)){
if
(
!
oMapAdditionalForCheck
[
i
].
selected
){
aAdditionalForCheck
.
push
(
oMapAdditionalForCheck
[
i
]);
}
}
}
this
.
drawingObjects
.
checkSelectedObjectsAndCallback
(
function
()
{
for
(
i
=
0
;
i
<
tracks
.
length
;
++
i
){
tracks
[
i
].
trackEnd
(
false
,
false
);
}
var
oGroupMaps
=
{};
for
(
i
=
0
;
i
<
aConnectors
.
length
;
++
i
){
aConnectors
[
i
].
calculateTransform
(
bFlag
);
var
oGroup
=
aConnectors
[
i
].
getMainGroup
();
if
(
oGroup
){
oGroupMaps
[
oGroup
.
Id
]
=
oGroup
;
}
}
for
(
var
key
in
oGroupMaps
){
if
(
oGroupMaps
.
hasOwnProperty
(
key
)){
oGroupMaps
[
key
].
updateCoordinatesAfterInternalResize
();
}
}
if
(
group
)
{
group
.
updateCoordinatesAfterInternalResize
();
}
if
(
!
oThis
.
drawingObjects
.
drawingObjects
||
!
oThis
.
drawingObjects
.
drawingObjects
.
cSld
)
{
var
min_x
,
min_y
,
drawing
,
arr_x2
=
[],
arr_y2
=
[],
oTransform
;
for
(
i
=
0
;
i
<
oThis
.
drawingObjects
.
selectedObjects
.
length
;
++
i
)
{
drawing
=
oThis
.
drawingObjects
.
selectedObjects
[
i
];
var
rot
=
AscFormat
.
isRealNumber
(
drawing
.
spPr
.
xfrm
.
rot
)
?
drawing
.
spPr
.
xfrm
.
rot
:
0
;
rot
=
AscFormat
.
normalizeRotate
(
rot
);
arr_x2
.
push
(
drawing
.
spPr
.
xfrm
.
offX
);
arr_y2
.
push
(
drawing
.
spPr
.
xfrm
.
offY
);
arr_x2
.
push
(
drawing
.
spPr
.
xfrm
.
offX
+
drawing
.
spPr
.
xfrm
.
extX
);
arr_y2
.
push
(
drawing
.
spPr
.
xfrm
.
offY
+
drawing
.
spPr
.
xfrm
.
extY
);
if
(
AscFormat
.
checkNormalRotate
(
rot
))
{
min_x
=
drawing
.
spPr
.
xfrm
.
offX
;
min_y
=
drawing
.
spPr
.
xfrm
.
offY
;
}
else
{
min_x
=
drawing
.
spPr
.
xfrm
.
offX
+
drawing
.
spPr
.
xfrm
.
extX
/
2
-
drawing
.
spPr
.
xfrm
.
extY
/
2
;
min_y
=
drawing
.
spPr
.
xfrm
.
offY
+
drawing
.
spPr
.
xfrm
.
extY
/
2
-
drawing
.
spPr
.
xfrm
.
extX
/
2
;
arr_x2
.
push
(
min_x
);
arr_y2
.
push
(
min_y
);
arr_x2
.
push
(
min_x
+
drawing
.
spPr
.
xfrm
.
extY
);
arr_y2
.
push
(
min_y
+
drawing
.
spPr
.
xfrm
.
extX
);
}
if
(
min_x
<
0
)
{
drawing
.
spPr
.
xfrm
.
setOffX
(
drawing
.
spPr
.
xfrm
.
offX
-
min_x
);
}
if
(
min_y
<
0
)
{
drawing
.
spPr
.
xfrm
.
setOffY
(
drawing
.
spPr
.
xfrm
.
offY
-
min_y
);
}
drawing
.
checkDrawingBaseCoords
();
drawing
.
recalculateTransform
();
oTransform
=
drawing
.
transform
;
arr_x2
.
push
(
oTransform
.
TransformPointX
(
0
,
0
));
arr_y2
.
push
(
oTransform
.
TransformPointY
(
0
,
0
));
arr_x2
.
push
(
oTransform
.
TransformPointX
(
drawing
.
extX
,
0
));
arr_y2
.
push
(
oTransform
.
TransformPointY
(
drawing
.
extX
,
0
));
arr_x2
.
push
(
oTransform
.
TransformPointX
(
drawing
.
extX
,
drawing
.
extY
));
arr_y2
.
push
(
oTransform
.
TransformPointY
(
drawing
.
extX
,
drawing
.
extY
));
arr_x2
.
push
(
oTransform
.
TransformPointX
(
0
,
drawing
.
extY
));
arr_y2
.
push
(
oTransform
.
TransformPointY
(
0
,
drawing
.
extY
));
}
oThis
.
drawingObjects
.
drawingObjects
.
checkGraphicObjectPosition
(
0
,
0
,
Math
.
max
.
apply
(
Math
,
arr_x2
),
Math
.
max
.
apply
(
Math
,
arr_y2
));
}
},
[],
false
,
AscDFH
.
historydescription_CommonDrawings_EndTrack
,
aAdditionalForCheck
);
}
}
}
...
...
common/Drawings/TrackObjects/ResizeTracks.js
View file @
2e9a959e
...
...
@@ -310,7 +310,7 @@ function ResizeTrackShapeImage(originalObject, cardDirection, drawingsController
this
.
resizedRot
=
originalObject
.
rot
;
this
.
transform
=
originalObject
.
transform
.
CreateDublicate
();
this
.
geometry
=
(
function
(){
return
originalObject
.
getGeom
();})(
);
this
.
geometry
=
AscFormat
.
ExecuteNoHistory
(
function
(){
return
originalObject
.
getGeom
().
createDuplicate
();},
this
,
[]
);
if
(
!
originalObject
.
isChart
())
{
...
...
common/Private/Locks.js
View file @
2e9a959e
...
...
@@ -750,7 +750,7 @@ if(typeof CComments !== "undefined")
if
(
typeof
CPresentation
!==
"
undefined
"
)
{
CPresentation
.
prototype
.
Document_Is_SelectionLocked
=
function
(
CheckType
,
AdditionalData
,
isIgnoreCanEditFlag
)
CPresentation
.
prototype
.
Document_Is_SelectionLocked
=
function
(
CheckType
,
AdditionalData
,
isIgnoreCanEditFlag
,
aAdditionaObjects
)
{
if
(
!
this
.
CanEdit
()
&&
true
!==
isIgnoreCanEditFlag
)
return
true
;
...
...
@@ -796,6 +796,19 @@ if(typeof CPresentation !== "undefined")
};
selected_objects
[
i
].
Lock
.
Check
(
check_obj
);
}
if
(
Array
.
isArray
(
aAdditionaObjects
)){
for
(
var
i
=
0
;
i
<
aAdditionaObjects
.
length
;
++
i
)
{
var
check_obj
=
{
"
type
"
:
c_oAscLockTypeElemPresentation
.
Object
,
"
slideId
"
:
slide_id
,
"
objId
"
:
aAdditionaObjects
[
i
].
Get_Id
(),
"
guid
"
:
aAdditionaObjects
[
i
].
Get_Id
()
};
aAdditionaObjects
[
i
].
Lock
.
Check
(
check_obj
);
}
}
}
if
(
CheckType
===
AscCommon
.
changestype_AddShape
||
CheckType
===
AscCommon
.
changestype_AddComment
)
...
...
slide/Editor/DrawingObjectsController.js
View file @
2e9a959e
...
...
@@ -115,7 +115,7 @@ DrawingObjectsController.prototype.handleOleObjectDoubleClick = function(drawing
oPresentation
.
OnMouseUp
(
e
,
x
,
y
,
pageIndex
);
};
DrawingObjectsController
.
prototype
.
checkSelectedObjectsAndCallback
=
function
(
callback
,
args
,
bNoSendProps
,
nHistoryPointType
)
DrawingObjectsController
.
prototype
.
checkSelectedObjectsAndCallback
=
function
(
callback
,
args
,
bNoSendProps
,
nHistoryPointType
,
aAdditionaObjects
)
{
var
check_type
=
AscCommon
.
changestype_Drawing_Props
,
comment
;
if
(
this
.
drawingObjects
.
slideComments
)
...
...
@@ -127,7 +127,7 @@ DrawingObjectsController.prototype.checkSelectedObjectsAndCallback = function(ca
comment
=
comment
.
Get_Id
();
}
}
if
(
editor
.
WordControl
.
m_oLogicDocument
.
Document_Is_SelectionLocked
(
check_type
,
comment
)
===
false
)
if
(
editor
.
WordControl
.
m_oLogicDocument
.
Document_Is_SelectionLocked
(
check_type
,
comment
,
undefined
,
aAdditionaObjects
)
===
false
)
{
var
nPointType
=
AscFormat
.
isRealNumber
(
nHistoryPointType
)
?
nHistoryPointType
:
AscDFH
.
historydescription_CommonControllerCheckSelected
;
History
.
Create_NewPoint
(
nPointType
);
...
...
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