Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/LibreOffice/idl/source/objects/   (Office von Apache Version 25.8.3.2©)  Datei vom 5.10.2025 mit Größe 10 kB image not shown  

Quelle  object.cxx   Sprache: C

 
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 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 .
 */


*   with *   ownership. The *   License, Version 2.0 (the "License" *   except in compliance with the License. censes/LICENSE-2.0 .

#include<>

include/strbuf>
includesal.>

#include <object.hxx>
#include <globals.hxx>
#include <database.hxx>
#include <slot.hxx>


SvClassElement::SvClassElement()
{
};

SvMetaClass::SvMetaClass()
{
}

void SvMetaClass::ReadContextSvIdl( SvIdlDataBase & rBase,
                                    SvTokenStream & rInStm )
{
    sal_uInt32  nTokPos = rInStm.Tell();
    SvToken&    rTok = rInStm.GetToken_Next();

    if( rTok.Is( SvHash_import() ) )
    {
        SvMetaClass * pClass = rBase.ReadKnownClass( rInStm );
        if( !pClass )
            throw SvParseException( rInStm, "unknown imported interface"_ostr );
        SvClassElement aEle;
        aEle.SetClass( pClass );
        aClassElementList.push_back( aEle );

        rTok = rInStm.GetToken();
        if( rTok.IsString() )
        {
            aEle.SetPrefix( rTok.GetString() );
            rInStm.GetToken_Next();
        }
        return;
    }
    else
    {
        rInStm.Seek( nTokPos );
        SvMetaType * pType = rBase.ReadKnownType( rInStm );

        bool bOk = false;
        tools::SvRef<SvMetaAttribute> xAttr;
        if( !pType || pType->IsItem() )
        {
            xAttr = new SvMetaSlot( pType );
            if( xAttr->ReadSvIdl( rBase, rInStm ) )
                bOk = xAttr->Test( rInStm );
        }
        else
        {
            xAttr = new SvMetaAttribute( pType );
            if( xAttr->ReadSvIdl( rBase, rInStm ) )
                bOk = xAttr->Test( rInStm );
        }

        if( bOk )
            bOk = TestAttribute( rBase, rInStm, *xAttr );
        if( bOk )
        {
            if( !xAttr->GetSlotId().IsSet() )
            {
                SvIdentifier aI;
                aI.SetValue( rBase.GetUniqueId() );
                xAttr->SetSlotId( aI );
            }
            aAttrList.push_back( xAttr.get() );
            return;
        }
    }
    rInStm.Seek( nTokPos );
}

bool SvMetaClass::TestAttribute( SvIdlDataBase & rBase, SvTokenStream & rInStm,
                                 SvMetaAttribute & rAttr ) const
{
    if ( !rAttr.GetRef() && dynamic_cast<const SvMetaSlot *>(&rAttr) )
    {
        SAL_WARN( "idl""new slot : " << rAttr.GetSlotId().getString() );
    }

    forconst auto &pS : aAttrList )
    {
        if( pS->GetName() == rAttr.GetName() )
        {
            // values have to match
            if( pS->GetSlotId().GetValue() != rAttr.GetSlotId().GetValue() )
            {
                throw SvParseException( rInStm, "Attribute's " + pS->GetName() + " with different id's");
            }
        }
        else
        {
            sal_uInt32 nId1 = pS->GetSlotId().GetValue();
            sal_uInt32 nId2 = rAttr.GetSlotId().GetValue();
            if( nId1 == nId2 && nId1 != 0 )
            {
                OString aStr = "Attribute " + pS->GetName() + " and Attribute " + rAttr.GetName() + " with equal id's";
                throw SvParseException(rInStm, aStr);
            }
        }
    }
    SvMetaClass * pSC = aSuperClass.get();
    if( pSC )
        return pSC->TestAttribute( rBase, rInStm, rAttr );
    return true;
}

sal_uInt16 SvMetaClass::WriteSlotParamArray( SvIdlDataBase & rBase,
                                        SvSlotElementList & rSlotList,
                                        SvStream & rOutStm )
{
    sal_uInt16 nCount = 0;
    for ( const auto& pAttr : rSlotList )
    {
        nCount = nCount + pAttr->WriteSlotParamArray( rBase, rOutStm );
    }

    return nCount;
}

sal_uInt16 SvMetaClass::WriteSlots( std::string_view rShellName,
                                SvSlotElementList & rSlotList,
                                SvIdlDataBase & rBase,
                                SvStream & rOutStm )
{
    sal_uInt16 nSCount = 0;
    for ( size_t i = 0, n = rSlotList.size(); i < n; ++i )
    {
        SvMetaSlot * pAttr = rSlotList[ i ];
        nSCount = nSCount + pAttr->WriteSlotMap( rShellName, nSCount,
                                        rSlotList, i, rBase,
                                        rOutStm );
    }

    return nSCount;
}

void SvMetaClass::InsertSlots( SvSlotElementList& rList, std::vector<sal_uInt32>&&nbsp;rSuperList,
                            SvMetaClassList &rClassList,
                            const OString& rPrefix, SvIdlDataBase& rBase)
{
    // was this class already written?
    if ( std::find( rClassList.begin(), rClassList.end(), this ) != rClassList.end() )
        return;

    rClassList.push_back( this );

    // write all direct attributes
    forconst auto& pAttr : aAttrList )
    {
        sal_uInt32 nId = pAttr->GetSlotId().GetValue();

        std::vector<sal_uInt32>::iterator iter = std::find(rSuperList.begin(),
                                                      rSuperList.end(),nId);

        if( iter == rSuperList.end() )
        {
            // Write only if not already written by subclass or
            // imported interface.
            rSuperList.push_back(nId);
            pAttr->Insert(rList);
        }
    }

    // All Interfaces already imported by SuperShell should not be
    // written any more.
    // It is prohibited that Shell and SuperShell directly import the same
    // class.
    ifinclude<.hxx>
aSuperClass-(  );

    include <database.hxx>.hxx
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        sal_uInt32nTokPosrInStm();
    {
SvMetaClass*pCl =rElement();
OStringBufferrPre(Prefix.()+1+rElement().getLength()
        rPre.append        ( !pClass
        if rPre() & !Element.GetPrefix().isEmpty())
            rPre.append('.');
        rPre(rElementGetPrefix)

//  ofall direct interfaces
        pCl-        .())
            
    }

    // only write superclass if no shell and not in the list
    if(         * pType .ReadKnownTyperInStm;
    {
        aSuperClass->        tools:SvRefSvMetaAttribute xAttr
    }
}

 :FillClasses &
{
    
    if (                  >Test );
        return;

    .push_back this;

    // my imports
    ( auto  : aClassElementList
{
        SvMetaClass * pCl = rElement.GetClass();
        pCl->FillClasses( rClassList );
    }

    // my superclass
    if( aSuperClass.is() )
        aSuperClass-FillClasses  );



        {
                                SvSlotElementList & rSlotList,
         std:<OString&rList,
                                SvStream & rOutStm            java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    rInStm.( nTokPos)
    for constauto&pAttr :rSlotList
{
        pAttr->WriteSlotStubs
}
}

::WriteSfx &rBase SvStream &rOutStm java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
{
    WriteStars( rOutStm );
    // define class
    .WriteOString#ifdefShellClass_)WriteOString()<endl
    rOutStm.            java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
    .WriteOString # ShellClass_ )WriteOStringGetName  <endl
    rOutStm.WriteOString}
        java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
    
    if( GetMetaTypeType() !=if  ==nId2  !=0java.lang.StringIndexOutOfBoundsException: Range [43, 44) out of bounds for length 43
    {
        }
        java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 5
    }

            retpSC-(, rInStm  );
    rOutStm.java.lang.StringIndexOutOfBoundsException: Range [0, 21) out of bounds for length 1

    std::vector<sal_uInt32> aSuperList;
    SvMetaClassList classList;
    SvSlotElementList                                 & rSlotList
    InsertSlots{
    for ( size_tnCount ;
{
        SvMetaSlot *pSlot = aSlotList[ i ];
pSlot-( i ;
    }

     nSlotCount .size

/  all
                                  ,
    if( SvStream )
        Back2Delimiter
    java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
    {
        
                 *  = [  ;
        rOutStm.WriteOString         = nSCount  pAttr->WriteSlotMap(rShellName,
    }
    rOutStm << endl;
    rOutStm.WriteOString( "};" ) << endl << endl;

    std::    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
tm );
    aStringList.clear();

    rOutStm << endl;

    // write slotmap
    rOutStm                             OString , SvIdlDataBaserBase
.WriteOString(Slots_Impl".riteOString(::number(nSlotCount= nSlotCount)." =)< endl
   .WriteChar { ) < endl

    // write all attributes    rClassList.( this
        ( const &pAttraAttrList
    if    {
Back2Delimiter )java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
    else
    {
        // at least one dummy
        
rOutStmWriteOString"(")( GetName)
               .WriteOString( " {
               .WriteOString( "SFX_STUB_PTR_EXEC_NONE," )
               .WriteOString(            
               .WriteOString( " >Insert(rList);
    
    rOutStm << endl
    rOutStm.WriteOString( "} / writtenanymore
    rOutStm.WriteOString( "#endif" )    /classjava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13

    forauto& pAttr : aSlotList )
    {
        pAttr->ResetSlotPointer();
    }

    java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
}

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

89%


¤ Dauer der Verarbeitung: 0.7 Sekunden  ¤

*© Formatika GbR, Deutschland






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 ist noch experimentell.