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
35545d3d
Kaydet (Commit)
35545d3d
authored
Eyl 16, 2014
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
DOCX import: handle w:sdt around w:r followed by a field
Change-Id: Ic0cf71efc8d57a98e7cff050ce68a0c4303ca6b1
üst
851b5a97
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
4 deletions
+28
-4
sdt-before-field.docx
sw/qa/extras/ooxmlexport/data/sdt-before-field.docx
+0
-0
ooxmlfieldexport.cxx
sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
+9
-0
DomainMapper.cxx
writerfilter/source/dmapper/DomainMapper.cxx
+13
-1
DomainMapper_Impl.cxx
writerfilter/source/dmapper/DomainMapper_Impl.cxx
+6
-3
No files found.
sw/qa/extras/ooxmlexport/data/sdt-before-field.docx
0 → 100644
Dosyayı görüntüle @
35545d3d
File added
sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
Dosyayı görüntüle @
35545d3d
...
...
@@ -599,6 +599,15 @@ DECLARE_OOXMLEXPORT_TEST(testfdo82123, "fdo82123.docx")
assertXPath
(
pXmlDoc
,
"/w:document/w:body/w:tbl/w:tr/w:tc[2]/w:p/w:sdt[1]/w:sdtContent/w:r"
,
1
);
}
DECLARE_OOXMLEXPORT_TEST
(
testSdtBeforeField
,
"sdt-before-field.docx"
)
{
if
(
xmlDocPtr
pXmlDoc
=
parseExport
(
"word/document.xml"
))
{
// Make sure the field doesn't sneak inside the SDT: the SDT should contain only a single run (there were 6 ones).
assertXPath
(
pXmlDoc
,
"//w:sdt/w:sdtContent/w:r"
,
1
);
}
}
DECLARE_OOXMLEXPORT_TEST
(
testfdo81946
,
"fdo81946.docx"
)
{
xmlDocPtr
pXmlDoc
=
parseExport
(
"word/header1.xml"
);
...
...
writerfilter/source/dmapper/DomainMapper.cxx
Dosyayı görüntüle @
35545d3d
...
...
@@ -2830,8 +2830,9 @@ void DomainMapper::lcl_startCharacterGroup()
m_pImpl
->
GetTopContext
()
->
Insert
(
PROP_CHAR_ROTATION
,
uno
::
makeAny
(
sal_Int16
(
900
)));
if
(
m_pImpl
->
isSdtEndDeferred
())
{
// Fields have an empty character group before the real one, so don't
// call setSdtEndDeferred(false) here, that will happen only in lcl_utext().
m_pImpl
->
GetTopContext
()
->
Insert
(
PROP_SDT_END_BEFORE
,
uno
::
makeAny
(
true
),
true
,
CHAR_GRAB_BAG
);
m_pImpl
->
setSdtEndDeferred
(
false
);
}
// Remember formatting of the date control as it only supports plain strings natively.
...
...
@@ -2937,6 +2938,17 @@ void DomainMapper::lcl_utext(const sal_uInt8 * data_, size_t len)
aBuffer
.
append
(
(
const
sal_Unicode
*
)
data_
,
len
);
sText
=
aBuffer
.
makeStringAndClear
();
if
(
m_pImpl
->
isSdtEndDeferred
())
{
// In case we have a field context, then save the property there, so
// SDT's ending right before a field start are handled as well.
PropertyMapPtr
pContext
=
m_pImpl
->
GetTopContext
();
if
(
m_pImpl
->
IsOpenField
())
pContext
=
m_pImpl
->
GetTopFieldContext
()
->
getProperties
();
pContext
->
Insert
(
PROP_SDT_END_BEFORE
,
uno
::
makeAny
(
true
),
true
,
CHAR_GRAB_BAG
);
m_pImpl
->
setSdtEndDeferred
(
false
);
}
if
(
!
m_pImpl
->
m_pSdtHelper
->
getDropDownItems
().
empty
())
{
m_pImpl
->
m_pSdtHelper
->
getSdtTexts
().
append
(
sText
);
...
...
writerfilter/source/dmapper/DomainMapper_Impl.cxx
Dosyayı görüntüle @
35545d3d
...
...
@@ -4231,13 +4231,16 @@ void DomainMapper_Impl::PopFieldContext()
xToInsert
=
uno
::
Reference
<
text
::
XTextContent
>
(
pContext
->
GetTextField
(),
uno
::
UNO_QUERY
);
if
(
xToInsert
.
is
()
&&
!
m_bStartTOC
&&
!
m_bStartIndex
&&
!
m_bStartBibliography
)
{
uno
::
Sequence
<
beans
::
PropertyValue
>
aValues
;
PropertyMap
aMap
;
// Character properties of the field show up here the
// last (always empty) run. Inherit character
// properties from there.
// Also merge in the properties from the field context,
// e.g. SdtEndBefore.
if
(
m_pLastCharacterContext
.
get
())
aValues
=
m_pLastCharacterContext
->
GetPropertyValues
();
appendTextContent
(
xToInsert
,
aValues
);
aMap
.
InsertProps
(
m_pLastCharacterContext
);
aMap
.
InsertProps
(
m_aFieldStack
.
top
()
->
getProperties
());
appendTextContent
(
xToInsert
,
aMap
.
GetPropertyValues
());
}
else
{
...
...
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