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
68dd2bf2
Commit
68dd2bf2
authored
Apr 04, 2016
by
Sergey Luzyanin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Относительные размеры шейпов
parent
6cc49fd9
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
74 additions
and
54 deletions
+74
-54
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
+44
-24
word/Editor/Serialize2.js
word/Editor/Serialize2.js
+19
-19
No files found.
common/Drawings/Format/Shape.js
View file @
68dd2bf2
...
...
@@ -2566,6 +2566,7 @@ CShape.prototype =
var
oParentParagraph
=
oParaDrawing
.
Get_ParentParagraph
();
if
(
oParentParagraph
)
{
var
oSectPr
=
oParentParagraph
.
Get_SectPr
();
if
(
oSectPr
)
{
...
...
@@ -2573,23 +2574,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
;
...
...
@@ -2604,25 +2605,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 @
68dd2bf2
...
...
@@ -2372,8 +2372,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 @
68dd2bf2
...
...
@@ -435,6 +435,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 @
68dd2bf2
...
...
@@ -4294,18 +4294,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
:
...
...
@@ -4427,10 +4427,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
)
...
...
@@ -8744,19 +8744,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
)
{
...
...
@@ -8857,7 +8857,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