Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
onlyoffice_core
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
onlyoffice_core
Commits
45231b82
Commit
45231b82
authored
Feb 10, 2017
by
ElenaSubbotina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RtfFormat - fix croping image, ...
parent
e0591675
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
338 additions
and
238 deletions
+338
-238
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXDrawingGraphicReader.cpp
...le/RtfFormatLib/source/Reader/OOXDrawingGraphicReader.cpp
+1
-1
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXPictureAnchorReader.h
...fFile/RtfFormatLib/source/Reader/OOXPictureAnchorReader.h
+0
-14
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXPictureInlineReader.h
...fFile/RtfFormatLib/source/Reader/OOXPictureInlineReader.h
+0
-14
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXShapeReader.cpp
...ficeRtfFile/RtfFormatLib/source/Reader/OOXShapeReader.cpp
+167
-41
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXShapeReader.h
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXShapeReader.h
+7
-6
ASCOfficeRtfFile/RtfFormatLib/source/RtfShape.cpp
ASCOfficeRtfFile/RtfFormatLib/source/RtfShape.cpp
+3
-2
Common/DocxFormat/Source/Common/SimpleTypes_Shared.h
Common/DocxFormat/Source/Common/SimpleTypes_Shared.h
+1
-1
Common/DocxFormat/Source/DocxFormat/Drawing/DrawingEffects.h
Common/DocxFormat/Source/DocxFormat/Drawing/DrawingEffects.h
+159
-159
No files found.
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXDrawingGraphicReader.cpp
View file @
45231b82
...
...
@@ -85,7 +85,7 @@ int OOXGraphicReader::Parse( ReaderParameter oParam , RtfShapePtr & pOutput)
OOX
::
Drawing
::
CPicture
*
picture
=
dynamic_cast
<
OOX
::
Drawing
::
CPicture
*>
(
m_ooxGraphic
->
m_arrItems
[
i
]);
if
(
picture
)
if
(
OOXShapeReader
::
Parse
(
oParam
,
&
picture
->
m_oBlipFill
,
pOutput
))
if
(
OOXShapeReader
::
Parse
(
oParam
,
pOutput
,
&
picture
->
m_oBlipFill
))
return
1
;
}
}
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXPictureAnchorReader.h
View file @
45231b82
...
...
@@ -304,20 +304,6 @@ public:
result
=
oGraphicReader
.
Parse
(
oParam
,
pOutput
);
}
//изменяем scale в соответсявии с выходным размером
if
(
pOutput
->
m_oPicture
)
{
if
(
PROP_DEF
!=
nWidth
&&
PROP_DEF
!=
pOutput
->
m_oPicture
->
m_nWidthGoal
)
{
int
nNewScale
=
(
int
)(
100
*
(
1.0
*
nWidth
/
pOutput
->
m_oPicture
->
m_nWidthGoal
));
pOutput
->
m_oPicture
->
m_dScaleX
=
nNewScale
;
}
if
(
PROP_DEF
!=
nHeight
&&
PROP_DEF
!=
pOutput
->
m_oPicture
->
m_nHeightGoal
)
{
int
nNewScale
=
(
int
)(
100
*
(
1.0
*
nHeight
/
pOutput
->
m_oPicture
->
m_nHeightGoal
));
pOutput
->
m_oPicture
->
m_dScaleY
=
nNewScale
;
}
}
if
(
PROP_DEF
==
pOutput
->
m_nBottom
&&
pOutput
->
m_nTop
!=
PROP_DEF
)
{
pOutput
->
m_nBottom
=
pOutput
->
m_nTop
+
nHeight
;
...
...
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXPictureInlineReader.h
View file @
45231b82
...
...
@@ -85,20 +85,6 @@ public:
result
=
oGraphicReader
.
Parse
(
oParam
,
pOutput
);
}
//изменяем scale в соответсявии с выходным размером
if
(
pOutput
->
m_oPicture
)
{
if
(
PROP_DEF
!=
nWidth
&&
PROP_DEF
!=
pOutput
->
m_oPicture
->
m_nWidthGoal
)
{
double
dNewScale
=
100
*
(
1.0
*
nWidth
/
pOutput
->
m_oPicture
->
m_nWidthGoal
)
;
pOutput
->
m_oPicture
->
m_dScaleX
=
dNewScale
;
}
if
(
PROP_DEF
!=
nHeight
&&
PROP_DEF
!=
pOutput
->
m_oPicture
->
m_nHeightGoal
)
{
double
dNewScale
=
100
*
(
1.0
*
nHeight
/
pOutput
->
m_oPicture
->
m_nHeightGoal
);
pOutput
->
m_oPicture
->
m_dScaleY
=
dNewScale
;
}
}
return
result
;
}
};
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXShapeReader.cpp
View file @
45231b82
This diff is collapsed.
Click to expand it.
ASCOfficeRtfFile/RtfFormatLib/source/Reader/OOXShapeReader.h
View file @
45231b82
...
...
@@ -64,9 +64,10 @@ public:
bool
Parse
(
ReaderParameter
oParam
,
RtfShapePtr
&
oOutput
);
bool
ParseVmlChild
(
ReaderParameter
oParam
,
RtfShapePtr
&
oOutput
);
bool
ParseVml
(
ReaderParameter
oParam
,
RtfShapePtr
&
oOutput
);
void
ParseAdjustment
(
RtfShape
&
oShape
,
std
::
wstring
sAdjustment
);
static
bool
Parse
(
ReaderParameter
oParam
,
OOX
::
Drawing
::
CBlipFillProperties
*
oox_bitmap_fill
,
RtfShapePtr
&
pOutput
);
static
bool
Parse
(
ReaderParameter
oParam
,
RtfShapePtr
&
pOutput
,
OOX
::
Drawing
::
CBlipFillProperties
*
oox_bitmap_fill
);
private:
bool
Parse
(
ReaderParameter
oParam
,
int
indexSchemeColor
,
BYTE
&
ucA
,
BYTE
&
ucG
,
BYTE
&
ucB
,
BYTE
&
ucR
);
...
...
@@ -75,12 +76,12 @@ private:
void
Parse
(
ReaderParameter
oParam
,
OOX
::
Drawing
::
Colors
::
CColorTransform
*
oox_ScrgbClr
,
unsigned
int
&
nColor
,
_CP_OPT
(
double
)
&
opacity
);
void
Parse
(
ReaderParameter
oParam
,
OOX
::
Drawing
::
CSolidColorFillProperties
*
oox_solid_fill
,
unsigned
int
&
nColor
,
_CP_OPT
(
double
)
&
opacity
);
void
Parse
(
ReaderParameter
oParam
,
OOX
::
Drawing
::
CLineProperties
*
oox_line_prop
,
RtfShapePtr
&
pOutput
);
void
Parse
(
ReaderParameter
oParam
,
RtfShapePtr
&
pOutput
,
OOX
::
Drawing
::
CStyleMatrixReference
*
style_matrix_ref
);
void
Parse
(
ReaderParameter
oParam
,
RtfShapePtr
&
pOutput
,
OOX
::
Drawing
::
CLineProperties
*
oox_line_prop
,
std
::
wstring
*
change_sheme_color
=
NULL
);
void
Parse
(
ReaderParameter
oParam
,
OOX
::
Drawing
::
CGradientFillProperties
*
oox_grad_fill
,
RtfShapePtr
&
pOutput
);
void
Parse
(
ReaderParameter
oParam
,
OOX
::
Drawing
::
CPatternFillProperties
*
oox_pattern_fill
,
RtfShapePtr
&
pOutput
);
void
Parse
(
ReaderParameter
oParam
,
OOX
::
Drawing
::
CSolidColorFillProperties
*
oox_solid_fill
,
RtfShapePtr
&
pOutput
);
void
Parse
(
ReaderParameter
oParam
,
RtfShapePtr
&
pOutput
,
OOX
::
Drawing
::
CGradientFillProperties
*
oox_grad_fill
,
std
::
wstring
*
change_sheme_color
=
NULL
);
void
Parse
(
ReaderParameter
oParam
,
RtfShapePtr
&
pOutput
,
OOX
::
Drawing
::
CPatternFillProperties
*
oox_pattern_fill
,
std
::
wstring
*
change_sheme_color
=
NULL
);
void
Parse
(
ReaderParameter
oParam
,
RtfShapePtr
&
pOutput
,
OOX
::
Drawing
::
CSolidColorFillProperties
*
oox_solid_fill
,
std
::
wstring
*
change_sheme_color
=
NULL
);
//---------------------------------------------------------------------------
OOX
::
Vml
::
CVmlCommonElements
*
m_vmlElement
;
OOX
::
WritingElementWithChilds
<
OOX
::
WritingElement
>
*
m_arrElement
;
...
...
ASCOfficeRtfFile/RtfFormatLib/source/RtfShape.cpp
View file @
45231b82
...
...
@@ -360,7 +360,7 @@ std::wstring RtfShape::RenderToRtf(RenderParameter oRenderParameter)
sResult
+=
m_oPicture
->
RenderToRtf
(
oRenderParameter
);
sResult
+=
L"}}"
;
}
else
if
(
m_nFillType
==
1
||
m_nFillType
==
2
||
m_nFillType
==
9
)
else
if
(
m_nFillType
==
1
||
m_nFillType
==
2
||
m_nFillType
==
3
||
m_nFillType
==
9
)
{
sResult
+=
L"{
\\
sp{
\\
sn fillType}{
\\
sv 2}}"
;
sResult
+=
L"{
\\
sp{
\\
sn fillBlip}{
\\
sv "
;
...
...
@@ -846,7 +846,8 @@ std::wstring RtfShape::RenderToOOXBegin(RenderParameter oRenderParameter)
//sStyle += L"right: " + std::to_wstring() + L";" , m_nRelRight);
sStyle
+=
L"width: "
+
std
::
to_wstring
(
nWidth
)
+
L";height: "
+
std
::
to_wstring
(
nHeight
)
+
L";"
;
}
else
if
(
0
!=
m_oPicture
&&
PROP_DEF
!=
m_oPicture
->
m_nWidthGoal
&&
PROP_DEF
!=
m_oPicture
->
m_nHeightGoal
&&
PROP_DEF
!=
(
int
)
m_oPicture
->
m_dScaleX
&&
PROP_DEF
!=
(
int
)
m_oPicture
->
m_dScaleY
)
else
if
(
0
!=
m_oPicture
&&
PROP_DEF
!=
m_oPicture
->
m_nWidthGoal
&&
PROP_DEF
!=
m_oPicture
->
m_nHeightGoal
&&
PROP_DEF
!=
(
int
)
m_oPicture
->
m_dScaleX
&&
PROP_DEF
!=
(
int
)
m_oPicture
->
m_dScaleY
)
{
float
nWidth
=
(
int
)(
m_oPicture
->
m_nWidthGoal
*
m_oPicture
->
m_dScaleX
/
100.
);
if
(
PROP_DEF
!=
m_oPicture
->
m_nCropL
)
...
...
Common/DocxFormat/Source/Common/SimpleTypes_Shared.h
View file @
45231b82
...
...
@@ -314,7 +314,7 @@ namespace SimpleTypes
bool
bResult
=
true
;
unResult
=
0
;
for
(
size_t
nIndex
=
sValue
.
length
()
-
1
,
nMult
=
0
;
nIndex
>=
0
;
nIndex
--
,
nMult
+=
4
)
for
(
int
nIndex
=
(
int
)
sValue
.
length
()
-
1
,
nMult
=
0
;
nIndex
>=
0
;
nIndex
--
,
nMult
+=
4
)
{
unResult
+=
HexToInt
(
(
int
)
sValue
[
nIndex
],
bResult
)
<<
nMult
;
}
...
...
Common/DocxFormat/Source/DocxFormat/Drawing/DrawingEffects.h
View file @
45231b82
This diff is collapsed.
Click to expand it.
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