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
71457cb2
Kaydet (Commit)
71457cb2
authored
Haz 10, 2014
tarafından
Jan Holesovsky
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
pct import: Unit test for the clipping import fix.
Change-Id: I8f9df1d92c86c087e37f77209f413ff8c1c6358f
üst
ce90fa30
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
69 additions
and
2 deletions
+69
-2
clipping-problem.pct
filter/qa/cppunit/data/pict/clipping-problem.pct
+0
-0
filters-pict-test.cxx
filter/qa/cppunit/filters-pict-test.cxx
+34
-1
ipict.cxx
filter/source/graphicfilter/ipict/ipict.cxx
+10
-1
ipict.hxx
filter/source/graphicfilter/ipict/ipict.hxx
+25
-0
No files found.
filter/qa/cppunit/data/pict/clipping-problem.pct
0 → 100644
Dosyayı görüntüle @
71457cb2
File added
filter/qa/cppunit/filters-pict-test.cxx
Dosyayı görüntüle @
71457cb2
...
...
@@ -10,12 +10,17 @@
#include <unotest/filters-test.hxx>
#include <test/bootstrapfixture.hxx>
#include <vcl/FilterConfigItem.hxx>
#include <test/mtfxmldump.hxx>
#include <test/xmltesttools.hxx>
#include <tools/stream.hxx>
#include <vcl/graph.hxx>
#include <vcl/metaactiontypes.hxx>
#include <osl/file.hxx>
#include <osl/process.h>
#include "../../source/graphicfilter/ipict/ipict.hxx"
extern
"C"
{
SAL_DLLPUBLIC_EXPORT
bool
SAL_CALL
...
...
@@ -30,6 +35,7 @@ using namespace ::com::sun::star;
class
PictFilterTest
:
public
test
::
FiltersTest
,
public
test
::
BootstrapFixture
,
public
XmlTestTools
{
public
:
PictFilterTest
()
:
BootstrapFixture
(
true
,
false
)
{}
...
...
@@ -38,13 +44,21 @@ public:
const
OUString
&
rURL
,
const
OUString
&
,
unsigned
int
,
unsigned
int
,
unsigned
int
)
SAL_OVERRIDE
;
OUString
pictURL
()
{
return
getURLFromSrc
(
"/filter/qa/cppunit/data/pict/"
);
}
/**
* Ensure CVEs remain unbroken
*/
void
testCVEs
();
void
testDontClipTooMuch
();
CPPUNIT_TEST_SUITE
(
PictFilterTest
);
CPPUNIT_TEST
(
testCVEs
);
CPPUNIT_TEST
(
testDontClipTooMuch
);
CPPUNIT_TEST_SUITE_END
();
};
...
...
@@ -60,10 +74,29 @@ bool PictFilterTest::load(const OUString &,
void
PictFilterTest
::
testCVEs
()
{
testDir
(
OUString
(),
getURLFromSrc
(
"/filter/qa/cppunit/data/pict/"
),
pictURL
(
),
OUString
());
}
void
PictFilterTest
::
testDontClipTooMuch
()
{
SvFileStream
aFileStream
(
pictURL
()
+
"clipping-problem.pct"
,
STREAM_READ
);
GDIMetaFile
aGDIMetaFile
;
pict
::
ReadPictFile
(
aFileStream
,
aGDIMetaFile
);
MetafileXmlDump
dumper
;
dumper
.
filterAllActionTypes
();
dumper
.
filterActionType
(
META_CLIPREGION_ACTION
,
false
);
xmlDocPtr
pDoc
=
dumper
.
dumpAndParse
(
aGDIMetaFile
);
CPPUNIT_ASSERT
(
pDoc
);
assertXPath
(
pDoc
,
"/metafile/clipregion[5]"
,
"top"
,
"0"
);
assertXPath
(
pDoc
,
"/metafile/clipregion[5]"
,
"left"
,
"0"
);
assertXPath
(
pDoc
,
"/metafile/clipregion[5]"
,
"bottom"
,
"-32767"
);
assertXPath
(
pDoc
,
"/metafile/clipregion[5]"
,
"right"
,
"-32767"
);
}
CPPUNIT_TEST_SUITE_REGISTRATION
(
PictFilterTest
);
CPPUNIT_PLUGIN_IMPLEMENT
();
...
...
filter/source/graphicfilter/ipict/ipict.cxx
Dosyayı görüntüle @
71457cb2
...
...
@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <string.h>
#include <osl/thread.h>
#include <vcl/bmpacc.hxx>
...
...
@@ -26,6 +25,7 @@
#include <vcl/virdev.hxx>
#include <math.h>
#include "ipict.hxx"
#include "shape.hxx"
#include <boost/scoped_array.hpp>
...
...
@@ -1940,5 +1940,14 @@ GraphicImport( SvStream& rIStm, Graphic & rGraphic, FilterConfigItem* )
return
bRet
;
}
namespace
pict
{
SAL_DLLPUBLIC_EXPORT
void
ReadPictFile
(
SvStream
&
rStreamPict
,
GDIMetaFile
&
rGDIMetaFile
)
{
PictReader
aPictReader
;
aPictReader
.
ReadPict
(
rStreamPict
,
rGDIMetaFile
);
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
filter/source/graphicfilter/ipict/ipict.hxx
0 → 100644
Dosyayı görüntüle @
71457cb2
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef INCLUDED_FILTER_SOURCE_GRAPHICFILTER_IPICT_HXX
#define INCLUDED_FILTER_SOURCE_GRAPHICFILTER_IPICT_HXX
class
GDIMetaFile
;
class
SvStream
;
namespace
pict
{
/// Function to access PictReader::ReadPict for unit testing.
void
ReadPictFile
(
SvStream
&
rStreamPict
,
GDIMetaFile
&
rGDIMetaFile
);
}
#endif // INCLUDED_FILTER_SOURCE_GRAPHICFILTER_IPICT_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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