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
01351811
Commit
01351811
authored
Apr 04, 2016
by
Sergey Luzyanin
Committed by
Alexander.Trofimov
May 19, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Относительные размеры шейпов
parent
ea96cf4a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
30 deletions
+50
-30
common/Drawings/Format/Shape.js
common/Drawings/Format/Shape.js
+9
-9
common/Shapes/SerializeWriter.js
common/Shapes/SerializeWriter.js
+2
-2
common/commonDefines.js
common/commonDefines.js
+20
-0
word/Editor/Serialize2.js
word/Editor/Serialize2.js
+19
-19
No files found.
common/Drawings/Format/Shape.js
View file @
01351811
...
...
@@ -2542,6 +2542,7 @@ CShape.prototype =
var
oParentParagraph
=
oParaDrawing
.
Get_ParentParagraph
();
if
(
oParentParagraph
)
{
var
oSectPr
=
oParentParagraph
.
Get_SectPr
();
if
(
oSectPr
)
{
...
...
@@ -2549,23 +2550,23 @@ CShape.prototype =
{
switch
(
oParaDrawing
.
SizeRelH
.
RelativeFrom
)
{
case
c_oAsc
RelativeFromH
.
Margin
:
case
c_oAsc
SizeRelFromH
.
sizerelfromh
Margin
:
{
this
.
extX
=
oSectPr
.
Get_PageWidth
()
-
oSectPr
.
Get_PageMargin_Left
()
-
oSectPr
.
Get_PageMargin_Right
();
break
;
}
case
c_oAsc
RelativeFromH
.
Page
:
case
c_oAsc
SizeRelFromH
.
sizerelfromh
Page
:
{
this
.
extX
=
oSectPr
.
Get_PageWidth
();
break
;
}
case
c_oAsc
RelativeFromH
.
LeftMargin
:
case
c_oAsc
SizeRelFromH
.
sizerelfromh
LeftMargin
:
{
this
.
extX
=
oSectPr
.
Get_PageMargin_Left
();
break
;
}
case
c_oAsc
RelativeFromH
.
RightMargin
:
case
c_oAsc
SizeRelFromH
.
sizerelfromh
RightMargin
:
{
this
.
extX
=
oSectPr
.
Get_PageMargin_Right
();
break
;
...
...
@@ -2580,25 +2581,24 @@ CShape.prototype =
}
if
(
oParaDrawing
.
SizeRelV
)
{
switch
(
oParaDrawing
.
SizeRelV
.
RelativeFrom
)
{
case
c_oAsc
RelativeFromV
.
Margin
:
case
c_oAsc
SizeRelFromV
.
sizerelfromv
Margin
:
{
this
.
extY
=
oSectPr
.
Get_PageHeight
()
-
oSectPr
.
Get_PageMargin_Top
()
-
oSectPr
.
Get_PageMargin_Bottom
();
break
;
}
case
c_oAsc
RelativeFromV
.
Page
:
case
c_oAsc
SizeRelFromV
.
sizerelfromv
Page
:
{
this
.
extY
=
oSectPr
.
Get_PageHeight
();
break
;
}
case
c_oAsc
RelativeFromV
.
TopMargin
:
case
c_oAsc
SizeRelFromV
.
sizerelfromv
TopMargin
:
{
this
.
extY
=
oSectPr
.
Get_PageMargin_Top
();
break
;
}
case
c_oAsc
RelativeFromV
.
BottomMargin
:
case
c_oAsc
SizeRelFromV
.
sizerelfromv
BottomMargin
:
{
this
.
extY
=
oSectPr
.
Get_PageMargin_Bottom
();
break
;
...
...
common/Shapes/SerializeWriter.js
View file @
01351811
...
...
@@ -2348,8 +2348,8 @@ function CBinaryFileWriter()
oThis
.
_WriteInt2
(
1
,
fill
.
tile
.
sy
);
oThis
.
_WriteInt2
(
2
,
fill
.
tile
.
tx
);
oThis
.
_WriteInt2
(
3
,
fill
.
tile
.
ty
);
oThis
.
_Write
In
t2
(
4
,
fill
.
tile
.
algn
);
oThis
.
_Write
In
t2
(
5
,
fill
.
tile
.
flip
);
oThis
.
_Write
Limi
t2
(
4
,
fill
.
tile
.
algn
);
oThis
.
_Write
Limi
t2
(
5
,
fill
.
tile
.
flip
);
oThis
.
WriteUChar
(
g_nodeAttributeEnd
);
oThis
.
EndRecord
();
}
...
...
common/commonDefines.js
View file @
01351811
...
...
@@ -411,6 +411,26 @@ var c_oAscRelativeFromH = {
RightMargin
:
0x07
};
var
c_oAscSizeRelFromH
=
{
sizerelfromhMargin
:
0
,
sizerelfromhPage
:
1
,
sizerelfromhLeftMargin
:
2
,
sizerelfromhRightMargin
:
3
,
sizerelfromhInsideMargin
:
4
,
sizerelfromhOutsideMargin
:
5
};
var
c_oAscSizeRelFromV
=
{
sizerelfromvMargin
:
0
,
sizerelfromvPage
:
1
,
sizerelfromvTopMargin
:
2
,
sizerelfromvBottomMargin
:
3
,
sizerelfromvInsideMargin
:
4
,
sizerelfromvOutsideMargin
:
5
};
var
c_oAscRelativeFromV
=
{
BottomMargin
:
0x00
,
InsideMargin
:
0x01
,
...
...
word/Editor/Serialize2.js
View file @
01351811
...
...
@@ -4270,18 +4270,18 @@ function BinaryDocumentTableWriter(memory, doc, oMapCommentId, oNumIdMap, copyPa
this
.
memory
.
WriteByte
(
c_oSerPropLenType
.
Variable
);
this
.
bs
.
WriteItemWithLength
(
function
(){
oThis
.
WriteSimplePos
(
img
.
SimplePos
);});
}
//
if(null != img.SizeRelH)
//
{
//
this.memory.WriteByte(c_oSerImageType2.SizeRelH);
//
this.memory.WriteByte(c_oSerPropLenType.Variable);
//
this.bs.WriteItemWithLength(function(){oThis.WriteSizeRelHV(img.SizeRelH);});
//
}
//
if(null != img.SizeRelV)
//
{
//
this.memory.WriteByte(c_oSerImageType2.SizeRelV);
//
this.memory.WriteByte(c_oSerPropLenType.Variable);
//
this.bs.WriteItemWithLength(function(){oThis.WriteSizeRelHV(img.SizeRelV);});
//
}
if
(
null
!=
img
.
SizeRelH
)
{
this
.
memory
.
WriteByte
(
c_oSerImageType2
.
SizeRelH
);
this
.
memory
.
WriteByte
(
c_oSerPropLenType
.
Variable
);
this
.
bs
.
WriteItemWithLength
(
function
(){
oThis
.
WriteSizeRelHV
(
img
.
SizeRelH
);});
}
if
(
null
!=
img
.
SizeRelV
)
{
this
.
memory
.
WriteByte
(
c_oSerImageType2
.
SizeRelV
);
this
.
memory
.
WriteByte
(
c_oSerPropLenType
.
Variable
);
this
.
bs
.
WriteItemWithLength
(
function
(){
oThis
.
WriteSizeRelHV
(
img
.
SizeRelV
);});
}
switch
(
img
.
wrappingType
)
{
case
WRAPPING_TYPE_NONE
:
...
...
@@ -4403,10 +4403,10 @@ function BinaryDocumentTableWriter(memory, doc, oMapCommentId, oNumIdMap, copyPa
this
.
memory
.
WriteByte
(
c_oSerPropLenType
.
Byte
);
this
.
memory
.
WriteByte
(
SizeRelHV
.
RelativeFrom
);
}
if
(
null
!=
SizeRelHV
.
P
c
t
)
{
if
(
null
!=
SizeRelHV
.
P
ercen
t
)
{
this
.
memory
.
WriteByte
(
c_oSerSizeRelHV
.
Pct
);
this
.
memory
.
WriteByte
(
c_oSerPropLenType
.
Double
);
this
.
memory
.
WriteDouble
(
SizeRelHV
.
Pct
);
this
.
memory
.
WriteDouble
(
(
SizeRelHV
.
Percent
*
100
)
>>
0
);
}
}
this
.
WriteSimplePos
=
function
(
oSimplePos
)
...
...
@@ -8720,19 +8720,19 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow
}
else
if
(
c_oSerImageType2
.
SizeRelH
===
type
)
{
var
oNewSizeRel
=
{
RelativeFrom
:
null
,
P
c
t
:
null
};
var
oNewSizeRel
=
{
RelativeFrom
:
null
,
P
ercen
t
:
null
};
res
=
this
.
bcr
.
Read2
(
length
,
function
(
t
,
l
){
return
oThis
.
ReadSizeRelHV
(
t
,
l
,
oNewSizeRel
);
});
//oParaDrawing.SizeRelH = oNewSizeRel
;
oParaDrawing
.
SetSizeRelH
(
oNewSizeRel
)
;
}
else
if
(
c_oSerImageType2
.
SizeRelV
===
type
)
{
var
oNewSizeRel
=
{
RelativeFrom
:
null
,
P
c
t
:
null
};
var
oNewSizeRel
=
{
RelativeFrom
:
null
,
P
ercen
t
:
null
};
res
=
this
.
bcr
.
Read2
(
length
,
function
(
t
,
l
){
return
oThis
.
ReadSizeRelHV
(
t
,
l
,
oNewSizeRel
);
});
//oParaDrawing.SizeRelV = oNewSizeRel
;
oParaDrawing
.
SetSizeRelV
(
oNewSizeRel
)
;
}
else
if
(
c_oSerImageType2
.
WrapSquare
===
type
)
{
...
...
@@ -8833,7 +8833,7 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow
if
(
c_oSerSizeRelHV
.
RelativeFrom
===
type
)
{
SizeRel
.
RelativeFrom
=
this
.
stream
.
GetUChar
();
}
else
if
(
c_oSerSizeRelHV
.
Pct
===
type
)
{
SizeRel
.
P
ct
=
this
.
bcr
.
ReadDouble
()
;
SizeRel
.
P
ercent
=
this
.
bcr
.
ReadDouble
()
/
100.0
;
}
else
res
=
c_oSerConstants
.
ReadUnknown
;
...
...
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