This is an automated email from the ASF dual-hosted git repository. mseidel pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/openoffice.git
The following commit(s) were added to refs/heads/trunk by this push: new 52ec01a Fixed typos, removed whitespace 52ec01a is described below commit 52ec01ac05bde4ba6193689bce5c5f172e6b5f3d Author: mseidel <msei...@apache.org> AuthorDate: Thu Feb 27 11:39:02 2020 +0100 Fixed typos, removed whitespace --- main/dtrans/source/win32/dtobj/DOTransferable.cxx | 176 +++++++++++----------- main/dtrans/source/win32/dtobj/DOTransferable.hxx | 45 +++--- main/dtrans/source/win32/dtobj/FetcList.hxx | 55 ++++--- 3 files changed, 137 insertions(+), 139 deletions(-) diff --git a/main/dtrans/source/win32/dtobj/DOTransferable.cxx b/main/dtrans/source/win32/dtobj/DOTransferable.cxx index 28a5f5a..17b5f4e 100644 --- a/main/dtrans/source/win32/dtobj/DOTransferable.cxx +++ b/main/dtrans/source/win32/dtobj/DOTransferable.cxx @@ -1,5 +1,5 @@ /************************************************************** - * + * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -7,16 +7,16 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * + * *************************************************************/ @@ -66,7 +66,7 @@ using namespace com::sun::star::lang; using namespace com::sun::star::container; //------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------ namespace @@ -78,7 +78,7 @@ namespace sal_Bool isValidFlavor( const DataFlavor& aFlavor ) { return ( aFlavor.MimeType.getLength( ) && - ( ( aFlavor.DataType == CPPUTYPE_SEQINT8 ) || + ( ( aFlavor.DataType == CPPUTYPE_SEQINT8 ) || ( aFlavor.DataType == CPPUTYPE_OUSTRING ) ) ); } @@ -89,21 +89,21 @@ namespace // ctor //------------------------------------------------------------------------ -CDOTransferable::CDOTransferable( +CDOTransferable::CDOTransferable( const Reference< XMultiServiceFactory >& ServiceManager, IDataObjectPtr rDataObject ) : m_rDataObject( rDataObject ), m_SrvMgr( ServiceManager ), m_DataFormatTranslator( m_SrvMgr ), m_bUnicodeRegistered( sal_False ), m_TxtFormatOnClipboard( CF_INVALID ) -{ +{ } //------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------ -Any SAL_CALL CDOTransferable::getTransferData( const DataFlavor& aFlavor ) +Any SAL_CALL CDOTransferable::getTransferData( const DataFlavor& aFlavor ) throw( UnsupportedFlavorException, IOException, RuntimeException ) { OSL_ASSERT( isValidFlavor( aFlavor ) ); @@ -120,30 +120,30 @@ Any SAL_CALL CDOTransferable::getTransferData( const DataFlavor& aFlavor ) //------------------------------------------------ // get the data from clipboard in a byte stream //------------------------------------------------ - + ByteSequence_t clipDataStream; - + try { clipDataStream = getClipboardData( fetc ); } catch( UnsupportedFlavorException& ) { - if ( m_DataFormatTranslator.isUnicodeTextFormat( fetc.getClipformat( ) ) && + if ( m_DataFormatTranslator.isUnicodeTextFormat( fetc.getClipformat( ) ) && m_bUnicodeRegistered ) { - OUString aUnicodeText = synthesizeUnicodeText( ); + OUString aUnicodeText = synthesizeUnicodeText( ); Any aAny = makeAny( aUnicodeText ); return aAny; } - // #124085# CF_DIBV5 should not be possible, but keep for reading from the + // #124085# CF_DIBV5 should not be possible, but keep for reading from the // clipboard for being on the safe side else if(CF_DIBV5 == fetc.getClipformat()) { - // #123407# CF_DIBV5 has priority; if the try to fetch this failed, + // #123407# CF_DIBV5 has priority; if the try to fetch this failed, // check CF_DIB availability as an alternative fetc.setClipformat(CF_DIB); - + try { clipDataStream = getClipboardData( fetc ); @@ -168,19 +168,19 @@ Any SAL_CALL CDOTransferable::getTransferData( const DataFlavor& aFlavor ) // getTransferDataFlavors //------------------------------------------------------------------------ -Sequence< DataFlavor > SAL_CALL CDOTransferable::getTransferDataFlavors( ) +Sequence< DataFlavor > SAL_CALL CDOTransferable::getTransferDataFlavors( ) throw( RuntimeException ) -{ - return m_FlavorList; +{ + return m_FlavorList; } //------------------------------------------------------------------------ // isDataFlavorSupported -// returns true if we find a DataFlavor with the same MimeType and +// returns true if we find a DataFlavor with the same MimeType and // DataType //------------------------------------------------------------------------ -sal_Bool SAL_CALL CDOTransferable::isDataFlavorSupported( const DataFlavor& aFlavor ) +sal_Bool SAL_CALL CDOTransferable::isDataFlavorSupported( const DataFlavor& aFlavor ) throw( RuntimeException ) { OSL_ASSERT( isValidFlavor( aFlavor ) ); @@ -194,9 +194,9 @@ sal_Bool SAL_CALL CDOTransferable::isDataFlavorSupported( const DataFlavor& aFla //------------------------------------------------------------------------ // helper function -// the list of datafalvors currently on the clipboard will be initialized -// only once; if the client of this Transferable will hold a reference -// to it und the underlying clipboard content changes, the client does +// the list of dataflavors currently on the clipboard will be initialized +// only once; if the client of this Transferable will hold a reference +// to it and the underlying clipboard content changes, the client does // possible operate on a invalid list // if there is only text on the clipboard we will also offer unicode text // an synthesize this format on the fly if requested, to accomplish this @@ -211,18 +211,18 @@ void SAL_CALL CDOTransferable::initFlavorList( ) if ( SUCCEEDED( hr ) ) { pEnumFormatEtc->Reset( ); - + FORMATETC fetc; while ( S_FALSE != pEnumFormatEtc->Next( 1, &fetc, NULL ) ) { // we use locales only to determine the - // charset if there is text on the cliboard + // charset if there is text on the clipboard // we don't offer this format if ( CF_LOCALE == fetc.cfFormat ) continue; - - DataFlavor aFlavor = formatEtcToDataFlavor( fetc ); - + + DataFlavor aFlavor = formatEtcToDataFlavor( fetc ); + // if text or oemtext is offered we also pretend to have unicode text if ( m_DataFormatTranslator.isOemOrAnsiTextFormat( fetc.cfFormat ) && !m_bUnicodeRegistered ) @@ -233,7 +233,7 @@ void SAL_CALL CDOTransferable::initFlavorList( ) m_bUnicodeRegistered = sal_True; // register unicode text as accompany format - aFlavor = formatEtcToDataFlavor( + aFlavor = formatEtcToDataFlavor( m_DataFormatTranslator.getFormatEtcForClipformat( CF_UNICODETEXT ) ); addSupportedFlavor( aFlavor ); } @@ -247,12 +247,12 @@ void SAL_CALL CDOTransferable::initFlavorList( ) // see MSDN IEnumFORMATETC CoTaskMemFree( fetc.ptd ); - } - } + } + } } //------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------ inline @@ -269,20 +269,20 @@ void SAL_CALL CDOTransferable::addSupportedFlavor( const DataFlavor& aFlavor ) } //------------------------------------------------------------------------ -// helper function +// helper function //------------------------------------------------------------------------ //inline DataFlavor SAL_CALL CDOTransferable::formatEtcToDataFlavor( const FORMATETC& aFormatEtc ) -{ +{ DataFlavor aFlavor; LCID lcid = 0; - - // for non-unicode text format we must provid a locale to get + + // for non-unicode text format we must provide a locale to get // the character-set of the text, if there is no locale on the // clipboard we assume the text is in a charset appropriate for // the current thread locale - if ( (CF_TEXT == aFormatEtc.cfFormat) || (CF_OEMTEXT == aFormatEtc.cfFormat) ) + if ( (CF_TEXT == aFormatEtc.cfFormat) || (CF_OEMTEXT == aFormatEtc.cfFormat) ) lcid = getLocaleFromClipboard( ); return m_DataFormatTranslator.getDataFlavorFromFormatEtc( aFormatEtc, lcid ); @@ -293,22 +293,22 @@ DataFlavor SAL_CALL CDOTransferable::formatEtcToDataFlavor( const FORMATETC& aFo // clipboard the function returns the current thread locale //------------------------------------------------------------------------ -LCID SAL_CALL CDOTransferable::getLocaleFromClipboard( ) +LCID SAL_CALL CDOTransferable::getLocaleFromClipboard( ) { LCID lcid = GetThreadLocale( ); try - { + { CFormatEtc fetc = m_DataFormatTranslator.getFormatEtcForClipformat( CF_LOCALE ); ByteSequence_t aLCIDSeq = getClipboardData( fetc ); lcid = *(reinterpret_cast<LCID*>( aLCIDSeq.getArray( ) ) ); - - // because of a Win95/98 Bug; there the high word + + // because of a Win95/98 Bug; there the high word // of a locale has the same value as the // low word e.g. 0x07040704 that's not right // correct is 0x00000704 - lcid &= 0x0000FFFF; - } + lcid &= 0x0000FFFF; + } catch(...) { // we take the default locale @@ -324,27 +324,27 @@ LCID SAL_CALL CDOTransferable::getLocaleFromClipboard( ) //------------------------------------------------------------------------ CDOTransferable::ByteSequence_t SAL_CALL CDOTransferable::getClipboardData( CFormatEtc& aFormatEtc ) -{ +{ STGMEDIUM stgmedium; HRESULT hr = m_rDataObject->GetData( aFormatEtc, &stgmedium ); - + // in case of failure to get a WMF metafile handle, try to get a memory block - if( FAILED( hr ) && - ( CF_METAFILEPICT == aFormatEtc.getClipformat() ) && + if( FAILED( hr ) && + ( CF_METAFILEPICT == aFormatEtc.getClipformat() ) && ( TYMED_MFPICT == aFormatEtc.getTymed() ) ) { CFormatEtc aTempFormat( aFormatEtc ); aTempFormat.setTymed( TYMED_HGLOBAL ); hr = m_rDataObject->GetData( aTempFormat, &stgmedium ); } - - if ( FAILED( hr ) ) + + if ( FAILED( hr ) ) { - OSL_ASSERT( (hr != E_INVALIDARG) && + OSL_ASSERT( (hr != E_INVALIDARG) && (hr != DV_E_DVASPECT) && (hr != DV_E_LINDEX) && (hr != DV_E_TYMED) ); - + if ( DV_E_FORMATETC == hr ) throw UnsupportedFlavorException( ); else if ( STG_E_MEDIUMFULL == hr ) @@ -352,15 +352,15 @@ CDOTransferable::ByteSequence_t SAL_CALL CDOTransferable::getClipboardData( CFor else throw RuntimeException( ); } - + ByteSequence_t byteStream; try - { + { if ( CF_ENHMETAFILE == aFormatEtc.getClipformat() ) - byteStream = WinENHMFPictToOOMFPict( stgmedium.hEnhMetaFile ); + byteStream = WinENHMFPictToOOMFPict( stgmedium.hEnhMetaFile ); else if (CF_HDROP == aFormatEtc.getClipformat()) - byteStream = CF_HDROPToFileList(stgmedium.hGlobal); + byteStream = CF_HDROPToFileList(stgmedium.hGlobal); else if ( CF_BITMAP == aFormatEtc.getClipformat() ) { byteStream = WinBITMAPToOOBMP(stgmedium.hBitmap); @@ -373,7 +373,7 @@ CDOTransferable::ByteSequence_t SAL_CALL CDOTransferable::getClipboardData( CFor else { clipDataToByteStream( aFormatEtc.getClipformat( ), stgmedium, byteStream ); - + // format conversion if necessary // #124085# DIBV5 should not happen currently, but keep as a hint here if(CF_DIBV5 == aFormatEtc.getClipformat() || CF_DIB == aFormatEtc.getClipformat()) @@ -389,38 +389,38 @@ CDOTransferable::ByteSequence_t SAL_CALL CDOTransferable::getClipboardData( CFor ReleaseStgMedium( &stgmedium ); } catch( CStgTransferHelper::CStgTransferException& ) - { + { ReleaseStgMedium( &stgmedium ); throw IOException( ); - } + } return byteStream; } //------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------ OUString SAL_CALL CDOTransferable::synthesizeUnicodeText( ) -{ +{ ByteSequence_t aTextSequence; CFormatEtc fetc; LCID lcid = getLocaleFromClipboard( ); sal_uInt32 cpForTxtCnvt = 0; - + if ( CF_TEXT == m_TxtFormatOnClipboard ) { fetc = m_DataFormatTranslator.getFormatEtcForClipformat( CF_TEXT ); aTextSequence = getClipboardData( fetc ); - + // determine the codepage used for text conversion - cpForTxtCnvt = getWinCPFromLocaleId( lcid, LOCALE_IDEFAULTANSICODEPAGE ).toInt32( ); + cpForTxtCnvt = getWinCPFromLocaleId( lcid, LOCALE_IDEFAULTANSICODEPAGE ).toInt32( ); } else if ( CF_OEMTEXT == m_TxtFormatOnClipboard ) { fetc = m_DataFormatTranslator.getFormatEtcForClipformat( CF_OEMTEXT ); aTextSequence = getClipboardData( fetc ); - + // determine the codepage used for text conversion cpForTxtCnvt = getWinCPFromLocaleId( lcid, LOCALE_IDEFAULTCODEPAGE ).toInt32( ); } @@ -435,15 +435,15 @@ OUString SAL_CALL CDOTransferable::synthesizeUnicodeText( ) sal::static_int_cast<sal_uInt32>(-1), // Huh ? stgTransferHelper, sal_False); - + CRawHGlobalPtr ptrHGlob(stgTransferHelper); sal_Unicode* pWChar = reinterpret_cast<sal_Unicode*>(ptrHGlob.GetMemPtr()); - + return OUString(pWChar); } //------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------ void CDOTransferable::clipDataToByteStream( CLIPFORMAT cf, STGMEDIUM stgmedium, ByteSequence_t& aByteSequence ) @@ -474,23 +474,23 @@ void CDOTransferable::clipDataToByteStream( CLIPFORMAT cf, STGMEDIUM stgmedium, throw UnsupportedFlavorException( ); break; } - + int nMemSize = memTransferHelper.memSize( cf ); aByteSequence.realloc( nMemSize ); - memTransferHelper.read( aByteSequence.getArray( ), nMemSize ); + memTransferHelper.read( aByteSequence.getArray( ), nMemSize ); } //------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------ -inline +inline Any CDOTransferable::byteStreamToAny( ByteSequence_t& aByteStream, const Type& aRequestedDataType ) -{ +{ Any aAny; - if ( aRequestedDataType == CPPUTYPE_OUSTRING ) - { + if ( aRequestedDataType == CPPUTYPE_OUSTRING ) + { OUString str = byteStreamToOUString( aByteStream ); aAny = makeAny( str ); } @@ -501,17 +501,17 @@ Any CDOTransferable::byteStreamToAny( ByteSequence_t& aByteStream, const Type& a } //------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------ -inline +inline OUString CDOTransferable::byteStreamToOUString( ByteSequence_t& aByteStream ) { sal_Int32 nWChars; sal_Int32 nMemSize = aByteStream.getLength( ); // if there is a trailing L"\0" subtract 1 from length - if ( 0 == aByteStream[ aByteStream.getLength( ) - 2 ] && + if ( 0 == aByteStream[ aByteStream.getLength( ) - 2 ] && 0 == aByteStream[ aByteStream.getLength( ) - 1 ] ) nWChars = static_cast< sal_Int32 >( nMemSize / sizeof( sal_Unicode ) ) - 1; else @@ -521,15 +521,15 @@ OUString CDOTransferable::byteStreamToOUString( ByteSequence_t& aByteStream ) } //------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------ -sal_Bool SAL_CALL CDOTransferable::compareDataFlavors( +sal_Bool SAL_CALL CDOTransferable::compareDataFlavors( const DataFlavor& lhs, const DataFlavor& rhs ) { if ( !m_rXMimeCntFactory.is( ) ) { - m_rXMimeCntFactory = Reference< XMimeContentTypeFactory >( m_SrvMgr->createInstance( + m_rXMimeCntFactory = Reference< XMimeContentTypeFactory >( m_SrvMgr->createInstance( OUString::createFromAscii( "com.sun.star.datatransfer.MimeContentTypeFactory" ) ), UNO_QUERY ); } OSL_ASSERT( m_rXMimeCntFactory.is( ) ); @@ -556,20 +556,20 @@ sal_Bool SAL_CALL CDOTransferable::compareDataFlavors( } //------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------ -sal_Bool SAL_CALL CDOTransferable::cmpFullMediaType( +sal_Bool SAL_CALL CDOTransferable::cmpFullMediaType( const Reference< XMimeContentType >& xLhs, const Reference< XMimeContentType >& xRhs ) const { return xLhs->getFullMediaType().equalsIgnoreAsciiCase( xRhs->getFullMediaType( ) ); } //------------------------------------------------------------------------ -// +// //------------------------------------------------------------------------ -sal_Bool SAL_CALL CDOTransferable::cmpAllContentTypeParameter( +sal_Bool SAL_CALL CDOTransferable::cmpAllContentTypeParameter( const Reference< XMimeContentType >& xLhs, const Reference< XMimeContentType >& xRhs ) const { Sequence< OUString > xLhsFlavors = xLhs->getParameters( ); @@ -584,7 +584,7 @@ sal_Bool SAL_CALL CDOTransferable::cmpAllContentTypeParameter( OUString pRhs; for ( sal_Int32 i = 0; i < xLhsFlavors.getLength( ); i++ ) - { + { pLhs = xLhs->getParameterValue( xLhsFlavors[i] ); pRhs = xRhs->getParameterValue( xLhsFlavors[i] ); @@ -622,7 +622,7 @@ sal_Bool SAL_CALL CDOTransferable::cmpAllContentTypeParameter( { if (m_rDataObject.is()) { - IDataObject* pObj= m_rDataObject.get(); + IDataObject* pObj= m_rDataObject.get(); pObj->AddRef(); retVal.setValue( &pObj, getCppuType((sal_uInt32*)0)); } diff --git a/main/dtrans/source/win32/dtobj/DOTransferable.hxx b/main/dtrans/source/win32/dtobj/DOTransferable.hxx index 2f39a32..d61641d 100644 --- a/main/dtrans/source/win32/dtobj/DOTransferable.hxx +++ b/main/dtrans/source/win32/dtobj/DOTransferable.hxx @@ -1,5 +1,5 @@ /************************************************************** - * + * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -7,21 +7,20 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * + * *************************************************************/ - #ifndef _DOTRANSFERABLE_HXX_ #define _DOTRANSFERABLE_HXX_ @@ -42,7 +41,7 @@ #include <systools/win32/comtools.hxx> //------------------------------------------------------------------------ -// deklarations +// declarations //------------------------------------------------------------------------ // forward @@ -59,25 +58,25 @@ public: // XTransferable //------------------------------------------------------------------------ - virtual ::com::sun::star::uno::Any SAL_CALL getTransferData( const ::com::sun::star::datatransfer::DataFlavor& aFlavor ) + virtual ::com::sun::star::uno::Any SAL_CALL getTransferData( const ::com::sun::star::datatransfer::DataFlavor& aFlavor ) throw( ::com::sun::star::datatransfer::UnsupportedFlavorException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor > SAL_CALL getTransferDataFlavors( ) + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor > SAL_CALL getTransferDataFlavors( ) throw( ::com::sun::star::uno::RuntimeException ); - - virtual sal_Bool SAL_CALL isDataFlavorSupported( const ::com::sun::star::datatransfer::DataFlavor& aFlavor ) + + virtual sal_Bool SAL_CALL isDataFlavorSupported( const ::com::sun::star::datatransfer::DataFlavor& aFlavor ) throw( ::com::sun::star::uno::RuntimeException ); //------------------------------------------------------------------------ // XSystemTransferable //------------------------------------------------------------------------ - virtual ::com::sun::star::uno::Any SAL_CALL getData( const com::sun::star::uno::Sequence<sal_Int8>& aProcessId ) throw + virtual ::com::sun::star::uno::Any SAL_CALL getData( const com::sun::star::uno::Sequence<sal_Int8>& aProcessId ) throw (::com::sun::star::uno::RuntimeException); - + private: // should be created only by CDTransObjFactory - explicit CDOTransferable( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& ServiceManager, + explicit CDOTransferable( + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& ServiceManager, IDataObjectPtr rDataObject ); //------------------------------------------------------------------------ @@ -85,32 +84,32 @@ private: //------------------------------------------------------------------------ void SAL_CALL initFlavorList( ); - - void SAL_CALL addSupportedFlavor( const com::sun::star::datatransfer::DataFlavor& aFlavor ); + + void SAL_CALL addSupportedFlavor( const com::sun::star::datatransfer::DataFlavor& aFlavor ); com::sun::star::datatransfer::DataFlavor SAL_CALL formatEtcToDataFlavor( const FORMATETC& aFormatEtc ); ByteSequence_t SAL_CALL getClipboardData( CFormatEtc& aFormatEtc ); rtl::OUString SAL_CALL synthesizeUnicodeText( ); - void SAL_CALL clipDataToByteStream( CLIPFORMAT cf, STGMEDIUM stgmedium, ByteSequence_t& aByteSequence ); - + void SAL_CALL clipDataToByteStream( CLIPFORMAT cf, STGMEDIUM stgmedium, ByteSequence_t& aByteSequence ); + ::com::sun::star::uno::Any SAL_CALL byteStreamToAny( ByteSequence_t& aByteStream, const com::sun::star::uno::Type& aRequestedDataType ); - rtl::OUString SAL_CALL byteStreamToOUString( ByteSequence_t& aByteStream ); - + rtl::OUString SAL_CALL byteStreamToOUString( ByteSequence_t& aByteStream ); + LCID SAL_CALL getLocaleFromClipboard( ); sal_Bool SAL_CALL compareDataFlavors( const com::sun::star::datatransfer::DataFlavor& lhs, const com::sun::star::datatransfer::DataFlavor& rhs ); - sal_Bool SAL_CALL cmpFullMediaType( const com::sun::star::uno::Reference< com::sun::star::datatransfer::XMimeContentType >& xLhs, + sal_Bool SAL_CALL cmpFullMediaType( const com::sun::star::uno::Reference< com::sun::star::datatransfer::XMimeContentType >& xLhs, const com::sun::star::uno::Reference< com::sun::star::datatransfer::XMimeContentType >& xRhs ) const; - sal_Bool SAL_CALL cmpAllContentTypeParameter( const com::sun::star::uno::Reference< com::sun::star::datatransfer::XMimeContentType >& xLhs, + sal_Bool SAL_CALL cmpAllContentTypeParameter( const com::sun::star::uno::Reference< com::sun::star::datatransfer::XMimeContentType >& xLhs, const com::sun::star::uno::Reference< com::sun::star::datatransfer::XMimeContentType >& xRhs ) const; private: IDataObjectPtr m_rDataObject; - com::sun::star::uno::Sequence< com::sun::star::datatransfer::DataFlavor > m_FlavorList; + com::sun::star::uno::Sequence< com::sun::star::datatransfer::DataFlavor > m_FlavorList; const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_SrvMgr; CDataFormatTranslator m_DataFormatTranslator; com::sun::star::uno::Reference< com::sun::star::datatransfer::XMimeContentTypeFactory > m_rXMimeCntFactory; diff --git a/main/dtrans/source/win32/dtobj/FetcList.hxx b/main/dtrans/source/win32/dtobj/FetcList.hxx index cf0f6b6..2238487 100644 --- a/main/dtrans/source/win32/dtobj/FetcList.hxx +++ b/main/dtrans/source/win32/dtobj/FetcList.hxx @@ -1,5 +1,5 @@ /************************************************************** - * + * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information @@ -7,21 +7,20 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. - * + * *************************************************************/ - #ifndef _FETCLIST_HXX_ #define _FETCLIST_HXX_ @@ -44,8 +43,8 @@ #include <vector> /***************************************************************** - a simple container for FORMATECT structures - instances of this class are not thread-safe + a simple container for FORMATETC structures + instances of this class are not thread-safe *****************************************************************/ class CFormatEtcContainer @@ -55,23 +54,23 @@ public: // duplicates not allowed void SAL_CALL addFormatEtc( const CFormatEtc& fetc ); - - // removes the specified formatetc + + // removes the specified formatetc void SAL_CALL removeFormatEtc( const CFormatEtc& fetc ); - + // removes the formatetc at pos void SAL_CALL removeAllFormatEtc( ); sal_Bool SAL_CALL hasFormatEtc( const CFormatEtc& fetc ) const; - + sal_Bool SAL_CALL hasElements( ) const; - + // begin enumeration void SAL_CALL beginEnumFormatEtc( ); - + // copies the specified number of formatetc structures starting // at the current enum position - // the return value is the number of copied elements; if the + // the return value is the number of copied elements; if the // current enum position is at the end the return value is 0 sal_uInt32 SAL_CALL nextFormatEtc( LPFORMATETC lpFetc, sal_uInt32 aNum = 1 ); @@ -81,7 +80,7 @@ public: protected: typedef std::vector< CFormatEtc > FormatEtcMap_t; -private: +private: FormatEtcMap_t m_FormatMap; FormatEtcMap_t::iterator m_EnumIterator; }; @@ -90,10 +89,10 @@ private: a helper class which converts data flavors to clipformats, creates an appropriate formatetc structures and if possible synthesizes clipboard formats if necessary, e.g. if text - is provided a locale will also be provided; + is provided a locale will also be provided; the class registers the formatetc within a CFormatEtcContainer - instances of this class are not thread-safe and multiple + instances of this class are not thread-safe and multiple instances of this class would use the same static variables that's why this class should not be used by multiple threads, only one thread of a process should use it @@ -106,24 +105,24 @@ class CFormatRegistrar { public: CFormatRegistrar( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& ServiceManager, - const CDataFormatTranslator& aDataFormatTranslator ); - + const CDataFormatTranslator& aDataFormatTranslator ); + void SAL_CALL RegisterFormats( const com::sun::star::uno::Reference< com::sun::star::datatransfer::XTransferable >& aXTransferable, CFormatEtcContainer& aFormatEtcContainer ); - + sal_Bool SAL_CALL hasSynthesizedLocale( ) const; LCID SAL_CALL getSynthesizedLocale( ) const; sal_uInt32 SAL_CALL getRegisteredTextCodePage( ) const; com::sun::star::datatransfer::DataFlavor SAL_CALL getRegisteredTextFlavor( ) const; - + sal_Bool SAL_CALL isSynthesizeableFormat( const CFormatEtc& aFormatEtc ) const; sal_Bool SAL_CALL needsToSynthesizeAccompanyFormats( const CFormatEtc& aFormatEtc ) const; -private: +private: sal_Bool SAL_CALL isEqualCurrentSystemCodePage( sal_uInt32 aCodePage ) const; rtl::OUString SAL_CALL getCharsetFromDataFlavor( const com::sun::star::datatransfer::DataFlavor& aFlavor ); - - sal_Bool SAL_CALL hasUnicodeFlavor( + + sal_Bool SAL_CALL hasUnicodeFlavor( const com::sun::star::uno::Reference< com::sun::star::datatransfer::XTransferable >& aXTransferable ) const; sal_Bool SAL_CALL findLocaleForTextCodePage( ); @@ -133,17 +132,17 @@ private: static sal_Bool SAL_CALL isLocaleCodePage( LCID lcid, LCTYPE lctype, sal_uInt32 codepage ); static BOOL CALLBACK EnumLocalesProc( LPSTR lpLocaleStr ); - -private: + +private: const CDataFormatTranslator& m_DataFormatTranslator; sal_Bool m_bHasSynthesizedLocale; com::sun::star::datatransfer::DataFlavor m_RegisteredTextFlavor; const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_SrvMgr; - + static LCID m_TxtLocale; static sal_uInt32 m_TxtCodePage; - + private: CFormatRegistrar( const CFormatRegistrar& ); CFormatRegistrar& operator=( const CFormatRegistrar& );