diff options
Diffstat (limited to 'reportdesign/source/core/api/ReportDefinition.cxx')
-rw-r--r-- | reportdesign/source/core/api/ReportDefinition.cxx | 117 |
1 files changed, 36 insertions, 81 deletions
diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx index f3cac81e8ade..724664aeb51f 100644 --- a/reportdesign/source/core/api/ReportDefinition.cxx +++ b/reportdesign/source/core/api/ReportDefinition.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -122,7 +123,6 @@ #include <unotools/streamwrap.hxx> #include <vcl/svapp.hxx> #include <vcl/virdev.hxx> -#include <vos/mutex.hxx> #include <boost/bind.hpp> #include <boost/mem_fn.hpp> @@ -243,8 +243,7 @@ void lcl_extractAndStartStatusIndicator( const ::comphelper::MediaDescriptor& _r } catch( const uno::Exception& ) { - OSL_ENSURE( sal_False, "lcl_extractAndStartStatusIndicator: caught an exception!" ); -// DBG_UNHANDLED_EXCEPTION(); + OSL_FAIL( "lcl_extractAndStartStatusIndicator: caught an exception!" ); } } // ----------------------------------------------------------------------------- @@ -323,30 +322,23 @@ OStyle::OStyle() registerPropertyNoMember( PROPERTY_NAME, ++i,nBound,::getCppuType( static_cast< ::rtl::OUString *>(NULL) ), &sName ); registerPropertyNoMember(PROPERTY_BACKCOLOR, ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nTransparent); - //registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_GRAPHICFILT), ++i,nBound,::getCppuType((const ::rtl::OUString*)0) ,&sEmpty); registerPropertyNoMember(PROPERTY_BACKGRAPHICLOCATION, ++i,nBound,::getCppuType((const style::GraphicLocation*)0) ,&eGraphicLocation); - //registerPropertyNoMember(PROPERTY_BACKGRAPHICURL, ++i,nBound,::getCppuType((const ::rtl::OUString*)0) ,&sEmpty); registerPropertyNoMember(PROPERTY_BACKTRANSPARENT, ++i,nBound,::getBooleanCppuType() ,&bTrue); - //registerPropertyNoMember(MAP_CHAR_LEN(OLD_UNO_PAGE_BACKCOLOR), ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nZero); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_BORDERDIST), ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nZero); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_BOTTBORDER), ++i,nBound,::getCppuType((const table::BorderLine*)0) ,&eBorderLine); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_BOTTBRDDIST), ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nZero); registerPropertyNoMember(PROPERTY_BOTTOMMARGIN, ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nMargin); registerPropertyNoMember(MAP_CHAR_LEN("DisplayName"), ++i,nBound,::getCppuType((rtl::OUString*)0) ,&sEmpty); - //registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FIRSTPAGE), ++i,nBound,::getCppuType((const sal_Int16*)0) ,&n16Zero); - // registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRBACKCOL), ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nTransparent); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRGRFFILT), ++i,nBound,::getCppuType((const ::rtl::OUString*)0) ,&sEmpty); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRGRFLOC), ++i,nBound,::getCppuType((const style::GraphicLocation*)0) ,&eGraphicLocation); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRGRFURL), ++i,nBound,::getCppuType((const ::rtl::OUString*)0) ,&sEmpty); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRBACKTRAN), ++i,nBound,::getBooleanCppuType() ,&bTrue); - //registerPropertyNoMember(MAP_CHAR_LEN(OLD_UNO_PAGE_FTRBACKCOL), ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nZero); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRBODYDIST), ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nZero); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRBRDDIST), ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nZero); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRBOTTBOR), ++i,nBound,::getCppuType((const table::BorderLine*)0) ,&eBorderLine); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRBOTTBDIS), ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nZero); - //registerPropertyNoMember(MAP_CHAR_LEN(OLD_UNO_PAGE_FTRDYNAMIC), ++i,nBound,::getBooleanCppuType() ,&bFalse); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRHEIGHT), ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nZero); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRDYNAMIC), ++i,nBound,::getBooleanCppuType() ,&bFalse); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRON), ++i,nBound,::getBooleanCppuType() ,&bFalse); @@ -354,12 +346,10 @@ OStyle::OStyle() registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRLEFTBOR), ++i,nBound,::getCppuType((const table::BorderLine*)0) ,&eBorderLine); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRLEFTBDIS), ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nZero); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRLEFTMAR), ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nZero); - //registerPropertyNoMember(MAP_CHAR_LEN(OLD_UNO_PAGE_FTRON), ++i,nBound,::getBooleanCppuType() ,&bFalse); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRRIGHTBOR), ++i,nBound,::getCppuType((const table::BorderLine*)0) ,&eBorderLine); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRRIGHTBDIS),++i,nBound,::getCppuType((const sal_Int32*)0) ,&nZero); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRRIGHTMAR), ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nZero); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRSHADOW), ++i,nBound,::getCppuType((const table::ShadowFormat*)0) ,&eShadowFormat); - //registerPropertyNoMember(MAP_CHAR_LEN(OLD_UNO_PAGE_FTRSHARED), ++i,nBound,::getBooleanCppuType() ,&bFalse); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRTOPBOR), ++i,nBound,::getCppuType((const table::BorderLine*)0) ,&eBorderLine); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRTOPBDIS), ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nZero); // @@ -368,12 +358,10 @@ OStyle::OStyle() registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRGRFLOC), ++i,nBound|nMayBeVoid,::getCppuType((const style::GraphicLocation*)0) ,&eGraphicLocation); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRGRFURL), ++i,nBound|nMayBeVoid,::getCppuType((const ::rtl::OUString*)0) ,&sEmpty); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRBACKTRAN), ++i,nBound|nMayBeVoid,::getBooleanCppuType() ,&bTrue); - //registerPropertyNoMember(MAP_CHAR_LEN(OLD_UNO_PAGE_HDRBACKCOL), ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nZero); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRBODYDIST), ++i,nBound|nMayBeVoid,::getCppuType((const sal_Int32*)0) ,&nZero); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRBRDDIST), ++i,nBound|nMayBeVoid,::getCppuType((const sal_Int32*)0) ,&nZero); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRBOTTBOR), ++i,nBound|nMayBeVoid,::getCppuType((const table::BorderLine*)0) ,&eBorderLine); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRBOTTBDIS), ++i,nBound|nMayBeVoid,::getCppuType((const sal_Int32*)0) ,&nZero); - //registerPropertyNoMember(MAP_CHAR_LEN(OLD_UNO_PAGE_HDRDYNAMIC), ++i,nBound,::getBooleanCppuType() ,&bFalse); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRHEIGHT), ++i,nBound|nMayBeVoid,::getCppuType((const sal_Int32*)0) ,&nZero); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRDYNAMIC), ++i,nBound|nMayBeVoid,::getBooleanCppuType() ,&bFalse); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRON), ++i,nBound|nMayBeVoid,::getBooleanCppuType() ,&bFalse); @@ -381,23 +369,18 @@ OStyle::OStyle() registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRLEFTBOR), ++i,nBound|nMayBeVoid,::getCppuType((const table::BorderLine*)0) ,&eBorderLine); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRLEFTBDIS), ++i,nBound|nMayBeVoid,::getCppuType((const sal_Int32*)0) ,&nZero); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRLEFTMAR), ++i,nBound|nMayBeVoid,::getCppuType((const sal_Int32*)0) ,&nZero); - //registerPropertyNoMember(MAP_CHAR_LEN(OLD_UNO_PAGE_HDRON), ++i,nBound,::getBooleanCppuType() ,&bFalse); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRRIGHTBOR), ++i,nBound|nMayBeVoid,::getCppuType((const table::BorderLine*)0) ,&eBorderLine); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRRIGHTBDIS),++i,nBound|nMayBeVoid,::getCppuType((const sal_Int32*)0) ,&nZero); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRRIGHTMAR), ++i,nBound|nMayBeVoid,::getCppuType((const sal_Int32*)0) ,&nZero); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRSHADOW), ++i,nBound|nMayBeVoid,::getCppuType((const table::ShadowFormat*)0) ,&eShadowFormat); - //registerPropertyNoMember(MAP_CHAR_LEN(OLD_UNO_PAGE_HDRSHARED), ++i,nBound,::getBooleanCppuType() ,&bFalse); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRTOPBOR), ++i,nBound|nMayBeVoid,::getCppuType((const table::BorderLine*)0) ,&eBorderLine); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRTOPBDIS), ++i,nBound|nMayBeVoid,::getCppuType((const sal_Int32*)0) ,&nZero); // registerProperty(PROPERTY_HEIGHT, ++i,nBound,&m_aSize.Height, ::getCppuType((const sal_Int32*)0) ); - //registerPropertyNoMember(MAP_CHAR_LEN(OLD_UNO_PAGE_BACKTRANS), ++i,nBound, ::getBooleanCppuType() ,&bFalse); registerPropertyNoMember(PROPERTY_ISLANDSCAPE, ++i,nBound, ::getBooleanCppuType() ,&bFalse); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_LEFTBORDER), ++i,nBound, ::getCppuType((const table::BorderLine*)0) ,&eBorderLine); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_LEFTBRDDIST), ++i,nBound, ::getCppuType((const sal_Int32*)0) ,&nZero); registerPropertyNoMember(PROPERTY_LEFTMARGIN, ++i,beans::PropertyAttribute::BOUND, ::getCppuType((const sal_Int32*)0) ,&nMargin); - //registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_LEFTFTRCONT), ++i,nBound,::getCppuType((const uno::Reference< sheet::XHeaderFooterContent >*)0) ,NULL); - //registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_LEFTHDRCONT), ++i,nBound,::getCppuType((const uno::Reference< sheet::XHeaderFooterContent >*)0) ,NULL); registerPropertyNoMember(PROPERTY_NUMBERINGTYPE, ++i,nBound,::getCppuType((const sal_Int16*)0) ,&nNummeringType); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_SCALEVAL), ++i,nBound,::getCppuType((const sal_Int16*)0) ,&n16Zero); registerPropertyNoMember(PROPERTY_PAGESTYLELAYOUT, ++i,nBound,::getCppuType((const style::PageStyleLayout*)0) ,&ePageStyleLayout); @@ -406,8 +389,6 @@ OStyle::OStyle() registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_RIGHTBORDER), ++i,nBound,::getCppuType((const table::BorderLine*)0) ,&eBorderLine); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_RIGHTBRDDIST),++i,nBound,::getCppuType((const sal_Int32*)0) ,&nZero); registerPropertyNoMember(PROPERTY_RIGHTMARGIN, ++i,beans::PropertyAttribute::BOUND,::getCppuType((const sal_Int32*)0) ,&nMargin); - //registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_RIGHTFTRCON), ++i,nBound,::getCppuType((const uno::Reference< sheet::XHeaderFooterContent >*)0) ,NULL); - //registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_RIGHTHDRCON), ++i,nBound,::getCppuType((const uno::Reference< sheet::XHeaderFooterContent >*)0) ,NULL); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_SCALETOPAG), ++i,nBound,::getCppuType((const sal_Int16*)0) ,&n16Zero); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_SCALETOX), ++i,nBound,::getCppuType((const sal_Int16*)0) ,&n16Zero); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_SCALETOY), ++i,nBound,::getCppuType((const sal_Int16*)0) ,&n16Zero); @@ -416,12 +397,9 @@ OStyle::OStyle() registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_TOPBORDER), ++i,nBound,::getCppuType((const table::BorderLine*)0) ,&eBorderLine); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_TOPBRDDIST), ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nZero); registerPropertyNoMember(PROPERTY_TOPMARGIN, ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nMargin); - //registerPropertyNoMember(MAP_CHAR_LEN(OLD_UNO_PAGE_FTRBACKTRAN),++i,nBound,::getBooleanCppuType() ,&bFalse); - //registerPropertyNoMember(MAP_CHAR_LEN(OLD_UNO_PAGE_HDRBACKTRAN),++i,nBound,::getBooleanCppuType() ,&bFalse); uno::Reference< container::XNameContainer> xAttribs = ::comphelper::NameContainer_createInstance(::getCppuType(static_cast< xml::AttributeData* >(NULL))); registerPropertyNoMember(MAP_CHAR_LEN("UserDefinedAttributes"), ++i,nBound,::getCppuType((uno::Reference<container::XNameContainer>*)0) ,&xAttribs); registerProperty(PROPERTY_WIDTH, ++i,nBound,&m_aSize.Width,::getCppuType((const sal_Int32*)0) ); - //registerPropertyNoMember(MAP_CHAR_LEN(SC_UNONAME_WRITING), ++i,nBound,:.getCppuType((sal_Int16*)0) ,&n16Zero); registerPropertyNoMember(MAP_CHAR_LEN("PrinterName"), ++i,nBound,::getCppuType((const ::rtl::OUString*)0),&sEmpty); uno::Sequence<sal_Int8> aSe; registerPropertyNoMember(MAP_CHAR_LEN("PrinterSetup"), ++i,nBound,::getCppuType((const uno::Sequence<sal_Int8>*)0),&aSe); @@ -824,7 +802,7 @@ void SAL_CALL OReportDefinition::disposing() m_pImpl->m_aStorageChangeListeners.disposeAndClear( aDisposeEvent ); // SYNCHRONIZED ---> - vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + SolarMutexGuard aSolarGuard; ::osl::ResettableMutexGuard aGuard(m_aMutex); m_pImpl->m_aControllers.clear(); @@ -835,18 +813,13 @@ void SAL_CALL OReportDefinition::disposing() m_pImpl->m_xPageHeader.clear(); m_pImpl->m_xPageFooter.clear(); m_pImpl->m_xDetail.clear(); - //::comphelper::disposeComponent(m_pImpl->m_xReportHeader); - //::comphelper::disposeComponent(m_pImpl->m_xReportFooter); - //::comphelper::disposeComponent(m_pImpl->m_xPageHeader); - //::comphelper::disposeComponent(m_pImpl->m_xPageFooter); - //::comphelper::disposeComponent(m_pImpl->m_xDetail); ::comphelper::disposeComponent(m_pImpl->m_xFunctions); //::comphelper::disposeComponent(m_pImpl->m_xStorage); // don't dispose, this currently is the task of either the ref count going to // 0, or of the embedded object (if we're embedded, which is the only possible // case so far) - // #i78366# / 2007-06-18 / frank.schoenheit@sun.com + // #i78366# m_pImpl->m_xStorage.clear(); m_pImpl->m_xViewData.clear(); m_pImpl->m_xCurrentController.clear(); @@ -1220,7 +1193,7 @@ void SAL_CALL OReportDefinition::setParent( const uno::Reference< uno::XInterfac // XCloneable uno::Reference< util::XCloneable > SAL_CALL OReportDefinition::createClone( ) throw (uno::RuntimeException) { - OSL_ENSURE(0,"Not yet implemented correctly"); + OSL_FAIL("Not yet implemented correctly"); uno::Reference< report::XReportComponent> xSource = this; uno::Reference< report::XReportDefinition> xSet(cloneObject(xSource,m_aProps->m_xFactory,SERVICE_REPORTDEFINITION),uno::UNO_QUERY_THROW); return xSet.get(); @@ -1259,7 +1232,7 @@ void SAL_CALL OReportDefinition::removeCloseListener( const uno::Reference< util // XCloseable void SAL_CALL OReportDefinition::close( ::sal_Bool _bDeliverOwnership ) throw (util::CloseVetoException, uno::RuntimeException) { - vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + SolarMutexGuard aSolarGuard; ::osl::ResettableMutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed); @@ -1287,7 +1260,7 @@ void SAL_CALL OReportDefinition::close( ::sal_Bool _bDeliverOwnership ) throw (u catch( const util::CloseVetoException& ) { throw; } catch( const uno::Exception& ) { - OSL_ENSURE( sal_False, "ODatabaseDocument::impl_closeControllerFrames: caught an unexpected exception!" ); + OSL_FAIL( "ODatabaseDocument::impl_closeControllerFrames: caught an unexpected exception!" ); } } } @@ -1303,7 +1276,7 @@ void SAL_CALL OReportDefinition::close( ::sal_Bool _bDeliverOwnership ) throw (u ::sal_Bool SAL_CALL OReportDefinition::attachResource( const ::rtl::OUString& /*_rURL*/, const uno::Sequence< beans::PropertyValue >& _aArguments ) throw (uno::RuntimeException) { // LLA: we had a deadlock problem in our context, so we get the SolarMutex earlier. - ::vos::OClearableGuard aSolarGuard( Application::GetSolarMutex() ); + SolarMutexGuard aSolarGuard; ::osl::MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed( ReportDefinitionBase::rBHelper.bDisposed ); @@ -1429,10 +1402,6 @@ uno::Reference< uno::XInterface > SAL_CALL OReportDefinition::getCurrentSelectio void OReportDefinition::impl_loadFromStorage_nolck_throw( const uno::Reference< embed::XStorage >& _xStorageToLoadFrom, const uno::Sequence< beans::PropertyValue >& _aMediaDescriptor ) { -// ::osl::MutexGuard aGuard(m_aMutex); -// ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed); -// - m_pImpl->m_xStorage = _xStorageToLoadFrom; ::comphelper::MediaDescriptor aDescriptor( _aMediaDescriptor ); @@ -1489,7 +1458,7 @@ void SAL_CALL OReportDefinition::storeToStorage( const uno::Reference< embed::XS if ( !_xStorageToSaveTo.is() ) throw lang::IllegalArgumentException(RPT_RESSTRING(RID_STR_ARGUMENT_IS_NULL,m_aProps->m_xContext->getServiceManager()),*this,1); - vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + SolarMutexGuard aSolarGuard; ::osl::MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed); // create XStatusIndicator @@ -1532,7 +1501,7 @@ void SAL_CALL OReportDefinition::storeToStorage( const uno::Reference< embed::XS { const ::rtl::OUString sVal( aDescriptor.getUnpackedValueOrDefault(aDescriptor.PROP_DOCUMENTBASEURL(),::rtl::OUString()) ); xInfoSet->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BaseURI")), uno::makeAny(sVal)); - } // if ( aSaveOpt.IsSaveRelFSys() ) + } const ::rtl::OUString sHierarchicalDocumentName( aDescriptor.getUnpackedValueOrDefault(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HierarchicalDocumentName")),::rtl::OUString()) ); xInfoSet->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StreamRelPath")), uno::makeAny(sHierarchicalDocumentName)); @@ -1585,7 +1554,7 @@ void SAL_CALL OReportDefinition::storeToStorage( const uno::Reference< embed::XS sWarnFile = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("meta.xml")); } } - } // if( !bErr ) + } if( !bErr ) { @@ -1614,7 +1583,7 @@ void SAL_CALL OReportDefinition::storeToStorage( const uno::Reference< embed::XS bErr = sal_True; sErrFile = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("content.xml")); } - } // if ( !bErr ) + } uno::Any aImage; uno::Reference< embed::XVisualObject > xCurrentController(getCurrentController(),uno::UNO_QUERY); @@ -1652,7 +1621,7 @@ void SAL_CALL OReportDefinition::storeToStorage( const uno::Reference< embed::XS } catch(uno::Exception) { - OSL_ENSURE(0,"Exception Caught: Could not commit report storage!"); + OSL_FAIL("Exception Caught: Could not commit report storage!"); throw io::IOException(); } @@ -1890,7 +1859,7 @@ void SAL_CALL OReportDefinition::load( const uno::Sequence< beans::PropertyValue aArguments.get_ensureType( "ReadOnly", bReadOnly ); nFirstOpenMode = bReadOnly ? 1 : 0; } - const size_t nLastOpenMode = sizeof( nOpenModes ) / sizeof( nOpenModes[0] ) - 1; + const size_t nLastOpenMode = SAL_N_ELEMENTS( nOpenModes ) - 1; for ( size_t i=nFirstOpenMode; i <= nLastOpenMode; ++i ) { uno::Sequence< uno::Any > aStorageCreationArgs(2); @@ -1905,7 +1874,7 @@ void SAL_CALL OReportDefinition::load( const uno::Sequence< beans::PropertyValue { if ( i == nLastOpenMode ) throw lang::WrappedTargetException( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "An error occured while creating the document storage." ) ), + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "An error occurred while creating the document storage." ) ), // TODO: resource *this, ::cppu::getCaughtException() @@ -1928,15 +1897,12 @@ void SAL_CALL OReportDefinition::setVisualAreaSize( ::sal_Int64 _nAspect, const { ::osl::MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed); - //if( nAspect == embed::Aspects::MSOLE_CONTENT ) - { bool bChanged = (m_pImpl->m_aVisualAreaSize.Width != _aSize.Width || m_pImpl->m_aVisualAreaSize.Height != _aSize.Height); m_pImpl->m_aVisualAreaSize = _aSize; if( bChanged ) setModified( sal_True ); - } m_pImpl->m_nAspect = _nAspect; } // ----------------------------------------------------------------------------- @@ -2100,8 +2066,6 @@ uno::Reference< container::XIndexAccess > SAL_CALL OReportDefinition::getViewDat { m_pImpl->m_xViewData.set(m_aProps->m_xContext->getServiceManager()->createInstanceWithContext( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.IndexedPropertyValues")),m_aProps->m_xContext ),uno::UNO_QUERY); - //uno::Sequence< beans::PropertyValue > aProps; - //m_pImpl->m_xViewData->insertByIndex(m_pImpl->m_xViewData->getCount(),uno::makeAny(aProps)); uno::Reference< container::XIndexContainer > xContainer(m_pImpl->m_xViewData,uno::UNO_QUERY); ::std::vector< uno::Reference< frame::XController> >::iterator aIter = m_pImpl->m_aControllers.begin(); ::std::vector< uno::Reference< frame::XController> >::iterator aEnd = m_pImpl->m_aControllers.end(); @@ -2116,7 +2080,7 @@ uno::Reference< container::XIndexAccess > SAL_CALL OReportDefinition::getViewDat catch(uno::Exception&) { } - } // if ( aIter->is() ) + } } } @@ -2197,14 +2161,9 @@ void SAL_CALL OReportDefinition::setMimeType( const ::rtl::OUString& _mimetype ) // ----------------------------------------------------------------------------- uno::Sequence< ::rtl::OUString > SAL_CALL OReportDefinition::getAvailableMimeTypes( ) throw (lang::DisposedException, uno::Exception, uno::RuntimeException) { - static uno::Sequence< ::rtl::OUString > s_aList; - if ( !s_aList.hasElements() ) - { - s_aList.realloc(2); - s_aList[0] = MIMETYPE_OASIS_OPENDOCUMENT_TEXT; - s_aList[1] = MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET; - } - + uno::Sequence< ::rtl::OUString > s_aList(2); + s_aList[0] = MIMETYPE_OASIS_OPENDOCUMENT_TEXT; + s_aList[1] = MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET; return s_aList; } // ----------------------------------------------------------------------------- @@ -2288,9 +2247,9 @@ uno::Reference< uno::XInterface > SAL_CALL OReportDefinition::createInstanceWith { beans::NamedValue aValue; *pIter >>= aValue; - if( aValue.Name.equalsAscii( "Storage" ) ) + if( aValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Storage" ) ) ) aValue.Value >>= xStorage; - } // for(;pIter != pEnd ;++pIter) + } m_pImpl->m_pObjectContainer->SwitchPersistence(xStorage); xRet = static_cast< ::cppu::OWeakObject* >(SvXMLEmbeddedObjectHelper::Create( xStorage,*this, EMBEDDEDOBJECTHELPER_MODE_READ )); } @@ -2302,7 +2261,7 @@ uno::Reference< uno::XInterface > SAL_CALL OReportDefinition::createInstance( co ::osl::MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed); uno::Reference< drawing::XShape > xShape; - if ( aServiceSpecifier.indexOf( ::rtl::OUString::createFromAscii("com.sun.star.report.") ) == 0 ) + if ( aServiceSpecifier.indexOf( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.report.")) ) == 0 ) { if ( aServiceSpecifier == SERVICE_SHAPE ) xShape.set(SvxUnoDrawMSFactory::createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.CustomShape")) ),uno::UNO_QUERY_THROW); @@ -2314,7 +2273,7 @@ uno::Reference< uno::XInterface > SAL_CALL OReportDefinition::createInstance( co else xShape.set(SvxUnoDrawMSFactory::createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.OLE2Shape")) ),uno::UNO_QUERY_THROW); } - else if ( aServiceSpecifier.indexOf( ::rtl::OUString::createFromAscii("com.sun.star.form.component.") ) == 0 ) + else if ( aServiceSpecifier.indexOf( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.component.")) ) == 0 ) { xShape.set(m_aProps->m_xContext->getServiceManager()->createInstanceWithContext(aServiceSpecifier,m_aProps->m_xContext),uno::UNO_QUERY); } @@ -2346,35 +2305,30 @@ uno::Reference< uno::XInterface > SAL_CALL OReportDefinition::createInstance( co { if ( !m_pImpl->m_xGradientTable.is() ) m_pImpl->m_xGradientTable.set(SvxUnoGradientTable_createInstance(m_pImpl->m_pReportModel.get()),uno::UNO_QUERY); - //comphelper::NameContainer_createInstance( ::getCppuType( (const awt::Gradient*) 0 ) ).get(); return m_pImpl->m_xGradientTable; } else if ( aServiceSpecifier.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.HatchTable") ) == 0 ) { if ( !m_pImpl->m_xHatchTable.is() ) m_pImpl->m_xHatchTable.set(SvxUnoHatchTable_createInstance(m_pImpl->m_pReportModel.get()),uno::UNO_QUERY); - //comphelper::NameContainer_createInstance( ::getCppuType( (const drawing::Hatch*) 0 ) ).get(); return m_pImpl->m_xHatchTable; } else if ( aServiceSpecifier.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.BitmapTable") ) == 0 ) { if ( !m_pImpl->m_xBitmapTable.is() ) m_pImpl->m_xBitmapTable.set(SvxUnoBitmapTable_createInstance(m_pImpl->m_pReportModel.get()),uno::UNO_QUERY); - //comphelper::NameContainer_createInstance( ::getCppuType( (const ::rtl::OUString*) 0 ) ).get(); return m_pImpl->m_xBitmapTable; } else if ( aServiceSpecifier.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.TransparencyGradientTable") ) == 0 ) { if ( !m_pImpl->m_xTransparencyGradientTable.is() ) m_pImpl->m_xTransparencyGradientTable.set(SvxUnoTransGradientTable_createInstance(m_pImpl->m_pReportModel.get()),uno::UNO_QUERY); - //comphelper::NameContainer_createInstance( ::getCppuType( (const awt::Gradient*) 0 ) ).get(); return m_pImpl->m_xTransparencyGradientTable; } else if ( aServiceSpecifier.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.DashTable") ) == 0 ) { if ( !m_pImpl->m_xDashTable.is() ) m_pImpl->m_xDashTable.set(SvxUnoDashTable_createInstance(m_pImpl->m_pReportModel.get()),uno::UNO_QUERY); - //comphelper::NameContainer_createInstance( ::getCppuType( (const drawing::LineDash*) 0 ) ).get(); return m_pImpl->m_xDashTable; } else if( 0 == aServiceSpecifier.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.MarkerTable") ) ) @@ -2447,7 +2401,7 @@ uno::Sequence< ::rtl::OUString > SAL_CALL OReportDefinition::getAvailableService ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.MarkerTable")) }; - static const sal_uInt16 nSvxComponentServiceNameListCount = sizeof(aSvxComponentServiceNameList) / sizeof ( aSvxComponentServiceNameList[0] ); + static const sal_uInt16 nSvxComponentServiceNameListCount = SAL_N_ELEMENTS(aSvxComponentServiceNameList); uno::Sequence< ::rtl::OUString > aSeq( nSvxComponentServiceNameListCount ); ::rtl::OUString* pStrings = aSeq.getArray(); @@ -2746,7 +2700,7 @@ bool OReportDefinition::isEnableSetModified() const } uno::Reference< frame::XTitle > OReportDefinition::impl_getTitleHelper_throw() { - vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + SolarMutexGuard aSolarGuard; ::osl::MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed); @@ -2768,7 +2722,7 @@ uno::Reference< frame::XTitle > OReportDefinition::impl_getTitleHelper_throw() // ----------------------------------------------------------------------------- uno::Reference< frame::XUntitledNumbers > OReportDefinition::impl_getUntitledHelper_throw() { - vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + SolarMutexGuard aSolarGuard; ::osl::MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed); @@ -2780,7 +2734,7 @@ uno::Reference< frame::XUntitledNumbers > OReportDefinition::impl_getUntitledHel m_pImpl->m_xNumberedControllers = uno::Reference< frame::XUntitledNumbers >(static_cast< ::cppu::OWeakObject* >(pHelper), uno::UNO_QUERY_THROW); pHelper->setOwner (xThis); - pHelper->setUntitledPrefix (::rtl::OUString::createFromAscii(" : ")); + pHelper->setUntitledPrefix (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" : "))); } return m_pImpl->m_xNumberedControllers; @@ -2791,7 +2745,7 @@ uno::Reference< frame::XUntitledNumbers > OReportDefinition::impl_getUntitledHel throw (uno::RuntimeException) { // SYNCHRONIZED -> - vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + SolarMutexGuard aSolarGuard; ::osl::MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed); @@ -2804,7 +2758,7 @@ void SAL_CALL OReportDefinition::setTitle( const ::rtl::OUString& sTitle ) throw (uno::RuntimeException) { // SYNCHRONIZED -> - vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + SolarMutexGuard aSolarGuard; ::osl::MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed); @@ -2817,7 +2771,7 @@ void SAL_CALL OReportDefinition::addTitleChangeListener( const uno::Reference< f throw (uno::RuntimeException) { // SYNCHRONIZED -> - vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + SolarMutexGuard aSolarGuard; ::osl::MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed); @@ -2832,7 +2786,7 @@ void SAL_CALL OReportDefinition::removeTitleChangeListener( const uno::Reference throw (uno::RuntimeException) { // SYNCHRONIZED -> - vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + SolarMutexGuard aSolarGuard; ::osl::MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed); @@ -2848,7 +2802,7 @@ void SAL_CALL OReportDefinition::removeTitleChangeListener( const uno::Reference uno::RuntimeException ) { // object already disposed? - vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + SolarMutexGuard aSolarGuard; ::osl::MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed); @@ -2861,7 +2815,7 @@ void SAL_CALL OReportDefinition::releaseNumber( ::sal_Int32 nNumber ) uno::RuntimeException ) { // object already disposed? - vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + SolarMutexGuard aSolarGuard; ::osl::MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed); @@ -2874,7 +2828,7 @@ void SAL_CALL OReportDefinition::releaseNumberForComponent( const uno::Reference uno::RuntimeException ) { // object already disposed? - vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + SolarMutexGuard aSolarGuard; ::osl::MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed); @@ -2886,7 +2840,7 @@ void SAL_CALL OReportDefinition::releaseNumberForComponent( const uno::Reference throw (uno::RuntimeException) { // object already disposed? - vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + SolarMutexGuard aSolarGuard; ::osl::MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed); @@ -2964,3 +2918,4 @@ uno::Reference< document::XUndoManager > SAL_CALL OReportDefinition::getUndoMana }// namespace reportdesign // ============================================================================= +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |