Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
2a649539
Kaydet (Commit)
2a649539
authored
Haz 10, 2014
tarafından
Jan Holesovsky
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
MetafileXmlDump: No need to specify the stream, simplify the API.
Change-Id: Ia08f67e359bbd26cefdba8661f0b0c4ae2147382
üst
0048709c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
33 deletions
+40
-33
mtfxmldump.hxx
include/test/mtfxmldump.hxx
+10
-3
xmltesttools.hxx
include/test/xmltesttools.hxx
+4
-1
mtfxmldump.cxx
test/source/mtfxmldump.cxx
+20
-5
wmfimporttest.cxx
vcl/qa/cppunit/wmf/wmfimporttest.cxx
+6
-24
No files found.
include/test/mtfxmldump.hxx
Dosyayı görüntüle @
2a649539
...
@@ -13,23 +13,30 @@
...
@@ -13,23 +13,30 @@
#include <sal/config.h>
#include <sal/config.h>
#include <test/testdllapi.hxx>
#include <test/testdllapi.hxx>
#include <libxml/tree.h>
#include <vcl/gdimtf.hxx>
#include <vcl/gdimtf.hxx>
#include <vector>
#include <vector>
class
OOO_DLLPUBLIC_TEST
MetafileXmlDump
class
OOO_DLLPUBLIC_TEST
MetafileXmlDump
{
{
std
::
vector
<
bool
>
maFilter
;
std
::
vector
<
bool
>
maFilter
;
SvStream
&
mrStream
;
public
:
public
:
MetafileXmlDump
(
SvStream
&
rStream
);
MetafileXmlDump
();
virtual
~
MetafileXmlDump
();
virtual
~
MetafileXmlDump
();
void
filterActionType
(
const
sal_uInt16
nActionType
,
bool
bShouldFilter
);
void
filterActionType
(
const
sal_uInt16
nActionType
,
bool
bShouldFilter
);
void
filterAllActionTypes
();
void
filterAllActionTypes
();
void
filterNoneActionTypes
();
void
filterNoneActionTypes
();
void
dump
(
GDIMetaFile
&
rMetaFile
);
/** The actual result that will be used for testing.
This function normally uses a SvMemoryStream for its operation; but
can use a physical file when a filename is specified in
pTempStreamName - this is useful when creating the test, to dump the
file for examination.
*/
xmlDocPtr
dumpAndParse
(
GDIMetaFile
&
rMetaFile
,
const
OUString
&
rTempStreamName
=
OUString
());
};
};
#endif
#endif
...
...
include/test/xmltesttools.hxx
Dosyayı görüntüle @
2a649539
...
@@ -27,12 +27,15 @@
...
@@ -27,12 +27,15 @@
class
OOO_DLLPUBLIC_TEST
XmlTestTools
class
OOO_DLLPUBLIC_TEST
XmlTestTools
{
{
public
:
/// Return xmlDocPtr representation of the XML stream read from pStream.
static
xmlDocPtr
parseXmlStream
(
SvStream
*
pStream
);
protected
:
protected
:
XmlTestTools
();
XmlTestTools
();
virtual
~
XmlTestTools
();
virtual
~
XmlTestTools
();
htmlDocPtr
parseXml
(
utl
::
TempFile
&
aTempFile
);
htmlDocPtr
parseXml
(
utl
::
TempFile
&
aTempFile
);
htmlDocPtr
parseXmlStream
(
SvStream
*
pStream
);
virtual
void
registerNamespaces
(
xmlXPathContextPtr
&
pXmlXpathCtx
);
virtual
void
registerNamespaces
(
xmlXPathContextPtr
&
pXmlXpathCtx
);
...
...
test/source/mtfxmldump.cxx
Dosyayı görüntüle @
2a649539
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
*/
*/
#include <test/mtfxmldump.hxx>
#include <test/mtfxmldump.hxx>
#include <test/xmltesttools.hxx>
#include <test/xmlwriter.hxx>
#include <test/xmlwriter.hxx>
#include <vcl/metaact.hxx>
#include <vcl/metaact.hxx>
...
@@ -137,9 +138,8 @@ OUString convertLineStyleToString(LineStyle eAlign)
...
@@ -137,9 +138,8 @@ OUString convertLineStyleToString(LineStyle eAlign)
}
// anonymous namespace
}
// anonymous namespace
MetafileXmlDump
::
MetafileXmlDump
(
SvStream
&
rStream
)
:
MetafileXmlDump
::
MetafileXmlDump
()
:
maFilter
(
512
,
false
),
maFilter
(
512
,
false
)
mrStream
(
rStream
)
{}
{}
MetafileXmlDump
::~
MetafileXmlDump
()
MetafileXmlDump
::~
MetafileXmlDump
()
...
@@ -160,9 +160,16 @@ void MetafileXmlDump::filterNoneActionTypes()
...
@@ -160,9 +160,16 @@ void MetafileXmlDump::filterNoneActionTypes()
maFilter
.
assign
(
512
,
false
);
maFilter
.
assign
(
512
,
false
);
}
}
void
MetafileXmlDump
::
dump
(
GDIMetaFile
&
rMetaFil
e
)
xmlDocPtr
MetafileXmlDump
::
dumpAndParse
(
GDIMetaFile
&
rMetaFile
,
const
OUString
&
rTempStreamNam
e
)
{
{
xmlOutputBufferPtr
xmlOutBuffer
=
xmlOutputBufferCreateIO
(
lclWriteCallback
,
lclCloseCallback
,
&
mrStream
,
NULL
);
SvStream
*
pStream
=
NULL
;
if
(
rTempStreamName
.
isEmpty
())
pStream
=
new
SvMemoryStream
();
else
pStream
=
new
SvFileStream
(
rTempStreamName
,
STREAM_STD_READWRITE
);
xmlOutputBufferPtr
xmlOutBuffer
=
xmlOutputBufferCreateIO
(
lclWriteCallback
,
lclCloseCallback
,
pStream
,
NULL
);
xmlTextWriterPtr
xmlWriter
=
xmlNewTextWriter
(
xmlOutBuffer
);
xmlTextWriterPtr
xmlWriter
=
xmlNewTextWriter
(
xmlOutBuffer
);
xmlTextWriterSetIndent
(
xmlWriter
,
1
);
xmlTextWriterSetIndent
(
xmlWriter
,
1
);
...
@@ -392,6 +399,14 @@ void MetafileXmlDump::dump(GDIMetaFile& rMetaFile)
...
@@ -392,6 +399,14 @@ void MetafileXmlDump::dump(GDIMetaFile& rMetaFile)
aWriter
.
endElement
();
aWriter
.
endElement
();
aWriter
.
endDocument
();
aWriter
.
endDocument
();
pStream
->
Seek
(
STREAM_SEEK_TO_BEGIN
);
xmlDocPtr
pDoc
=
XmlTestTools
::
parseXmlStream
(
pStream
);
delete
pStream
;
return
pDoc
;
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
vcl/qa/cppunit/wmf/wmfimporttest.cxx
Dosyayı görüntüle @
2a649539
...
@@ -57,16 +57,10 @@ void WmfTest::testNonPlaceableWmf()
...
@@ -57,16 +57,10 @@ void WmfTest::testNonPlaceableWmf()
GDIMetaFile
aGDIMetaFile
;
GDIMetaFile
aGDIMetaFile
;
ReadWindowMetafile
(
aFileStream
,
aGDIMetaFile
);
ReadWindowMetafile
(
aFileStream
,
aGDIMetaFile
);
SvMemoryStream
aStream
;
MetafileXmlDump
dumper
;
MetafileXmlDump
dumper
(
aStream
);
dumper
.
filterAllActionTypes
();
dumper
.
filterAllActionTypes
();
dumper
.
filterActionType
(
META_POLYLINE_ACTION
,
false
);
dumper
.
filterActionType
(
META_POLYLINE_ACTION
,
false
);
dumper
.
dump
(
aGDIMetaFile
);
xmlDocPtr
pDoc
=
dumper
.
dumpAndParse
(
aGDIMetaFile
);
aStream
.
Seek
(
STREAM_SEEK_TO_BEGIN
);
xmlDocPtr
pDoc
=
parseXmlStream
(
&
aStream
);
CPPUNIT_ASSERT
(
pDoc
);
CPPUNIT_ASSERT
(
pDoc
);
...
@@ -92,16 +86,10 @@ void WmfTest::testSine()
...
@@ -92,16 +86,10 @@ void WmfTest::testSine()
GDIMetaFile
aGDIMetaFile
;
GDIMetaFile
aGDIMetaFile
;
ReadWindowMetafile
(
aFileStream
,
aGDIMetaFile
);
ReadWindowMetafile
(
aFileStream
,
aGDIMetaFile
);
SvMemoryStream
aStream
;
MetafileXmlDump
dumper
;
MetafileXmlDump
dumper
(
aStream
);
dumper
.
filterAllActionTypes
();
dumper
.
filterAllActionTypes
();
dumper
.
filterActionType
(
META_ISECTRECTCLIPREGION_ACTION
,
false
);
dumper
.
filterActionType
(
META_ISECTRECTCLIPREGION_ACTION
,
false
);
dumper
.
dump
(
aGDIMetaFile
);
xmlDocPtr
pDoc
=
dumper
.
dumpAndParse
(
aGDIMetaFile
);
aStream
.
Seek
(
STREAM_SEEK_TO_BEGIN
);
xmlDocPtr
pDoc
=
parseXmlStream
(
&
aStream
);
CPPUNIT_ASSERT
(
pDoc
);
CPPUNIT_ASSERT
(
pDoc
);
...
@@ -122,16 +110,10 @@ void WmfTest::testEmfProblem()
...
@@ -122,16 +110,10 @@ void WmfTest::testEmfProblem()
GDIMetaFile
aGDIMetaFile
;
GDIMetaFile
aGDIMetaFile
;
ReadWindowMetafile
(
aFileStream
,
aGDIMetaFile
);
ReadWindowMetafile
(
aFileStream
,
aGDIMetaFile
);
SvMemoryStream
aStream
;
MetafileXmlDump
dumper
;
MetafileXmlDump
dumper
(
aStream
);
dumper
.
filterAllActionTypes
();
dumper
.
filterAllActionTypes
();
dumper
.
filterActionType
(
META_ISECTRECTCLIPREGION_ACTION
,
false
);
dumper
.
filterActionType
(
META_ISECTRECTCLIPREGION_ACTION
,
false
);
dumper
.
dump
(
aGDIMetaFile
);
xmlDocPtr
pDoc
=
dumper
.
dumpAndParse
(
aGDIMetaFile
);
aStream
.
Seek
(
STREAM_SEEK_TO_BEGIN
);
xmlDocPtr
pDoc
=
parseXmlStream
(
&
aStream
);
CPPUNIT_ASSERT
(
pDoc
);
CPPUNIT_ASSERT
(
pDoc
);
...
...
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