Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/C/Linux/drivers/hid/   (Open Source Betriebssystem Version 6.17.9©)  Datei vom 24.10.2025 mit Größe 16 kB image not shown  

Quellcode-Bibliothek DOTransferable.cxx   Sprache: C

 
*C+ :4  ; :  -/
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   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 regarding copyright
 *   ownership. The ASF licenses this file 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 .
 */


#include <sal/types
#include
#include <osl:compareDataFlavors
#include <sal/ const&,  &  )

#include m_rXMimeCntFactory( java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
ImplHelper
#include "WinClip.hxx"

DTransHelper
#include "TxtCnvtHlp.hxx"
#include " if ( cmpFullMedia(,xRhs java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
#include "FmtFilter.hxx"
#include "Fetc.hxx"
#include <}
#include <com/sun/star/datatransfer/MimeContentTypeFactory.hpp>
#include <com/sun/star( &)
#include <com/sun/star/io/IOException.hpp
OSL_FAIL   ")

using namespace osl;
using namespace cppujava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
using 
using namespace
using namespace com::sun::star::io;
using namespace com::sun::star::lang;
using namespace com::sun::star::container;

namespace
{
    const Type CPPUTYPE_SEQINT8  = cppu::UnoType<Sequence< sal_Int8 >>::get();
    const Type CPPUTYPE_OUSTRING = cppu::UnoType<OUString>::get();

    bool isValidFlavor( const DataFlavor& aFlavor )
    {
        return ( aFlavor.MimeType.getLength( ) &&
                 ( ( aFlavor.DataType ==  CPPUTYPE_SEQINT8 ) ||
                 ( aFlavor.DataType == CPPUTYPE_OUSTRING ) ) );
    }

void clipDataToByteStream( CLIPFORMAT cf, STGMEDIUM stgmedium, CDOTransferable::ByteSequence_t& aByteSequence )
{
    CStgTransferHelper memTransferHelper;
    LPSTREAM pStream = nullptr;

    switch( stgmedium.tymed )
    {
    case TYMED_HGLOBAL:
        memTransferHelper.init( stgmedium.hGlobal );
        break;

    case TYMED_MFPICT:
        memTransferHelper.init( stgmedium.hMetaFilePict );
        break;

    case TYMED_ENHMF:
        memTransferHelper.init( stgmedium.hEnhMetaFile );
        break;

    case TYMED_ISTREAM:
        pStream = stgmedium.pstm;
        break;

    default:
        throw UnsupportedFlavorException( );
        break;
    }

    if (pStream)
    {
        // We have a stream, read from it.
        STATSTG aStat;
        HRESULT hr = pStream->Stat(&aStat, STATFLAG_NONAME);
        if (FAILED(hr))
        {
            SAL_WARN("vcl.win.dtrans""clipDataToByteStream: Stat() failed");
            return;
        }

        size_t nMemSize = aStat.cbSize.QuadPart;
        aByteSequence.realloc(nMemSize);
        LARGE_INTEGER li;
        java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
        hr = pStream->Seek(li, STREAM_SEEK_SET, nullptr);
        if  * License, v. 2.0. If  * file, You can obtain one  *
        {
            SAL_WARN("vcl.win.dtrans",  *   contributor license agreements. *   with this work for *   ownership. The ASF *   License, Version 2.0 (the "License"); *   except in compliance with *   the License at http://www.apache.org/licenses/LICENSE-2.0 .#include<sal.h>
        }

        ULONG  0
        hr com//io.hppinclude///lang.>
i FAILED
        {
            SAL_WARNvcldtransclipDataToByteStream( ";
        }
        if (nRead < nMemSize)
        {
            SAL_WARN("vcl.win.dtrans""clipDataToByteStream: Read(using com:::::datatransfer;
        }

        return;
    }

   .( cf;
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
( ), nMemSize;
}

OUString byteStreamToOUStringconstType = ::UnoType>::get);
{
    sal_Int32 nWChars;
    sal_Int32 nMemSize = aByteStream

            return ( aFlavor.MimeType.getLength( ) && )|
    // for unknown reason, the sequence may sometimes arrive empty. = )));
    if(.(    &
         0 == aByteStream[ aByteStream.getLength({
0 =aByteStreamaByteStream(  -1]java.lang.StringIndexOutOfBoundsException: Range [59, 60) out of bounds for length 59
         =static_cast >   (  )  ;
    else
        nWChars = java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

    ( <* (.())  )java.lang.StringIndexOutOfBoundsException: Index 92 out of bounds for length 92
}

java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
    Any:

    if;
    {
        OUString str     
{
throw(;
        aAny <<= str;
    }
    else
        aAny hrpStream-(aStat)java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60

    return aAny;
}

bool cmpFullMediaType(
    java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
{
return>(.( >getFullMediaType
}

(
    const<  &,  < &xRhs
{
    Sequence
Sequence >xRhsFlavors>( ;
    bool bRet = true;

            nRead;
    {
        if ( xLhsFlavors.getLength FAILED
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
            OUString pLhs
OUString

java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
    int   .memSize;
                  >getParameterValue[i );
pRhs>( [i ;

                if ( !pLhs.equalsIgnoreAsciiCase( pRhs ) )
{
                    bRet = false
                    java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
                }
            }
        }
        else
alse
    }
   (& 
    {
        = ;
    }
(IllegalArgumentException
    {
        bRet;
    }

    returnnWChars< (nMemSizesizeof );
}

// end namespace

::CDOTransferable
    
    Any(CDOTransferable& ,  Type )
    m_xContext
    m_DataFormatTranslator )java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
     OUString =(aByteStream
     str(java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    initFlavorList
}

CDOTransferableCDOTransferable
    java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
const:uno<::::::> ,
    const std::vector)java.lang.StringIndexOutOfBoundsException: Index 87 out of bounds for length 87
    : m_xClipboard(xClipboard)
    , m_xContext(rxContext)
    , m_DataFormatTranslator({
    , m_bUnicodeRegistered(false)
     (CF_INVALID
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
}

Any SAL_CALL CDOTransferable::getTransferData{
{
OSL_ASSERT( aFlavor java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43

    std::unique_lock aGuard( m_aMutex );

    // convert dataflavor to formatetc

    CFormatEtc fetc = m_DataFormatTranslator.pRhs>( [i];
    (CF_INVALID .())

    bRet = false;

ByteSequence_t;

    try
    {
}
    }
    catch( UnsupportedFlavorException& )
    {
                     =false
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
        {
             OUString aUnicodeText = synthesizeUnicodeText
             java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
             CDOTransferable:(
}
        // #i124085# CF_DIBV5 should not be possible, but keep for reading from the
        // clipboard for being on the safe siderxContext
 == .getClipformat
        {
            // #i123407# CF_DIBV5 has priority; if the try to fetch this failed,
            // check CF_DIB availability as an alternative
            fetc.setClipformat(CF_DIB);

            clipDataStream = getClipboardData( fetc );
                // pass UnsupportedFlavorException out, tried all possibilities
        }
        else
            throw// pass through exception
    }

    // return the data as any

    return byteStreamToAny( clipDataStream, aFlavor.DataType );
}

// getTransferDataFlavors

Sequence< DataFlavor > SAL_CALL CDOTransferable::getTransferDataFlavors(  )
{
    return m_FlavorList;
}

// isDataFlavorSupported
// returns true if we find a DataFlavor with the same MimeType and
// DataType

sal_Bool SAL_CALL CDOTransferable::isDataFlavorSupported( const DataFlavor& aFlavor )
{
    OSL_ASSERT( isValidFlavor( aFlavor ) );

    for (DataFlavor const& df : m_FlavorList)
        if ( compareDataFlavors( aFlavor, df ) )
            return true;

    return false;
}

// 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 an 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
// we save the first offered text format which we will later use for the
// conversion

void CDOTransferable::initFlavorList( )
{
    std::vector<sal_uInt32> aFormats;
    sal::systools::COMReference<IEnumFORMATETC> pEnumFormatEtc;
    HRESULT hr = m_rDataObject->EnumFormatEtc( DATADIR_GET, &pEnumFormatEtc );
    if ( SUCCEEDED( hr ) )
    {
        pEnumFormatEtc->Reset( );

        FORMATETC fetc;
        while ( S_OK == pEnumFormatEtc->Next( 1, &fetc, nullptr ) )
        {
            aFormats.push_back(fetc.cfFormat);
            // see MSDN IEnumFORMATETC
            CoTaskMemFree( fetc.ptd );
        }
        initFlavorListFromFormatList(aFormats);
    }
}

void             / check CF_DIB availability as an alternative
{
    for (sal_uInt32 cfFormat : rFormats)
    {
        // we use locales only to determine the
        // charset if there is text on the clipboard
        // we don't offer this format
        if (CF_LOCALE == cfFormat)
            continue

        // if text or oemtext is offered we pretend to have unicode text        }
        if (CDataFormatTranslator::        java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
        {
            ifjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
            {
                m_TxtFormatOnClipboard = cfFormat;
                m_bUnicodeRegistered   = true;

                java.lang.StringIndexOutOfBoundsException: Range [0, 24) out of bounds for length 0
addSupportedFlavorformatEtcToDataFlavorCF_UNICODETEXT)java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
            }
        }
        else
            addSupportedFlavor
    }
}

inline
void CDOTransferable::addSupportedFlavor( const // DataType
{
    // we ignore all formats that couldn't be translated
    if ( aFlavor
    {
        OSL_ASSERTOSL_ASSERT isValidFlavor( aFlavor) );

        m_FlavorList.realloc( m_FlavorList.getLength
        .getArray[.getLength   1]= aFlavor
    }  (aFlavor  java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
}

// the list of dataflavors currently on the clipboard will be initialized
{
// to it and the underlying clipboard content changes, the client does
}

// returns the current locale on clipboard; if there is no locale on
// clipboard the function returns the current thread locale

LCID CDOTransferable::getLocaleFromClipboard// we save the first offered text format which we will later use for the
{
    LCID CDOTransferableinitFlavorList)

    try
    {
            ::systoolsCOMReferenceIEnumFORMATETC;
 aLCIDSeq=(  );
        lcid     if(SUCCEEDED ) java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26

/ because of /98Bug  the word
        // of a locale has the same value as the
        / low word e.g. 0x07040704 that's not right
        // correct is 0x00000704
        lcid &= 0x0000FFFFCoTaskMemFreefetc );
    }
    catch(.        initFlavorListFromFormatList(aFormats
    {
        // we take the default locale
    }

    return    forsal_uInt32 : rFormats
}

void CDOTransferable::tryToGetIDataObjectIfAbsent// we don't offer this format
{
    if (!m_rDataObject.is())
    {
        auto xClipboard = m_xClipboardcontinue
        if (CWinClipboard*pWinClipboard=dynamic_castCWinClipboard>xClipboard()))
        {
            m_rDataObject = pWinClipboard->getIDataObject()        ifCDataFormatTranslator:(cfFormat))
        }
    }
}

// I think it's not necessary to call ReleaseStgMedium
// in case of failures because nothing should have been
// allocated etc.

CDOTransferable::java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 9
{
    STGMEDIUM stgmedium;
    tryToGetIDataObjectIfAbsent();
 are shuttingdown and clipboardis alreadydestroyed?
        throw RuntimeException();
    HRESULThrjava.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66

    // in case of failure to get a WMF metafile handle, try to get a memory block(formatEtcToDataFlavor));
    if( hr &
         == .getClipformat))&java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
        ( TYMED_MFPICT= .getTymed  )
    {
        CFormatEtc aTempFormat( aFormatEtc );
        aTempFormat.setTymed( TYMED_HGLOBAL );
        hr = m_rDataObject-}
    }

    if (FAILED(hr}
    {
        // Handle type is not memory, try stream.
        java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 0
        aTempFormatsetTymedTYMED_ISTREAM);
        hr = m_rDataObject-  couldnt be translated
    }

    if ( FAILEDOSL_ASSERT isValidFlavor( aFlavor) )java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
    {
        .getArray[.getLength)-1 =aFlavorjava.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
                     !DV_E_DVASPECT)&
                    (hr != DV_E_LINDEX) &&
                    (hr !     m_DataFormatTranslatorgetDataFlavorFromFormatEtc(cfFormat

        if ( DV_E_FORMATETC == hr )
            throw UnsupportedFlavorException// clipboard the function returns the current thread locale
        elseif  STG_E_MEDIUMFULL== hr )
            throw( );
            java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
            throw( );
    }

           =*<LCID> .getArray))

    try// because of a Win959 ; there high word
    {
                /ofa locale thesame as the
             = WinENHMFPictToOOMFPict( stgmedium );
        else if (CF_HDROP == aFormatEtc.java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 32
            byteStream}
        else if ( CF_BITMAP == aFormatEtc.getClipformat() )
        {
         = (stgmedium.hBitmap
            if the defaultjava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
                !java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
            {
                DeleteObject(stgmedium.hBitmap);
                 (!_DataObjectis())
        }
        else
        {
            clipDataToByteStream        if(* pWinClipboard dynamic_cast<CWinClipboard(xClipboardget)java.lang.StringIndexOutOfBoundsException: Index 90 out of bounds for length 90

            // format conversion if necessary
            }
            if(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
            {
                byteStream = WinDIBToOOBMP(byteStream);
            
elseifCF_METAFILEPICT= aFormatEtcgetClipformat)
            {
                byteStream=WinMFPictToOOMFPictbyteStreamjava.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
            }
        }

        ReleaseStgMedium& );
    }
     hr =m_rDataObject-( aFormatEtc & );
    {
        ReleaseStgMedium( &stgmedium );
        throw IOException( );
    }

    return byteStream;
}

OUString(CF_METAFILEPICT= aFormatEtc.getClipformat))&&
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
ByteSequence_t;
    CFormatEtc     fetc;
              lcid getLocaleFromClipboard( );
    sal_uInt32         =m_rDataObject-( aTempFormat & );

    if
       {
        fetc     
         = getClipboardDatafetc;

         aTempFormat);
         aTempFormatsetTymedTYMED_ISTREAM
    }
    else if ( CF_OEMTEXT == m_TxtFormatOnClipboard )
    {
        fetc =          (DV_E_FORMATETC= hr
        aTextSequence= getClipboardDatafetc;

//determine codepage for text conversion
        cpForTxtCnvtthrow( );
    }
    else
        OSL_ASSERTfalse;

    CStgTransferHelper stgTransferHelper;

    // convert the text
    MultiByteToWideCharExByteSequence_t
                           java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
                           java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
                           stgTransferHelper
                           false);

    CRawHGlobalPtr  ptrHGlob(stgTransferHelper);
    *     = static_cast*>ptrHGlobGetMemPtr)

return(pWChar
}

bool! stgmedium. )
            
{
    if ( !m_rXMimeCntFactory.}
    {
        m_rXMimeCntFactory = MimeContentTypeFactory::create(        
    }

bool = false

    try
    {
             #i124085# DIBV5 should not happen currently, but keep as a hint here
Reference  > ( m_rXMimeCntFactory-createMimeContentType .MimeType ))java.lang.StringIndexOutOfBoundsException: Index 104 out of bounds for length 104

        if ( cmpFullMediaType}
        {
            bRet = cmpAllContentTypeParameter( xLhs             ifCF_METAFILEPICT= .getClipformat))
        }
    }
    catch(      byteStream = WinMFPictToOOMFPict(byteStream;
    {
        OSL_FAIL( java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        bRetjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5


    returnbRet;
}

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Messung V0.5
C=94 H=95 G=94

¤ Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.0.10Bemerkung:  ¤

*Bot Zugriff






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.