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
5da91ea5
Kaydet (Commit)
5da91ea5
authored
Tem 18, 2012
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
implement export of RTF_ATNREF, RTF_ATRFSTART and RTF_ATRFEND
Change-Id: I829ec1fbca990f3d42121270f0bf3647dbd08a30
üst
75bcb45a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
69 additions
and
1 deletion
+69
-1
fdo38244.rtf
sw/qa/extras/rtfexport/data/fdo38244.rtf
+15
-0
rtfexport.cxx
sw/qa/extras/rtfexport/rtfexport.cxx
+28
-0
rtfattributeoutput.cxx
sw/source/filter/ww8/rtfattributeoutput.cxx
+19
-1
rtfattributeoutput.hxx
sw/source/filter/ww8/rtfattributeoutput.hxx
+7
-0
No files found.
sw/qa/extras/rtfexport/data/fdo38244.rtf
0 → 100644
Dosyayı görüntüle @
5da91ea5
{\rtf1\pard\plain
aaa
{\*\atrfstart 0}
bbb
{\*\atrfend 0}
{\*\atnid M}
{\*\atnauthor Miklos}
\chatn
{\*\annotation
{\*\atnref 0}
{\*\atndate 0}
Content}
ccc
\par
}
sw/qa/extras/rtfexport/rtfexport.cxx
Dosyayı görüntüle @
5da91ea5
...
...
@@ -50,6 +50,7 @@ public:
void
testFdo50087
();
void
testFdo50831
();
void
testFdo48335
();
void
testFdo38244
();
CPPUNIT_TEST_SUITE
(
Test
);
#if !defined(MACOSX) && !defined(WNT)
...
...
@@ -60,6 +61,7 @@ public:
CPPUNIT_TEST
(
testFdo50087
);
CPPUNIT_TEST
(
testFdo50831
);
CPPUNIT_TEST
(
testFdo48335
);
CPPUNIT_TEST
(
testFdo38244
);
#endif
CPPUNIT_TEST_SUITE_END
();
...
...
@@ -174,6 +176,32 @@ void Test::testFdo48335()
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"SoftPageBreak"
),
aValue
);
}
void
Test
::
testFdo38244
()
{
// See ooxmlexport's testFdo38244().
roundtrip
(
"fdo38244.rtf"
);
// Test comment range feature.
uno
::
Reference
<
text
::
XTextDocument
>
xTextDocument
(
mxComponent
,
uno
::
UNO_QUERY
);
uno
::
Reference
<
container
::
XEnumerationAccess
>
xParaEnumAccess
(
xTextDocument
->
getText
(),
uno
::
UNO_QUERY
);
uno
::
Reference
<
container
::
XEnumeration
>
xParaEnum
=
xParaEnumAccess
->
createEnumeration
();
uno
::
Reference
<
container
::
XEnumerationAccess
>
xRunEnumAccess
(
xParaEnum
->
nextElement
(),
uno
::
UNO_QUERY
);
uno
::
Reference
<
container
::
XEnumeration
>
xRunEnum
=
xRunEnumAccess
->
createEnumeration
();
xRunEnum
->
nextElement
();
uno
::
Reference
<
beans
::
XPropertySet
>
xPropertySet
(
xRunEnum
->
nextElement
(),
uno
::
UNO_QUERY
);
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"TextFieldStart"
),
getProperty
<
OUString
>
(
xPropertySet
,
"TextPortionType"
));
xRunEnum
->
nextElement
();
xPropertySet
.
set
(
xRunEnum
->
nextElement
(),
uno
::
UNO_QUERY
);
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"TextFieldEnd"
),
getProperty
<
OUString
>
(
xPropertySet
,
"TextPortionType"
));
// Test initials.
uno
::
Reference
<
text
::
XTextFieldsSupplier
>
xTextFieldsSupplier
(
mxComponent
,
uno
::
UNO_QUERY
);
uno
::
Reference
<
container
::
XEnumerationAccess
>
xFieldsAccess
(
xTextFieldsSupplier
->
getTextFields
());
uno
::
Reference
<
container
::
XEnumeration
>
xFields
(
xFieldsAccess
->
createEnumeration
());
xPropertySet
.
set
(
xFields
->
nextElement
(),
uno
::
UNO_QUERY
);
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"M"
),
getProperty
<
OUString
>
(
xPropertySet
,
"Initials"
));
}
CPPUNIT_TEST_SUITE_REGISTRATION
(
Test
);
CPPUNIT_PLUGIN_IMPLEMENT
();
...
...
sw/source/filter/ww8/rtfattributeoutput.cxx
Dosyayı görüntüle @
5da91ea5
...
...
@@ -3002,7 +3002,7 @@ void RtfAttributeOutput::PostitField( const SwField* pFld )
const
SwPostItField
&
rPFld
=
*
(
SwPostItField
*
)
pFld
;
m_aRunText
->
append
(
"{"
OOO_STRING_SVTOOLS_RTF_IGNORE
OOO_STRING_SVTOOLS_RTF_ATNID
" "
);
m_aRunText
->
append
(
OUStringToOString
(
OUString
(
rPFld
.
Get
Par1
()),
m_rExport
.
eCurrentEncoding
));
m_aRunText
->
append
(
OUStringToOString
(
OUString
(
rPFld
.
Get
Initials
()),
m_rExport
.
eCurrentEncoding
));
m_aRunText
->
append
(
"}"
);
m_aRunText
->
append
(
"{"
OOO_STRING_SVTOOLS_RTF_IGNORE
OOO_STRING_SVTOOLS_RTF_ATNAUTHOR
" "
);
m_aRunText
->
append
(
OUStringToOString
(
OUString
(
rPFld
.
GetPar1
()),
m_rExport
.
eCurrentEncoding
));
...
...
@@ -3010,6 +3010,9 @@ void RtfAttributeOutput::PostitField( const SwField* pFld )
m_aRunText
->
append
(
OOO_STRING_SVTOOLS_RTF_CHATN
);
m_aRunText
->
append
(
"{"
OOO_STRING_SVTOOLS_RTF_IGNORE
OOO_STRING_SVTOOLS_RTF_ANNOTATION
);
m_aRunText
->
append
(
"{"
OOO_STRING_SVTOOLS_RTF_IGNORE
OOO_STRING_SVTOOLS_RTF_ATNREF
" "
);
m_aRunText
->
append
(
sal_Int32
(
m_nPostitFieldsMaxId
++
));
m_aRunText
->
append
(
'}'
);
m_aRunText
->
append
(
"{"
OOO_STRING_SVTOOLS_RTF_IGNORE
OOO_STRING_SVTOOLS_RTF_ATNDATE
" "
);
m_aRunText
->
append
((
sal_Int32
)
sw
::
ms
::
DateTime2DTTM
(
rPFld
.
GetDateTime
()));
m_aRunText
->
append
(
'}'
);
...
...
@@ -3017,6 +3020,20 @@ void RtfAttributeOutput::PostitField( const SwField* pFld )
m_aRunText
->
append
(
'}'
);
}
void
RtfAttributeOutput
::
WritePostitFieldStart
()
{
m_aRunText
->
append
(
"{"
OOO_STRING_SVTOOLS_RTF_IGNORE
OOO_STRING_SVTOOLS_RTF_ATRFSTART
" "
);
m_aRunText
->
append
(
sal_Int32
(
m_nPostitFieldsMaxId
));
m_aRunText
->
append
(
"}"
);
}
void
RtfAttributeOutput
::
WritePostitFieldEnd
()
{
m_aRunText
->
append
(
"{"
OOO_STRING_SVTOOLS_RTF_IGNORE
OOO_STRING_SVTOOLS_RTF_ATRFEND
" "
);
m_aRunText
->
append
(
sal_Int32
(
m_nPostitFieldsMaxId
));
m_aRunText
->
append
(
"}"
);
}
bool
RtfAttributeOutput
::
DropdownField
(
const
SwField
*
/*pFld*/
)
{
// this is handled in OutputFlyFrame_Impl()
...
...
@@ -3040,6 +3057,7 @@ RtfAttributeOutput::RtfAttributeOutput( RtfExport &rExport )
m_aCells
(),
m_bSingleEmptyRun
(
false
),
m_bInRun
(
false
),
m_nPostitFieldsMaxId
(
0
),
m_pPrevPageDesc
(
0
)
{
SAL_INFO
(
"sw.rtf"
,
OSL_THIS_FUNC
);
...
...
sw/source/filter/ww8/rtfattributeoutput.hxx
Dosyayı görüntüle @
5da91ea5
...
...
@@ -75,6 +75,10 @@ public:
/// Called after we end outputting the attributes.
virtual
void
EndRunProperties
(
const
SwRedlineData
*
pRedlineData
);
virtual
void
WritePostitFieldStart
();
virtual
void
WritePostitFieldEnd
();
/// Output text (inside a run).
virtual
void
RunText
(
const
String
&
rText
,
rtl_TextEncoding
eCharSet
=
RTL_TEXTENCODING_UTF8
);
...
...
@@ -545,6 +549,9 @@ private:
bool
m_bSingleEmptyRun
;
bool
m_bInRun
;
unsigned
int
m_nPostitFieldsMaxId
;
public
:
RtfAttributeOutput
(
RtfExport
&
rExport
);
...
...
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