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
e5fd50c3
Commit
e5fd50c3
authored
May 24, 2017
by
SergeyLuzyanin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
connectors
parent
db301e93
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
42 additions
and
6 deletions
+42
-6
common/Drawings/CommonController.js
common/Drawings/CommonController.js
+22
-4
common/Drawings/Format/CnxShape.js
common/Drawings/Format/CnxShape.js
+17
-0
common/Drawings/Format/GroupShape.js
common/Drawings/Format/GroupShape.js
+1
-1
common/Drawings/TrackObjects/ResizeTracks.js
common/Drawings/TrackObjects/ResizeTracks.js
+1
-1
word/Editor/GraphicObjects/GraphicObjects.js
word/Editor/GraphicObjects/GraphicObjects.js
+1
-0
No files found.
common/Drawings/CommonController.js
View file @
e5fd50c3
...
@@ -581,9 +581,6 @@ function CheckSpPrXfrm2(object)
...
@@ -581,9 +581,6 @@ function CheckSpPrXfrm2(object)
}
}
function
getObjectsByTypesFromArr
(
arr
,
bGrouped
)
function
getObjectsByTypesFromArr
(
arr
,
bGrouped
)
{
{
var
ret
=
{
shapes
:
[],
images
:
[],
groups
:
[],
charts
:
[],
tables
:
[],
oleObjects
:
[]};
var
ret
=
{
shapes
:
[],
images
:
[],
groups
:
[],
charts
:
[],
tables
:
[],
oleObjects
:
[]};
...
@@ -595,6 +592,7 @@ function getObjectsByTypesFromArr(arr, bGrouped)
...
@@ -595,6 +592,7 @@ function getObjectsByTypesFromArr(arr, bGrouped)
switch
(
type
)
switch
(
type
)
{
{
case
AscDFH
.
historyitem_type_Shape
:
case
AscDFH
.
historyitem_type_Shape
:
case
AscDFH
.
historyitem_type_Cnx
:
{
{
ret
.
shapes
.
push
(
drawing
);
ret
.
shapes
.
push
(
drawing
);
break
;
break
;
...
@@ -2537,6 +2535,15 @@ DrawingObjectsController.prototype =
...
@@ -2537,6 +2535,15 @@ DrawingObjectsController.prototype =
return
api
.
textArtPreviewManager
;
return
api
.
textArtPreviewManager
;
},
},
resetConnectors
:
function
(
aShapes
){
var
aAllConnectors
=
this
.
getAllConnectors
(
this
.
getDrawingArray
());
for
(
var
i
=
0
;
i
<
aAllConnectors
.
length
;
++
i
){
for
(
var
j
=
0
;
j
<
aShapes
.
length
;
++
j
){
aAllConnectors
[
i
].
resetShape
(
aShapes
[
j
]);
}
}
},
applyDrawingProps
:
function
(
props
)
applyDrawingProps
:
function
(
props
)
{
{
var
objects_by_type
=
this
.
getSelectedObjectsByTypes
(
true
);
var
objects_by_type
=
this
.
getSelectedObjectsByTypes
(
true
);
...
@@ -2629,14 +2636,20 @@ DrawingObjectsController.prototype =
...
@@ -2629,14 +2636,20 @@ DrawingObjectsController.prototype =
}
}
if
(
typeof
(
props
.
type
)
===
"
string
"
)
if
(
typeof
(
props
.
type
)
===
"
string
"
)
{
{
var
aShapes
=
[];
for
(
i
=
0
;
i
<
objects_by_type
.
shapes
.
length
;
++
i
)
for
(
i
=
0
;
i
<
objects_by_type
.
shapes
.
length
;
++
i
)
{
{
objects_by_type
.
shapes
[
i
].
changePresetGeom
(
props
.
type
);
if
(
objects_by_type
.
shapes
[
i
].
getObjectType
()
===
AscDFH
.
historyitem_type_Shape
){
objects_by_type
.
shapes
[
i
].
changePresetGeom
(
props
.
type
);
aShapes
.
push
(
objects_by_type
.
shapes
[
i
]);
}
}
}
for
(
i
=
0
;
i
<
objects_by_type
.
groups
.
length
;
++
i
)
for
(
i
=
0
;
i
<
objects_by_type
.
groups
.
length
;
++
i
)
{
{
objects_by_type
.
groups
[
i
].
changePresetGeom
(
props
.
type
);
objects_by_type
.
groups
[
i
].
changePresetGeom
(
props
.
type
);
objects_by_type
.
groups
[
i
].
getAllShapes
(
objects_by_type
.
groups
[
i
].
spTree
,
aShapes
);
}
}
this
.
resetConnectors
(
aShapes
);
}
}
if
(
isRealObject
(
props
.
stroke
))
if
(
isRealObject
(
props
.
stroke
))
{
{
...
@@ -5031,6 +5044,7 @@ DrawingObjectsController.prototype =
...
@@ -5031,6 +5044,7 @@ DrawingObjectsController.prototype =
{
{
worksheet
.
endEditChart
();
worksheet
.
endEditChart
();
}
}
var
aAllShapes
=
[];
if
(
this
.
selection
.
groupSelection
)
if
(
this
.
selection
.
groupSelection
)
{
{
if
(
this
.
selection
.
groupSelection
.
selection
.
chartSelection
)
if
(
this
.
selection
.
groupSelection
.
selection
.
chartSelection
)
...
@@ -5039,6 +5053,7 @@ DrawingObjectsController.prototype =
...
@@ -5039,6 +5053,7 @@ DrawingObjectsController.prototype =
}
}
else
else
{
{
this
.
getAllShapes
(
this
.
selection
.
groupSelection
.
selectedObjects
,
aAllShapes
);
var
group_map
=
{},
group_arr
=
[],
i
,
cur_group
,
sp
,
xc
,
yc
,
hc
,
vc
,
rel_xc
,
rel_yc
,
j
;
var
group_map
=
{},
group_arr
=
[],
i
,
cur_group
,
sp
,
xc
,
yc
,
hc
,
vc
,
rel_xc
,
rel_yc
,
j
;
for
(
i
=
0
;
i
<
this
.
selection
.
groupSelection
.
selectedObjects
.
length
;
++
i
)
for
(
i
=
0
;
i
<
this
.
selection
.
groupSelection
.
selectedObjects
.
length
;
++
i
)
{
{
...
@@ -5131,6 +5146,7 @@ DrawingObjectsController.prototype =
...
@@ -5131,6 +5146,7 @@ DrawingObjectsController.prototype =
}
}
else
else
{
{
this
.
getAllShapes
(
this
.
selectedObjects
,
aAllShapes
);
for
(
var
i
=
0
;
i
<
this
.
selectedObjects
.
length
;
++
i
)
for
(
var
i
=
0
;
i
<
this
.
selectedObjects
.
length
;
++
i
)
{
{
this
.
selectedObjects
[
i
].
deleteDrawingBase
(
true
);
this
.
selectedObjects
[
i
].
deleteDrawingBase
(
true
);
...
@@ -5139,6 +5155,7 @@ DrawingObjectsController.prototype =
...
@@ -5139,6 +5155,7 @@ DrawingObjectsController.prototype =
}
}
}
}
this
.
resetConnectors
(
aAllShapes
);
this
.
resetSelection
();
this
.
resetSelection
();
this
.
recalculate
();
this
.
recalculate
();
}
}
...
@@ -7077,6 +7094,7 @@ DrawingObjectsController.prototype =
...
@@ -7077,6 +7094,7 @@ DrawingObjectsController.prototype =
switch
(
drawing
.
getObjectType
())
switch
(
drawing
.
getObjectType
())
{
{
case
AscDFH
.
historyitem_type_Shape
:
case
AscDFH
.
historyitem_type_Shape
:
case
AscDFH
.
historyitem_type_Cnx
:
{
{
new_shape_props
=
new_shape_props
=
...
...
common/Drawings/Format/CnxShape.js
View file @
e5fd50c3
...
@@ -490,6 +490,23 @@
...
@@ -490,6 +490,23 @@
return
copy
;
return
copy
;
};
};
CConnectionShape
.
prototype
.
resetShape
=
function
(
oShape
)
{
var
cnxPr
=
this
.
nvSpPr
.
nvUniSpPr
;
if
(
cnxPr
.
stCnxId
===
oShape
.
Id
||
cnxPr
.
endCnxId
===
oShape
.
Id
){
var
oNewPr
=
cnxPr
.
copy
();
if
(
cnxPr
.
stCnxId
===
oShape
.
Id
){
oNewPr
.
stCnxId
=
null
;
oNewPr
.
stCnxIdx
=
null
;
}
if
(
cnxPr
.
endCnxId
===
oShape
.
Id
){
oNewPr
.
endCnxId
=
null
;
oNewPr
.
endCnxIdx
=
null
;
}
this
.
nvSpPr
.
setUniSpPr
(
oNewPr
);
}
};
window
[
'
AscFormat
'
]
=
window
[
'
AscFormat
'
]
||
{};
window
[
'
AscFormat
'
]
=
window
[
'
AscFormat
'
]
||
{};
window
[
'
AscFormat
'
].
fCalculateSpPr
=
fCalculateSpPr
;
window
[
'
AscFormat
'
].
fCalculateSpPr
=
fCalculateSpPr
;
window
[
'
AscFormat
'
].
fCalculateConnectionInfo
=
fCalculateConnectionInfo
;
window
[
'
AscFormat
'
].
fCalculateConnectionInfo
=
fCalculateConnectionInfo
;
...
...
common/Drawings/Format/GroupShape.js
View file @
e5fd50c3
...
@@ -1331,7 +1331,7 @@ function CGroupShape()
...
@@ -1331,7 +1331,7 @@ function CGroupShape()
{
{
for
(
var
_shape_index
=
0
;
_shape_index
<
this
.
spTree
.
length
;
++
_shape_index
)
for
(
var
_shape_index
=
0
;
_shape_index
<
this
.
spTree
.
length
;
++
_shape_index
)
{
{
if
(
this
.
spTree
[
_shape_index
].
changePresetGeom
)
if
(
this
.
spTree
[
_shape_index
].
getObjectType
()
===
AscDFH
.
historyitem_type_Shape
)
{
{
this
.
spTree
[
_shape_index
].
changePresetGeom
(
preset
);
this
.
spTree
[
_shape_index
].
changePresetGeom
(
preset
);
}
}
...
...
common/Drawings/TrackObjects/ResizeTracks.js
View file @
e5fd50c3
...
@@ -960,7 +960,7 @@ function ResizeTrackShapeImage(originalObject, cardDirection, drawingsController
...
@@ -960,7 +960,7 @@ function ResizeTrackShapeImage(originalObject, cardDirection, drawingsController
this
.
trackEnd
=
function
(
bWord
)
this
.
trackEnd
=
function
(
bWord
)
{
{
if
(
!
this
.
bConnector
){
if
(
!
this
.
bConnector
||
!
this
.
oSpPr
){
var
scale_coefficients
,
ch_off_x
,
ch_off_y
;
var
scale_coefficients
,
ch_off_x
,
ch_off_y
;
if
(
this
.
originalObject
.
group
)
if
(
this
.
originalObject
.
group
)
{
{
...
...
word/Editor/GraphicObjects/GraphicObjects.js
View file @
e5fd50c3
...
@@ -1287,6 +1287,7 @@ CGraphicObjects.prototype =
...
@@ -1287,6 +1287,7 @@ CGraphicObjects.prototype =
getTargetDocContent
:
DrawingObjectsController
.
prototype
.
getTargetDocContent
,
getTargetDocContent
:
DrawingObjectsController
.
prototype
.
getTargetDocContent
,
getTextArtPreviewManager
:
DrawingObjectsController
.
prototype
.
getTextArtPreviewManager
,
getTextArtPreviewManager
:
DrawingObjectsController
.
prototype
.
getTextArtPreviewManager
,
getEditorApi
:
DrawingObjectsController
.
prototype
.
getEditorApi
,
getEditorApi
:
DrawingObjectsController
.
prototype
.
getEditorApi
,
resetConnectors
:
DrawingObjectsController
.
prototype
.
resetConnectors
,
handleChartDoubleClick
:
function
(
drawing
,
chart
,
e
,
x
,
y
,
pageIndex
)
handleChartDoubleClick
:
function
(
drawing
,
chart
,
e
,
x
,
y
,
pageIndex
)
{
{
...
...
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