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
b0058366
Kaydet (Commit)
b0058366
authored
Ock 12, 2016
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
tdf#61511 RTF export: handle page background solid color fill
Change-Id: I562419b6d4fb791ef5b255effe9a4510d930bdbc
üst
813a319f
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
51 additions
and
27 deletions
+51
-27
rtfkeywd.hxx
include/svtools/rtfkeywd.hxx
+1
-0
page-background.rtf
sw/qa/extras/rtfexport/data/page-background.rtf
+1
-1
rtfexport.cxx
sw/qa/extras/rtfexport/rtfexport.cxx
+7
-0
rtfimport.cxx
sw/qa/extras/rtfimport/rtfimport.cxx
+0
-7
docxexport.cxx
sw/source/filter/ww8/docxexport.cxx
+0
-16
docxexport.hxx
sw/source/filter/ww8/docxexport.hxx
+0
-3
rtfexport.cxx
sw/source/filter/ww8/rtfexport.cxx
+24
-0
wrtww8.cxx
sw/source/filter/ww8/wrtww8.cxx
+16
-0
wrtww8.hxx
sw/source/filter/ww8/wrtww8.hxx
+2
-0
No files found.
include/svtools/rtfkeywd.hxx
Dosyayı görüntüle @
b0058366
...
...
@@ -1207,6 +1207,7 @@
#define LO_STRING_SVTOOLS_RTF_LEVELPICTURE "\\levelpicture"
#define LO_STRING_SVTOOLS_RTF_BRDRSH "\\brdrsh"
#define LO_STRING_SVTOOLS_RTF_GENERATOR "\\generator"
#define LO_STRING_SVTOOLS_RTF_VIEWBKSP "\\viewbksp"
#endif // INCLUDED_SVTOOLS_RTFKEYWD_HXX
...
...
sw/qa/extras/rtf
im
port/data/page-background.rtf
→
sw/qa/extras/rtf
ex
port/data/page-background.rtf
Dosyayı görüntüle @
b0058366
{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff31507\deff0\stshfdbch31506\stshfloch31506\stshfhich31506\stshfbi31507\deflang1033\deflangfe1033\themelang1033\themelangfe0\themelangcs0
\viewbksp1
{\*\background
{\*\background
{\shp
{\*\shpinst\shpleft0\shptop0\shpright0\shpbottom0\shpfhdr0\shpbxmargin\shpbxignore\shpbymargin\shpbyignore\shpwr0\shpwrk0\shpfblwtxt1
{\sp
...
...
sw/qa/extras/rtfexport/rtfexport.cxx
Dosyayı görüntüle @
b0058366
...
...
@@ -966,6 +966,13 @@ DECLARE_RTFEXPORT_TEST(testTdf94377, "tdf94377.rtf")
CPPUNIT_ASSERT_EQUAL
(
12.
f
,
getProperty
<
float
>
(
getRun
(
getParagraphOfText
(
2
,
xText
,
"asdf12"
),
1
),
"CharHeight"
));
}
DECLARE_RTFEXPORT_TEST
(
testPageBackground
,
"page-background.rtf"
)
{
// The problem was that \background was ignored.
uno
::
Reference
<
beans
::
XPropertySet
>
xPageStyle
(
getStyles
(
"PageStyles"
)
->
getByName
(
DEFAULT_STYLE
),
uno
::
UNO_QUERY
);
CPPUNIT_ASSERT_EQUAL
(
sal_Int32
(
0x92D050
),
getProperty
<
sal_Int32
>
(
xPageStyle
,
"BackColor"
));
}
CPPUNIT_PLUGIN_IMPLEMENT
();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sw/qa/extras/rtfimport/rtfimport.cxx
Dosyayı görüntüle @
b0058366
...
...
@@ -1221,13 +1221,6 @@ DECLARE_RTFIMPORT_TEST(testFdo64671, "fdo64671.rtf")
getRun
(
getParagraph
(
1
),
1
,
OUString
(
"
\xC5\xBD
"
,
2
,
RTL_TEXTENCODING_UTF8
));
}
DECLARE_RTFIMPORT_TEST
(
testPageBackground
,
"page-background.rtf"
)
{
// The problem was that \background was ignored.
uno
::
Reference
<
beans
::
XPropertySet
>
xPageStyle
(
getStyles
(
"PageStyles"
)
->
getByName
(
DEFAULT_STYLE
),
uno
::
UNO_QUERY
);
CPPUNIT_ASSERT_EQUAL
(
sal_Int32
(
0x92D050
),
getProperty
<
sal_Int32
>
(
xPageStyle
,
"BackColor"
));
}
DECLARE_RTFIMPORT_TEST
(
testFdo81944
,
"fdo81944.rtf"
)
{
// font properties in style were not imported
...
...
sw/source/filter/ww8/docxexport.cxx
Dosyayı görüntüle @
b0058366
...
...
@@ -1306,22 +1306,6 @@ bool DocxExport::isMirroredMargin()
return
bMirroredMargins
;
}
boost
::
optional
<
SvxBrushItem
>
DocxExport
::
getBackground
()
{
boost
::
optional
<
SvxBrushItem
>
oRet
;
const
SwFrameFormat
&
rFormat
=
m_pDoc
->
GetPageDesc
(
0
).
GetMaster
();
SvxBrushItem
aBrush
(
RES_BACKGROUND
);
SfxItemState
eState
=
rFormat
.
GetBackgroundState
(
aBrush
);
if
(
SfxItemState
::
SET
==
eState
)
{
// The 'color' is set for the first page style - take it and use it as the background color of the entire DOCX
if
(
aBrush
.
GetColor
().
GetColor
()
!=
COL_AUTO
)
oRet
.
reset
(
aBrush
);
}
return
oRet
;
}
void
DocxExport
::
WriteMainText
()
{
// setup the namespaces
...
...
sw/source/filter/ww8/docxexport.hxx
Dosyayı görüntüle @
b0058366
...
...
@@ -241,9 +241,6 @@ private:
/// Write word/embeddings/Worksheet[n].xlsx
void
WriteEmbeddings
();
/// Get background color of the document, if there is one.
boost
::
optional
<
SvxBrushItem
>
getBackground
();
/// return true if Page Layout is set as Mirrored
bool
isMirroredMargin
();
...
...
sw/source/filter/ww8/rtfexport.cxx
Dosyayı görüntüle @
b0058366
...
...
@@ -386,6 +386,30 @@ void RtfExport::WriteMainText()
{
SAL_INFO
(
"sw.rtf"
,
OSL_THIS_FUNC
<<
" start"
);
if
(
boost
::
optional
<
SvxBrushItem
>
oBrush
=
getBackground
())
{
Strm
().
WriteCharPtr
(
LO_STRING_SVTOOLS_RTF_VIEWBKSP
).
WriteChar
(
'1'
);
Strm
().
WriteCharPtr
(
"{"
OOO_STRING_SVTOOLS_RTF_IGNORE
OOO_STRING_SVTOOLS_RTF_BACKGROUND
);
Strm
().
WriteCharPtr
(
"{"
OOO_STRING_SVTOOLS_RTF_SHP
);
Strm
().
WriteCharPtr
(
"{"
OOO_STRING_SVTOOLS_RTF_IGNORE
OOO_STRING_SVTOOLS_RTF_SHPINST
);
std
::
vector
<
std
::
pair
<
OString
,
OString
>
>
aProperties
;
aProperties
.
push_back
(
std
::
make_pair
<
OString
,
OString
>
(
"shapeType"
,
"1"
));
aProperties
.
push_back
(
std
::
make_pair
<
OString
,
OString
>
(
"fillColor"
,
OString
::
number
(
msfilter
::
util
::
BGRToRGB
(
oBrush
->
GetColor
().
GetColor
()))));
for
(
size_t
i
=
0
;
i
<
aProperties
.
size
();
++
i
)
{
Strm
().
WriteCharPtr
(
"{"
OOO_STRING_SVTOOLS_RTF_SP
"{"
);
Strm
().
WriteCharPtr
(
OOO_STRING_SVTOOLS_RTF_SN
" "
);
Strm
().
WriteCharPtr
(
aProperties
[
i
].
first
.
getStr
());
Strm
().
WriteCharPtr
(
"}{"
OOO_STRING_SVTOOLS_RTF_SV
" "
);
Strm
().
WriteCharPtr
(
aProperties
[
i
].
second
.
getStr
());
Strm
().
WriteCharPtr
(
"}}"
);
}
Strm
().
WriteChar
(
'}'
);
// shpinst
Strm
().
WriteChar
(
'}'
);
// shp
Strm
().
WriteChar
(
'}'
);
// background
}
SwTableNode
*
pTableNode
=
m_pCurPam
->
GetNode
().
FindTableNode
();
if
(
m_pWriter
&&
m_pWriter
->
bWriteOnlyFirstTable
&&
pTableNode
!=
nullptr
)
...
...
sw/source/filter/ww8/wrtww8.cxx
Dosyayı görüntüle @
b0058366
...
...
@@ -1520,6 +1520,22 @@ void WW8Export::AppendBookmark( const OUString& rName, bool bSkip )
m_pBkmks
->
Append
(
nSttCP
,
rName
);
}
boost
::
optional
<
SvxBrushItem
>
MSWordExportBase
::
getBackground
()
{
boost
::
optional
<
SvxBrushItem
>
oRet
;
const
SwFrameFormat
&
rFormat
=
m_pDoc
->
GetPageDesc
(
0
).
GetMaster
();
SvxBrushItem
aBrush
(
RES_BACKGROUND
);
SfxItemState
eState
=
rFormat
.
GetBackgroundState
(
aBrush
);
if
(
SfxItemState
::
SET
==
eState
)
{
// The 'color' is set for the first page style - take it and use it as the background color of the entire DOCX
if
(
aBrush
.
GetColor
().
GetColor
()
!=
COL_AUTO
)
oRet
.
reset
(
aBrush
);
}
return
oRet
;
}
// #i120928 collect all the graphics of bullets applied to paragraphs
int
MSWordExportBase
::
CollectGrfsOfBullets
()
{
...
...
sw/source/filter/ww8/wrtww8.hxx
Dosyayı görüntüle @
b0058366
...
...
@@ -865,6 +865,8 @@ protected:
void
SetCurPam
(
sal_uLong
nStt
,
sal_uLong
nEnd
);
/// Get background color of the document, if there is one.
boost
::
optional
<
SvxBrushItem
>
getBackground
();
/// Populates m_vecBulletPic with all the bullet graphics used by numberings.
int
CollectGrfsOfBullets
();
/// Write the numbering picture bullets.
...
...
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