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
1b9353ba
Kaydet (Commit)
1b9353ba
authored
Agu 05, 2014
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
DOCX export: handle all attributes of CT_TblLook
Change-Id: Ibe72d60be302158001fbf6e197f30945fe8fbed9
üst
a9bae496
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
0 deletions
+57
-0
ooxmlexport.cxx
sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+10
-0
docxattributeoutput.cxx
sw/source/filter/ww8/docxattributeoutput.cxx
+47
-0
No files found.
sw/qa/extras/ooxmlexport/ooxmlexport.cxx
Dosyayı görüntüle @
1b9353ba
...
@@ -1309,6 +1309,16 @@ DECLARE_OOXMLEXPORT_TEST(testCalendar1, "calendar1.docx")
...
@@ -1309,6 +1309,16 @@ DECLARE_OOXMLEXPORT_TEST(testCalendar1, "calendar1.docx")
assertXPath
(
pXmlStyles
,
"/w:styles/w:style[@w:styleId='Calendar1']/w:tblStylePr[@w:type='firstRow']/w:tcPr/w:vAlign"
,
"val"
,
"bottom"
);
assertXPath
(
pXmlStyles
,
"/w:styles/w:style[@w:styleId='Calendar1']/w:tblStylePr[@w:type='firstRow']/w:tcPr/w:vAlign"
,
"val"
,
"bottom"
);
assertXPath
(
pXmlStyles
,
"/w:styles/w:style[@w:styleId='Calendar1']/w:tblStylePr[@w:type='lastRow']/w:tcPr/w:tcBorders/w:tr2bl"
,
"val"
,
"nil"
);
assertXPath
(
pXmlStyles
,
"/w:styles/w:style[@w:styleId='Calendar1']/w:tblStylePr[@w:type='lastRow']/w:tcPr/w:tcBorders/w:tr2bl"
,
"val"
,
"nil"
);
assertXPath
(
pXmlStyles
,
"/w:styles/w:style[@w:styleId='Calendar1']/w:tblStylePr[@w:type='band2Horz']/w:tcPr/w:tcBorders/w:top"
,
"themeColor"
,
"text1"
);
assertXPath
(
pXmlStyles
,
"/w:styles/w:style[@w:styleId='Calendar1']/w:tblStylePr[@w:type='band2Horz']/w:tcPr/w:tcBorders/w:top"
,
"themeColor"
,
"text1"
);
// w:tblLook element and its attributes were missing.
xmlDocPtr
pXmlDoc
=
parseExport
(
"word/document.xml"
);
assertXPath
(
pXmlDoc
,
"/w:document/w:body/w:tbl/w:tblPr/w:tblLook"
,
"firstRow"
,
"1"
);
assertXPath
(
pXmlDoc
,
"/w:document/w:body/w:tbl/w:tblPr/w:tblLook"
,
"lastRow"
,
"0"
);
assertXPath
(
pXmlDoc
,
"/w:document/w:body/w:tbl/w:tblPr/w:tblLook"
,
"lastColumn"
,
"0"
);
assertXPath
(
pXmlDoc
,
"/w:document/w:body/w:tbl/w:tblPr/w:tblLook"
,
"firstColumn"
,
"1"
);
assertXPath
(
pXmlDoc
,
"/w:document/w:body/w:tbl/w:tblPr/w:tblLook"
,
"noHBand"
,
"0"
);
assertXPath
(
pXmlDoc
,
"/w:document/w:body/w:tbl/w:tblPr/w:tblLook"
,
"noVBand"
,
"1"
);
assertXPath
(
pXmlDoc
,
"/w:document/w:body/w:tbl/w:tblPr/w:tblLook"
,
"val"
,
"04a0"
);
}
}
DECLARE_OOXMLEXPORT_TEST
(
testCalendar2
,
"calendar2.docx"
)
DECLARE_OOXMLEXPORT_TEST
(
testCalendar2
,
"calendar2.docx"
)
...
...
sw/source/filter/ww8/docxattributeoutput.cxx
Dosyayı görüntüle @
1b9353ba
...
@@ -2950,6 +2950,21 @@ void DocxAttributeOutput::TableInfoRow( ww8::WW8TableNodeInfoInner::Pointer_t /*
...
@@ -2950,6 +2950,21 @@ void DocxAttributeOutput::TableInfoRow( ww8::WW8TableNodeInfoInner::Pointer_t /*
{
{
}
}
/// Does the same as comphelper::string::padToLength(), but extends the start, not the end.
OString
lcl_padStartToLength
(
OString
aString
,
sal_Int32
nLen
,
sal_Char
cFill
)
{
if
(
nLen
>
aString
.
getLength
())
{
sal_Int32
nDiff
=
nLen
-
aString
.
getLength
();
OStringBuffer
aBuffer
;
comphelper
::
string
::
padToLength
(
aBuffer
,
nDiff
,
cFill
);
aBuffer
.
append
(
aString
);
return
aBuffer
.
makeStringAndClear
();
}
else
return
aString
;
}
void
DocxAttributeOutput
::
TableDefinition
(
ww8
::
WW8TableNodeInfoInner
::
Pointer_t
pTableTextNodeInfoInner
)
void
DocxAttributeOutput
::
TableDefinition
(
ww8
::
WW8TableNodeInfoInner
::
Pointer_t
pTableTextNodeInfoInner
)
{
{
bool
bEcma
=
GetExport
().
GetFilter
().
getVersion
(
)
==
oox
::
core
::
ECMA_DIALECT
;
bool
bEcma
=
GetExport
().
GetFilter
().
getVersion
(
)
==
oox
::
core
::
ECMA_DIALECT
;
...
@@ -3057,6 +3072,36 @@ void DocxAttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t
...
@@ -3057,6 +3072,36 @@ void DocxAttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t
m_aTableStyleConf
[
BOX_LINE_LEFT
]
=
aGrabBagElement
->
second
.
get
<
table
::
BorderLine2
>
();
m_aTableStyleConf
[
BOX_LINE_LEFT
]
=
aGrabBagElement
->
second
.
get
<
table
::
BorderLine2
>
();
else
if
(
aGrabBagElement
->
first
==
"TableStyleRightBorder"
)
else
if
(
aGrabBagElement
->
first
==
"TableStyleRightBorder"
)
m_aTableStyleConf
[
BOX_LINE_RIGHT
]
=
aGrabBagElement
->
second
.
get
<
table
::
BorderLine2
>
();
m_aTableStyleConf
[
BOX_LINE_RIGHT
]
=
aGrabBagElement
->
second
.
get
<
table
::
BorderLine2
>
();
else
if
(
aGrabBagElement
->
first
==
"TableStyleLook"
)
{
FastAttributeList
*
pAttributeList
=
m_pSerializer
->
createAttrList
();
uno
::
Sequence
<
beans
::
PropertyValue
>
aAttributeList
=
aGrabBagElement
->
second
.
get
<
uno
::
Sequence
<
beans
::
PropertyValue
>
>
();
for
(
sal_Int32
i
=
0
;
i
<
aAttributeList
.
getLength
();
++
i
)
{
if
(
aAttributeList
[
i
].
Name
==
"val"
)
pAttributeList
->
add
(
FSNS
(
XML_w
,
XML_val
),
lcl_padStartToLength
(
OString
::
number
(
aAttributeList
[
i
].
Value
.
get
<
sal_Int32
>
(),
16
),
4
,
'0'
));
else
{
static
DocxStringTokenMap
const
aTokens
[]
=
{
{
"firstRow"
,
XML_firstRow
},
{
"lastRow"
,
XML_lastRow
},
{
"firstColumn"
,
XML_firstColumn
},
{
"lastColumn"
,
XML_lastColumn
},
{
"noHBand"
,
XML_noHBand
},
{
"noVBand"
,
XML_noVBand
},
{
0
,
0
}
};
if
(
sal_Int32
nToken
=
DocxStringGetToken
(
aTokens
,
aAttributeList
[
i
].
Name
))
pAttributeList
->
add
(
FSNS
(
XML_w
,
nToken
),
(
aAttributeList
[
i
].
Value
.
get
<
sal_Int32
>
()
?
"1"
:
"0"
));
}
}
XFastAttributeListRef
xAttributeList
(
pAttributeList
);
m_pSerializer
->
singleElementNS
(
XML_w
,
XML_tblLook
,
xAttributeList
);
}
else
if
(
aGrabBagElement
->
first
==
"TablePosition"
)
else
if
(
aGrabBagElement
->
first
==
"TablePosition"
)
{
{
FastAttributeList
*
attrListTablePos
=
m_pSerializer
->
createAttrList
(
);
FastAttributeList
*
attrListTablePos
=
m_pSerializer
->
createAttrList
(
);
...
@@ -3114,6 +3159,8 @@ void DocxAttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t
...
@@ -3114,6 +3159,8 @@ void DocxAttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t
m_pSerializer
->
singleElementNS
(
XML_w
,
XML_tblpPr
,
xAttrListTablePosRef
);
m_pSerializer
->
singleElementNS
(
XML_w
,
XML_tblpPr
,
xAttrListTablePosRef
);
attrListTablePos
=
NULL
;
attrListTablePos
=
NULL
;
}
}
else
SAL_WARN
(
"sw.ww8"
,
"DocxAttributeOutput::TableDefinition: unhandled property: "
<<
aGrabBagElement
->
first
);
}
}
// Output the table alignement
// Output the table alignement
...
...
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