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
672f2ed3
Commit
672f2ed3
authored
May 10, 2016
by
ElenaSubbotina
Committed by
Alexander Trofimov
May 21, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Svm метафайлы ...
parent
b31d554a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
45 deletions
+24
-45
DesktopEditor/raster/Metafile/StarView/SvmFile.cpp
DesktopEditor/raster/Metafile/StarView/SvmFile.cpp
+10
-28
DesktopEditor/raster/Metafile/StarView/SvmFile.h
DesktopEditor/raster/Metafile/StarView/SvmFile.h
+4
-7
DesktopEditor/raster/Metafile/StarView/SvmPlayer.cpp
DesktopEditor/raster/Metafile/StarView/SvmPlayer.cpp
+9
-9
DesktopEditor/raster/Metafile/TestMain.cpp
DesktopEditor/raster/Metafile/TestMain.cpp
+1
-1
No files found.
DesktopEditor/raster/Metafile/StarView/SvmFile.cpp
View file @
672f2ed3
...
...
@@ -152,10 +152,8 @@ void CSvmFile::PlayMetaFile()
case
META_TRANSPARENT_ACTION
:
Read_META_TRANSPARENT
();
break
;
case
META_FLOATTRANSPARENT_ACTION
:
Read_META_FLOATTRANSPARENT
();
break
;
case
META_ISECTRECTCLIPREGION_ACTION
:
Read_META_SECTRECTCLIPREGION
();
break
;
case
META_ISECTREGIONCLIPREGION_ACTION
:
Read_META_SECTREGIONCLIPREGION
();
break
;
case
META_LAYOUTMODE_ACTION
:
Read_META_LAYOUTMODE
();
break
;
case
META_ISECTRECTCLIPREGION_ACTION
:
Read_META_SECTRECTCLIPREGION
();
break
;
case
META_ISECTREGIONCLIPREGION_ACTION
:
Read_META_SECTREGIONCLIPREGION
();
break
;
case
META_ROUNDRECT_ACTION
:
case
META_ELLIPSE_ACTION
:
...
...
@@ -177,13 +175,13 @@ void CSvmFile::PlayMetaFile()
case
META_MOVECLIPREGION_ACTION
:
case
META_EPS_ACTION
:
case
META_REFPOINT_ACTION
:
case
META_LAYOUTMODE_ACTION
:
case
META_OVERLINECOLOR_ACTION
:
case
META_RENDERGRAPHIC_ACTION
:
case
META_COMMENT_ACTION
:
case
META_NULL_ACTION
:
default:
m_unRecordPos
=
m_unRecordPos
;
break
;
}
...
...
@@ -193,7 +191,7 @@ void CSvmFile::PlayMetaFile()
m_oStream
.
Skip
(
need_skip
);
#ifdef _DEBUG
if
(
100
<=
actionType
&&
actionType
<=
META_LAST_ACTION
&&
need_skip
!=
0
&&
!
m_pOutput
)
if
(
100
<=
actionType
&&
actionType
<=
META_LAST_ACTION
&&
need_skip
>
0
&&
!
m_pOutput
)
{
std
::
wstring
name
=
actionNames
[
actionType
-
99
].
actionName
;
...
...
@@ -220,7 +218,7 @@ void CSvmFile::Read_META_LINE()
CSvmPen
*
last_pen
=
dynamic_cast
<
CSvmPen
*>
(
m_oPlayer
.
GetLastObject
(
SVM_OBJECT_PEN
));
if
(
last_pen
)
{
last_pen
->
Width
=
line_info
.
width
/
(
m_oPlayer
.
GetDC
()
->
m_dPixelWidth
*
2
)
;
last_pen
->
Width
=
line_info
.
width
;
switch
(
line_info
.
style
)
{
...
...
@@ -252,12 +250,12 @@ void CSvmFile::Read_SVM_HEADER()
m_pDC
->
SetMapMode
(
m_oHeader
.
mapMode
,
true
);
m_oBoundingBox
=
m_oHeader
.
boundRect
;
m_oBoundingBox
.
nRight
*=
m_pDC
->
m_dPixelWidthPrefered
*
2
;
m_oBoundingBox
.
nRight
*=
m_pDC
->
m_dPixelWidthPrefered
*
2
;
m_oBoundingBox
.
nBottom
*=
m_pDC
->
m_dPixelHeightPrefered
*
2
;
m_oBoundingBox
.
nLeft
*=
m_pDC
->
m_dPixelWidthPrefered
;
m_oBoundingBox
.
nTop
*=
m_pDC
->
m_dPixelHeightPrefered
;
//
????
*2 ради повышения качества картинки (если в векторе насамом деле растр - сментся на растровые размеры ниже
m_oBoundingBox
.
nLeft
*=
m_pDC
->
m_dPixelWidthPrefered
*
2
;
m_oBoundingBox
.
nTop
*=
m_pDC
->
m_dPixelHeightPrefered
*
2
;
// *2 ради повышения качества картинки (если в векторе насамом деле растр - сментся на растровые размеры ниже
m_bFirstPoint
=
true
;
}
void
CSvmFile
::
Read_META_POLYLINE
()
...
...
@@ -273,7 +271,7 @@ void CSvmFile::Read_META_POLYLINE()
CSvmPen
*
last_pen
=
dynamic_cast
<
CSvmPen
*>
(
m_oPlayer
.
GetLastObject
(
SVM_OBJECT_PEN
));
if
(
last_pen
)
{
last_pen
->
Width
=
line_info
.
width
/
(
m_oPlayer
.
GetDC
()
->
m_dPixelWidth
*
2
)
;
last_pen
->
Width
=
line_info
.
width
;
switch
(
line_info
.
style
)
{
...
...
@@ -285,15 +283,11 @@ void CSvmFile::Read_META_POLYLINE()
if
(
m_currentActionVersion
>=
3
)
{
unsigned
int
tmp1
;
unsigned
short
tmp2
;
unsigned
char
bHasPolyFlags
=
0
;
m_oStream
>>
bHasPolyFlags
;
if
(
bHasPolyFlags
)
{
m_oStream
>>
tmp1
>>
tmp2
;
}
bHasPolyFlags
=
bHasPolyFlags
;
//read flags
//enum PolyFlags
//{
...
...
@@ -425,15 +419,6 @@ void CSvmFile::Read_META_SETMAPMODE()
UpdateOutputDC
();
}
void
CSvmFile
::
Read_META_LAYOUTMODE
()
{
unsigned
int
textLayputMode
;
m_oStream
>>
textLayputMode
;
UpdateOutputDC
();
}
void
CSvmFile
::
Read_META_STRETCHTEXT
()
{
std
::
wstring
sText
;
...
...
@@ -502,7 +487,6 @@ void CSvmFile::Read_META_TEXT()
void
CSvmFile
::
Read_META_ARRAYTEXT
()
{
std
::
wstring
sText
;
std
::
wstring
sText2
;
TSvmPoint
startPoint
;
m_oStream
>>
startPoint
;
...
...
@@ -545,8 +529,6 @@ void CSvmFile::Read_META_ARRAYTEXT()
m_oStream
>>
nTemp
;
tempBuffer
+=
(
wchar_t
)
nTemp
;
}
sText2
=
tempBuffer
;
}
DrawText
(
sText
,
sText
.
length
(),
startPoint
.
x
,
startPoint
.
y
,
mpDXAry
);
...
...
DesktopEditor/raster/Metafile/StarView/SvmFile.h
View file @
672f2ed3
...
...
@@ -49,6 +49,7 @@ class CSvmFile : virtual public IMetaFileBase
}
TRect
*
GetDCBounds
()
{
//if (m_oHeader.mapMode.isSimple)
if
(
m_pDC
->
m_oMapMode
.
isSimple
)
{
m_oDCRect
=
m_oBoundingBox
;
...
...
@@ -56,7 +57,6 @@ class CSvmFile : virtual public IMetaFileBase
}
else
{
m_oDCRect
=
m_oHeader
.
boundRect
;
return
&
m_oHeader
.
boundRect
;
}
}
...
...
@@ -199,8 +199,6 @@ class CSvmFile : virtual public IMetaFileBase
void
Read_META_SECTRECTCLIPREGION
();
void
Read_META_SECTREGIONCLIPREGION
();
void
Read_META_LAYOUTMODE
();
void
Read_META_STRETCHTEXT
();
void
Read_META_POLYPOLYGON
(
std
::
vector
<
TSvmPolygon
>
&
polygons
,
std
::
vector
<
TSvmPolygon
>
&
complexPolygons
);
...
...
@@ -213,13 +211,12 @@ class CSvmFile : virtual public IMetaFileBase
}
void
TranslatePoint
(
int
nX
,
int
nY
,
double
&
dX
,
double
&
dY
)
{
if
(
m_pDC
->
m_oMapMode
.
isSimple
)
return
;
if
(
m_pDC
->
m_oMapMode
.
isSimple
)
return
;
//TSvmWindow* pWindow = m_pDC->GetWindow();
//TSvmWindow* pViewport = m_pDC->GetViewport();
//
dX = (double)(nX) * m_pDC->m_dPixelWidth ;
//
dY = (double)(nY) * m_pDC->m_dPixelHeight ;
dX
=
(
double
)(
nX
)
*
m_pDC
->
m_dPixelWidth
;
dY
=
(
double
)(
nY
)
*
m_pDC
->
m_dPixelHeight
;
//dX = (double)((double)(nX - pWindow->lX) * m_pDC->m_dPixelWidth) + pViewport->lX;
//dY = (double)((double)(nY - pWindow->lY) * m_pDC->m_dPixelHeight) + pViewport->lY;
...
...
DesktopEditor/raster/Metafile/StarView/SvmPlayer.cpp
View file @
672f2ed3
...
...
@@ -464,49 +464,49 @@ void CSvmDC::SetMapMode(TSvmMapMode & mapMode, bool prefered )
{
case
MAP_MM
:
// 1 unit = 1 mm
{
dPixel
=
1.
*
96
/
25.4
;
dPixel
=
1.
*
72
/
25.4
;
SetPixelWidth
(
dPixel
);
SetPixelHeight
(
dPixel
);
}
break
;
case
MAP_CM
:
// 1 unit = 1 cm = 10 mm
{
dPixel
=
10.
*
96
/
25.4
;
dPixel
=
10.
*
72
/
25.4
;
SetPixelWidth
(
dPixel
);
SetPixelHeight
(
dPixel
);
}
break
;
case
MAP_100TH_MM
:
{
dPixel
=
1.
*
96
/
2540.
;
dPixel
=
1.
*
72
/
2540.
;
SetPixelWidth
(
dPixel
);
SetPixelHeight
(
dPixel
);
}
break
;
case
MAP_10TH_MM
:
{
dPixel
=
1.
*
96
/
254.
;
dPixel
=
1.
*
72
/
254.
;
SetPixelWidth
(
dPixel
);
SetPixelHeight
(
dPixel
);
}
break
;
case
MAP_1000TH_INCH
:
{
dPixel
=
1.
*
96
/
1000.
;
dPixel
=
1.
*
72
/
1000.
;
SetPixelWidth
(
dPixel
);
SetPixelHeight
(
dPixel
);
}
break
;
case
MAP_100TH_INCH
:
{
dPixel
=
1.
*
96
/
100.
;
dPixel
=
1.
*
72
/
100.
;
SetPixelWidth
(
dPixel
);
SetPixelHeight
(
dPixel
);
}
break
;
case
MAP_10TH_INCH
:
{
dPixel
=
1.
*
96
/
10.
;
dPixel
=
1.
*
72
/
10.
;
SetPixelWidth
(
dPixel
);
SetPixelHeight
(
dPixel
);
}
break
;
case
MAP_INCH
:
// 1 unit = 1 inch
{
dPixel
=
1.
*
96
;
dPixel
=
1.
*
72
;
SetPixelWidth
(
dPixel
);
SetPixelHeight
(
dPixel
);
}
break
;
...
...
@@ -522,7 +522,7 @@ void CSvmDC::SetMapMode(TSvmMapMode & mapMode, bool prefered )
}
break
;
case
MAP_PIXEL
:
{
dPixel
=
0.5
;
// /
96
.; //todooo
dPixel
=
0.5
;
// /
72
.; //todooo
SetPixelWidth
(
dPixel
);
SetPixelHeight
(
dPixel
);
}
break
;
...
...
DesktopEditor/raster/Metafile/TestMain.cpp
View file @
672f2ed3
...
...
@@ -78,7 +78,7 @@ void main()
oFonts
.
Initialize
();
CMetaFile
oMetaFile
(
&
oFonts
);
ConvertFolder
(
oMetaFile
,
L"D://test//_svm//
4
//"
,
c_lMetaSvm
);
ConvertFolder
(
oMetaFile
,
L"D://test//_svm//
5
//"
,
c_lMetaSvm
);
//ConvertFolder(oMetaFile, L"D://Test Files//Wmf//Test//", c_lMetaWmf);
//ConvertFolder(oMetaFile, L"D://Test Files//Emf//Temp//", c_lMetaEmf);
...
...
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