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
b7549732
Commit
b7549732
authored
Jul 08, 2016
by
Sergey Luzyanin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'release/4.0.1' into develop
parents
3c0789c2
15810781
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
82 additions
and
18 deletions
+82
-18
common/Charts/DrawingObjects.js
common/Charts/DrawingObjects.js
+17
-12
common/Drawings/CommonController.js
common/Drawings/CommonController.js
+28
-4
common/Drawings/Format/OleObject.js
common/Drawings/Format/OleObject.js
+15
-0
common/apiCommon.js
common/apiCommon.js
+14
-2
word/Editor/GraphicObjects/GraphicObjects.js
word/Editor/GraphicObjects/GraphicObjects.js
+6
-0
word/api.js
word/api.js
+2
-0
No files found.
common/Charts/DrawingObjects.js
View file @
b7549732
...
...
@@ -3247,23 +3247,28 @@ function DrawingObjects() {
_this
.
getOriginalImageSize
=
function
()
{
var
selectedObjects
=
_this
.
controller
.
selectedObjects
;
if
(
(
selectedObjects
.
length
==
1
)
&&
selectedObjects
[
0
].
isImage
()
)
{
if
(
(
selectedObjects
.
length
==
1
)
)
{
var
imageUrl
=
selectedObjects
[
0
].
getImageUrl
();
if
(
AscFormat
.
isRealNumber
(
selectedObjects
[
0
].
m_fDefaultSizeX
)
&&
AscFormat
.
isRealNumber
(
selectedObjects
[
0
].
m_fDefaultSizeY
)){
return
new
AscCommon
.
asc_CImageSize
(
selectedObjects
[
0
].
m_fDefaultSizeX
,
selectedObjects
[
0
].
m_fDefaultSizeY
,
true
);
}
if
(
selectedObjects
[
0
].
isImage
()){
var
imageUrl
=
selectedObjects
[
0
].
getImageUrl
();
var
_image
=
api
.
ImageLoader
.
map_image_index
[
AscCommon
.
getFullImageSrc2
(
imageUrl
)];
if
(
_image
!=
undefined
&&
_image
.
Image
!=
null
&&
_image
.
Status
==
AscFonts
.
ImageLoadStatus
.
Complete
)
{
var
_image
=
api
.
ImageLoader
.
map_image_index
[
AscCommon
.
getFullImageSrc2
(
imageUrl
)];
if
(
_image
!=
undefined
&&
_image
.
Image
!=
null
&&
_image
.
Status
==
AscFonts
.
ImageLoadStatus
.
Complete
)
{
var
_w
=
1
,
_h
=
1
;
var
bIsCorrect
=
false
;
if
(
_image
.
Image
!=
null
)
{
var
_w
=
1
,
_h
=
1
;
var
bIsCorrect
=
false
;
if
(
_image
.
Image
!=
null
)
{
bIsCorrect
=
true
;
_w
=
Math
.
max
(
pxToMm
(
_image
.
Image
.
width
),
1
);
_h
=
Math
.
max
(
pxToMm
(
_image
.
Image
.
height
),
1
);
}
bIsCorrect
=
true
;
_w
=
Math
.
max
(
pxToMm
(
_image
.
Image
.
width
),
1
);
_h
=
Math
.
max
(
pxToMm
(
_image
.
Image
.
height
),
1
);
}
return
new
AscCommon
.
asc_CImageSize
(
_w
,
_h
,
bIsCorrect
);
return
new
AscCommon
.
asc_CImageSize
(
_w
,
_h
,
bIsCorrect
);
}
}
}
return
new
AscCommon
.
asc_CImageSize
(
50
,
50
,
false
);
...
...
common/Drawings/CommonController.js
View file @
b7549732
...
...
@@ -2451,6 +2451,18 @@ DrawingObjectsController.prototype =
{
checkObjectInArray
(
aGroups
,
objects_by_type
.
oleObjects
[
i
].
group
.
getMainGroup
());
}
var
api
=
window
.
editor
||
window
.
Asc
.
editor
;
if
(
api
)
{
var
pluginData
=
new
Asc
.
CPluginData
();
pluginData
.
setAttribute
(
"
data
"
,
objects_by_type
.
oleObjects
[
i
].
m_sData
);
pluginData
.
setAttribute
(
"
guid
"
,
objects_by_type
.
oleObjects
[
i
].
m_sApplicationId
);
pluginData
.
setAttribute
(
"
width
"
,
objects_by_type
.
oleObjects
[
i
].
spPr
.
xfrm
.
extX
);
pluginData
.
setAttribute
(
"
height
"
,
objects_by_type
.
oleObjects
[
i
].
spPr
.
xfrm
.
extY
);
pluginData
.
setAttribute
(
"
objectId
"
,
objects_by_type
.
oleObjects
[
i
].
Get_Id
());
api
.
asc_pluginResize
(
pluginData
);
}
objects_by_type
.
oleObjects
[
i
].
checkDrawingBaseCoords
();
}
}
...
...
@@ -6642,7 +6654,7 @@ DrawingObjectsController.prototype =
pluginData
.
setAttribute
(
"
objectId
"
,
drawing
.
Id
);
new_image_props
=
{
ImageUrl
:
null
,
ImageUrl
:
drawing
.
getImageUrl
()
,
w
:
drawing
.
extX
,
h
:
drawing
.
extY
,
locked
:
locked
,
...
...
@@ -6650,7 +6662,9 @@ DrawingObjectsController.prototype =
y
:
drawing
.
y
,
lockAspect
:
lockAspect
,
pluginGuid
:
drawing
.
m_sApplicationId
,
pluginData
:
pluginData
pluginData
:
pluginData
,
oleWidth
:
drawing
.
m_fDefaultSizeX
,
oleHeight
:
drawing
.
m_fDefaultSizeY
};
if
(
!
image_props
)
image_props
=
new_image_props
;
...
...
@@ -6670,8 +6684,10 @@ DrawingObjectsController.prototype =
image_props
.
locked
=
true
;
if
(
image_props
.
lockAspect
||
new_image_props
.
lockAspect
)
image_props
.
lockAspect
=
false
;
new_image_props
.
pluginGuid
=
null
;
new_image_props
.
pluginData
=
undefined
;
image_props
.
pluginGuid
=
null
;
image_props
.
pluginData
=
undefined
;
image_props
.
oleWidth
=
undefined
;
image_props
.
oleHeight
=
undefined
;
}
break
;
}
...
...
@@ -7095,6 +7111,14 @@ DrawingObjectsController.prototype =
image_props
.
ImageUrl
=
props
.
imageProps
.
ImageUrl
;
image_props
.
Locked
=
props
.
imageProps
.
locked
===
true
;
image_props
.
lockAspect
=
props
.
imageProps
.
lockAspect
;
image_props
.
pluginGuid
=
props
.
imageProps
.
pluginGuid
;
image_props
.
pluginData
=
props
.
imageProps
.
pluginData
;
image_props
.
oleWidth
=
props
.
imageProps
.
oleWidth
;
image_props
.
oleHeight
=
props
.
imageProps
.
oleHeight
;
if
(
!
bParaLocked
)
{
bParaLocked
=
image_props
.
Locked
;
...
...
common/Drawings/Format/OleObject.js
View file @
b7549732
...
...
@@ -45,6 +45,8 @@ function (window, undefined) {
this
.
m_sApplicationId
=
null
;
this
.
m_nPixWidth
=
null
;
this
.
m_nPixHeight
=
null
;
this
.
m_fDefaultSizeX
=
null
;
this
.
m_fDefaultSizeY
=
null
;
this
.
Id
=
AscCommon
.
g_oIdCounter
.
Get_NewId
();
AscCommon
.
g_oTableId
.
Add
(
this
,
this
.
Id
);
}
...
...
@@ -104,6 +106,19 @@ function (window, undefined) {
copy
.
cachedPixW
=
this
.
cachedPixW
;
return
copy
;
};
COleObject
.
prototype
.
handleUpdateExtents
=
function
(){
if
(
!
AscFormat
.
isRealNumber
(
this
.
m_fDefaultSizeX
)
||
!
AscFormat
.
isRealNumber
(
this
.
m_fDefaultSizeY
)){
if
(
this
.
spPr
&&
this
.
spPr
.
xfrm
&&
AscFormat
.
isRealNumber
(
this
.
spPr
.
xfrm
.
extX
)
&&
AscFormat
.
isRealNumber
(
this
.
spPr
.
xfrm
.
extY
)){
this
.
m_fDefaultSizeX
=
this
.
spPr
.
xfrm
.
extX
;
this
.
m_fDefaultSizeY
=
this
.
spPr
.
xfrm
.
extY
;
}
}
if
(
AscFormat
.
CImageShape
.
prototype
.
handleUpdateExtents
){
AscFormat
.
CImageShape
.
prototype
.
handleUpdateExtents
.
call
(
this
,
[]);
}
};
window
[
'
AscFormat
'
]
=
window
[
'
AscFormat
'
]
||
{};
window
[
'
AscFormat
'
].
COleObject
=
COleObject
;
})(
window
);
\ No newline at end of file
common/apiCommon.js
View file @
b7549732
...
...
@@ -1747,8 +1747,10 @@
this
.
vert
=
obj
.
vert
!=
undefined
?
obj
.
vert
:
undefined
;
//oleObjects
this
.
pluginGuid
=
obj
.
pluginGuid
!=
undefined
?
obj
.
pluginGuid
:
undefined
;
this
.
pluginData
=
obj
.
pluginData
!=
undefined
?
obj
.
pluginData
:
undefined
;
this
.
pluginGuid
=
obj
.
pluginGuid
!==
undefined
?
obj
.
pluginGuid
:
undefined
;
this
.
pluginData
=
obj
.
pluginData
!==
undefined
?
obj
.
pluginData
:
undefined
;
this
.
oleWidth
=
obj
.
oleWidth
!=
undefined
?
obj
.
oleWidth
:
undefined
;
this
.
oleHeight
=
obj
.
oleHeight
!=
undefined
?
obj
.
oleHeight
:
undefined
;
}
else
{
this
.
CanBeFlow
=
true
;
...
...
@@ -1783,6 +1785,9 @@
//oleObjects
this
.
pluginGuid
=
undefined
;
this
.
pluginData
=
undefined
;
this
.
oleWidth
=
undefined
;
this
.
oleHeight
=
undefined
;
}
}
...
...
@@ -1873,6 +1878,9 @@
asc_getOriginSize
:
function
(
api
)
{
if
(
AscFormat
.
isRealNumber
(
this
.
oleWidth
)
&&
AscFormat
.
isRealNumber
(
this
.
oleHeight
)){
return
new
asc_CImageSize
(
this
.
oleWidth
,
this
.
oleHeight
,
true
);
}
var
_section_select
=
api
.
WordControl
.
m_oLogicDocument
.
Get_PageSizesByDrawingObjects
();
var
_page_width
=
AscCommon
.
Page_Width
;
var
_page_height
=
AscCommon
.
Page_Height
;
...
...
@@ -2823,6 +2831,10 @@
prot
[
"
get_ShapeProperties
"
]
=
prot
[
"
asc_getShapeProperties
"
]
=
prot
.
asc_getShapeProperties
;
prot
[
"
put_ShapeProperties
"
]
=
prot
[
"
asc_putShapeProperties
"
]
=
prot
.
asc_putShapeProperties
;
prot
[
"
get_OriginSize
"
]
=
prot
[
"
asc_getOriginSize
"
]
=
prot
.
asc_getOriginSize
;
prot
[
"
get_PluginGuid
"
]
=
prot
[
"
asc_getPluginGuid
"
]
=
prot
.
asc_getPluginGuid
;
prot
[
"
put_PluginGuid
"
]
=
prot
[
"
asc_putPluginGuid
"
]
=
prot
.
asc_putPluginGuid
;
prot
[
"
get_PluginData
"
]
=
prot
[
"
asc_getPluginData
"
]
=
prot
.
asc_getPluginData
;
prot
[
"
put_PluginData
"
]
=
prot
[
"
asc_putPluginData
"
]
=
prot
.
asc_putPluginData
;
window
[
"
AscCommon
"
].
asc_CSelectedObject
=
asc_CSelectedObject
;
prot
=
asc_CSelectedObject
.
prototype
;
...
...
word/Editor/GraphicObjects/GraphicObjects.js
View file @
b7549732
...
...
@@ -506,6 +506,12 @@ CGraphicObjects.prototype =
image_props
.
Width
=
props_by_types
.
imageProps
.
w
;
image_props
.
Height
=
props_by_types
.
imageProps
.
h
;
image_props
.
lockAspect
=
props_by_types
.
imageProps
.
lockAspect
;
image_props
.
pluginGuid
=
props_by_types
.
imageProps
.
pluginGuid
;
image_props
.
pluginData
=
props_by_types
.
imageProps
.
pluginData
;
image_props
.
oleWidth
=
props_by_types
.
imageProps
.
oleWidth
;
image_props
.
oleHeight
=
props_by_types
.
imageProps
.
oleHeight
;
}
if
(
props_by_types
.
chartProps
&&
!
(
props_by_types
.
chartProps
.
severalCharts
===
true
))
{
...
...
word/api.js
View file @
b7549732
...
...
@@ -5596,12 +5596,14 @@ background-repeat: no-repeat;\
this
.
WordControl
.
m_oLogicDocument
.
Create_NewHistoryPoint
(
AscDFH
.
historydescription_Document_EditOleObject
);
this
.
WordControl
.
m_oLogicDocument
.
Edit_OleObject
(
oOleObject
,
sData
,
sImageUrl
,
nPixWidth
,
nPixHeight
);
this
.
WordControl
.
m_oLogicDocument
.
Recalculate
();
this
.
WordControl
.
m_oLogicDocument
.
Document_UpdateInterfaceState
();
}
}
else
{
this
.
WordControl
.
m_oLogicDocument
.
Edit_OleObject
(
oOleObject
,
sData
,
sImageUrl
,
nPixWidth
,
nPixHeight
);
this
.
WordControl
.
m_oLogicDocument
.
Recalculate
();
this
.
WordControl
.
m_oLogicDocument
.
Document_UpdateInterfaceState
();
}
}
};
...
...
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