summaryrefslogtreecommitdiffstats
path: root/dtrans/source/win32/dtobj/DataFmtTransl.cxx
diff options
context:
space:
mode:
authorTino Rachui <tra@openoffice.org>2001-03-20 12:40:26 +0000
committerTino Rachui <tra@openoffice.org>2001-03-20 12:40:26 +0000
commit405ea9e6ea8ef8ada07ba206960ace6dc491377f (patch)
treef828507518521584ca8d9d3b4f5b611da910ed67 /dtrans/source/win32/dtobj/DataFmtTransl.cxx
parentadd. include XMuliServiceFactory (diff)
downloadcore-405ea9e6ea8ef8ada07ba206960ace6dc491377f.tar.gz
core-405ea9e6ea8ef8ada07ba206960ace6dc491377f.zip
*** empty log message ***
Diffstat (limited to 'dtrans/source/win32/dtobj/DataFmtTransl.cxx')
-rw-r--r--dtrans/source/win32/dtobj/DataFmtTransl.cxx53
1 files changed, 5 insertions, 48 deletions
diff --git a/dtrans/source/win32/dtobj/DataFmtTransl.cxx b/dtrans/source/win32/dtobj/DataFmtTransl.cxx
index 9f6845d8f9d2..b5de5aa02624 100644
--- a/dtrans/source/win32/dtobj/DataFmtTransl.cxx
+++ b/dtrans/source/win32/dtobj/DataFmtTransl.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: DataFmtTransl.cxx,v $
*
- * $Revision: 1.11 $
+ * $Revision: 1.12 $
*
- * last change: $Author: tra $ $Date: 2001-03-20 09:26:01 $
+ * last change: $Author: tra $ $Date: 2001-03-20 13:39:33 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -183,7 +183,7 @@ CFormatEtc CDataFormatTranslator::getFormatEtcFromDataFlavor( const DataFlavor&
//
//------------------------------------------------------------------------
-DataFlavor CDataFormatTranslator::getDataFlavorFromFormatEtc( const Reference< XTransferable >& refXTransferable, const FORMATETC& aFormatEtc ) const
+DataFlavor CDataFormatTranslator::getDataFlavorFromFormatEtc( const FORMATETC& aFormatEtc, LCID lcid ) const
{
DataFlavor aFlavor;
@@ -201,7 +201,7 @@ DataFlavor CDataFormatTranslator::getDataFlavorFromFormatEtc( const Reference< X
if ( isOemOrAnsiTextFormat( aClipformat ) )
{
aFlavor.MimeType = OUString::createFromAscii( "text/plain;charset=" );
- aFlavor.MimeType += getTextCharsetFromClipboard( refXTransferable, aClipformat );
+ aFlavor.MimeType += getTextCharsetFromLCID( lcid, aClipformat );
aFlavor.HumanPresentableName = OUString::createFromAscii( "OEM/ANSI Text" );
aFlavor.DataType = CPPUTYPE_SEQSALINT8;
@@ -340,58 +340,16 @@ sal_Bool SAL_CALL CDataFormatTranslator::isTextHtmlFormat( CLIPFORMAT cf ) const
}
//------------------------------------------------------------------------
-// should be called only if there is realy text on the clipboard
-//------------------------------------------------------------------------
-
-LCID SAL_CALL CDataFormatTranslator::getCurrentLocaleFromClipboard(
- const Reference< XTransferable >& refXTransferable ) const
-{
- Any aAny;
- CFormatEtc fetc = getFormatEtcForClipformat( CF_LOCALE );
- DataFlavor aFlavor = getDataFlavorFromFormatEtc( refXTransferable, fetc );
-
- OSL_ASSERT( aFlavor.MimeType.getLength( ) );
-
- LCID lcid = 0;
-
- try
- {
- aAny = refXTransferable->getTransferData( aFlavor );
- if ( aAny.hasValue( ) && (aAny.getValueType( ) == CPPUTYPE_SEQSALINT8) )
- {
- Sequence< sal_Int8 > byteStream;
- aAny >>= byteStream;
-
- lcid = *reinterpret_cast< LCID* >( byteStream.getArray( ) );
- }
- }
- catch( UnsupportedFlavorException& )
- {
- }
- catch( ... )
- {
- OSL_ENSURE( sal_False, "Unexpected error" );
- }
-
- if ( !IsValidLocale( lcid, LCID_SUPPORTED ) )
- lcid = GetThreadLocale( );
-
- return lcid;
-}
-
-//------------------------------------------------------------------------
//
//------------------------------------------------------------------------
-OUString SAL_CALL CDataFormatTranslator::getTextCharsetFromClipboard(
- const Reference< XTransferable >& refXTransferable, CLIPFORMAT aClipformat ) const
+OUString SAL_CALL CDataFormatTranslator::getTextCharsetFromLCID( LCID lcid, CLIPFORMAT aClipformat ) const
{
OSL_ASSERT( isOemOrAnsiTextFormat( aClipformat ) );
OUString charset;
if ( CF_TEXT == aClipformat )
{
- LCID lcid = getCurrentLocaleFromClipboard( refXTransferable );
charset = getMimeCharsetFromLocaleId(
lcid,
LOCALE_IDEFAULTANSICODEPAGE,
@@ -399,7 +357,6 @@ OUString SAL_CALL CDataFormatTranslator::getTextCharsetFromClipboard(
}
else if ( CF_OEMTEXT == aClipformat )
{
- LCID lcid = getCurrentLocaleFromClipboard( refXTransferable );
charset = getMimeCharsetFromLocaleId(
lcid,
LOCALE_IDEFAULTCODEPAGE,