summaryrefslogtreecommitdiff
path: root/sw/source/filter/rtf
diff options
context:
space:
mode:
authorjp <jp@openoffice.org>2001-07-03 16:32:09 +0000
committerjp <jp@openoffice.org>2001-07-03 16:32:09 +0000
commitc00014f11cd0b9176f79e75da03ce66ec14f60d5 (patch)
treeba8c8e22274f3dda89f222944dce8e61d3efab2e /sw/source/filter/rtf
parent73689d7a36f05f25d4e34beac841012ffafcbc52 (diff)
Bug #89193#,#89130#: dont write the list of fonts - only one or two
Diffstat (limited to 'sw/source/filter/rtf')
-rw-r--r--sw/source/filter/rtf/wrtrtf.cxx49
1 files changed, 45 insertions, 4 deletions
diff --git a/sw/source/filter/rtf/wrtrtf.cxx b/sw/source/filter/rtf/wrtrtf.cxx
index 18524ca0b6d2..cc096acc6e6d 100644
--- a/sw/source/filter/rtf/wrtrtf.cxx
+++ b/sw/source/filter/rtf/wrtrtf.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: wrtrtf.cxx,v $
*
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: jp $ $Date: 2001-05-25 16:03:48 $
+ * last change: $Author: jp $ $Date: 2001-07-03 17:32:09 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -78,6 +78,9 @@
#ifndef _DATETIME_HXX //autogen
#include <tools/datetime.hxx>
#endif
+#ifndef _SV_FONTCVT_HXX
+#include <vcl/fontcvt.hxx>
+#endif
#ifndef _RTL_TENCINFO_H
#include <rtl/tencinfo.h>
#endif
@@ -874,9 +877,47 @@ static void _OutFont( SwRTFWriter& rWrt, const SvxFontItem& rFont, USHORT nNo )
rWrt.Strm() << sRTF_FCHARSET;
rWrt.OutULong( nChSet );
+#ifdef _WITH_ALTERNATIV_NAMES
+ String sFntNm( GetFontToken( rFont.GetFamilyName(), 0 )),
+ sAltNm( GetFontToken( rFont.GetFamilyName(), 1 ));
+
+//JP 27.6.2001: hack for WinWord - in other case they can't use alternative
+// fontnames - don't ask me why.
+
rWrt.Strm() << ' ';
- RTFOutFuncs::Out_String( rWrt.Strm(), rFont.GetFamilyName(), DEF_ENCODING,
- rWrt.bWriteHelpFmt ) << ";}";
+ RTFOutFuncs::Out_String( rWrt.Strm(), sFntNm, DEF_ENCODING,
+ rWrt.bWriteHelpFmt );
+ if( sAltNm.Len() )
+ {
+ OutComment( rWrt, sRTF_FALT) << ' ';
+ RTFOutFuncs::Out_String( rWrt.Strm(), sAltNm, DEF_ENCODING,
+ rWrt.bWriteHelpFmt ) << '}';
+ }
+#else
+ String sFamilyNm( ::GetFontToken( rFont.GetFamilyName(), 0 ));
+/* if( sFamilyNm.Len() != rFont.GetFamilyName().Len() )
+ {
+ String sTmp( ::GetSubsFontName( sFamilyNm,
+ SUBSFONT_MS | SUBSFONT_ONLYONE ));
+ if( sTmp.Len() )
+ sFamilyNm = sTmp;
+ }
+*/
+ //JP 3.7.2001: hack - so that WW can show CJK documents correct, if no
+ // font exist.
+ if( sFamilyNm.Len() != rFont.GetFamilyName().Len() )
+ {
+ // mostly the MS fonts are the second one ;-)
+ String sTmp( ::GetFontToken( rFont.GetFamilyName(), 1 ));
+ if( sTmp.Len() )
+ ( sFamilyNm += ';' ) += sTmp;
+ }
+ rWrt.Strm() << ' ';
+ RTFOutFuncs::Out_String( rWrt.Strm(), sFamilyNm, DEF_ENCODING,
+ rWrt.bWriteHelpFmt );
+#endif
+
+ rWrt.Strm() << ";}";
}
void SwRTFWriter::OutRTFFontTab()