summaryrefslogtreecommitdiff
path: root/sw/source/filter/ww8
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2013-02-26 15:36:09 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-02-28 15:11:57 +0000
commit3209bc81245452ef6976c77818186b05c3026438 (patch)
tree84face5b12c25994325b03a79b3d6809ba65edb8 /sw/source/filter/ww8
parent4ffa2ddf2490005347a6567fcd2f619f06c33025 (diff)
fdo#61507 import/export RTF_UPR and RTF_UD
In short, these commits make the RTF filter import and export unicode characters in document title properly. Previously we failed to import such files from Word, and the export result caused problems in Wordpad (Word handled it fine). (cherry picked from commits 0805b222f87bf99ec0c53ca678d1c670eb5293a2, 3a934d928e455eca38f124072c20a624a64aa225 and 5de52551a963b932cc23c2ea75f709fa1924520b) Change-Id: Ic9417d0f23d44149acb3ae3dc9d4c281058a1b36 Reviewed-on: https://gerrit.libreoffice.org/2436 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source/filter/ww8')
-rw-r--r--sw/source/filter/ww8/rtfexport.cxx15
-rw-r--r--sw/source/filter/ww8/rtfexport.hxx2
2 files changed, 11 insertions, 6 deletions
diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx
index 8259d59fb065..fc1afec58911 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -395,7 +395,7 @@ void RtfExport::WriteInfo()
}
if (xDocProps.is()) {
- OutUnicode(OOO_STRING_SVTOOLS_RTF_TITLE, xDocProps->getTitle());
+ OutUnicode(OOO_STRING_SVTOOLS_RTF_TITLE, xDocProps->getTitle(), true);
OutUnicode(OOO_STRING_SVTOOLS_RTF_SUBJECT, xDocProps->getSubject());
OutUnicode(OOO_STRING_SVTOOLS_RTF_KEYWORDS,
@@ -791,13 +791,18 @@ SvStream& RtfExport::OutLong( long nVal )
return m_pWriter->OutLong( Strm(), nVal );
}
-void RtfExport::OutUnicode(const sal_Char *pToken, const String &rContent)
+void RtfExport::OutUnicode(const sal_Char *pToken, const String &rContent, bool bUpr)
{
if (rContent.Len())
{
- Strm() << '{' << pToken << ' ';
- Strm() << msfilter::rtfutil::OutString( rContent, eCurrentEncoding ).getStr();
- Strm() << '}';
+ if (!bUpr)
+ {
+ Strm() << '{' << pToken << ' ';
+ Strm() << msfilter::rtfutil::OutString( rContent, eCurrentEncoding ).getStr();
+ Strm() << '}';
+ }
+ else
+ Strm() << msfilter::rtfutil::OutStringUpr(pToken, rContent, eCurrentEncoding).getStr();
}
}
diff --git a/sw/source/filter/ww8/rtfexport.hxx b/sw/source/filter/ww8/rtfexport.hxx
index c21a5e9e5b94..30d4c799a03b 100644
--- a/sw/source/filter/ww8/rtfexport.hxx
+++ b/sw/source/filter/ww8/rtfexport.hxx
@@ -156,7 +156,7 @@ public:
SvStream& Strm();
SvStream& OutULong( sal_uLong nVal );
SvStream& OutLong( long nVal );
- void OutUnicode(const sal_Char *pToken, const String &rContent);
+ void OutUnicode(const sal_Char *pToken, const String &rContent, bool bUpr = false);
void OutDateTime(const sal_Char* pStr, const util::DateTime& rDT );
void OutPageDescription( const SwPageDesc& rPgDsc, sal_Bool bWriteReset, sal_Bool bCheckForFirstPage );