connectivity/Library_jdbc.mk | 1 connectivity/Library_mork.mk | 1 connectivity/Library_sdbc2.mk | 1 extensions/Library_log.mk | 1 include/oox/core/filterbase.hxx | 4 - include/tools/diagnose_ex.h | 3 - offapi/UnoApi_offapi.mk | 8 ++ offapi/com/sun/star/chart2/ExponentialRegressionCurve.idl | 38 +++++++++++++ offapi/com/sun/star/chart2/LinearRegressionCurve.idl | 38 +++++++++++++ offapi/com/sun/star/chart2/LogarithmicRegressionCurve.idl | 38 +++++++++++++ offapi/com/sun/star/chart2/PotentialRegressionCurve.idl | 38 +++++++++++++ offapi/com/sun/star/oox/ExcelFilterExport.idl | 37 +++++++++++++ offapi/com/sun/star/oox/PowerPointExport.idl | 37 +++++++++++++ oox/source/core/filterbase.cxx | 11 --- oox/source/core/xmlfilterbase.cxx | 14 +---- oox/source/drawingml/chart/converterbase.cxx | 6 +- oox/source/export/shapes.cxx | 5 + oox/source/ppt/pptimport.cxx | 30 +++++----- oox/source/ppt/timenode.cxx | 2 sc/inc/document.hxx | 4 - sc/source/core/data/documen2.cxx | 1 sc/source/core/data/documen6.cxx | 2 sc/source/core/data/documen8.cxx | 2 sc/source/core/data/dpobject.cxx | 4 - sc/source/core/data/poolhelp.cxx | 2 sc/source/core/data/table3.cxx | 2 sc/source/filter/excel/xechart.cxx | 8 +- sc/source/filter/excel/xestream.cxx | 9 +-- sc/source/filter/excel/xestyle.cxx | 4 - sc/source/filter/excel/xichart.cxx | 39 +++----------- sc/source/filter/inc/xlchart.hxx | 4 - sc/source/filter/oox/excelfilter.cxx | 21 +++---- sc/source/filter/xml/xmlimprt.cxx | 4 - sc/source/ui/docshell/docsh.cxx | 2 sc/source/ui/docshell/docsh2.cxx | 2 sc/source/ui/docshell/impex.cxx | 12 ++-- sc/source/ui/unoobj/forbiuno.cxx | 2 sc/source/ui/xmlsource/xmlsourcedlg.cxx | 6 -- sc/util/scfilt.component | 2 sd/source/filter/eppt/pptx-epptooxml.cxx | 5 + sd/util/sdfilt.component | 1 tools/source/debug/debug.cxx | 2 ucb/Library_ucpext.mk | 1 xmlscript/Library_xmlscript.mk | 1 44 files changed, 325 insertions(+), 130 deletions(-)
New commits: commit 02021163dbbcc8904da0b2138c8b53684dcc8ab4 Author: Noel Grandin <n...@peralex.com> Date: Tue May 21 13:52:07 2013 +0200 fdo#46808, Convert oox::PowerPointExport service to new style The service already existed, it just needed an IDL file Change-Id: I1404f4f60abafd489ddfb7294affcc7ff33885ce diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk index 79f76c8..20aa8a7 100644 --- a/offapi/UnoApi_offapi.mk +++ b/offapi/UnoApi_offapi.mk @@ -262,6 +262,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/mozilla,\ )) $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/oox,\ ExcelFilterExport \ + PowerPointExport \ )) $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/packages/manifest,\ ManifestReader \ diff --git a/offapi/com/sun/star/oox/PowerPointExport.idl b/offapi/com/sun/star/oox/PowerPointExport.idl new file mode 100644 index 0000000..14f84eb --- /dev/null +++ b/offapi/com/sun/star/oox/PowerPointExport.idl @@ -0,0 +1,37 @@ +/* -*- 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 . + */ + +#ifndef __com_sun_star_oox_PowerPointExport_idl__ +#define __com_sun_star_oox_PowerPointExport_idl__ + +#include <com/sun/star/document/XExporter.idl> + + +module com { module sun { module star { module oox { + +/** + @since LibreOffice 4.2 +*/ +service PowerPointExport : com::sun::star::document::XExporter; + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/ppt/pptimport.cxx b/oox/source/ppt/pptimport.cxx index 285ac2a..e9008b3 100644 --- a/oox/source/ppt/pptimport.cxx +++ b/oox/source/ppt/pptimport.cxx @@ -24,10 +24,12 @@ #include "oox/helper/graphichelper.hxx" #include "oox/ole/vbaproject.hxx" +#include "com/sun/star/oox/PowerPointExport.hpp" + using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::xml::sax; -using namespace oox::core; +using namespace ::oox::core; using ::com::sun::star::beans::PropertyValue; using ::com::sun::star::lang::XComponent; @@ -96,7 +98,7 @@ sal_Int32 PowerPointImport::getSchemeColor( sal_Int32 nToken ) const if ( mpActualSlidePersist ) { sal_Bool bColorMapped = sal_False; - oox::drawingml::ClrMapPtr pClrMapPtr( mpActualSlidePersist->getClrMap() ); + ::oox::drawingml::ClrMapPtr pClrMapPtr( mpActualSlidePersist->getClrMap() ); if ( pClrMapPtr ) bColorMapped = pClrMapPtr->getColorMap( nToken ); @@ -110,7 +112,7 @@ sal_Int32 PowerPointImport::getSchemeColor( sal_Int32 nToken ) const bColorMapped = pClrMapPtr->getColorMap( nToken ); } } - oox::drawingml::ClrSchemePtr pClrSchemePtr( mpActualSlidePersist->getClrScheme() ); + ::oox::drawingml::ClrSchemePtr pClrSchemePtr( mpActualSlidePersist->getClrScheme() ); if ( pClrSchemePtr ) pClrSchemePtr->getColor( nToken, nColor ); else @@ -140,17 +142,15 @@ sal_Bool SAL_CALL PowerPointImport::filter( const Sequence< PropertyValue >& rDe return true; if( isExportFilter() ) { - Reference< XExporter > xExporter( Reference<css::lang::XMultiServiceFactory>(getComponentContext()->getServiceManager(), UNO_QUERY_THROW)->createInstance( "com.sun.star.comp.Impress.oox.PowerPointExport" ), UNO_QUERY );; + Reference< XExporter > xExporter = css::oox::PowerPointExport::create( getComponentContext() ); - if( xExporter.is() ) { - Reference< XComponent > xDocument( getModel(), UNO_QUERY ); - Reference< XFilter > xFilter( xExporter, UNO_QUERY ); + Reference< XComponent > xDocument( getModel(), UNO_QUERY ); + Reference< XFilter > xFilter( xExporter, UNO_QUERY ); - if( xFilter.is() ) { - xExporter->setSourceDocument( xDocument ); - if( xFilter->filter( rDescriptor ) ) - return true; - } + if( xFilter.is() ) { + xExporter->setSourceDocument( xDocument ); + if( xFilter->filter( rDescriptor ) ) + return true; } } @@ -162,12 +162,12 @@ sal_Bool SAL_CALL PowerPointImport::filter( const Sequence< PropertyValue >& rDe return mpActualSlidePersist ? mpActualSlidePersist->getDrawing() : 0; } -const oox::drawingml::table::TableStyleListPtr PowerPointImport::getTableStyles() +const ::oox::drawingml::table::TableStyleListPtr PowerPointImport::getTableStyles() { if ( !mpTableStyleList && !maTableStyleListPath.isEmpty() ) { - mpTableStyleList = oox::drawingml::table::TableStyleListPtr( new oox::drawingml::table::TableStyleList() ); - importFragment( new oox::drawingml::table::TableStyleListFragmentHandler( + mpTableStyleList = ::oox::drawingml::table::TableStyleListPtr( new ::oox::drawingml::table::TableStyleList() ); + importFragment( new ::oox::drawingml::table::TableStyleListFragmentHandler( *this, maTableStyleListPath, *mpTableStyleList ) ); } return mpTableStyleList; diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx index ba04809..084fa787 100644 --- a/sd/source/filter/eppt/pptx-epptooxml.cxx +++ b/sd/source/filter/eppt/pptx-epptooxml.cxx @@ -2141,8 +2141,9 @@ OUString SAL_CALL PowerPointExport_getImplementationName() throw() uno::Sequence< OUString > SAL_CALL PowerPointExport_getSupportedServiceNames() throw() { - const OUString aServiceName( "com.sun.star.comp.ooxpptx" ); - const Sequence< OUString > aSeq( &aServiceName, 1 ); + Sequence< OUString > aSeq( 2 ); + aSeq[0] = "com.sun.star.comp.ooxpptx"; + aSeq[1] = "com.sun.star.oox.PowerPointExport"; return aSeq; } diff --git a/sd/util/sdfilt.component b/sd/util/sdfilt.component index 3b1d3b0..349ea8b 100644 --- a/sd/util/sdfilt.component +++ b/sd/util/sdfilt.component @@ -11,5 +11,6 @@ xmlns="http://openoffice.org/2010/uno-components"> <implementation name="com.sun.star.comp.Impress.oox.PowerPointExport"> <service name="com.sun.star.comp.ooxpptx"/> + <service name="com.sun.star.oox.PowerPointExport"/> </implementation> </component> commit 6bf00f0f94394c62bddcd77b776e4e3592160201 Author: Noel Grandin <n...@peralex.com> Date: Tue May 21 13:50:45 2013 +0200 fix for linking caused by my commit 863d38fbfa4fb4861e476828c46410602100919e "move DBG_UNHANDLED_EXCEPTION out of line" Change-Id: Idfd84d987ba9151ba476ce0516a9e5fbdb2003ec diff --git a/connectivity/Library_jdbc.mk b/connectivity/Library_jdbc.mk index 9222bc5..68282c0 100644 --- a/connectivity/Library_jdbc.mk +++ b/connectivity/Library_jdbc.mk @@ -30,6 +30,7 @@ $(eval $(call gb_Library_use_libraries,jdbc,\ salhelper \ jvmaccess \ dbtools \ + tl \ utl \ jvmfwk \ comphelper \ diff --git a/connectivity/Library_mork.mk b/connectivity/Library_mork.mk index 4041049..18917c5 100644 --- a/connectivity/Library_mork.mk +++ b/connectivity/Library_mork.mk @@ -34,6 +34,7 @@ $(eval $(call gb_Library_use_libraries,mork, \ dbtools \ sal \ salhelper \ + tl \ utl \ $(gb_UWINAPI) \ )) diff --git a/connectivity/Library_sdbc2.mk b/connectivity/Library_sdbc2.mk index e8da462..146b966 100644 --- a/connectivity/Library_sdbc2.mk +++ b/connectivity/Library_sdbc2.mk @@ -28,6 +28,7 @@ $(eval $(call gb_Library_use_libraries,sdbc2,\ dbtools \ utl \ sal \ + tl \ $(gb_UWINAPI) \ )) diff --git a/extensions/Library_log.mk b/extensions/Library_log.mk index d0a9518..1227f9d 100644 --- a/extensions/Library_log.mk +++ b/extensions/Library_log.mk @@ -35,6 +35,7 @@ $(eval $(call gb_Library_use_libraries,log,\ cppuhelper \ cppu \ sal \ + tl \ $(gb_UWINAPI) \ )) diff --git a/include/tools/diagnose_ex.h b/include/tools/diagnose_ex.h index a38b2d4..4c27193 100644 --- a/include/tools/diagnose_ex.h +++ b/include/tools/diagnose_ex.h @@ -40,8 +40,9 @@ #include <osl/thread.h> #include <boost/current_function.hpp> #include <typeinfo> + #include <tools/toolsdllapi.h> - void DbgUnhandledException(const ::com::sun::star::uno::Any& caughtException, const char* currentFunction); + TOOLS_DLLPUBLIC void DbgUnhandledException(const ::com::sun::star::uno::Any& caughtException, const char* currentFunction); /** reports a caught UNO exception via OSL diagnostics diff --git a/tools/source/debug/debug.cxx b/tools/source/debug/debug.cxx index eec15eb..3f950ca 100644 --- a/tools/source/debug/debug.cxx +++ b/tools/source/debug/debug.cxx @@ -1589,7 +1589,7 @@ void DbgOutf( const sal_Char*, ... ) {} #if OSL_DEBUG_LEVEL > 0 -void DbgUnhandledException(const css::uno::Any & caught, const char* currentFunction) +TOOLS_DLLPUBLIC void DbgUnhandledException(const css::uno::Any & caught, const char* currentFunction) { OString sMessage( "caught an exception!" ); sMessage += "\nin function:"; diff --git a/ucb/Library_ucpext.mk b/ucb/Library_ucpext.mk index 0d5237c..e492579 100644 --- a/ucb/Library_ucpext.mk +++ b/ucb/Library_ucpext.mk @@ -22,6 +22,7 @@ $(eval $(call gb_Library_use_libraries,ucpext,\ cppuhelper \ sal \ salhelper \ + tl \ ucbhelper \ $(gb_UWINAPI) \ )) diff --git a/xmlscript/Library_xmlscript.mk b/xmlscript/Library_xmlscript.mk index 869109a..fa680d1 100644 --- a/xmlscript/Library_xmlscript.mk +++ b/xmlscript/Library_xmlscript.mk @@ -20,6 +20,7 @@ $(eval $(call gb_Library_use_libraries,xmlscript,\ cppu \ cppuhelper \ sal \ + tl \ $(gb_UWINAPI) \ )) commit a986eddb9b9d1de71ae1c6f73246e493cc449c21 Author: Noel Grandin <n...@peralex.com> Date: Tue May 21 13:08:34 2013 +0200 fdo#46808, Convert oox.ExcelFilterExport service to new style Service already existed, just needed an IDL file Change-Id: I397296e5ad7b32febb63e74f8ee9a0db53ba5a81 diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk index 1b70c75..79f76c8 100644 --- a/offapi/UnoApi_offapi.mk +++ b/offapi/UnoApi_offapi.mk @@ -260,6 +260,9 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/media,\ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/mozilla,\ MozillaBootstrap \ )) +$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/oox,\ + ExcelFilterExport \ +)) $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/packages/manifest,\ ManifestReader \ ManifestWriter \ diff --git a/offapi/com/sun/star/oox/ExcelFilterExport.idl b/offapi/com/sun/star/oox/ExcelFilterExport.idl new file mode 100644 index 0000000..cb74aa8 --- /dev/null +++ b/offapi/com/sun/star/oox/ExcelFilterExport.idl @@ -0,0 +1,37 @@ +/* -*- 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 . + */ + +#ifndef __com_sun_star_oox_ExcelFilterExport_idl__ +#define __com_sun_star_oox_ExcelFilterExport_idl__ + +#include <com/sun/star/document/XExporter.idl> + + +module com { module sun { module star { module oox { + +/** + @since LibreOffice 4.2 +*/ +service ExcelFilterExport : com::sun::star::document::XExporter; + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index 2fc1133..75a5b59 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -46,6 +46,7 @@ #include <com/sun/star/graphic/XGraphic.hpp> #include <com/sun/star/i18n/ScriptType.hpp> #include <com/sun/star/io/XOutputStream.hpp> +#include <com/sun/star/oox/ExcelFilterExport.hpp> #include <com/sun/star/sheet/XSpreadsheetDocument.hpp> #include <com/sun/star/style/ParagraphAdjust.hpp> #include <com/sun/star/text/XSimpleText.hpp> @@ -1312,8 +1313,8 @@ ShapeExport& ShapeExport::WriteOLE2Shape( Reference< XShape > xShape ) if( xSheetDoc.is() && mpFB) { Reference< XComponent > xDocument( mAny, UNO_QUERY ); - Reference< XExporter > xExporter( Reference<css::lang::XMultiServiceFactory>(mpFB->getComponentContext()->getServiceManager(), UNO_QUERY_THROW)->createInstance( "com.sun.star.comp.oox.ExcelFilterExport" ), UNO_QUERY );; - if( xDocument.is() && xExporter.is()) + Reference< XExporter > xExporter = css::oox::ExcelFilterExport::create( mpFB->getComponentContext() ); + if( xDocument.is() ) { Reference< XOutputStream > xOutStream = mpFB->openFragmentStream( OUStringBuffer() .appendAscii( GetComponentDir() ) diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx index dacbb1d..cc4678f 100644 --- a/sc/source/filter/excel/xestream.cxx +++ b/sc/source/filter/excel/xestream.cxx @@ -1146,11 +1146,9 @@ bool XclExpXmlStream::exportDocument() throw() // UNO stuff so that the filter is registered ////////////////////////////////////////////////////////////////////////// -#define IMPL_NAME "com.sun.star.comp.oox.ExcelFilterExport" - OUString XlsxExport_getImplementationName() { - return OUString( IMPL_NAME ); + return OUString( "com.sun.star.comp.oox.ExcelFilterExport" ); } ::oox::ole::VbaProject* XclExpXmlStream::implCreateVbaProject() const @@ -1166,8 +1164,9 @@ OUString XclExpXmlStream::implGetImplementationName() const Sequence< OUString > SAL_CALL XlsxExport_getSupportedServiceNames() throw() { - const OUString aServiceName( "com.sun.star.document.ExportFilter" ); - const Sequence< OUString > aSeq( &aServiceName, 1 ); + Sequence< OUString > aSeq( 2 ); + aSeq[0] = "com.sun.star.document.ExportFilter"; + aSeq[1] = "com.sun.star.oox.ExcelFilterExport"; return aSeq; } diff --git a/sc/source/filter/oox/excelfilter.cxx b/sc/source/filter/oox/excelfilter.cxx index 379b323..e8414cb 100644 --- a/sc/source/filter/oox/excelfilter.cxx +++ b/sc/source/filter/oox/excelfilter.cxx @@ -20,6 +20,8 @@ #include "excelfilter.hxx" #include <com/sun/star/sheet/XSpreadsheetDocument.hpp> +#include <com/sun/star/oox/ExcelFilterExport.hpp> + #include "oox/helper/binaryinputstream.hxx" #include "biffinputstream.hxx" #include "excelchartconverter.hxx" @@ -175,19 +177,16 @@ sal_Bool SAL_CALL ExcelFilter::filter( const ::com::sun::star::uno::Sequence< :: if ( isExportFilter() ) { - Reference< XExporter > xExporter( Reference<XMultiServiceFactory>(getComponentContext()->getServiceManager(), UNO_QUERY_THROW)->createInstance( "com.sun.star.comp.oox.ExcelFilterExport" ), UNO_QUERY );; + Reference< XExporter > xExporter = css::oox::ExcelFilterExport::create( getComponentContext() ); + + Reference< XComponent > xDocument( getModel(), UNO_QUERY ); + Reference< XFilter > xFilter( xExporter, UNO_QUERY ); - if ( xExporter.is() ) + if ( xFilter.is() ) { - Reference< XComponent > xDocument( getModel(), UNO_QUERY ); - Reference< XFilter > xFilter( xExporter, UNO_QUERY ); - - if ( xFilter.is() ) - { - xExporter->setSourceDocument( xDocument ); - if ( xFilter->filter( rDescriptor ) ) - return true; - } + xExporter->setSourceDocument( xDocument ); + if ( xFilter->filter( rDescriptor ) ) + return true; } } diff --git a/sc/util/scfilt.component b/sc/util/scfilt.component index 292fbd4..6834ce1 100644 --- a/sc/util/scfilt.component +++ b/sc/util/scfilt.component @@ -20,7 +20,7 @@ <component loader="com.sun.star.loader.SharedLibrary" prefix="scfilt" xmlns="http://openoffice.org/2010/uno-components"> <implementation name="com.sun.star.comp.oox.ExcelFilterExport"> - <service name="com.sun.star.comp.oox.ExcelFilterExport"/> + <service name="com.sun.star.oox.ExcelFilterExport"/> </implementation> <implementation name="com.sun.star.comp.oox.xls.ExcelFilter"> <service name="com.sun.star.document.ImportFilter"/> commit d4d16d8a27517930bdc9e9a308da287d367dd622 Author: Noel Grandin <n...@peralex.com> Date: Tue May 21 12:02:40 2013 +0200 fdo#46808, Remove unnecessary XMultiServiceFactory member .. and associated methods Change-Id: Iec01b4615decc1616e405166088d7d1d844ac0ae diff --git a/include/oox/core/filterbase.hxx b/include/oox/core/filterbase.hxx index 6f4fc40..cfd9354 100644 --- a/include/oox/core/filterbase.hxx +++ b/include/oox/core/filterbase.hxx @@ -117,10 +117,6 @@ public: const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& getComponentContext() const; - /** Returns the multi service factory of the component (always existing). */ - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& - getServiceFactory() const; - /** Returns the document model (always existing). */ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& getModel() const; diff --git a/oox/source/core/filterbase.cxx b/oox/source/core/filterbase.cxx index 13551fe..6a6f73b 100644 --- a/oox/source/core/filterbase.cxx +++ b/oox/source/core/filterbase.cxx @@ -144,7 +144,6 @@ struct FilterBaseImpl Reference< XComponentContext > mxComponentContext; Reference< XMultiComponentFactory > mxComponentFactory; - Reference< XMultiServiceFactory > mxServiceFactory; Reference< XModel > mxModel; Reference< XMultiServiceFactory > mxModelFactory; Reference< XFrame > mxTargetFrame; @@ -168,8 +167,7 @@ FilterBaseImpl::FilterBaseImpl( const Reference< XComponentContext >& rxContext meDirection( FILTERDIRECTION_UNKNOWN ), meVersion( ECMA_DIALECT ), mxComponentContext( rxContext, UNO_SET_THROW ), - mxComponentFactory( rxContext->getServiceManager(), UNO_SET_THROW ), - mxServiceFactory( rxContext->getServiceManager(), UNO_QUERY_THROW ) + mxComponentFactory( rxContext->getServiceManager(), UNO_SET_THROW ) { } @@ -245,11 +243,6 @@ const Reference< XComponentContext >& FilterBase::getComponentContext() const return mxImpl->mxComponentContext; } -const Reference< XMultiServiceFactory >& FilterBase::getServiceFactory() const -{ - return mxImpl->mxServiceFactory; -} - const Reference< XModel >& FilterBase::getModel() const { return mxImpl->mxModel; @@ -561,7 +554,7 @@ void FilterBase::setMediaDescriptor( const Sequence< PropertyValue >& rMediaDesc OUString sFilterName = mxImpl->maMediaDesc.getUnpackedValueOrDefault( "FilterName", OUString() ); try { - Reference< XNameAccess > xFilters( getServiceFactory()->createInstance("com.sun.star.document.FilterFactory" ), UNO_QUERY_THROW ); + Reference< XNameAccess > xFilters( Reference<XMultiServiceFactory>(getComponentContext()->getServiceManager(), UNO_QUERY_THROW)->createInstance("com.sun.star.document.FilterFactory" ), UNO_QUERY_THROW ); Any aValues = xFilters->getByName( sFilterName ); Sequence<PropertyValue > aPropSeq; aValues >>= aPropSeq; diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx index fe2055e..9a06b81 100644 --- a/oox/source/core/xmlfilterbase.cxx +++ b/oox/source/core/xmlfilterbase.cxx @@ -47,14 +47,10 @@ #include <comphelper/processfactory.hxx> #include <oox/core/filterdetect.hxx> #include <comphelper/storagehelper.hxx> -using ::com::sun::star::uno::XComponentContext; -using ::com::sun::star::document::XOOXMLDocumentPropertiesImporter; -using ::com::sun::star::document::XDocumentPropertiesSupplier; + using ::com::sun::star::xml::dom::DocumentBuilder; using ::com::sun::star::xml::dom::XDocument; using ::com::sun::star::xml::dom::XDocumentBuilder; -using ::com::sun::star::xml::sax::XFastSAXSerializable; -using ::com::sun::star::lang::XComponent; namespace oox { namespace core { @@ -204,10 +200,10 @@ XmlFilterBase::~XmlFilterBase() void XmlFilterBase::importDocumentProperties() { - Reference< XMultiServiceFactory > xFactory( getServiceFactory(), UNO_QUERY ); + Reference< XMultiServiceFactory > xFactory( getComponentContext()->getServiceManager(), UNO_QUERY ); MediaDescriptor aMediaDesc( getMediaDescriptor() ); Reference< XInputStream > xInputStream; - Reference< XComponentContext > xContext = comphelper::getComponentContext(getServiceFactory()); + Reference< XComponentContext > xContext = getComponentContext(); ::oox::core::FilterDetect aDetector( xContext ); xInputStream = aDetector.extractUnencryptedPackage( aMediaDesc ); Reference< XComponent > xModel( getModel(), UNO_QUERY ); @@ -330,9 +326,7 @@ Reference<XDocument> XmlFilterBase::importFragment( const OUString& aFragmentPat try { // create the dom parser - Reference< XComponentContext > xContext = - comphelper::getComponentContext(getServiceFactory()); - Reference<XDocumentBuilder> xDomBuilder( DocumentBuilder::create(xContext) ); + Reference<XDocumentBuilder> xDomBuilder( DocumentBuilder::create( getComponentContext() ) ); // create DOM from fragment xRet = xDomBuilder->parse(xInStrm); diff --git a/oox/source/drawingml/chart/converterbase.cxx b/oox/source/drawingml/chart/converterbase.cxx index 67f0a68..e36ecf1 100644 --- a/oox/source/drawingml/chart/converterbase.cxx +++ b/oox/source/drawingml/chart/converterbase.cxx @@ -231,7 +231,9 @@ Reference< XInterface > ConverterRoot::createInstance( const OUString& rServiceN Reference< XInterface > xInt; try { - xInt = mxData->mrFilter.getServiceFactory()->createInstance( rServiceName ); + Reference<XMultiServiceFactory> xMSF = Reference<XMultiServiceFactory>(getComponentContext()->getServiceManager(), uno::UNO_QUERY_THROW); + + xInt = xMSF->createInstance( rServiceName ); } catch( Exception& ) { @@ -242,7 +244,7 @@ Reference< XInterface > ConverterRoot::createInstance( const OUString& rServiceN Reference< XComponentContext > ConverterRoot::getComponentContext() const { - return comphelper::getComponentContext(mxData->mrFilter.getServiceFactory()); + return mxData->mrFilter.getComponentContext(); } XmlFilterBase& ConverterRoot::getFilter() const diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index 2f918c2..2fc1133 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -1312,7 +1312,7 @@ ShapeExport& ShapeExport::WriteOLE2Shape( Reference< XShape > xShape ) if( xSheetDoc.is() && mpFB) { Reference< XComponent > xDocument( mAny, UNO_QUERY ); - Reference< XExporter > xExporter( mpFB->getServiceFactory()->createInstance( "com.sun.star.comp.oox.ExcelFilterExport" ), UNO_QUERY ); + Reference< XExporter > xExporter( Reference<css::lang::XMultiServiceFactory>(mpFB->getComponentContext()->getServiceManager(), UNO_QUERY_THROW)->createInstance( "com.sun.star.comp.oox.ExcelFilterExport" ), UNO_QUERY );; if( xDocument.is() && xExporter.is()) { Reference< XOutputStream > xOutStream = mpFB->openFragmentStream( OUStringBuffer() diff --git a/oox/source/ppt/pptimport.cxx b/oox/source/ppt/pptimport.cxx index a7e9922..285ac2a 100644 --- a/oox/source/ppt/pptimport.cxx +++ b/oox/source/ppt/pptimport.cxx @@ -140,7 +140,7 @@ sal_Bool SAL_CALL PowerPointImport::filter( const Sequence< PropertyValue >& rDe return true; if( isExportFilter() ) { - Reference< XExporter > xExporter( getServiceFactory()->createInstance( "com.sun.star.comp.Impress.oox.PowerPointExport" ), UNO_QUERY ); + Reference< XExporter > xExporter( Reference<css::lang::XMultiServiceFactory>(getComponentContext()->getServiceManager(), UNO_QUERY_THROW)->createInstance( "com.sun.star.comp.Impress.oox.PowerPointExport" ), UNO_QUERY );; if( xExporter.is() ) { Reference< XComponent > xDocument( getModel(), UNO_QUERY ); diff --git a/oox/source/ppt/timenode.cxx b/oox/source/ppt/timenode.cxx index 3248e41..309d3bf 100644 --- a/oox/source/ppt/timenode.cxx +++ b/oox/source/ppt/timenode.cxx @@ -578,7 +578,7 @@ namespace oox { namespace ppt { const Reference< XAnimationNode >& rxNode ) { try { - Reference< XAnimationNode > xNode ( rFilter.getServiceFactory()->createInstance( rServiceName ), UNO_QUERY_THROW ); + Reference< XAnimationNode > xNode( Reference<css::lang::XMultiServiceFactory>(rFilter.getComponentContext()->getServiceManager(), UNO_QUERY_THROW)->createInstance( rServiceName ), UNO_QUERY_THROW );; Reference< XTimeContainer > xParentContainer( rxNode, UNO_QUERY_THROW ); xParentContainer->appendChild( xNode ); diff --git a/sc/source/filter/oox/excelfilter.cxx b/sc/source/filter/oox/excelfilter.cxx index b54d09c..379b323 100644 --- a/sc/source/filter/oox/excelfilter.cxx +++ b/sc/source/filter/oox/excelfilter.cxx @@ -175,7 +175,7 @@ sal_Bool SAL_CALL ExcelFilter::filter( const ::com::sun::star::uno::Sequence< :: if ( isExportFilter() ) { - Reference< XExporter > xExporter( getServiceFactory()->createInstance( "com.sun.star.comp.oox.ExcelFilterExport" ), UNO_QUERY ); + Reference< XExporter > xExporter( Reference<XMultiServiceFactory>(getComponentContext()->getServiceManager(), UNO_QUERY_THROW)->createInstance( "com.sun.star.comp.oox.ExcelFilterExport" ), UNO_QUERY );; if ( xExporter.is() ) { commit 823377b707fda94222a99b6710363f392fd9e4dd Author: Noel Grandin <n...@peralex.com> Date: Tue May 21 11:24:26 2013 +0200 fdo#46808, Convert chart2::*RegressionCurve services to new style The service already existed, they just needed IDL files. Change-Id: I547b3b40912e2fefdb173c010826f86aa8347b11 diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk index 682ef39..1b70c75 100644 --- a/offapi/UnoApi_offapi.mk +++ b/offapi/UnoApi_offapi.mk @@ -80,12 +80,16 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/awt/tree,\ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/chart2,\ CartesianCoordinateSystem2d \ CartesianCoordinateSystem3d \ + ExponentialRegressionCurve \ ExponentialScaling \ FormattedString \ + LogarithmicRegressionCurve \ LogarithmicScaling \ + LinearRegressionCurve \ LinearScaling \ PolarCoordinateSystem2d \ PolarCoordinateSystem3d \ + PotentialRegressionCurve \ PowerScaling \ RegressionEquation \ Scaling \ diff --git a/offapi/com/sun/star/chart2/ExponentialRegressionCurve.idl b/offapi/com/sun/star/chart2/ExponentialRegressionCurve.idl new file mode 100644 index 0000000..b9e9465 --- /dev/null +++ b/offapi/com/sun/star/chart2/ExponentialRegressionCurve.idl @@ -0,0 +1,38 @@ +/* -*- 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 . + */ +#ifndef com_sun_star_chart2_ExponentialRegressionCurve_idl +#define com_sun_star_chart2_ExponentialRegressionCurve_idl + +#include <com/sun/star/chart2/XRegressionCurve.idl> + + +module com { module sun { module star { module chart2 { + + +/** + @since LibreOffice 4.1 +*/ +service ExponentialRegressionCurve : com::sun::star::chart2::XRegressionCurve; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/chart2/LinearRegressionCurve.idl b/offapi/com/sun/star/chart2/LinearRegressionCurve.idl new file mode 100644 index 0000000..6aeee66 --- /dev/null +++ b/offapi/com/sun/star/chart2/LinearRegressionCurve.idl @@ -0,0 +1,38 @@ +/* -*- 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 . + */ +#ifndef com_sun_star_chart2_LinearRegressionCurve_idl +#define com_sun_star_chart2_LinearRegressionCurve_idl + +#include <com/sun/star/chart2/XRegressionCurve.idl> + + +module com { module sun { module star { module chart2 { + + +/** + @since LibreOffice 4.1 +*/ +service LinearRegressionCurve : com::sun::star::chart2::XRegressionCurve; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/chart2/LogarithmicRegressionCurve.idl b/offapi/com/sun/star/chart2/LogarithmicRegressionCurve.idl new file mode 100644 index 0000000..cd791e8 --- /dev/null +++ b/offapi/com/sun/star/chart2/LogarithmicRegressionCurve.idl @@ -0,0 +1,38 @@ +/* -*- 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 . + */ +#ifndef com_sun_star_chart2_LogarithmicRegressionCurve_idl +#define com_sun_star_chart2_LogarithmicRegressionCurve_idl + +#include <com/sun/star/chart2/XRegressionCurve.idl> + + +module com { module sun { module star { module chart2 { + + +/** + @since LibreOffice 4.1 +*/ +service LogarithmicRegressionCurve : com::sun::star::chart2::XRegressionCurve; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/chart2/PotentialRegressionCurve.idl b/offapi/com/sun/star/chart2/PotentialRegressionCurve.idl new file mode 100644 index 0000000..6f24074 --- /dev/null +++ b/offapi/com/sun/star/chart2/PotentialRegressionCurve.idl @@ -0,0 +1,38 @@ +/* -*- 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 . + */ +#ifndef com_sun_star_chart2_PotentialRegressionCurve_idl +#define com_sun_star_chart2_PotentialRegressionCurve_idl + +#include <com/sun/star/chart2/XRegressionCurve.idl> + + +module com { module sun { module star { module chart2 { + + +/** + @since LibreOffice 4.1 +*/ +service PotentialRegressionCurve : com::sun::star::chart2::XRegressionCurve; + + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/excel/xechart.cxx b/sc/source/filter/excel/xechart.cxx index fa7df36..e8f8828 100644 --- a/sc/source/filter/excel/xechart.cxx +++ b/sc/source/filter/excel/xechart.cxx @@ -1692,16 +1692,16 @@ bool XclExpChSerTrendLine::Convert( Reference< XRegressionCurve > xRegCurve, sal // trend line type ScfPropertySet aCurveProp( xRegCurve ); OUString aService = aCurveProp.GetServiceName(); - if( aService == SERVICE_CHART2_LINEARREGCURVE ) + if( aService == "com.sun.star.chart2.LinearRegressionCurve" ) { maData.mnLineType = EXC_CHSERTREND_POLYNOMIAL; maData.mnOrder = 1; } - else if( aService == SERVICE_CHART2_EXPREGCURVE ) + else if( aService == "com.sun.star.chart2.ExponentialRegressionCurve" ) maData.mnLineType = EXC_CHSERTREND_EXPONENTIAL; - else if( aService == SERVICE_CHART2_LOGREGCURVE ) + else if( aService == "com.sun.star.chart2.LogarithmicRegressionCurve" ) maData.mnLineType = EXC_CHSERTREND_LOGARITHMIC; - else if( aService == SERVICE_CHART2_POTREGCURVE ) + else if( aService == "com.sun.star.chart2.PotentialRegressionCurve" ) maData.mnLineType = EXC_CHSERTREND_POWER; else return false; diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx index e36a147..cb85b90 100644 --- a/sc/source/filter/excel/xichart.cxx +++ b/sc/source/filter/excel/xichart.cxx @@ -40,6 +40,10 @@ #include <com/sun/star/chart/DataLabelPlacement.hpp> #include <com/sun/star/chart/ErrorBarStyle.hpp> #include <com/sun/star/chart/MissingValueTreatment.hpp> +#include <com/sun/star/chart2/LinearRegressionCurve.hpp> +#include <com/sun/star/chart2/ExponentialRegressionCurve.hpp> +#include <com/sun/star/chart2/LogarithmicRegressionCurve.hpp> +#include <com/sun/star/chart2/PotentialRegressionCurve.hpp> #include <com/sun/star/chart2/CartesianCoordinateSystem2d.hpp> #include <com/sun/star/chart2/CartesianCoordinateSystem3d.hpp> #include <com/sun/star/chart2/FormattedString.hpp> @@ -104,27 +108,7 @@ using ::com::sun::star::drawing::XDrawPage; using ::com::sun::star::drawing::XDrawPageSupplier; using ::com::sun::star::drawing::XShape; -using ::com::sun::star::chart2::IncrementData; -using ::com::sun::star::chart2::RelativePosition; -using ::com::sun::star::chart2::RelativeSize; -using ::com::sun::star::chart2::ScaleData; -using ::com::sun::star::chart2::SubIncrement; -using ::com::sun::star::chart2::XAxis; -using ::com::sun::star::chart2::XChartDocument; -using ::com::sun::star::chart2::XChartType; -using ::com::sun::star::chart2::XChartTypeContainer; -using ::com::sun::star::chart2::XCoordinateSystem; -using ::com::sun::star::chart2::XCoordinateSystemContainer; -using ::com::sun::star::chart2::XDataSeries; -using ::com::sun::star::chart2::XDataSeriesContainer; -using ::com::sun::star::chart2::XDiagram; -using ::com::sun::star::chart2::XFormattedString; -using ::com::sun::star::chart2::XLegend; -using ::com::sun::star::chart2::XRegressionCurve; -using ::com::sun::star::chart2::XRegressionCurveContainer; -using ::com::sun::star::chart2::XScaling; -using ::com::sun::star::chart2::XTitle; -using ::com::sun::star::chart2::XTitled; +using namespace ::com::sun::star::chart2; using ::com::sun::star::chart2::data::XDataProvider; using ::com::sun::star::chart2::data::XDataReceiver; @@ -1627,27 +1611,24 @@ void XclImpChSerTrendLine::ReadChSerTrendLine( XclImpStream& rStrm ) Reference< XRegressionCurve > XclImpChSerTrendLine::CreateRegressionCurve() const { // trend line type - OUString aService; + Reference< XRegressionCurve > xRegCurve; switch( maData.mnLineType ) { case EXC_CHSERTREND_POLYNOMIAL: // TODO: only linear trend lines are supported by OOChart (#i20819#) if( maData.mnOrder == 1 ) - aService = SERVICE_CHART2_LINEARREGCURVE; + xRegCurve = LinearRegressionCurve::create( comphelper::getProcessComponentContext() ); break; case EXC_CHSERTREND_EXPONENTIAL: - aService = SERVICE_CHART2_EXPREGCURVE; + xRegCurve = ExponentialRegressionCurve::create( comphelper::getProcessComponentContext() ); break; case EXC_CHSERTREND_LOGARITHMIC: - aService = SERVICE_CHART2_LOGREGCURVE; + xRegCurve = LogarithmicRegressionCurve::create( comphelper::getProcessComponentContext() ); break; case EXC_CHSERTREND_POWER: - aService = SERVICE_CHART2_POTREGCURVE; + xRegCurve = PotentialRegressionCurve::create( comphelper::getProcessComponentContext() ); break; } - Reference< XRegressionCurve > xRegCurve; - if( !aService.isEmpty() ) - xRegCurve.set( ScfApiHelper::CreateInstance( aService ), UNO_QUERY ); // trend line formatting if( xRegCurve.is() && mxDataFmt ) diff --git a/sc/source/filter/inc/xlchart.hxx b/sc/source/filter/inc/xlchart.hxx index 4e3eb94..828d677 100644 --- a/sc/source/filter/inc/xlchart.hxx +++ b/sc/source/filter/inc/xlchart.hxx @@ -53,11 +53,7 @@ class XclRoot; #define SERVICE_CHART2_DATASERIES "com.sun.star.chart2.DataSeries" #define SERVICE_CHART2_DIAGRAM "com.sun.star.chart2.Diagram" #define SERVICE_CHART2_ERRORBAR "com.sun.star.chart2.ErrorBar" -#define SERVICE_CHART2_EXPREGCURVE "com.sun.star.chart2.ExponentialRegressionCurve" #define SERVICE_CHART2_LEGEND "com.sun.star.chart2.Legend" -#define SERVICE_CHART2_LINEARREGCURVE "com.sun.star.chart2.LinearRegressionCurve" -#define SERVICE_CHART2_LOGREGCURVE "com.sun.star.chart2.LogarithmicRegressionCurve" -#define SERVICE_CHART2_POTREGCURVE "com.sun.star.chart2.PotentialRegressionCurve" // property names #define EXC_CHPROP_ADDITIONALSHAPES "AdditionalShapes" commit 2750fe97c5a2c5b374542e3383dfc75ec099c7af Author: Noel Grandin <n...@peralex.com> Date: Tue May 21 11:05:42 2013 +0200 fdo#46808, Convert some XMultiServiceFactory to XComponentContext and remove unnecessarily storing the global XComponentContext Change-Id: Ifb230b88661fea38d96a9d7f0994f92b9632ef79 diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index f5d3414..427ab2c 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -232,7 +232,6 @@ friend class ScDocumentImport; typedef ::std::vector<ScTable*> TableContainer; private: - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceManager; rtl::Reference<ScPoolHelper> xPoolHelper; @@ -433,9 +432,6 @@ public: SfxObjectShell* pDocShell = NULL ); SC_DLLPUBLIC ~ScDocument(); - inline ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > - GetServiceManager() const { return xServiceManager; } - SC_DLLPUBLIC const OUString& GetName() const { return aDocName; } void SetName( const OUString& r ) { aDocName = r; } const OUString& GetCodeName() const { return aDocCodeName; } diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx index dcdae98..1d63dd9 100644 --- a/sc/source/core/data/documen2.cxx +++ b/sc/source/core/data/documen2.cxx @@ -118,7 +118,6 @@ private: ScDocument::ScDocument( ScDocumentMode eMode, SfxObjectShell* pDocShell ) : - xServiceManager( ::comphelper::getProcessServiceFactory() ), mpUndoManager( NULL ), pEditEngine( NULL ), pNoteEngine( NULL ), diff --git a/sc/source/core/data/documen6.cxx b/sc/source/core/data/documen6.cxx index 819b7a5..b08c5a9 100644 --- a/sc/source/core/data/documen6.cxx +++ b/sc/source/core/data/documen6.cxx @@ -51,7 +51,7 @@ const uno::Reference< i18n::XBreakIterator >& ScDocument::GetBreakIterator() pScriptTypeData = new ScScriptTypeData; if ( !pScriptTypeData->xBreakIter.is() ) { - pScriptTypeData->xBreakIter = i18n::BreakIterator::create( comphelper::getComponentContext(xServiceManager) ); + pScriptTypeData->xBreakIter = i18n::BreakIterator::create( comphelper::getProcessComponentContext() ); } return pScriptTypeData->xBreakIter; } diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx index 9eefd8f..5c19499 100644 --- a/sc/source/core/data/documen8.cxx +++ b/sc/source/core/data/documen8.cxx @@ -1593,7 +1593,7 @@ void ScDocument::TransliterateText( const ScMarkData& rMultiMark, sal_Int32 nTyp { OSL_ENSURE( rMultiMark.IsMultiMarked(), "TransliterateText: no selection" ); - utl::TransliterationWrapper aTranslitarationWrapper( comphelper::getComponentContext(xServiceManager), nType ); + utl::TransliterationWrapper aTranslitarationWrapper( comphelper::getProcessComponentContext(), nType ); bool bConsiderLanguage = aTranslitarationWrapper.needLanguageForTheMode(); sal_uInt16 nLanguage = LANGUAGE_SYSTEM; diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx index dff56a5..5b1017b 100644 --- a/sc/source/core/data/dpobject.cxx +++ b/sc/source/core/data/dpobject.cxx @@ -3023,7 +3023,7 @@ const ScDPCache* ScDPCollection::DBCaches::getCache( SAL_WNODEPRECATED_DECLARATIONS_PUSH ::std::auto_ptr<ScDPCache> pCache(new ScDPCache(mpDoc)); SAL_WNODEPRECATED_DECLARATIONS_POP - SvNumberFormatter aFormat( comphelper::getComponentContext(mpDoc->GetServiceManager()), ScGlobal::eLnge); + SvNumberFormatter aFormat( comphelper::getProcessComponentContext(), ScGlobal::eLnge); DBConnector aDB(*pCache, xRowSet, *aFormat.GetNullDate()); if (!aDB.isValid()) return NULL; @@ -3137,7 +3137,7 @@ void ScDPCollection::DBCaches::updateCache( return; } - SvNumberFormatter aFormat( comphelper::getComponentContext(mpDoc->GetServiceManager()), ScGlobal::eLnge); + SvNumberFormatter aFormat( comphelper::getProcessComponentContext(), ScGlobal::eLnge); DBConnector aDB(rCache, xRowSet, *aFormat.GetNullDate()); if (!aDB.isValid()) return; diff --git a/sc/source/core/data/poolhelp.cxx b/sc/source/core/data/poolhelp.cxx index c2ba946..b6f027a 100644 --- a/sc/source/core/data/poolhelp.cxx +++ b/sc/source/core/data/poolhelp.cxx @@ -73,7 +73,7 @@ SvNumberFormatter* ScPoolHelper::GetFormTable() const { if ( !pFormTable ) { - pFormTable = new SvNumberFormatter( comphelper::getComponentContext(m_pSourceDoc->GetServiceManager()), ScGlobal::eLnge ); + pFormTable = new SvNumberFormatter( comphelper::getProcessComponentContext(), ScGlobal::eLnge ); pFormTable->SetColorLink( LINK( m_pSourceDoc, ScDocument, GetUserDefinedColor ) ); pFormTable->SetEvalDateFormat( NF_EVALDATEFORMAT_INTL_FORMAT ); diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx index d1ef841f..0058cac 100644 --- a/sc/source/core/data/table3.cxx +++ b/sc/source/core/data/table3.cxx @@ -312,7 +312,7 @@ void ScTable::InitSortCollator( const ScSortParam& rPar ) if ( !rPar.aCollatorLocale.Language.isEmpty() ) { if ( !pSortCollator || IsSortCollatorGlobal() ) - pSortCollator = new CollatorWrapper( comphelper::getComponentContext(pDocument->GetServiceManager()) ); + pSortCollator = new CollatorWrapper( comphelper::getProcessComponentContext() ); pSortCollator->loadCollatorAlgorithm( rPar.aCollatorAlgorithm, rPar.aCollatorLocale, (rPar.bCaseSens ? 0 : SC_COLLATOR_IGNORES) ); } diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx index b7e054d..0623ae5 100644 --- a/sc/source/filter/excel/xestyle.cxx +++ b/sc/source/filter/excel/xestyle.cxx @@ -1223,7 +1223,7 @@ XclExpNumFmtBuffer::XclExpNumFmtBuffer( const XclExpRoot& rRoot ) : /* Compiler needs a hint, this doesn't work: new NfKeywordTable; cannot convert from 'class String *' to 'class String (*)[54]' The effective result here is class String (*)[54*1] */ - mxFormatter( new SvNumberFormatter( comphelper::getComponentContext(rRoot.GetDoc().GetServiceManager()), LANGUAGE_ENGLISH_US ) ), + mxFormatter( new SvNumberFormatter( comphelper::getProcessComponentContext(), LANGUAGE_ENGLISH_US ) ), mpKeywordTable( new NfKeywordTable ), mnStdFmt( GetFormatter().GetStandardFormat( ScGlobal::eLnge ) ) { @@ -2864,7 +2864,7 @@ void XclExpXFBuffer::AddBorderAndFill( const XclExpXF& rXF ) XclExpDxfs::XclExpDxfs( const XclExpRoot& rRoot ) : XclExpRoot( rRoot ), - mxFormatter( new SvNumberFormatter( comphelper::getComponentContext(rRoot.GetDoc().GetServiceManager()), LANGUAGE_ENGLISH_US ) ), + mxFormatter( new SvNumberFormatter( comphelper::getProcessComponentContext(), LANGUAGE_ENGLISH_US ) ), mpKeywordTable( new NfKeywordTable ) { mxFormatter->FillKeywordTable( *mpKeywordTable, LANGUAGE_ENGLISH_US ); diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx index d1e5e47..3e80d97 100644 --- a/sc/source/filter/xml/xmlimprt.cxx +++ b/sc/source/filter/xml/xmlimprt.cxx @@ -2392,7 +2392,7 @@ void ScXMLImport::ExamineDefaultStyle() aDecSep = ScGlobal::pLocaleData->getNumDecimalSep(); else { - LocaleDataWrapper aLocaleData( comphelper::getComponentContext(pDoc->GetServiceManager()), + LocaleDataWrapper aLocaleData( comphelper::getProcessComponentContext(), LanguageTag( nFormatLang ) ); aDecSep = aLocaleData.getNumDecimalSep(); } @@ -2612,7 +2612,7 @@ sal_Int32 ScXMLImport::SetCurrencySymbol(const sal_Int32 nKey, const OUString& r { { ScXMLImport::MutexGuard aGuard(*this); - LocaleDataWrapper aLocaleData( comphelper::getComponentContext(GetDocument()->GetServiceManager()), LanguageTag( aLocale) ); + LocaleDataWrapper aLocaleData( comphelper::getProcessComponentContext(), LanguageTag( aLocale) ); OUStringBuffer aBuffer(15); aBuffer.appendAscii("#"); aBuffer.append( aLocaleData.getNumThousandSep() ); diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index d7003c9..da59b28 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -1388,7 +1388,7 @@ sal_Bool ScDocShell::ConvertFrom( SfxMedium& rMedium ) ScRange aRange; // HTML macht eigenes ColWidth/RowHeight CalcOutputFactor(); - SvNumberFormatter aNumFormatter( comphelper::getComponentContext(aDocument.GetServiceManager()), eLang); + SvNumberFormatter aNumFormatter( comphelper::getProcessComponentContext(), eLang); eError = ScFormatFilter::Get().ScImportHTML( *pInStream, rMedium.GetBaseURL(), &aDocument, aRange, GetOutputFactor(), !bWebQuery, &aNumFormatter, bDateConvert ); if (eError != eERR_OK) diff --git a/sc/source/ui/docshell/docsh2.cxx b/sc/source/ui/docshell/docsh2.cxx index 1039219..7f5ea07 100644 --- a/sc/source/ui/docshell/docsh2.cxx +++ b/sc/source/ui/docshell/docsh2.cxx @@ -125,7 +125,7 @@ void ScDocShell::InitItems() if (aLocales.getLength()) { rtl::Reference<SvxForbiddenCharactersTable> xForbiddenTable = - new SvxForbiddenCharactersTable( comphelper::getComponentContext(aDocument.GetServiceManager()) ); + new SvxForbiddenCharactersTable( comphelper::getProcessComponentContext() ); const lang::Locale* pLocales = aLocales.getConstArray(); for (sal_Int32 i = 0; i < aLocales.getLength(); i++) diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx index e09a139..4a74487 100644 --- a/sc/source/ui/docshell/impex.cxx +++ b/sc/source/ui/docshell/impex.cxx @@ -1284,14 +1284,14 @@ bool ScImportExport::ExtText2Doc( SvStream& rStrm ) long nSkipLines = pExtOptions->GetStartRow(); LanguageType eDocLang = pExtOptions->GetLanguage(); - SvNumberFormatter aNumFormatter( comphelper::getComponentContext(pDoc->GetServiceManager()), eDocLang); + SvNumberFormatter aNumFormatter( comphelper::getProcessComponentContext(), eDocLang); bool bDetectNumFormat = pExtOptions->IsDetectSpecialNumber(); // For date recognition ::utl::TransliterationWrapper aTransliteration( - comphelper::getComponentContext(pDoc->GetServiceManager()), SC_TRANSLITERATION_IGNORECASE ); + comphelper::getProcessComponentContext(), SC_TRANSLITERATION_IGNORECASE ); aTransliteration.loadModuleIfNeeded( eDocLang ); - CalendarWrapper aCalendar( comphelper::getComponentContext(pDoc->GetServiceManager()) ); + CalendarWrapper aCalendar( comphelper::getProcessComponentContext() ); aCalendar.loadDefaultCalendar( LanguageTag( eDocLang ).getLocale() ); boost::scoped_ptr< ::utl::TransliterationWrapper > pEnglishTransliteration; @@ -1299,9 +1299,9 @@ bool ScImportExport::ExtText2Doc( SvStream& rStrm ) if ( eDocLang != LANGUAGE_ENGLISH_US ) { pEnglishTransliteration.reset(new ::utl::TransliterationWrapper ( - comphelper::getComponentContext(pDoc->GetServiceManager()), SC_TRANSLITERATION_IGNORECASE )); + comphelper::getProcessComponentContext(), SC_TRANSLITERATION_IGNORECASE )); aTransliteration.loadModuleIfNeeded( LANGUAGE_ENGLISH_US ); - pEnglishCalendar.reset(new CalendarWrapper ( comphelper::getComponentContext(pDoc->GetServiceManager()) )); + pEnglishCalendar.reset(new CalendarWrapper ( comphelper::getProcessComponentContext() )); pEnglishCalendar->loadDefaultCalendar( LanguageTag( LANGUAGE_ENGLISH_US ).getLocale() ); } @@ -2192,7 +2192,7 @@ bool ScImportExport::HTML2Doc( SvStream& rStrm, const String& rBaseURL ) { // Pick up import options if available. LanguageType eLang = pExtOptions->GetLanguage(); - SvNumberFormatter aNumFormatter( comphelper::getComponentContext(pDoc->GetServiceManager()), eLang); + SvNumberFormatter aNumFormatter( comphelper::getProcessComponentContext(), eLang); bool bSpecialNumber = pExtOptions->IsDetectSpecialNumber(); pImp->WriteToDocument(false, 1.0, &aNumFormatter, bSpecialNumber); } diff --git a/sc/source/ui/unoobj/forbiuno.cxx b/sc/source/ui/unoobj/forbiuno.cxx index e261906..242816d 100644 --- a/sc/source/ui/unoobj/forbiuno.cxx +++ b/sc/source/ui/unoobj/forbiuno.cxx @@ -38,7 +38,7 @@ static rtl::Reference<SvxForbiddenCharactersTable> lcl_GetForbidden( ScDocShell* // create an empty SvxForbiddenCharactersTable for SvxUnoForbiddenCharsTable, // so changes can be stored. - xRet = new SvxForbiddenCharactersTable( comphelper::getComponentContext(pDoc->GetServiceManager()) ); + xRet = new SvxForbiddenCharactersTable( comphelper::getProcessComponentContext() ); pDoc->SetForbiddenCharacters( xRet ); } } diff --git a/sc/source/ui/xmlsource/xmlsourcedlg.cxx b/sc/source/ui/xmlsource/xmlsourcedlg.cxx index 952ac3c..6699530 100644 --- a/sc/source/ui/xmlsource/xmlsourcedlg.cxx +++ b/sc/source/ui/xmlsource/xmlsourcedlg.cxx @@ -174,11 +174,7 @@ sal_Bool ScXMLSourceDlg::Close() void ScXMLSourceDlg::SelectSourceFile() { - uno::Reference<lang::XMultiServiceFactory> xServiceMgr = mpDoc->GetServiceManager(); - if (!xServiceMgr.is()) - return; - - uno::Reference<ui::dialogs::XFilePicker3> xFilePicker = ui::dialogs::FilePicker::createWithMode( comphelper::getComponentContext(xServiceMgr), ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE ); + uno::Reference<ui::dialogs::XFilePicker3> xFilePicker = ui::dialogs::FilePicker::createWithMode( comphelper::getProcessComponentContext(), ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE ); if (maSrcPath.isEmpty()) // Use default path. _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits