/* -*- 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 .
*/
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>& 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 for( constauto& 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. if( GetMetaTypeType() == MetaTypeType::Shell && aSuperClass.is() )
aSuperClass->FillClasses( rClassList );
// Write all attributes of the imported classes, as long as they have // not already been imported by the superclass. for( auto& rElement : aClassElementList )
{
SvMetaClass * pCl = rElement.GetClass();
OStringBuffer rPre(rPrefix.getLength() + 1 + rElement.GetPrefix().getLength());
rPre.append(rPrefix); if( !rPre.isEmpty() && !rElement.GetPrefix().isEmpty() )
rPre.append('.');
rPre.append(rElement.GetPrefix());
// first of all write direct imported interfaces
pCl->InsertSlots( rList, rSuperList, rClassList,
rPre.makeStringAndClear(), rBase );
}
// only write superclass if no shell and not in the list if( GetMetaTypeType() != MetaTypeType::Shell && aSuperClass.is() )
{
aSuperClass->InsertSlots( rList, rSuperList, rClassList, rPrefix, rBase );
}
}
void SvMetaClass::FillClasses( SvMetaClassList & rClassList )
{ // Am I not yet in? if ( std::find( rClassList.begin(), rClassList.end(), this ) != rClassList.end() ) return;
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.