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
03eb7ac9
Kaydet (Commit)
03eb7ac9
authored
Ock 09, 2014
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
RTF export of annotation marks
Change-Id: I079516ad0f30886d175748fdee19fbd71c2704f8
üst
bcfd016c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
85 additions
and
12 deletions
+85
-12
rtfexport.cxx
sw/qa/extras/rtfexport/rtfexport.cxx
+2
-5
rtfattributeoutput.cxx
sw/source/filter/ww8/rtfattributeoutput.cxx
+53
-6
rtfattributeoutput.hxx
sw/source/filter/ww8/rtfattributeoutput.hxx
+5
-0
rtfexport.cxx
sw/source/filter/ww8/rtfexport.cxx
+25
-1
No files found.
sw/qa/extras/rtfexport/rtfexport.cxx
Dosyayı görüntüle @
03eb7ac9
...
@@ -134,8 +134,6 @@ DECLARE_RTFEXPORT_TEST(testFdo48335, "fdo48335.odt")
...
@@ -134,8 +134,6 @@ DECLARE_RTFEXPORT_TEST(testFdo48335, "fdo48335.odt")
DECLARE_RTFEXPORT_TEST
(
testFdo38244
,
"fdo38244.rtf"
)
DECLARE_RTFEXPORT_TEST
(
testFdo38244
,
"fdo38244.rtf"
)
{
{
#if 0
// FIXME port to AnnotationMarks
// See ooxmlexport's testFdo38244().
// See ooxmlexport's testFdo38244().
// Test comment range feature.
// Test comment range feature.
uno
::
Reference
<
text
::
XTextDocument
>
xTextDocument
(
mxComponent
,
uno
::
UNO_QUERY
);
uno
::
Reference
<
text
::
XTextDocument
>
xTextDocument
(
mxComponent
,
uno
::
UNO_QUERY
);
...
@@ -145,10 +143,10 @@ DECLARE_RTFEXPORT_TEST(testFdo38244, "fdo38244.rtf")
...
@@ -145,10 +143,10 @@ DECLARE_RTFEXPORT_TEST(testFdo38244, "fdo38244.rtf")
uno
::
Reference
<
container
::
XEnumeration
>
xRunEnum
=
xRunEnumAccess
->
createEnumeration
();
uno
::
Reference
<
container
::
XEnumeration
>
xRunEnum
=
xRunEnumAccess
->
createEnumeration
();
xRunEnum
->
nextElement
();
xRunEnum
->
nextElement
();
uno
::
Reference
<
beans
::
XPropertySet
>
xPropertySet
(
xRunEnum
->
nextElement
(),
uno
::
UNO_QUERY
);
uno
::
Reference
<
beans
::
XPropertySet
>
xPropertySet
(
xRunEnum
->
nextElement
(),
uno
::
UNO_QUERY
);
CPPUNIT_ASSERT_EQUAL(OUString("
TextFieldStart
"), getProperty<OUString>(xPropertySet, "TextPortionType"));
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"
Annotation
"
),
getProperty
<
OUString
>
(
xPropertySet
,
"TextPortionType"
));
xRunEnum
->
nextElement
();
xRunEnum
->
nextElement
();
xPropertySet
.
set
(
xRunEnum
->
nextElement
(),
uno
::
UNO_QUERY
);
xPropertySet
.
set
(
xRunEnum
->
nextElement
(),
uno
::
UNO_QUERY
);
CPPUNIT_ASSERT_EQUAL(OUString("
TextField
End"), getProperty<OUString>(xPropertySet, "TextPortionType"));
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"
Annotation
End"
),
getProperty
<
OUString
>
(
xPropertySet
,
"TextPortionType"
));
// Test initials.
// Test initials.
uno
::
Reference
<
text
::
XTextFieldsSupplier
>
xTextFieldsSupplier
(
mxComponent
,
uno
::
UNO_QUERY
);
uno
::
Reference
<
text
::
XTextFieldsSupplier
>
xTextFieldsSupplier
(
mxComponent
,
uno
::
UNO_QUERY
);
...
@@ -156,7 +154,6 @@ DECLARE_RTFEXPORT_TEST(testFdo38244, "fdo38244.rtf")
...
@@ -156,7 +154,6 @@ DECLARE_RTFEXPORT_TEST(testFdo38244, "fdo38244.rtf")
uno
::
Reference
<
container
::
XEnumeration
>
xFields
(
xFieldsAccess
->
createEnumeration
());
uno
::
Reference
<
container
::
XEnumeration
>
xFields
(
xFieldsAccess
->
createEnumeration
());
xPropertySet
.
set
(
xFields
->
nextElement
(),
uno
::
UNO_QUERY
);
xPropertySet
.
set
(
xFields
->
nextElement
(),
uno
::
UNO_QUERY
);
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"M"
),
getProperty
<
OUString
>
(
xPropertySet
,
"Initials"
));
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"M"
),
getProperty
<
OUString
>
(
xPropertySet
,
"Initials"
));
#endif
}
}
DECLARE_RTFEXPORT_TEST
(
testMathAccents
,
"math-accents.rtf"
)
DECLARE_RTFEXPORT_TEST
(
testMathAccents
,
"math-accents.rtf"
)
...
...
sw/source/filter/ww8/rtfattributeoutput.cxx
Dosyayı görüntüle @
03eb7ac9
...
@@ -1472,6 +1472,48 @@ void RtfAttributeOutput::WriteBookmarks_Impl( std::vector< OUString >& rStarts,
...
@@ -1472,6 +1472,48 @@ void RtfAttributeOutput::WriteBookmarks_Impl( std::vector< OUString >& rStarts,
rEnds
.
clear
();
rEnds
.
clear
();
}
}
void
RtfAttributeOutput
::
WriteAnnotationMarks_Impl
(
std
::
vector
<
OUString
>&
rStarts
,
std
::
vector
<
OUString
>&
rEnds
)
{
for
(
std
::
vector
<
OUString
>::
const_iterator
i
=
rStarts
.
begin
(),
end
=
rStarts
.
end
();
i
!=
end
;
++
i
)
{
OString
rName
=
OUStringToOString
(
*
i
,
RTL_TEXTENCODING_UTF8
);
// Output the annotation mark
sal_uInt16
nId
=
m_nNextAnnotationMarkId
++
;
const
SwPostItField
*
pField
=
0
;
// This will be set by PostitField().
m_rOpenedAnnotationMarksIds
[
rName
]
=
std
::
make_pair
(
nId
,
pField
);
m_aRun
->
append
(
"{"
OOO_STRING_SVTOOLS_RTF_IGNORE
OOO_STRING_SVTOOLS_RTF_ATRFSTART
" "
);
m_aRun
->
append
(
OString
::
number
(
nId
).
getStr
());
m_aRun
->
append
(
'}'
);
}
rStarts
.
clear
();
for
(
std
::
vector
<
OUString
>::
const_iterator
i
=
rEnds
.
begin
(),
end
=
rEnds
.
end
();
i
!=
end
;
++
i
)
{
OString
rName
=
OUStringToOString
(
*
i
,
RTL_TEXTENCODING_UTF8
);
// Get the id of the annotation mark
std
::
map
<
OString
,
std
::
pair
<
sal_uInt16
,
const
SwPostItField
*>
>::
iterator
it
=
m_rOpenedAnnotationMarksIds
.
find
(
rName
);
if
(
it
!=
m_rOpenedAnnotationMarksIds
.
end
())
{
sal_uInt16
nId
=
(
*
it
).
second
.
first
;
const
SwPostItField
*
pField
=
(
*
it
).
second
.
second
;
m_aRun
->
append
(
"{"
OOO_STRING_SVTOOLS_RTF_IGNORE
OOO_STRING_SVTOOLS_RTF_ATRFEND
" "
);
m_aRun
->
append
(
OString
::
number
(
nId
).
getStr
());
m_aRun
->
append
(
'}'
);
m_rOpenedAnnotationMarksIds
.
erase
(
rName
);
if
(
pField
)
{
m_aRunText
->
append
(
"{"
);
PostitField
(
pField
);
m_aRunText
->
append
(
"}"
);
}
}
}
rEnds
.
clear
();
}
void
RtfAttributeOutput
::
WriteHeaderFooter_Impl
(
const
SwFrmFmt
&
rFmt
,
bool
bHeader
,
const
sal_Char
*
pStr
,
bool
bTitlepg
)
void
RtfAttributeOutput
::
WriteHeaderFooter_Impl
(
const
SwFrmFmt
&
rFmt
,
bool
bHeader
,
const
sal_Char
*
pStr
,
bool
bTitlepg
)
{
{
OStringBuffer
aSectionBreaks
=
m_aSectionBreaks
;
OStringBuffer
aSectionBreaks
=
m_aSectionBreaks
;
...
@@ -3184,6 +3226,16 @@ void RtfAttributeOutput::PostitField( const SwField* pFld )
...
@@ -3184,6 +3226,16 @@ void RtfAttributeOutput::PostitField( const SwField* pFld )
const
SwPostItField
&
rPFld
=
*
(
SwPostItField
*
)
pFld
;
const
SwPostItField
&
rPFld
=
*
(
SwPostItField
*
)
pFld
;
OString
aName
=
OUStringToOString
(
rPFld
.
GetName
(),
RTL_TEXTENCODING_UTF8
);
std
::
map
<
OString
,
std
::
pair
<
sal_uInt16
,
const
SwPostItField
*>
>::
iterator
it
=
m_rOpenedAnnotationMarksIds
.
find
(
aName
);
if
(
it
!=
m_rOpenedAnnotationMarksIds
.
end
())
{
// In case this field is inside annotation marks, we want to write the
// annotation itself after the annotation mark is closed, not here.
it
->
second
.
second
=
&
rPFld
;
return
;
}
m_aRunText
->
append
(
"{"
OOO_STRING_SVTOOLS_RTF_IGNORE
OOO_STRING_SVTOOLS_RTF_ATNID
" "
);
m_aRunText
->
append
(
"{"
OOO_STRING_SVTOOLS_RTF_IGNORE
OOO_STRING_SVTOOLS_RTF_ATNID
" "
);
m_aRunText
->
append
(
OUStringToOString
(
OUString
(
rPFld
.
GetInitials
()),
m_rExport
.
eCurrentEncoding
));
m_aRunText
->
append
(
OUStringToOString
(
OUString
(
rPFld
.
GetInitials
()),
m_rExport
.
eCurrentEncoding
));
m_aRunText
->
append
(
"}"
);
m_aRunText
->
append
(
"}"
);
...
@@ -3205,16 +3257,10 @@ void RtfAttributeOutput::PostitField( const SwField* pFld )
...
@@ -3205,16 +3257,10 @@ void RtfAttributeOutput::PostitField( const SwField* pFld )
void
RtfAttributeOutput
::
WritePostitFieldStart
()
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
()
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*/
)
bool
RtfAttributeOutput
::
DropdownField
(
const
SwField
*
/*pFld*/
)
...
@@ -3234,6 +3280,7 @@ bool RtfAttributeOutput::PlaceholderField( const SwField* pField)
...
@@ -3234,6 +3280,7 @@ bool RtfAttributeOutput::PlaceholderField( const SwField* pField)
RtfAttributeOutput
::
RtfAttributeOutput
(
RtfExport
&
rExport
)
RtfAttributeOutput
::
RtfAttributeOutput
(
RtfExport
&
rExport
)
:
m_rExport
(
rExport
),
:
m_rExport
(
rExport
),
m_bStrikeDouble
(
false
),
m_bStrikeDouble
(
false
),
m_nNextAnnotationMarkId
(
0
),
m_pTableWrt
(
NULL
),
m_pTableWrt
(
NULL
),
m_bTableCellOpen
(
false
),
m_bTableCellOpen
(
false
),
m_nTableDepth
(
0
),
m_nTableDepth
(
0
),
...
...
sw/source/filter/ww8/rtfattributeoutput.hxx
Dosyayı görüntüle @
03eb7ac9
...
@@ -212,6 +212,7 @@ public:
...
@@ -212,6 +212,7 @@ public:
void
WriteField_Impl
(
const
SwField
*
pFld
,
ww
::
eField
eType
,
const
OUString
&
rFldCmd
,
sal_uInt8
nMode
);
void
WriteField_Impl
(
const
SwField
*
pFld
,
ww
::
eField
eType
,
const
OUString
&
rFldCmd
,
sal_uInt8
nMode
);
void
WriteBookmarks_Impl
(
std
::
vector
<
OUString
>&
rStarts
,
std
::
vector
<
OUString
>&
rEnds
);
void
WriteBookmarks_Impl
(
std
::
vector
<
OUString
>&
rStarts
,
std
::
vector
<
OUString
>&
rEnds
);
void
WriteAnnotationMarks_Impl
(
std
::
vector
<
OUString
>&
rStarts
,
std
::
vector
<
OUString
>&
rEnds
);
void
WriteHeaderFooter_Impl
(
const
SwFrmFmt
&
rFmt
,
bool
bHeader
,
const
sal_Char
*
pStr
,
bool
bTitlepg
);
void
WriteHeaderFooter_Impl
(
const
SwFrmFmt
&
rFmt
,
bool
bHeader
,
const
sal_Char
*
pStr
,
bool
bTitlepg
);
protected
:
protected
:
...
@@ -502,6 +503,10 @@ private:
...
@@ -502,6 +503,10 @@ private:
*/
*/
bool
m_bStrikeDouble
;
bool
m_bStrikeDouble
;
sal_Int32
m_nNextAnnotationMarkId
;
/// Map of the annotation marks ids
std
::
map
<
OString
,
std
::
pair
<
sal_uInt16
,
const
SwPostItField
*>
>
m_rOpenedAnnotationMarksIds
;
/*
/*
* The current table helper.
* The current table helper.
*/
*/
...
...
sw/source/filter/ww8/rtfexport.cxx
Dosyayı görüntüle @
03eb7ac9
...
@@ -163,8 +163,32 @@ void RtfExport::AppendBookmark( const OUString& rName, bool /*bSkip*/ )
...
@@ -163,8 +163,32 @@ void RtfExport::AppendBookmark( const OUString& rName, bool /*bSkip*/ )
m_pAttrOutput
->
WriteBookmarks_Impl
(
aStarts
,
aEnds
);
m_pAttrOutput
->
WriteBookmarks_Impl
(
aStarts
,
aEnds
);
}
}
void
RtfExport
::
AppendAnnotationMarks
(
const
SwTxtNode
&
/*rNode*/
,
sal_Int32
/*nAktPos*/
,
sal_Int32
/*nLen*/
)
void
RtfExport
::
AppendAnnotationMarks
(
const
SwTxtNode
&
rNode
,
sal_Int32
nAktPos
,
sal_Int32
nLen
)
{
{
SAL_INFO
(
"sw.rtf"
,
OSL_THIS_FUNC
);
std
::
vector
<
OUString
>
aStarts
;
std
::
vector
<
OUString
>
aEnds
;
IMarkVector
aMarks
;
if
(
GetAnnotationMarks
(
rNode
,
nAktPos
,
nAktPos
+
nLen
,
aMarks
)
)
{
for
(
IMarkVector
::
const_iterator
it
=
aMarks
.
begin
(),
end
=
aMarks
.
end
();
it
!=
end
;
++
it
)
{
IMark
*
pMark
=
(
*
it
);
const
sal_Int32
nStart
=
pMark
->
GetMarkStart
().
nContent
.
GetIndex
();
const
sal_Int32
nEnd
=
pMark
->
GetMarkEnd
().
nContent
.
GetIndex
();
if
(
nStart
==
nAktPos
)
aStarts
.
push_back
(
pMark
->
GetName
()
);
if
(
nEnd
==
nAktPos
)
aEnds
.
push_back
(
pMark
->
GetName
()
);
}
}
m_pAttrOutput
->
WriteAnnotationMarks_Impl
(
aStarts
,
aEnds
);
}
}
//For i120928,to export graphic of bullet for RTF filter
//For i120928,to export graphic of bullet for RTF filter
...
...
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