Kaydet (Commit) f2c63c56 authored tarafından Malte Timmermann's avatar Malte Timmermann

#96441# EnableStoreUnicodeNames

üst e3c0f8d4
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: fontitem.hxx,v $ * $RCSfile: fontitem.hxx,v $
* *
* $Revision: 1.5 $ * $Revision: 1.6 $
* *
* last change: $Author: mib $ $Date: 2001-07-05 09:48:22 $ * last change: $Author: mt $ $Date: 2002-11-05 15:40:35 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -98,6 +98,8 @@ class SvxFontItem : public SfxPoolItem ...@@ -98,6 +98,8 @@ class SvxFontItem : public SfxPoolItem
FontPitch ePitch; FontPitch ePitch;
rtl_TextEncoding eTextEncoding; rtl_TextEncoding eTextEncoding;
static BOOL bEnableStoreUnicodeNames;
public: public:
TYPEINFO(); TYPEINFO();
...@@ -147,6 +149,8 @@ public: ...@@ -147,6 +149,8 @@ public:
return *this; return *this;
} }
static void EnableStoreUnicodeNames( BOOL bEnable ) { bEnableStoreUnicodeNames = bEnable; }
}; };
void GetDefaultFonts( SvxFontItem& rLatin, SvxFontItem& rAsian, void GetDefaultFonts( SvxFontItem& rLatin, SvxFontItem& rAsian,
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: impedit2.cxx,v $ * $RCSfile: impedit2.cxx,v $
* *
* $Revision: 1.81 $ * $Revision: 1.82 $
* *
* last change: $Author: mt $ $Date: 2002-11-01 12:37:49 $ * last change: $Author: mt $ $Date: 2002-11-05 15:42:43 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -86,6 +86,7 @@ ...@@ -86,6 +86,7 @@
#include <adjitem.hxx> #include <adjitem.hxx>
#include <scripttypeitem.hxx> #include <scripttypeitem.hxx>
#include <frmdiritem.hxx> #include <frmdiritem.hxx>
#include <fontitem.hxx>
#ifndef _SFXVIEWFRM_HXX //autogen #ifndef _SFXVIEWFRM_HXX //autogen
#include <sfx2/viewfrm.hxx> #include <sfx2/viewfrm.hxx>
...@@ -2938,8 +2939,10 @@ uno::Reference< datatransfer::XTransferable > ImpEditEngine::CreateTransferable( ...@@ -2938,8 +2939,10 @@ uno::Reference< datatransfer::XTransferable > ImpEditEngine::CreateTransferable(
aText.ConvertLineEnd(); // Systemspezifisch aText.ConvertLineEnd(); // Systemspezifisch
pDataObj->GetString() = aText; pDataObj->GetString() = aText;
SvxFontItem::EnableStoreUnicodeNames( TRUE );
WriteBin( pDataObj->GetStream(), aSelection, TRUE ); WriteBin( pDataObj->GetStream(), aSelection, TRUE );
pDataObj->GetStream().Seek( 0 ); pDataObj->GetStream().Seek( 0 );
SvxFontItem::EnableStoreUnicodeNames( FALSE );
((ImpEditEngine*)this)->WriteRTF( pDataObj->GetRTFStream(), aSelection ); ((ImpEditEngine*)this)->WriteRTF( pDataObj->GetRTFStream(), aSelection );
pDataObj->GetRTFStream().Seek( 0 ); pDataObj->GetRTFStream().Seek( 0 );
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: textitem.cxx,v $ * $RCSfile: textitem.cxx,v $
* *
* $Revision: 1.48 $ * $Revision: 1.49 $
* *
* last change: $Author: mt $ $Date: 2002-11-01 12:32:47 $ * last change: $Author: mt $ $Date: 2002-11-05 15:40:55 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -241,6 +241,8 @@ ...@@ -241,6 +241,8 @@
#include <tools/tenccvt.hxx> #include <tools/tenccvt.hxx>
#endif #endif
#define STORE_UNICODE_MAGIC_MARKER 0xFE331188
using namespace ::rtl; using namespace ::rtl;
using namespace ::com::sun::star; using namespace ::com::sun::star;
using namespace ::com::sun::star::text; using namespace ::com::sun::star::text;
...@@ -249,6 +251,8 @@ using namespace ::com::sun::star::text; ...@@ -249,6 +251,8 @@ using namespace ::com::sun::star::text;
#define TWIP_TO_MM100(TWIP) ((TWIP) >= 0 ? (((TWIP)*127L+36L)/72L) : (((TWIP)*127L-36L)/72L)) #define TWIP_TO_MM100(TWIP) ((TWIP) >= 0 ? (((TWIP)*127L+36L)/72L) : (((TWIP)*127L-36L)/72L))
#define MM100_TO_TWIP(MM100) ((MM100) >= 0 ? (((MM100)*72L+63L)/127L) : (((MM100)*72L-63L)/127L)) #define MM100_TO_TWIP(MM100) ((MM100) >= 0 ? (((MM100)*72L+63L)/127L) : (((MM100)*72L-63L)/127L))
BOOL SvxFontItem::bEnableStoreUnicodeNames = FALSE;
// STATIC DATA ----------------------------------------------------------- // STATIC DATA -----------------------------------------------------------
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
...@@ -476,18 +480,20 @@ SvStream& SvxFontItem::Store( SvStream& rStrm , USHORT nItemVersion ) const ...@@ -476,18 +480,20 @@ SvStream& SvxFontItem::Store( SvStream& rStrm , USHORT nItemVersion ) const
rStrm << (BYTE) GetFamily() << (BYTE) GetPitch() rStrm << (BYTE) GetFamily() << (BYTE) GetPitch()
<< (BYTE)(bToBats ? RTL_TEXTENCODING_SYMBOL : GetSOStoreTextEncoding(GetCharSet(), (sal_uInt16)rStrm.GetVersion())); << (BYTE)(bToBats ? RTL_TEXTENCODING_SYMBOL : GetSOStoreTextEncoding(GetCharSet(), (sal_uInt16)rStrm.GetVersion()));
String aStoreFamilyName( GetFamilyName() );
if( bToBats ) if( bToBats )
aStoreFamilyName = String( "StarBats", sizeof("StarBats")-1, RTL_TEXTENCODING_ASCII_US );
rStrm.WriteByteString(aStoreFamilyName);
rStrm.WriteByteString(GetStyleName());
// #96441# Kach for EditEngine, only set while creating clipboard stream.
if ( bEnableStoreUnicodeNames )
{ {
String sStarBats( "StarBats", sizeof("StarBats")-1, RTL_TEXTENCODING_ASCII_US ); ULONG nMagic = STORE_UNICODE_MAGIC_MARKER;
rStrm.WriteByteString( sStarBats ); rStrm << nMagic;
rStrm.WriteByteString( aStoreFamilyName, RTL_TEXTENCODING_UNICODE );
rStrm.WriteByteString( GetStyleName(), RTL_TEXTENCODING_UNICODE );
} }
else
rStrm.WriteByteString(GetFamilyName());
// UNICODE: rStrm << GetFamilyName();
// UNICODE: rStrm << GetStyleName();
rStrm.WriteByteString(GetStyleName());
return rStrm; return rStrm;
} }
...@@ -515,6 +521,22 @@ SfxPoolItem* SvxFontItem::Create(SvStream& rStrm, USHORT) const ...@@ -515,6 +521,22 @@ SfxPoolItem* SvxFontItem::Create(SvStream& rStrm, USHORT) const
if ( RTL_TEXTENCODING_SYMBOL != eFontTextEncoding && aName.EqualsAscii("StarBats") ) if ( RTL_TEXTENCODING_SYMBOL != eFontTextEncoding && aName.EqualsAscii("StarBats") )
eFontTextEncoding = RTL_TEXTENCODING_SYMBOL; eFontTextEncoding = RTL_TEXTENCODING_SYMBOL;
// Check if we have stored unicode
ULONG nStreamPos = rStrm.Tell();
ULONG nMagic = STORE_UNICODE_MAGIC_MARKER;
rStrm >> nMagic;
if ( nMagic == STORE_UNICODE_MAGIC_MARKER )
{
rStrm.ReadByteString( aName, RTL_TEXTENCODING_UNICODE );
rStrm.ReadByteString( aStyle, RTL_TEXTENCODING_UNICODE );
}
else
{
rStrm.Seek( nStreamPos );
}
return new SvxFontItem( (FontFamily)eFamily, aName, aStyle, return new SvxFontItem( (FontFamily)eFamily, aName, aStyle,
(FontPitch)eFontPitch, (rtl_TextEncoding)eFontTextEncoding, Which() ); (FontPitch)eFontPitch, (rtl_TextEncoding)eFontTextEncoding, Which() );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment