diff options
Diffstat (limited to 'reportdesign/source/ui/inspection/GeometryHandler.cxx')
-rw-r--r-- | reportdesign/source/ui/inspection/GeometryHandler.cxx | 112 |
1 files changed, 56 insertions, 56 deletions
diff --git a/reportdesign/source/ui/inspection/GeometryHandler.cxx b/reportdesign/source/ui/inspection/GeometryHandler.cxx index a90a80a26f65..691bef2134e9 100644 --- a/reportdesign/source/ui/inspection/GeometryHandler.cxx +++ b/reportdesign/source/ui/inspection/GeometryHandler.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -85,9 +85,9 @@ #include <svl/itempool.hxx> #include <svl/itemset.hxx> -#define ITEMID_COLOR_TABLE SID_COLOR_TABLE -#define ITEMID_DASH_LIST SID_DASH_LIST -#define ITEMID_LINEEND_LIST SID_LINEEND_LIST +#define ITEMID_COLOR_TABLE SID_COLOR_TABLE +#define ITEMID_DASH_LIST SID_DASH_LIST +#define ITEMID_LINEEND_LIST SID_LINEEND_LIST #include <svx/xdef.hxx> #include <svx/xpool.hxx> #include <svx/xtable.hxx> @@ -104,9 +104,9 @@ #include <svx/xlineit0.hxx> #include <svx/svxids.hrc> -#define ITEMID_COLOR_TABLE SID_COLOR_TABLE -#define ITEMID_DASH_LIST SID_DASH_LIST -#define ITEMID_LINEEND_LIST SID_LINEEND_LIST +#define ITEMID_COLOR_TABLE SID_COLOR_TABLE +#define ITEMID_DASH_LIST SID_DASH_LIST +#define ITEMID_LINEEND_LIST SID_LINEEND_LIST #include <svx/drawitem.hxx> #define ITEMID_BRUSH SID_ATTR_BRUSH #include <editeng/brshitem.hxx> @@ -176,7 +176,7 @@ void lcl_collectFunctionNames(const uno::Reference< report::XSection>& _xSection nPos = getPositionInIndexAccess(xGroups.get(),xGroup); else if ( _xSection == xReportDefinition->getDetail() ) nPos = xGroups->getCount()-1; - + for (sal_Int32 i = 0 ; i <= nPos ; ++i) { xGroup.set(xGroups->getByIndex(i),uno::UNO_QUERY_THROW); @@ -249,7 +249,7 @@ GeometryHandler::GeometryHandler(uno::Reference< uno::XComponentContext > const // ----------------------------------------------------------------------------- GeometryHandler::~GeometryHandler() { - DBG_DTOR(rpt_GeometryHandler,NULL); + DBG_DTOR(rpt_GeometryHandler,NULL); } //------------------------------------------------------------------------ ::rtl::OUString SAL_CALL GeometryHandler::getImplementationName( ) throw(uno::RuntimeException) @@ -300,7 +300,7 @@ void SAL_CALL GeometryHandler::disposing() ::comphelper::disposeComponent(m_xTypeConverter); if ( m_xReportComponent.is() && m_xReportComponent->getPropertySetInfo()->hasPropertyByName(PROPERTY_DATAFIELD) ) m_xReportComponent->removePropertyChangeListener(PROPERTY_DATAFIELD,static_cast< beans::XPropertyChangeListener* >( this )); - + m_xReportComponent.clear(); m_xRowSet.clear(); m_aPropertyListeners.clear(); @@ -398,7 +398,7 @@ uno::Any SAL_CALL GeometryHandler::getPropertyValue(const ::rtl::OUString & Prop aPropertyValue = uno::Any(); break; } - + } break; case PROPERTY_ID_TYPE: @@ -434,8 +434,8 @@ uno::Any SAL_CALL GeometryHandler::getPropertyValue(const ::rtl::OUString & Prop aPropertyValue <<= m_sScope; break; } - - } + + } break; case PROPERTY_ID_BACKCOLOR: case PROPERTY_ID_CONTROLBACKGROUND: @@ -494,7 +494,7 @@ void SAL_CALL GeometryHandler::setPropertyValue(const ::rtl::OUString & Property else if ( m_aFunctionNames.find(sDataField) != m_aFunctionNames.end() ) m_nDataFieldType = USER_DEF_FUNCTION; } - + resetOwnProperties(aGuard,sOldFunctionName,sOldScope,nOldDataFieldType); } break; @@ -592,10 +592,10 @@ void SAL_CALL GeometryHandler::setPropertyValue(const ::rtl::OUString & Property } } } - + break; case PROPERTY_ID_SCOPE: - if ( !(Value >>= m_sScope) ) + if ( !(Value >>= m_sScope) ) m_sScope = ::rtl::OUString(); else { @@ -618,7 +618,7 @@ void SAL_CALL GeometryHandler::setPropertyValue(const ::rtl::OUString & Property ::rtl::OUString sDefaultFunctionName; ::rtl::OUString sDataField; OSL_VERIFY( impl_isDefaultFunction_nothrow(m_xFunction,sDataField,sDefaultFunctionName) ); - m_sDefaultFunction = sDefaultFunctionName; + m_sDefaultFunction = sDefaultFunctionName; createDefaultFunction(aGuard,m_sDefaultFunction,sDataField); } } @@ -645,7 +645,7 @@ void SAL_CALL GeometryHandler::setPropertyValue(const ::rtl::OUString & Property aAwtSize.Height = nNewValue; else if ( nId == PROPERTY_ID_WIDTH ) aAwtSize.Width = nNewValue; - + checkPosAndSize(aAwtPoint,aAwtSize); } } @@ -690,7 +690,7 @@ void GeometryHandler::implCreateListLikeControl( { ::std::vector< ::rtl::OUString > aList; tools::StringListResource aRes(ModuleRes(_nResId),aList); - + implCreateListLikeControl(_rxControlFactory,out_Descriptor,aList,_bReadOnlyControl,_bTrueIfListBoxFalseIfComboBox); } // ----------------------------------------------------------------------------- @@ -755,7 +755,7 @@ inspection::LineDescriptor SAL_CALL GeometryHandler::describePropertyLine(const case PROPERTY_ID_TYPE: implCreateListLikeControl(_xControlFactory,aOut,RID_STR_TYPE_CONST,sal_False,sal_True); break; - case PROPERTY_ID_VISIBLE: + case PROPERTY_ID_VISIBLE: case PROPERTY_ID_CANGROW: case PROPERTY_ID_CANSHRINK: case PROPERTY_ID_REPEATSECTION: @@ -845,7 +845,7 @@ inspection::LineDescriptor SAL_CALL GeometryHandler::describePropertyLine(const aOut = m_xFormComponentHandler->describePropertyLine(PropertyName, _xControlFactory); } } - + if ( nId != -1 ) { aOut.Category = ((m_pInfoService->getPropertyUIFlags(nId ) & PROP_FLAG_DATA_PROPERTY) != 0) ? @@ -855,7 +855,7 @@ inspection::LineDescriptor SAL_CALL GeometryHandler::describePropertyLine(const aOut.HelpURL = HelpIdUrl::getHelpURL( m_pInfoService->getPropertyHelpId( nId ) ); aOut.DisplayName = m_pInfoService->getPropertyTranslation(nId); } - + if ( ( nId == PROPERTY_ID_POSITIONX ) || ( nId == PROPERTY_ID_POSITIONY ) || ( nId == PROPERTY_ID_WIDTH ) @@ -974,7 +974,7 @@ uno::Any SAL_CALL GeometryHandler::convertToPropertyValue(const ::rtl::OUString aPropertyValue <<= static_cast<sal_Int32>(COL_TRANSPARENT); break; } - // run through + // run through case PROPERTY_ID_KEEPTOGETHER: if ( uno::Reference< report::XGroup>(m_xReportComponent,uno::UNO_QUERY).is()) @@ -982,7 +982,7 @@ uno::Any SAL_CALL GeometryHandler::convertToPropertyValue(const ::rtl::OUString aPropertyValue = getConstantValue(sal_False,RID_STR_KEEPTOGETHER_CONST,_rControlValue,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.report.KeepTogether")),PropertyName); break; } - // run through + // run through case PROPERTY_ID_VISIBLE: case PROPERTY_ID_CANGROW: @@ -999,17 +999,17 @@ uno::Any SAL_CALL GeometryHandler::convertToPropertyValue(const ::rtl::OUString case PROPERTY_ID_CONTROLBACKGROUNDTRANSPARENT: { if ( aPropertyValue.hasValue() ) - { + { const beans::Property aProp = getProperty(PropertyName); if ( aPropertyValue.getValueType().equals( aProp.Type ) ) // nothing to do, type is already as desired return aPropertyValue; - + if ( _rControlValue.getValueType().getTypeClass() == uno::TypeClass_STRING ) { ::rtl::OUString sControlValue; _rControlValue >>= sControlValue; - + const uno::Reference< inspection::XStringRepresentation > xConversionHelper = inspection::StringRepresentation::create( m_xContext,m_xTypeConverter ); aPropertyValue = xConversionHelper->convertToPropertyValue( sControlValue, aProp.Type ); } @@ -1025,7 +1025,7 @@ uno::Any SAL_CALL GeometryHandler::convertToPropertyValue(const ::rtl::OUString } } } - + break; } case PROPERTY_ID_CONDITIONALPRINTEXPRESSION: @@ -1336,10 +1336,10 @@ uno::Sequence< beans::Property > SAL_CALL GeometryHandler::getSupportedPropertie // { // beans::Property aValue; // aValue.Name = PROPERTY_AREA; -// aNewProps.push_back(aValue); +// aNewProps.push_back(aValue); // } // re-enable when the remaining issues of #i88727# are fixed - + return uno::Sequence< beans::Property > (&(*aNewProps.begin()),aNewProps.size()); } @@ -1384,7 +1384,7 @@ inspection::InteractiveSelectionResult SAL_CALL GeometryHandler::onInteractivePr if ( !_rxInspectorUI.is() ) throw lang::NullPointerException(); if ( PropertyName.equalsAscii(PROPERTY_FILTER) ) - { + { ::osl::ClearableMutexGuard aGuard( m_aMutex ); inspection::InteractiveSelectionResult eResult = inspection::InteractiveSelectionResult_Cancelled; @@ -1395,9 +1395,9 @@ inspection::InteractiveSelectionResult SAL_CALL GeometryHandler::onInteractivePr eResult = inspection::InteractiveSelectionResult_ObtainedValue; } return eResult; - } + } else if ( PropertyName.equalsAscii(PROPERTY_FONT) ) - { + { ::osl::ClearableMutexGuard aGuard( m_aMutex ); inspection::InteractiveSelectionResult eResult = inspection::InteractiveSelectionResult_Cancelled; @@ -1413,21 +1413,21 @@ inspection::InteractiveSelectionResult SAL_CALL GeometryHandler::onInteractivePr } return eResult; } - else if ( PropertyName.equalsAscii(PROPERTY_FORMULA) - || PropertyName.equalsAscii(PROPERTY_INITIALFORMULA) - || PropertyName.equalsAscii(PROPERTY_DATAFIELD) + else if ( PropertyName.equalsAscii(PROPERTY_FORMULA) + || PropertyName.equalsAscii(PROPERTY_INITIALFORMULA) + || PropertyName.equalsAscii(PROPERTY_DATAFIELD) || PropertyName.equalsAscii(PROPERTY_CONDITIONALPRINTEXPRESSION)) - { + { ::osl::ClearableMutexGuard aGuard( m_aMutex ); - + ::rtl::OUString sFormula; m_xReportComponent->getPropertyValue(PropertyName) >>= sFormula; const uno::Reference< awt::XWindow> xInspectorWindow(m_xContext->getValueByName( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DialogParentWindow"))) ,uno::UNO_QUERY); uno::Reference< uno::XComponentContext > xContext = m_xContext; uno::Reference< beans::XPropertySet > xRowSet( m_xRowSet,uno::UNO_QUERY); aGuard.clear(); - + inspection::InteractiveSelectionResult eResult = inspection::InteractiveSelectionResult_Cancelled; if ( rptui::openDialogFormula_nothrow( sFormula, xContext,xInspectorWindow,xRowSet ) ) { @@ -1437,7 +1437,7 @@ inspection::InteractiveSelectionResult SAL_CALL GeometryHandler::onInteractivePr return eResult; } else if ( PropertyName.equalsAscii(PROPERTY_AREA) ) - { + { ::osl::ClearableMutexGuard aGuard( m_aMutex ); inspection::InteractiveSelectionResult eResult = inspection::InteractiveSelectionResult_Cancelled; @@ -1482,14 +1482,14 @@ void SAL_CALL GeometryHandler::actuatingPropertyChanged(const ::rtl::OUString & _rxInspectorUI->enablePropertyUI(PROPERTY_FORMULALIST,sal_False); _rxInspectorUI->enablePropertyUI(PROPERTY_SCOPE,sal_False); OSL_ENSURE(m_sDefaultFunction.getLength() == 0,"Why is the m_sDefaultFunction set?"); - OSL_ENSURE(m_sScope.getLength() == 0,"Why is the m_sScope set?"); + OSL_ENSURE(m_sScope.getLength() == 0,"Why is the m_sScope set?"); break; case FUNCTION: _rxInspectorUI->rebuildPropertyUI(PROPERTY_DATAFIELD); _rxInspectorUI->rebuildPropertyUI(PROPERTY_FORMULALIST); _rxInspectorUI->enablePropertyUI(PROPERTY_DATAFIELD,sal_True); - _rxInspectorUI->enablePropertyUI(PROPERTY_FORMULALIST,m_sDefaultFunction.getLength() != 0); - _rxInspectorUI->enablePropertyUI(PROPERTY_SCOPE,m_sScope.getLength() != 0); + _rxInspectorUI->enablePropertyUI(PROPERTY_FORMULALIST,m_sDefaultFunction.getLength() != 0); + _rxInspectorUI->enablePropertyUI(PROPERTY_SCOPE,m_sScope.getLength() != 0); break; case USER_DEF_FUNCTION: _rxInspectorUI->enablePropertyUI(PROPERTY_DATAFIELD,sal_False); @@ -1541,7 +1541,7 @@ void SAL_CALL GeometryHandler::actuatingPropertyChanged(const ::rtl::OUString & default: m_xFormComponentHandler->actuatingPropertyChanged(ActuatingPropertyName, NewValue, OldValue, _rxInspectorUI, _bFirstTimeInit); break; - } + } } ::sal_Bool SAL_CALL GeometryHandler::suspend(::sal_Bool Suspend) throw (uno::RuntimeException) @@ -1625,7 +1625,7 @@ void GeometryHandler::checkPosAndSize( const awt::Point& _aNewPos, const uno::Reference< report::XSection> xSection(xSourceReportComponent->getParent(),uno::UNO_QUERY); if ( !xSection.is() || uno::Reference< report::XShape>(xSourceReportComponent,uno::UNO_QUERY).is() ) // shapes can overlap. return; - + ::Point aPos(VCLPoint(_aNewPos)); if ( aPos.X() < 0 || aPos.Y() < 0 ) // TODO: have to check size with pos aka || (aPos.X() + aAwtSize.Width) > m_xSection->getReportDefinition()-> throw beans::PropertyVetoException(String(ModuleRes(RID_STR_ILLEGAL_POSITION)),xSourceReportComponent); @@ -1750,7 +1750,7 @@ uno::Reference< report::XFunctionsSupplier> GeometryHandler::fillScope_throw(::r const uno::Reference< report::XSection> xSection(xSourceReportComponent->getParent(),uno::UNO_QUERY_THROW); const uno::Reference< report::XReportDefinition> xReportDefinition = xSection->getReportDefinition(); if ( !m_sScope.getLength() ) - { + { const uno::Reference< report::XGroup> xGroup(xSection->getGroup(),uno::UNO_QUERY); if ( xGroup.is() ) { @@ -1770,7 +1770,7 @@ uno::Reference< report::XFunctionsSupplier> GeometryHandler::fillScope_throw(::r String sGroupName = String(ModuleRes(RID_STR_SCOPE_GROUP)); _rsNamePostFix = xGroup2->getExpression(); sGroupName.SearchAndReplaceAscii("%1",_rsNamePostFix); - m_sScope = sGroupName; + m_sScope = sGroupName; xReturn = xGroup2.get(); } } @@ -1789,7 +1789,7 @@ uno::Reference< report::XFunctionsSupplier> GeometryHandler::fillScope_throw(::r { uno::Reference< report::XGroups> xGroups = xReportDefinition->getGroups(); const sal_Int32 nCount = xGroups->getCount(); - + for (sal_Int32 i = 0 ; i < nCount; ++i) { const uno::Reference< report::XGroup> xGroup(xGroups->getByIndex(i),uno::UNO_QUERY_THROW); @@ -1802,7 +1802,7 @@ uno::Reference< report::XFunctionsSupplier> GeometryHandler::fillScope_throw(::r break; } } - + } OSL_ENSURE(xReturn.is(),"Why don't we have a functionssupplier here!"); @@ -1820,7 +1820,7 @@ sal_Bool GeometryHandler::isDefaultFunction( const ::rtl::OUString& _sQuotedFunc const uno::Reference< report::XReportComponent> xSourceReportComponent(m_xReportComponent,uno::UNO_QUERY_THROW); const uno::Reference< report::XSection> xSection(xSourceReportComponent->getParent(),uno::UNO_QUERY_THROW); const uno::Reference< report::XReportDefinition> xReportDefinition = xSection->getReportDefinition(); - + ::std::pair<TFunctions::const_iterator,TFunctions::const_iterator> aFind = m_aFunctionNames.equal_range(_sQuotedFunction); while ( aFind.first != aFind.second ) { @@ -1891,7 +1891,7 @@ sal_Bool GeometryHandler::impl_isDefaultFunction_nothrow( const uno::Reference< break; } } - + bDefaultFunction = aIter != aDeEnd; } catch(uno::Exception&) @@ -2039,7 +2039,7 @@ void GeometryHandler::resetOwnProperties(::osl::ResettableMutexGuard& _aGuard,co aFormulaEvent.PropertyName = PROPERTY_FORMULALIST; aFormulaEvent.OldValue <<= _sOldFunctionName; aFormulaEvent.NewValue <<= sNewFunction; - + m_aPropertyListeners.notify( aFormulaEvent, &beans::XPropertyChangeListener::propertyChange ); } if ( _sOldScope != sNewScope ) @@ -2050,7 +2050,7 @@ void GeometryHandler::resetOwnProperties(::osl::ResettableMutexGuard& _aGuard,co aScopeEvent.NewValue <<= sNewScope; m_aPropertyListeners.notify( aScopeEvent, &beans::XPropertyChangeListener::propertyChange ); } - + _aGuard.reset(); } //------------------------------------------------------------------------ @@ -2168,7 +2168,7 @@ void GeometryHandler::impl_setCounterFunction_throw() ::rtl::OUString sScope; if ( !(sFunctionName.getLength() && m_aFunctionNames.find(sQuotedFunctionName) != m_aFunctionNames.end() && impl_isCounterFunction_throw(sQuotedFunctionName,sScope)) ) impl_createFunction(sFunctionName,::rtl::OUString(),m_aCounterFunction); - + OBlocker aBlocker(m_bIn); m_xReportComponent->setPropertyValue(PROPERTY_DATAFIELD,uno::makeAny(impl_convertToFormula( uno::makeAny(sQuotedFunctionName)))); } @@ -2185,7 +2185,7 @@ sal_uInt32 GeometryHandler::impl_getDataFieldType_throw(const ::rtl::OUString& _ lcl_convertFormulaTo(aDataField,aDataField); aDataField >>= sDataField; } - + if ( sDataField.getLength() ) { if ( impl_isDataField(sDataField) ) @@ -2237,7 +2237,7 @@ void SAL_CALL GeometryHandler::propertyChange(const beans::PropertyChangeEvent& default: ; } - + resetOwnProperties(aGuard,sOldFunctionName,sOldScope,nOldDataFieldType); } } |