/* -*- 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 .
*/
static sal_Int16 lcl_implMapAsciiValue( const OUString& _rAsciiValue, std::span<const Ascii2Int16> _rMap )
{ // search the map for the given ascii value for (constauto & rSearch : _rMap)
{ if ( _rAsciiValue == rSearch.aAscii ) // found return rSearch.nValue;
}
SAL_WARN( "svx.form", "could not convert the ascii value " << _rAsciiValue); return -1;
}
staticconst OUString& lcl_implMapIntValue( const sal_Int16 _nValue, std::span<constAscii2Int16> _rMap )
{ // search the map for the given integer value for (const Ascii2Int16& rSearch : _rMap)
{ if ( _nValue == rSearch.nValue ) // found return rSearch.aAscii;
}
SAL_WARN( "svx", "lcl_implMapIntValue: could not convert the integer value "
<< _nValue << " !"); static constexpr OUString s_pDummy = u""_ustr; // just as a fallback... return s_pDummy;
}
// class FmSearchConfigItem - a config item that stores search parameters
#define TA( c ) &c, cppu::UnoType<decltype(c)>::get()
FmSearchConfigItem::FmSearchConfigItem()
:OConfigurationValueContainer( ::comphelper::getProcessComponentContext(), m_aMutex, u"/org.openoffice.Office.DataAccess/FormSearchOptions"_ustr, 2 )
{ // register our members so the data exchange with the node values is done automatically
// the properties which need to be translated
registerExchangeLocation( u"SearchType"_ustr, TA( m_sSearchForType ) );
registerExchangeLocation( u"SearchPosition"_ustr, TA( m_sSearchPosition ) );
const FmSearchParams& FmSearchConfigItem::getParams() const
{ // ensure that the properties which are not stored directly are up-to-date const_cast< FmSearchConfigItem* >( this )->implTranslateFromConfig( );
// and return our FmSearchParams part return *this;
}
void FmSearchConfigItem::setParams( const FmSearchParams& _rParams )
{ // copy the FmSearchParams part
*static_cast< FmSearchParams* >( this ) = _rParams;
// translate the settings not represented by a direct config value
implTranslateToConfig();
}
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.