/* -*- 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 .
*/
OSL_ENSURE(m_pHelper, "SubmissionPropertyHandler::getPropertyValue: inconsistency!"); // if we survived impl_getPropertyId_throwUnknownProperty, we should have a helper, since no helper implies no properties
Any aReturn; try
{ switch ( nPropId )
{ case PROPERTY_ID_SUBMISSION_ID:
{
Reference< submission::XSubmissionSupplier > xSubmissionSupp( m_xComponent, UNO_QUERY );
OSL_ENSURE( xSubmissionSupp.is(), "SubmissionPropertyHandler::getPropertyValue: this should never happen ..." ); // this handler is not intended for components which are no XSubmissionSupplier
Reference< submission::XSubmission > xSubmission; if ( xSubmissionSupp.is() )
xSubmission = xSubmissionSupp->getSubmission( );
aReturn <<= xSubmission;
} break;
OSL_ENSURE(m_pHelper, "SubmissionPropertyHandler::setPropertyValue: inconsistency!"); // if we survived impl_getPropertyId_throwUnknownProperty, we should have a helper, since no helper implies no properties
Reference< submission::XSubmissionSupplier > xSubmissionSupp( m_xComponent, UNO_QUERY );
OSL_ENSURE( xSubmissionSupp.is(), "SubmissionPropertyHandler::setPropertyValue: this should never happen ..." ); // this handler is not intended for components which are no XSubmissionSupplier if ( xSubmissionSupp.is() )
{
xSubmissionSupp->setSubmission( xSubmission );
impl_setContextDocumentModified_nothrow();
}
} break;
case PROPERTY_ID_XFORMS_BUTTONTYPE:
m_xComponent->setPropertyValue( PROPERTY_BUTTONTYPE, _rValue ); break;
case PROPERTY_ID_XFORMS_BUTTONTYPE:
{ // available options are nearly the same as for the "normal" button type, but only the // first two options
aListEntries = m_pInfoService->getPropertyEnumRepresentations( PROPERTY_ID_BUTTONTYPE );
aListEntries.resize( 2 );
} break;
::osl::MutexGuard aGuard( m_aMutex );
PropertyId nActuatingPropId( impl_getPropertyId_throwRuntime( _rActuatingPropertyName ) );
OSL_PRECOND(m_pHelper, "SubmissionPropertyHandler::actuatingPropertyChanged: inconsistency!"); // if we survived impl_getPropertyId_throwRuntime, we should have a helper, since no helper implies no properties
case PROPERTY_ID_XFORMS_BUTTONTYPE:
{
::rtl::Reference< IPropertyEnumRepresentation > aEnumConversion( new DefaultEnumRepresentation( *m_pInfoService, ::cppu::UnoType<FormButtonType>::get(), PROPERTY_ID_BUTTONTYPE ) ); // TODO/UNOize: make aEnumConversion a member?
aEnumConversion->getValueFromDescription( sControlValue, aPropertyValue );
} break;
default:
OSL_FAIL( "SubmissionPropertyHandler::convertToPropertyValue: cannot handle this id!" );
}
return aPropertyValue;
}
Any SAL_CALL SubmissionPropertyHandler::convertToControlValue( const OUString& _rPropertyName, const Any& _rPropertyValue, const Type& _rControlValueType )
{
::osl::MutexGuard aGuard( m_aMutex );
Any aControlValue;
OSL_ENSURE(
m_pHelper, "SubmissionPropertyHandler::convertToControlValue: we have no SupportedProperties!"); if (!m_pHelper) return aControlValue;
OSL_ENSURE( _rControlValueType.getTypeClass() == TypeClass_STRING, "SubmissionPropertyHandler::convertToControlValue: all our controls should use strings for value exchange!" );
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.