/* -*- 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 .
*/
void clear(SbxDataType type) { // A hacky way of zeroing the union value corresponding to the given type (even though the // relevant zero value need not be represented by all-zero bits, in general) without evoking // GCC 8 -Wclass-memaccess or loplugin:classmemaccess, and without having to turn the // anonymous union into a non-anonymous one: autoconst p = static_cast<void *>(this);
std::memset(p, 0, offsetof(SbxValues, eType));
eType = type;
}
};
class BASIC_DLLPUBLIC SbxValue : public SbxBase
{ // #55226 Transport additional infos
BASIC_DLLPRIVATE SbxValue* TheRealValue( bool bObjInObjError ) const; protected:
SbxValues aData; // Data
OUString aPic; // Picture-String
OUString aToolString; // tool string copy
// The following operators are defined for easier handling. // TODO: Ensure error conditions (overflow, conversions) // are taken into consideration in Compute and Compare
// Parameter-Interface
SAL_DLLPRIVATE virtual SbxInfo* GetInfo();
SAL_DLLPRIVATE void SetInfo( SbxInfo* p ); void SetParameters( SbxArray* p );
SbxArray* GetParameters() const;
// Sfx-Broadcasting-Support: // Due to data reduction and better DLL-hierarchy currently via casting
SfxBroadcaster& GetBroadcaster(); bool IsBroadcaster() const { return mpBroadcaster != nullptr; } virtualvoid Broadcast( SfxHintId nHintId ) override;
// Create a simple hashcode: the first six characters are evaluated. static constexpr sal_uInt16 MakeHashCode(std::u16string_view aName)
{
sal_uInt16 n = 0; constauto first6 = aName.substr(0, 6); for (constauto& c : first6)
{ if (!rtl::isAscii(c)) continue; // Just skip it to let non-ASCII strings have some hash variance
n = static_cast<sal_uInt16>((n << 3) + rtl::toAsciiUpperCase(c));
} return n;
}
};
//tdf#59222 SbxEnsureParentVariable is a SbxVariable which keeps a reference to //its parent, ensuring it always exists while this SbxVariable exists class SbxEnsureParentVariable final : public SbxVariable
{
SbxObjectRef xParent; public:
SbxEnsureParentVariable(const SbxVariable& r); virtualvoid SetParent(SbxObject* p) override;
};
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.