/* -*- 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 . */ #include #include #include #include #include AstEnum::AstEnum(const OString& name, AstScope* pScope) : AstType(NT_enum, name, pScope) , AstScope(NT_enum) , m_enumValueCount(0) { } AstEnum::~AstEnum() { } AstConstant* AstEnum::checkValue(AstExpression* pExpr) { DeclList::const_iterator iter = getIteratorBegin(); DeclList::const_iterator end = getIteratorEnd(); iter = std::find_if(iter, end, [&pExpr](AstDeclaration* pDecl) { return static_cast(pDecl)->getConstValue()->compareLong(pExpr); }); if (iter != end) return static_cast(*iter); if ( pExpr->getExprValue()->u.lval > m_enumValueCount ) m_enumValueCount = pExpr->getExprValue()->u.lval + 1; return nullptr; } bool AstEnum::dump(RegistryKey& rKey) { RegistryKey localKey; if (rKey.createKey( OStringToOUString(getFullName(), RTL_TEXTENCODING_UTF8 ), localKey) != RegError::NO_ERROR) { fprintf(stderr, "%s: warning, could not create key '%s' in '%s'\n", idlc()->getOptions()->getProgramName().getStr(), getFullName().getStr(), OUStringToOString(rKey.getRegistryName(), RTL_TEXTENCODING_UTF8).getStr()); return false; } sal_uInt16 nConst = getNodeCount(NT_enum_val); if ( nConst > 0 ) { typereg::Writer aBlob( m_bPublished ? TYPEREG_VERSION_1 : TYPEREG_VERSION_0, getDocumentation(), "", RT_TYPE_ENUM, m_bPublished, OStringToOUString(getRelativName(), RTL_TEXTENCODING_UTF8), 0, nConst, 0, 0); DeclList::const_iterator iter = getIteratorBegin(); DeclList::const_iterator end = getIteratorEnd(); sal_uInt16 index = 0; while ( iter != end ) { AstDeclaration* pDecl = *iter; if ( pDecl->getNodeType() == NT_enum_val ) static_cast(pDecl)->dumpBlob(aBlob, index++, false); ++iter; } sal_uInt32 aBlobSize; void const * pBlob = aBlob.getBlob(&aBlobSize); if (localKey.setValue("", RegValueType::BINARY, const_cast(pBlob), aBlobSize) != RegError::NO_ERROR) { fprintf(stderr, "%s: warning, could not set value of key \"%s\" in %s\n", idlc()->getOptions()->getProgramName().getStr(), getFullName().getStr(), OUStringToOString(localKey.getRegistryName(), RTL_TEXTENCODING_UTF8).getStr()); return false; } } return true; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ llabora/cp-4.1'>distro/collabora/cp-4.1 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Expand)Author
2017-07-21migrate to boost::gettextCaolán McNamara
2017-07-15emfplus: create a wmf/emf/emf+ primitive based importerArmin Le Grand
2017-04-14remove the old collaboration feature based on telepathyMarkus Mohrhard
2016-12-19lets always have at least dbtoolsCaolán McNamara
2016-08-18screenshots: add new global make targetArmin Le Grand
2016-06-18uitest: build system part for new uitestsMarkus Mohrhard
2016-03-21clew: move this foreign code to external/clewMichael Stahl
2016-01-20drop basebmp entirely nowCaolán McNamara
2015-06-29online update: Add MAR library creation capabilityNathan Yee
2015-03-20Remove library urelibs. It was more just a temporary hack and is not used.Matúš Kukan
2015-02-02Fix circular dependency with libmerged, finallyMatúš Kukan
2015-01-07drop crashrep unused since start of LibreOfficeCaolán McNamara
2014-12-18The touch module, ByteBufferWrapper, and the libotouch library can go away nowTor Lillqvist
2014-12-15gbuild: Do not require gb_Library_use_externals for libmergedMatúš Kukan
2014-12-08Don't treat clew as part of an "external" clcc moduleTor Lillqvist
2014-11-27Work in progress: Move Calc-independend OpenCL configuration out of scTor Lillqvist
2014-10-29Don't bother with a separate dynamically loaded scopencl libraryTor Lillqvist
2014-09-13Fix circular deps when opencl is disabledPeter Foley
2014-08-26gbuild: serialize linking on "make check" tooMichael Stahl
2014-06-11Move liblibreoffice into LibreOfficeKit.Andrzej Hunt
2014-05-07No fpicker needed for non-DESKTOP surely?Tor Lillqvist
2014-04-28We don't want forms in the no-DBCONNECTIVITY case after all, I thinkTor Lillqvist
2014-04-18Intermediate commit of hacking on --disable-database-connectivityTor Lillqvist
2014-04-17More generic way to disable avmediaTor Lillqvist
2014-03-21Fold psprint_config into vclKhaled Hosny
2014-03-21move remaining padmin dialogs into vclCaolán McNamara
2014-02-19Consistently use gb_Helper_optionalTor Lillqvist
2014-02-19Fix fallout from 9ad3fc29dd98167c35fcb599da0b4e764ddf04ddTor Lillqvist
2014-01-29move glm to externalMarkus Mohrhard
2014-01-29add glm to the libreoffice buildMarkus Mohrhard
2013-12-05fdo#39956 Delete JABDavid Ostrovsky
2013-11-19RepositoryModule: conditionally add winaccessibilityMichael Stahl