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
f332db68
Kaydet (Commit)
f332db68
authored
Eyl 03, 2014
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
RTF export: handle wrap polygon of Writer pictures
Change-Id: I712d8f73466c662659a7b76ff363a44a71bba324
üst
34580851
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
15 deletions
+43
-15
picture-wrap-polygon.rtf
sw/qa/extras/rtfexport/data/picture-wrap-polygon.rtf
+0
-0
rtfexport.cxx
sw/qa/extras/rtfexport/rtfexport.cxx
+16
-0
rtfimport.cxx
sw/qa/extras/rtfimport/rtfimport.cxx
+0
-15
rtfattributeoutput.cxx
sw/source/filter/ww8/rtfattributeoutput.cxx
+27
-0
No files found.
sw/qa/extras/rtf
im
port/data/picture-wrap-polygon.rtf
→
sw/qa/extras/rtf
ex
port/data/picture-wrap-polygon.rtf
Dosyayı görüntüle @
f332db68
File moved
sw/qa/extras/rtfexport/rtfexport.cxx
Dosyayı görüntüle @
f332db68
...
...
@@ -14,6 +14,7 @@
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
#include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp>
#include <com/sun/star/drawing/FillStyle.hpp>
#include <com/sun/star/drawing/PointSequenceSequence.hpp>
#include <com/sun/star/frame/XStorable.hpp>
#include <com/sun/star/table/BorderLine2.hpp>
#include <com/sun/star/table/ShadowFormat.hpp>
...
...
@@ -664,6 +665,21 @@ DECLARE_RTFEXPORT_TEST(testFdo32613, "fdo32613.odt")
CPPUNIT_ASSERT_EQUAL
(
text
::
TextContentAnchorType_AT_CHARACTER
,
getProperty
<
text
::
TextContentAnchorType
>
(
getShape
(
1
),
"AnchorType"
));
}
DECLARE_RTFEXPORT_TEST
(
testPictureWrapPolygon
,
"picture-wrap-polygon.rtf"
)
{
// The problem was that the wrap polygon was ignored during import.
drawing
::
PointSequenceSequence
aSeqSeq
=
getProperty
<
drawing
::
PointSequenceSequence
>
(
getShape
(
1
),
"ContourPolyPolygon"
);
// This was 0: the polygon list was empty.
CPPUNIT_ASSERT_EQUAL
(
sal_Int32
(
1
),
aSeqSeq
.
getLength
());
drawing
::
PointSequence
aSeq
=
aSeqSeq
[
0
];
CPPUNIT_ASSERT_EQUAL
(
sal_Int32
(
11
),
aSeq
.
getLength
());
// The shape also didn't have negative top / left coordinates.
CPPUNIT_ASSERT_EQUAL
(
sal_Int32
(
convertTwipToMm100
(
-
1177
)),
getProperty
<
sal_Int32
>
(
getShape
(
1
),
"HoriOrientPosition"
));
CPPUNIT_ASSERT_EQUAL
(
sal_Int32
(
convertTwipToMm100
(
-
67
)),
getProperty
<
sal_Int32
>
(
getShape
(
1
),
"VertOrientPosition"
));
}
#endif
CPPUNIT_PLUGIN_IMPLEMENT
();
...
...
sw/qa/extras/rtfimport/rtfimport.cxx
Dosyayı görüntüle @
f332db68
...
...
@@ -1903,21 +1903,6 @@ DECLARE_RTFIMPORT_TEST(testBehindDoc, "behind-doc.rtf")
CPPUNIT_ASSERT_EQUAL
(
false
,
getProperty
<
bool
>
(
xShape
,
"Opaque"
));
}
DECLARE_RTFIMPORT_TEST
(
testPictureWrapPolygon
,
"picture-wrap-polygon.rtf"
)
{
// The problem was that the wrap polygon was ignored during import.
drawing
::
PointSequenceSequence
aSeqSeq
=
getProperty
<
drawing
::
PointSequenceSequence
>
(
getShape
(
1
),
"ContourPolyPolygon"
);
// This was 0: the polygon list was empty.
CPPUNIT_ASSERT_EQUAL
(
sal_Int32
(
1
),
aSeqSeq
.
getLength
());
drawing
::
PointSequence
aSeq
=
aSeqSeq
[
0
];
CPPUNIT_ASSERT_EQUAL
(
sal_Int32
(
11
),
aSeq
.
getLength
());
// The shape also didn't have negative top / left coordinates.
CPPUNIT_ASSERT_EQUAL
(
sal_Int32
(
convertTwipToMm100
(
-
1177
)),
getProperty
<
sal_Int32
>
(
getShape
(
1
),
"HoriOrientPosition"
));
CPPUNIT_ASSERT_EQUAL
(
sal_Int32
(
convertTwipToMm100
(
-
67
)),
getProperty
<
sal_Int32
>
(
getShape
(
1
),
"VertOrientPosition"
));
}
DECLARE_RTFIMPORT_TEST
(
testFdo74229
,
"fdo74229.rtf"
)
{
uno
::
Reference
<
text
::
XTextTablesSupplier
>
xTextTablesSupplier
(
mxComponent
,
uno
::
UNO_QUERY
);
...
...
sw/source/filter/ww8/rtfattributeoutput.cxx
Dosyayı görüntüle @
f332db68
...
...
@@ -65,6 +65,7 @@
#include <editeng/blinkitem.hxx>
#include <editeng/charhiddenitem.hxx>
#include <editeng/shaditem.hxx>
#include <editeng/opaqitem.hxx>
#include <svx/svdmodel.hxx>
#include <svx/fmglob.hxx>
#include <svx/svdouno.hxx>
...
...
@@ -2866,6 +2867,10 @@ void RtfAttributeOutput::FormatSurround(const SwFmtSurround& rSurround)
oWrk
=
3
;
// largest
break
;
}
if
(
rSurround
.
IsContour
())
nWr
=
4
;
// tight
m_rExport
.
Strm
().
WriteCharPtr
(
OOO_STRING_SVTOOLS_RTF_SHPWR
);
m_rExport
.
OutLong
(
nWr
);
if
(
oWrk
)
...
...
@@ -3721,6 +3726,28 @@ void RtfAttributeOutput::FlyFrameGraphic(const SwFlyFrmFmt* pFlyFrmFmt, const Sw
aFlyProperties
.
push_back
(
std
::
make_pair
<
OString
,
OString
>
(
"shapeType"
,
OString
::
number
(
ESCHER_ShpInst_PictureFrame
)));
aFlyProperties
.
push_back
(
std
::
make_pair
<
OString
,
OString
>
(
"wzDescription"
,
msfilter
::
rtfutil
::
OutString
(
pFlyFrmFmt
->
GetObjDescription
(),
m_rExport
.
eCurrentEncoding
)));
aFlyProperties
.
push_back
(
std
::
make_pair
<
OString
,
OString
>
(
"wzName"
,
msfilter
::
rtfutil
::
OutString
(
pFlyFrmFmt
->
GetObjTitle
(),
m_rExport
.
eCurrentEncoding
)));
// If we have a wrap polygon, then handle that here.
if
(
pFlyFrmFmt
->
GetSurround
().
IsContour
())
{
if
(
const
SwNoTxtNode
*
pNd
=
sw
::
util
::
GetNoTxtNodeFromSwFrmFmt
(
*
pFlyFrmFmt
))
{
const
PolyPolygon
*
pPolyPoly
=
pNd
->
HasContour
();
if
(
pPolyPoly
&&
pPolyPoly
->
Count
())
{
Polygon
aPoly
=
sw
::
util
::
CorrectWordWrapPolygonForExport
(
*
pPolyPoly
,
pNd
);
OStringBuffer
aVerticies
;
for
(
sal_uInt16
i
=
0
;
i
<
aPoly
.
GetSize
();
++
i
)
aVerticies
.
append
(
";("
).
append
(
aPoly
[
i
].
X
()).
append
(
","
).
append
(
aPoly
[
i
].
Y
()).
append
(
")"
);
aFlyProperties
.
push_back
(
std
::
make_pair
<
OString
,
OString
>
(
"pWrapPolygonVertices"
,
"8;"
+
OString
::
number
(
aPoly
.
GetSize
())
+
aVerticies
.
makeStringAndClear
()));
}
}
}
// Below text, behind document, opaque: they all refer to the same thing.
if
(
!
pFlyFrmFmt
->
GetOpaque
().
GetValue
())
aFlyProperties
.
push_back
(
std
::
make_pair
<
OString
,
OString
>
(
"fBehindDocument"
,
"1"
));
for
(
size_t
i
=
0
;
i
<
aFlyProperties
.
size
();
++
i
)
{
m_rExport
.
Strm
().
WriteCharPtr
(
"{"
OOO_STRING_SVTOOLS_RTF_SP
"{"
);
...
...
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