/* -*- 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 OQuery::rebuildColumns()
{
OSL_PRECOND( getColumnCount() == 0, "OQuery::rebuildColumns: column container should be empty!" ); // the base class' definition of rebuildColumns promised that clearColumns is called before rebuildColumns
try
{
m_pColumnMediator = nullptr;
Reference<XColumnsSupplier> xColSup(m_xCommandDefinition,UNO_QUERY);
Reference< XNameAccess > xColumnDefinitions; if ( xColSup.is() )
{
xColumnDefinitions = xColSup->getColumns(); if ( xColumnDefinitions.is() )
m_pColumnMediator = new OContainerMediator( m_pColumns.get(), xColumnDefinitions );
}
// fill the columns with columns from the statement
Reference< XMultiServiceFactory > xFactory( m_xConnection, UNO_QUERY_THROW );
SharedUNOComponent< XSingleSelectQueryComposer, DisposableComponent > xComposer(
Reference< XSingleSelectQueryComposer >( xFactory->createInstance( SERVICE_NAME_SINGLESELECTQUERYCOMPOSER ), UNO_QUERY_THROW ) );
OSL_ENSURE(_rSource.Source.get() == Reference< XInterface >(m_xCommandDefinition, UNO_QUERY).get(), "OQuery::propertyChange : where did this call come from ?");
if (m_eDoingCurrently == AggregateAction::SettingProperties) // we're setting the property ourself, so we will do the necessary notifications later return;
// forward this to our own member holding a copy of the property value if (getArrayHelper()->hasPropertyByName(_rSource.PropertyName))
{
Property aOwnProp = getArrayHelper()->getPropertyByName(_rSource.PropertyName);
nOwnHandle = aOwnProp.Handle;
ODataSettings::setFastPropertyValue_NoBroadcast(nOwnHandle, _rSource.NewValue); // don't use our own setFastPropertyValue_NoBroadcast, this would forward it to the CommandSettings, // again // and don't use the "real" setPropertyValue, this is too expensive and not sure to succeed
} else
{
OSL_FAIL("OQuery::propertyChange : my CommandDefinition has more properties than I do !");
}
}
OSL_ENSURE(_rSource.Source.get() == Reference< XInterface >(m_xCommandDefinition, UNO_QUERY).get(), "OQuery::disposing : where did this call come from ?");
void OQuery::setFastPropertyValue_NoBroadcast( sal_Int32 _nHandle, const Any& _rValue )
{
ODataSettings::setFastPropertyValue_NoBroadcast(_nHandle, _rValue);
OUString sAggPropName;
sal_Int16 nAttr = 0; if (getInfoHelper().fillPropertyMembersByHandle(&sAggPropName,&nAttr,_nHandle) &&
m_xCommandPropInfo.is() &&
m_xCommandPropInfo->hasPropertyByName(sAggPropName))
{ // the base class holds the property values itself, but we have to forward this to our CommandDefinition
void OQuery::registerProperties()
{ // the properties which OCommandBase supplies (it has no own registration, as it's not derived from // an OPropertyStateContainer)
registerProperty(PROPERTY_NAME, PROPERTY_ID_NAME, PropertyAttribute::BOUND|PropertyAttribute::CONSTRAINED,
&m_sElementName, cppu::UnoType<decltype(m_sElementName)>::get());
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.