[Libreoffice-commits] .: 12 commits - avmedia/source basic/source chart2/source cui/source dbaccess/source drawinglayer/source filter/source forms/source offapi/com offapi/UnoApi_offapi.mk oox/inc oox/source reportdesign/source sc/source sd/source sfx2/source svl/inc svl/source svtools/source sw/source toolkit/source ucb/source uui/source vbahelper/source writerfilter/source xmloff/inc xmloff/source xmlscript/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Mon Jan 28 01:07:51 PST 2013
avmedia/source/viewer/mediawindowbase_impl.cxx | 58 ++---
basic/source/runtime/methods.cxx | 4
basic/source/runtime/runtime.cxx | 5
basic/source/sbx/sbxdate.cxx | 10
basic/source/sbx/sbxscan.cxx | 4
basic/source/uno/dlgcont.cxx | 14 -
chart2/source/model/filter/XMLFilter.cxx | 9
chart2/source/model/main/ChartModel.cxx | 3
cui/source/options/optupdt.cxx | 21 -
dbaccess/source/core/api/tablecontainer.cxx | 8
dbaccess/source/core/dataaccess/ComponentDefinition.cxx | 18 +
dbaccess/source/core/dataaccess/ComponentDefinition.hxx | 3
dbaccess/source/core/dataaccess/commandcontainer.cxx | 6
dbaccess/source/core/dataaccess/databasedocument.cxx | 6
dbaccess/source/core/recovery/subcomponentrecovery.cxx | 8
dbaccess/source/filter/xml/xmlDocuments.cxx | 2
dbaccess/source/inc/stringconstants.hrc | 1
dbaccess/source/inc/stringconstants.inc | 1
dbaccess/source/ui/dlg/ConnectionHelper.cxx | 49 +---
drawinglayer/source/primitive2d/controlprimitive2d.cxx | 17 -
drawinglayer/source/primitive2d/textbreakuphelper.cxx | 125 +++++-----
filter/source/config/cache/basecontainer.cxx | 8
filter/source/config/cache/basecontainer.hxx | 10
filter/source/config/cache/cacheupdatelistener.cxx | 18 -
filter/source/config/cache/cacheupdatelistener.hxx | 12 -
filter/source/config/cache/configflush.cxx | 2
filter/source/config/cache/constant.hxx | 1
filter/source/config/cache/contenthandlerfactory.cxx | 10
filter/source/config/cache/contenthandlerfactory.hxx | 6
filter/source/config/cache/filtercache.cxx | 14 -
filter/source/config/cache/filtercache.hxx | 6
filter/source/config/cache/filterfactory.cxx | 17 -
filter/source/config/cache/filterfactory.hxx | 6
filter/source/config/cache/frameloaderfactory.cxx | 10
filter/source/config/cache/frameloaderfactory.hxx | 6
filter/source/config/cache/typedetection.cxx | 23 -
filter/source/config/cache/typedetection.hxx | 6
filter/source/svg/svgexport.cxx | 2
forms/source/component/FormattedField.cxx | 12 -
offapi/UnoApi_offapi.mk | 8
offapi/com/sun/star/document/FilterConfigRefresh.idl | 40 +++
offapi/com/sun/star/document/GraphicObjectResolver.idl | 42 +++
offapi/com/sun/star/document/IndexedPropertyValues.idl | 37 +++
offapi/com/sun/star/document/NamedPropertyValues.idl | 37 +++
offapi/com/sun/star/sdb/TableDefinition.idl | 45 +++
offapi/com/sun/star/setup/UpdateCheckConfig.idl | 41 +++
oox/inc/oox/helper/containerhelper.hxx | 11
oox/source/helper/containerhelper.cxx | 30 --
reportdesign/source/core/api/ReportDefinition.cxx | 4
sc/source/core/data/dpobject.cxx | 4
sc/source/core/data/global.cxx | 2
sc/source/core/data/poolhelp.cxx | 2
sc/source/filter/excel/xestyle.cxx | 4
sc/source/filter/excel/xltoolbar.cxx | 5
sc/source/filter/oox/viewsettings.cxx | 6
sc/source/ui/docshell/docsh.cxx | 2
sc/source/ui/docshell/impex.cxx | 4
sc/source/ui/miscdlgs/autofmt.cxx | 2
sc/source/ui/unoobj/docuno.cxx | 27 +-
sc/source/ui/view/viewdata.cxx | 56 ++--
sd/source/ui/app/sdmod.cxx | 2
sd/source/ui/unoidl/unomodel.cxx | 3
sfx2/source/dialog/dinfdlg.cxx | 2
sfx2/source/doc/sfxbasemodel.cxx | 5
svl/inc/svl/documentlockfile.hxx | 3
svl/inc/svl/lockfilecommon.hxx | 6
svl/inc/svl/sharecontrolfile.hxx | 5
svl/inc/svl/zforlist.hxx | 12 -
svl/source/misc/documentlockfile.cxx | 6
svl/source/misc/lockfilecommon.cxx | 6
svl/source/misc/sharecontrolfile.cxx | 4
svl/source/numbers/supservs.cxx | 2
svl/source/numbers/zforlist.cxx | 22 -
svl/source/numbers/zforscan.cxx | 2
svtools/source/control/fmtfield.cxx | 2
sw/source/core/doc/docfmt.cxx | 3
sw/source/filter/ww8/ww8atr.cxx | 2
sw/source/filter/ww8/ww8par.cxx | 4
sw/source/filter/ww8/ww8toolbar.cxx | 5
sw/source/filter/xml/swxml.cxx | 17 -
sw/source/filter/xml/xmlexp.cxx | 18 -
sw/source/ui/table/tautofmt.cxx | 13 -
sw/source/ui/utlui/numfmtlb.cxx | 5
toolkit/source/controls/unocontrols.cxx | 4
ucb/source/ucp/webdav/webdavresponseparser.cxx | 8
uui/source/iahndl-ssl.cxx | 3
uui/source/newerverwarn.cxx | 28 --
vbahelper/source/vbahelper/vbashape.cxx | 8
writerfilter/source/dmapper/DomainMapper_Impl.cxx | 4
xmloff/inc/xmloff/XMLSettingsExportContext.hxx | 6
xmloff/inc/xmloff/xmlexp.hxx | 3
xmloff/inc/xmloff/xmlnumfi.hxx | 11
xmloff/source/core/DocumentSettingsContext.cxx | 70 +-----
xmloff/source/core/RDFaExportHelper.cxx | 4
xmloff/source/core/SettingsExportHelper.cxx | 185 +++++++---------
xmloff/source/core/xmlexp.cxx | 25 --
xmloff/source/core/xmlimp.cxx | 4
xmloff/source/draw/ximpstyl.cxx | 4
xmloff/source/style/xmlnumfe.cxx | 8
xmloff/source/style/xmlnumfi.cxx | 28 +-
xmloff/source/xforms/xformsexport.cxx | 6
xmlscript/source/xmldlg_imexp/xmldlg_export.cxx | 14 -
102 files changed, 773 insertions(+), 749 deletions(-)
New commits:
commit 77856e81ce4d279f00d0f92e917099f4f5220034
Author: Noel Grandin <noel at peralex.com>
Date: Fri Jan 11 13:12:07 2013 +0200
fdo#46808, Adapt document::*PropertyValues UNO service to new style
The services are:
document::NamedPropertyValues
document::IndexedPropertyValues
The services already existed, they just did not have IDL files
Change-Id: Ibafe9b5afb9b30785df4f66aa923f4b96ceabeed
diff --git a/dbaccess/source/core/recovery/subcomponentrecovery.cxx b/dbaccess/source/core/recovery/subcomponentrecovery.cxx
index 3f73833..951f476 100644
--- a/dbaccess/source/core/recovery/subcomponentrecovery.cxx
+++ b/dbaccess/source/core/recovery/subcomponentrecovery.cxx
@@ -213,8 +213,8 @@ namespace dbaccess
virtual void EndElement ( const sal_Bool i_bIgnoreWhitespace );
virtual void Characters( const ::rtl::OUString& i_rCharacters );
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
- GetServiceFactory() const;
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
+ GetComponentContext() const;
private:
::rtl::OUString impl_prefix( const ::xmloff::token::XMLTokenEnum i_eToken )
@@ -267,9 +267,9 @@ namespace dbaccess
}
//--------------------------------------------------------------------
- Reference< XMultiServiceFactory > SettingsExportContext::GetServiceFactory() const
+ Reference< com::sun::star::uno::XComponentContext > SettingsExportContext::GetComponentContext() const
{
- return m_rContext.getLegacyServiceFactory();
+ return m_rContext.getUNOContext();
}
//==================================================================================================================
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index 5960919..eda4101 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -95,8 +95,10 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/deployment
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/document,\
DocumentProperties \
DocumentRevisionListPersistence \
+ IndexedPropertyValues \
FilterConfigRefresh \
GraphicObjectResolver \
+ NamedPropertyValues \
OleEmbeddedServerRegistration \
OOXMLDocumentPropertiesImporter \
))
diff --git a/offapi/com/sun/star/document/IndexedPropertyValues.idl b/offapi/com/sun/star/document/IndexedPropertyValues.idl
new file mode 100644
index 0000000..e9b96fe
--- /dev/null
+++ b/offapi/com/sun/star/document/IndexedPropertyValues.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_document_IndexedPropertyValues_idl__
+#define __com_sun_star_document_IndexedPropertyValues_idl__
+
+#include <com/sun/star/container/XIndexContainer.idl>
+
+
+module com { module sun { module star { module document {
+
+/**
+ @since LibreOffice 4.1
+ */
+service IndexedPropertyValues : com::sun::star::container::XIndexContainer;
+
+
+}; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/offapi/com/sun/star/document/NamedPropertyValues.idl b/offapi/com/sun/star/document/NamedPropertyValues.idl
new file mode 100644
index 0000000..08b0035
--- /dev/null
+++ b/offapi/com/sun/star/document/NamedPropertyValues.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_document_NamedPropertyValues_idl__
+#define __com_sun_star_document_NamedPropertyValues_idl__
+
+#include <com/sun/star/container/XNameContainer.idl>
+
+
+module com { module sun { module star { module document {
+
+/**
+ @since LibreOffice 4.1
+ */
+service NamedPropertyValues : com::sun::star::container::XNameContainer;
+
+
+}; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/inc/oox/helper/containerhelper.hxx b/oox/inc/oox/helper/containerhelper.hxx
index 494729b..4843226 100644
--- a/oox/inc/oox/helper/containerhelper.hxx
+++ b/oox/inc/oox/helper/containerhelper.hxx
@@ -157,17 +157,6 @@ private:
class OOX_DLLPUBLIC ContainerHelper
{
public:
- // com.sun.star.container.XIndexContainer ---------------------------------
-
- /** Creates a new index container object from scratch. */
- static ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer >
- createIndexContainer( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
-
- // com.sun.star.container.XNameContainer ----------------------------------
-
- /** Creates a new name container object from scratch. */
- static ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >
- createNameContainer( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
/** Returns a name that is not used in the passed name container.
diff --git a/oox/source/helper/containerhelper.cxx b/oox/source/helper/containerhelper.cxx
index 75bd99e..0686395 100644
--- a/oox/source/helper/containerhelper.cxx
+++ b/oox/source/helper/containerhelper.cxx
@@ -82,36 +82,6 @@ void ValueRangeSet::insert( const ValueRange& rRange )
// ============================================================================
-Reference< XIndexContainer > ContainerHelper::createIndexContainer( const Reference< XComponentContext >& rxContext )
-{
- Reference< XIndexContainer > xContainer;
- if( rxContext.is() ) try
- {
- Reference< XMultiServiceFactory > xFactory( rxContext->getServiceManager(), UNO_QUERY_THROW );
- xContainer.set( xFactory->createInstance( "com.sun.star.document.IndexedPropertyValues" ), UNO_QUERY_THROW );
- }
- catch( Exception& )
- {
- }
- OSL_ENSURE( xContainer.is(), "ContainerHelper::createIndexContainer - cannot create container" );
- return xContainer;
-}
-
-Reference< XNameContainer > ContainerHelper::createNameContainer( const Reference< XComponentContext >& rxContext )
-{
- Reference< XNameContainer > xContainer;
- if( rxContext.is() ) try
- {
- Reference< XMultiServiceFactory > xFactory( rxContext->getServiceManager(), UNO_QUERY_THROW );
- xContainer.set( xFactory->createInstance( "com.sun.star.document.NamedPropertyValues" ), UNO_QUERY_THROW );
- }
- catch( Exception& )
- {
- }
- OSL_ENSURE( xContainer.is(), "ContainerHelper::createNameContainer - cannot create container" );
- return xContainer;
-}
-
OUString ContainerHelper::getUnusedName(
const Reference< XNameAccess >& rxNameAccess, const OUString& rSuggestedName,
sal_Unicode cSeparator, sal_Int32 nFirstIndexToAppend )
diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx
index 1dc6056..14592bc 100644
--- a/reportdesign/source/core/api/ReportDefinition.cxx
+++ b/reportdesign/source/core/api/ReportDefinition.cxx
@@ -40,6 +40,7 @@
#include <com/sun/star/beans/XMultiPropertyStates.hpp>
#include <com/sun/star/chart2/data/DatabaseDataProvider.hpp>
#include <com/sun/star/document/DocumentProperties.hpp>
+#include <com/sun/star/document/IndexedPropertyValues.hpp>
#include <com/sun/star/document/EventObject.hpp>
#include <com/sun/star/document/XEventListener.hpp>
#include <com/sun/star/document/XExporter.hpp>
@@ -2032,8 +2033,7 @@ uno::Reference< container::XIndexAccess > SAL_CALL OReportDefinition::getViewDat
::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
if ( !m_pImpl->m_xViewData.is() )
{
- 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);
+ m_pImpl->m_xViewData.set( document::IndexedPropertyValues::create(m_aProps->m_xContext), uno::UNO_QUERY);
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();
diff --git a/sc/source/filter/excel/xltoolbar.cxx b/sc/source/filter/excel/xltoolbar.cxx
index 2bb994e..cfc058e 100644
--- a/sc/source/filter/excel/xltoolbar.cxx
+++ b/sc/source/filter/excel/xltoolbar.cxx
@@ -31,6 +31,7 @@
#include "xltoolbar.hxx"
#include <rtl/ustrbuf.hxx>
#include <stdarg.h>
+#include <com/sun/star/document/IndexedPropertyValues.hpp>
#include <com/sun/star/ui/XUIConfigurationPersistence.hpp>
#include <com/sun/star/ui/ModuleUIConfigurationManagerSupplier.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -293,9 +294,7 @@ bool ScTBC::ImportToolBarControl( ScCTBWrapper& rWrapper, const css::uno::Refere
ScCTB* pCustTB = rWrapper.GetCustomizationData( pMenu->Name() );
if ( pCustTB )
{
- uno::Reference< container::XIndexContainer > xMenuDesc;
- uno::Reference< lang::XMultiServiceFactory > xMSF( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
- xMenuDesc.set( xMSF->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.IndexedPropertyValues" ) ) ), uno::UNO_QUERY_THROW );
+ uno::Reference< container::XIndexContainer > xMenuDesc = document::IndexedPropertyValues::create( comphelper::getProcessComponentContext() );
if ( !pCustTB->ImportMenuTB( rWrapper, xMenuDesc, helper ) )
return false;
if ( !bIsMenuToolbar )
diff --git a/sc/source/filter/oox/viewsettings.cxx b/sc/source/filter/oox/viewsettings.cxx
index d3d86219..40c50db 100644
--- a/sc/source/filter/oox/viewsettings.cxx
+++ b/sc/source/filter/oox/viewsettings.cxx
@@ -24,7 +24,9 @@
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/container/XIndexContainer.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/document/IndexedPropertyValues.hpp>
#include <com/sun/star/document/XViewDataSupplier.hpp>
+#include <com/sun/star/document/NamedPropertyValues.hpp>
#include <comphelper/mediadescriptor.hxx>
#include "oox/core/filterbase.hxx"
#include "oox/helper/attributelist.hxx"
@@ -579,7 +581,7 @@ void ViewSettings::finalizeImport()
sal_Int16 nShowMode = getWorkbookSettings().getApiShowObjectMode();
// view settings for all sheets
- Reference< XNameContainer > xSheetsNC = ContainerHelper::createNameContainer( getBaseFilter().getComponentContext() );
+ Reference< XNameContainer > xSheetsNC = NamedPropertyValues::create( getBaseFilter().getComponentContext() );
if( !xSheetsNC.is() ) return;
for( SheetPropertiesMap::const_iterator aIt = maSheetProps.begin(), aEnd = maSheetProps.end(); aIt != aEnd; ++aIt )
ContainerHelper::insertByName( xSheetsNC, rWorksheets.getCalcSheetName( aIt->first ), aIt->second );
@@ -591,7 +593,7 @@ void ViewSettings::finalizeImport()
if( !rxActiveSheetView )
rxActiveSheetView.reset( new SheetViewModel );
- Reference< XIndexContainer > xContainer = ContainerHelper::createIndexContainer( getBaseFilter().getComponentContext() );
+ Reference< XIndexContainer > xContainer = IndexedPropertyValues::create( getBaseFilter().getComponentContext() );
if( xContainer.is() ) try
{
PropertyMap aPropMap;
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index a501a32..1e174bb 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -51,6 +51,7 @@
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/lang/ServiceNotRegisteredException.hpp>
#include <com/sun/star/document/XDocumentEventBroadcaster.hpp>
+#include <com/sun/star/document/IndexedPropertyValues.hpp>
#include <com/sun/star/script/XInvocation.hpp>
#include <com/sun/star/script/vba/XVBAEventProcessor.hpp>
#include <comphelper/processfactory.hxx>
@@ -1560,21 +1561,17 @@ uno::Reference< container::XIndexAccess > SAL_CALL ScModelObj::getViewData( )
SolarMutexGuard aGuard;
if (pDocShell && pDocShell->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED)
{
- xRet.set(uno::Reference < container::XIndexAccess >::query(::comphelper::getProcessServiceFactory()->createInstance(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.IndexedPropertyValues")))));
-
- uno::Reference < container::XIndexContainer > xCont( xRet, uno::UNO_QUERY );
- OSL_ENSURE( xCont.is(), "ScModelObj::getViewData() failed for OLE object" );
- if( xCont.is() )
- {
- uno::Sequence< beans::PropertyValue > aSeq;
- aSeq.realloc(1);
- rtl::OUString sName;
- pDocShell->GetDocument()->GetName( pDocShell->GetDocument()->GetVisibleTab(), sName );
- rtl::OUString sOUName(sName);
- aSeq[0].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_ACTIVETABLE));
- aSeq[0].Value <<= sOUName;
- xCont->insertByIndex( 0, uno::makeAny( aSeq ) );
- }
+ uno::Reference < container::XIndexContainer > xCont = document::IndexedPropertyValues::create( ::comphelper::getProcessComponentContext() );
+ xRet.set( xCont, uno::UNO_QUERY_THROW );
+
+ uno::Sequence< beans::PropertyValue > aSeq;
+ aSeq.realloc(1);
+ rtl::OUString sName;
+ pDocShell->GetDocument()->GetName( pDocShell->GetDocument()->GetVisibleTab(), sName );
+ rtl::OUString sOUName(sName);
+ aSeq[0].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_ACTIVETABLE));
+ aSeq[0].Value <<= sOUName;
+ xCont->insertByIndex( 0, uno::makeAny( aSeq ) );
}
}
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index c1ce5ff..f727b75 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -62,6 +62,7 @@
#include <comphelper/processfactory.hxx>
#include <comphelper/string.hxx>
#include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/document/NamedPropertyValues.hpp>
using namespace com::sun::star;
@@ -2628,44 +2629,35 @@ void ScViewData::WriteUserDataSequence(uno::Sequence <beans::PropertyValue>& rSe
static_cast<sal_Int32>(nViewID));
pSettings[SC_VIEW_ID].Value <<= sBuffer.makeStringAndClear();
- uno::Reference<lang::XMultiServiceFactory> xServiceFactory =
- comphelper::getProcessServiceFactory();
- OSL_ENSURE( xServiceFactory.is(), "got no service manager" );
- if( xServiceFactory.is() )
+ uno::Reference<container::XNameContainer> xNameContainer =
+ document::NamedPropertyValues::create( comphelper::getProcessComponentContext() );
+ for (SCTAB nTab=0; nTab<static_cast<SCTAB>(maTabData.size()); nTab++)
{
- rtl::OUString sName(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.NamedPropertyValues"));
- uno::Reference<container::XNameContainer> xNameContainer = uno::Reference<container::XNameContainer>(xServiceFactory->createInstance(sName), uno::UNO_QUERY);
- if (xNameContainer.is())
+ if (maTabData[nTab])
{
- for (SCTAB nTab=0; nTab<static_cast<SCTAB>(maTabData.size()); nTab++)
+ uno::Sequence <beans::PropertyValue> aTableViewSettings;
+ maTabData[nTab]->WriteUserDataSequence(aTableViewSettings, *this, nTab);
+ rtl::OUString sTabName;
+ GetDocument()->GetName( nTab, sTabName );
+ uno::Any aAny;
+ aAny <<= aTableViewSettings;
+ try
{
- if (maTabData[nTab])
- {
- uno::Sequence <beans::PropertyValue> aTableViewSettings;
- maTabData[nTab]->WriteUserDataSequence(aTableViewSettings, *this, nTab);
- rtl::OUString sTabName;
- GetDocument()->GetName( nTab, sTabName );
- uno::Any aAny;
- aAny <<= aTableViewSettings;
- try
- {
- xNameContainer->insertByName(sTabName, aAny);
- }
- //#101739#; two tables with the same name are possible
- catch ( container::ElementExistException& )
- {
- OSL_FAIL("seems there are two tables with the same name");
- }
- catch ( uno::RuntimeException& )
- {
- OSL_FAIL("something went wrong");
- }
- }
+ xNameContainer->insertByName(sTabName, aAny);
+ }
+ //#101739#; two tables with the same name are possible
+ catch ( container::ElementExistException& )
+ {
+ OSL_FAIL("seems there are two tables with the same name");
+ }
+ catch ( uno::RuntimeException& )
+ {
+ OSL_FAIL("something went wrong");
}
- pSettings[SC_TABLE_VIEWSETTINGS].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_TABLES));
- pSettings[SC_TABLE_VIEWSETTINGS].Value <<= xNameContainer;
}
}
+ pSettings[SC_TABLE_VIEWSETTINGS].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_TABLES));
+ pSettings[SC_TABLE_VIEWSETTINGS].Value <<= xNameContainer;
rtl::OUString sName;
GetDocument()->GetName( nTabNo, sName );
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index 37ea6339..a5cbde3 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -25,6 +25,7 @@
#include <com/sun/star/lang/Locale.hpp>
#include <com/sun/star/style/XStyle.hpp>
#include <com/sun/star/awt/XDevice.hpp>
+#include <com/sun/star/document/IndexedPropertyValues.hpp>
#include <com/sun/star/embed/Aspects.hpp>
@@ -607,7 +608,7 @@ uno::Reference < container::XIndexAccess > SAL_CALL SdXImpressDocument::getViewD
if( !rList.empty() )
{
- xRet = uno::Reference < container::XIndexAccess >::query(::comphelper::getProcessServiceFactory()->createInstance("com.sun.star.document.IndexedPropertyValues"));
+ xRet = uno::Reference< container::XIndexAccess >(document::IndexedPropertyValues::create( ::comphelper::getProcessComponentContext() ), uno::UNO_QUERY);
uno::Reference < container::XIndexContainer > xCont( xRet, uno::UNO_QUERY );
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 9eb6026..cb7d3ae 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -35,6 +35,7 @@
#include <com/sun/star/embed/EmbedMapUnits.hpp>
#include <com/sun/star/document/XStorageChangeListener.hpp>
#include <com/sun/star/document/XActionLockable.hpp>
+#include <com/sun/star/document/IndexedPropertyValues.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/XPropertySetInfo.hpp>
#include <com/sun/star/container/XIndexContainer.hpp>
@@ -3197,8 +3198,8 @@ uno::Reference < container::XIndexAccess > SAL_CALL SfxBaseModel::getViewData()
return uno::Reference < container::XIndexAccess >();
m_pData->m_contViewData = Reference < container::XIndexAccess >(
- ::comphelper::getProcessServiceFactory()->createInstance(
- DEFINE_CONST_UNICODE("com.sun.star.document.IndexedPropertyValues") ),
+ document::IndexedPropertyValues::create(
+ ::comphelper::getProcessComponentContext() ),
uno::UNO_QUERY );
if ( !m_pData->m_contViewData.is() )
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 6cabcbd..fdef14c 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -91,6 +91,7 @@
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
#include <com/sun/star/document/XViewDataSupplier.hpp>
+#include <com/sun/star/document/IndexedPropertyValues.hpp>
#include <svl/itemiter.hxx> //SfxItemIter
#include <comphelper/processfactory.hxx>
@@ -1504,8 +1505,7 @@ void SwWW8ImplReader::ImportDop()
aViewProps[2].Value <<= sal_Int16(0);
uno::Reference< uno::XComponentContext > xComponentContext(comphelper::getProcessComponentContext());
- uno::Reference<container::XIndexContainer> xBox(xComponentContext->getServiceManager()->createInstanceWithContext("com.sun.star.document.IndexedPropertyValues",
- xComponentContext), uno::UNO_QUERY);
+ uno::Reference<container::XIndexContainer> xBox = document::IndexedPropertyValues::create(xComponentContext);
xBox->insertByIndex(sal_Int32(0), uno::makeAny(aViewProps));
uno::Reference<container::XIndexAccess> xIndexAccess(xBox, uno::UNO_QUERY);
uno::Reference<document::XViewDataSupplier> xViewDataSupplier(mpDocShell->GetModel(), uno::UNO_QUERY);
diff --git a/sw/source/filter/ww8/ww8toolbar.cxx b/sw/source/filter/ww8/ww8toolbar.cxx
index 5d8c502..f74857b 100644
--- a/sw/source/filter/ww8/ww8toolbar.cxx
+++ b/sw/source/filter/ww8/ww8toolbar.cxx
@@ -32,6 +32,7 @@
#include "ww8scan.hxx"
#include <rtl/ustrbuf.hxx>
#include <stdarg.h>
+#include <com/sun/star/document/IndexedPropertyValues.hpp>
#include <com/sun/star/ui/XUIConfigurationPersistence.hpp>
#include <com/sun/star/ui/ModuleUIConfigurationManagerSupplier.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -731,9 +732,7 @@ SwTBC::ImportToolBarControl( SwCTBWrapper& rWrapper, const css::uno::Reference<
SwCTB* pCustTB = rWrapper.GetCustomizationData( pMenu->Name() );
if ( pCustTB )
{
- uno::Reference< container::XIndexContainer > xMenuDesc;
- uno::Reference< lang::XMultiServiceFactory > xMSF( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
- xMenuDesc.set( xMSF->createInstance( "com.sun.star.document.IndexedPropertyValues" ), uno::UNO_QUERY_THROW );
+ uno::Reference< container::XIndexContainer > xMenuDesc = document::IndexedPropertyValues::create( comphelper::getProcessComponentContext() );
if ( !pCustTB->ImportMenuTB( rWrapper,xMenuDesc, helper ) )
return false;
if ( !bIsMenuBar )
diff --git a/sw/source/filter/xml/swxml.cxx b/sw/source/filter/xml/swxml.cxx
index 84a49a3..736a5a8 100644
--- a/sw/source/filter/xml/swxml.cxx
+++ b/sw/source/filter/xml/swxml.cxx
@@ -28,6 +28,7 @@
#include <com/sun/star/io/XActiveDataControl.hpp>
#include <com/sun/star/text/XTextRange.hpp>
#include <com/sun/star/container/XChild.hpp>
+#include <com/sun/star/document/NamedPropertyValues.hpp>
#include <com/sun/star/beans/XPropertySetInfo.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/beans/NamedValue.hpp>
@@ -514,10 +515,8 @@ sal_uLong XMLReader::Read( SwDoc &rDoc, const String& rBaseURL, SwPaM &rPaM, con
// Get service factory
uno::Reference< lang::XMultiServiceFactory > xServiceFactory =
comphelper::getProcessServiceFactory();
- OSL_ENSURE( xServiceFactory.is(),
- "XMLReader::Read: got no service manager" );
- if( !xServiceFactory.is() )
- return ERR_SWG_READ_ERROR;
+ uno::Reference< uno::XComponentContext > xContext =
+ comphelper::getProcessComponentContext();
uno::Reference< io::XActiveDataSource > xSource;
uno::Reference< XInterface > xPipe;
@@ -696,9 +695,7 @@ sal_uLong XMLReader::Read( SwDoc &rDoc, const String& rBaseURL, SwPaM &rPaM, con
OUString sProgressRange(RTL_CONSTASCII_USTRINGPARAM("ProgressRange"));
xInfoSet->setPropertyValue(sProgressRange, aProgRange);
- ::comphelper::ComponentContext aContext( xServiceFactory );
- Reference< container::XNameAccess > xLateInitSettings(
- aContext.createComponent( "com.sun.star.document.NamedPropertyValues" ), UNO_QUERY_THROW );
+ Reference< container::XNameAccess > xLateInitSettings( document::NamedPropertyValues::create(xContext), UNO_QUERY_THROW );
beans::NamedValue aLateInitSettings(
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LateInitSettings" ) ),
makeAny( xLateInitSettings )
@@ -872,7 +869,7 @@ sal_uLong XMLReader::Read( SwDoc &rDoc, const String& rBaseURL, SwPaM &rPaM, con
const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(xModelComp,
uno::UNO_QUERY_THROW);
const uno::Reference<rdf::XURI> xBaseURI( ::sfx2::createBaseURI(
- aContext.getUNOContext(), xStorage, aBaseURL, StreamPath) );
+ xContext, xStorage, aBaseURL, StreamPath) );
const uno::Reference<task::XInteractionHandler> xHandler(
pDocSh->GetMedium()->GetInteractionHandler() );
xDMA->loadMetadataFromStorage(xStorage, xBaseURI, xHandler);
@@ -1054,10 +1051,8 @@ size_t XMLReader::GetSectionList( SfxMedium& rMedium,
comphelper::getProcessServiceFactory();
uno::Reference< uno::XComponentContext > xContext =
comphelper::getProcessComponentContext();
- OSL_ENSURE( xServiceFactory.is(),
- "XMLReader::Read: got no service manager" );
uno::Reference < embed::XStorage > xStg2;
- if( xServiceFactory.is() && ( xStg2 = rMedium.GetStorage() ).is() )
+ if( ( xStg2 = rMedium.GetStorage() ).is() )
{
try
{
diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx
index 578269f..7148709 100644
--- a/sw/source/filter/xml/xmlexp.cxx
+++ b/sw/source/filter/xml/xmlexp.cxx
@@ -23,6 +23,7 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/container/XIndexContainer.hpp>
+#include <com/sun/star/document/IndexedPropertyValues.hpp>
#include <com/sun/star/uno/RuntimeException.hpp>
#include <com/sun/star/xforms/XFormsSupplier.hpp>
@@ -367,25 +368,14 @@ void SwXMLExport::_ExportFontDecls()
#define NUM_EXPORTED_VIEW_SETTINGS 11
void SwXMLExport::GetViewSettings(Sequence<PropertyValue>& aProps)
{
- Reference< XMultiServiceFactory > xServiceFactory =
- comphelper::getProcessServiceFactory();
- OSL_ENSURE( xServiceFactory.is(),
- "XMLReader::Read: got no service manager" );
- if( !xServiceFactory.is() )
- return;
-
aProps.realloc( NUM_EXPORTED_VIEW_SETTINGS );
// Currently exporting 9 properties
PropertyValue *pValue = aProps.getArray();
sal_Int32 nIndex = 0;
- Reference < XIndexContainer > xBox (xServiceFactory->createInstance
- (OUString( RTL_CONSTASCII_USTRINGPARAM ("com.sun.star.document.IndexedPropertyValues") ) ), UNO_QUERY);
- if (xBox.is() )
- {
- pValue[nIndex].Name = OUString( RTL_CONSTASCII_USTRINGPARAM ( "Views") );
- pValue[nIndex++].Value <<= Reference < XIndexAccess > ( xBox, UNO_QUERY );
- }
+ Reference < XIndexContainer > xBox = IndexedPropertyValues::create( comphelper::getProcessComponentContext() );
+ pValue[nIndex].Name = OUString( RTL_CONSTASCII_USTRINGPARAM ( "Views") );
+ pValue[nIndex++].Value <<= Reference < XIndexAccess > ( xBox, UNO_QUERY );
Reference < XText > xText;
SwXText *pText = 0;
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 33d2646..c808d76 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -25,6 +25,7 @@
#include <com/sun/star/beans/XPropertyState.hpp>
#include <com/sun/star/container/XNamed.hpp>
#include <com/sun/star/document/PrinterIndependentLayout.hpp>
+#include <com/sun/star/document/IndexedPropertyValues.hpp>
#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
@@ -3710,8 +3711,7 @@ void DomainMapper_Impl::ApplySettingsTable()
aViewProps[2].Name = "ZoomType";
aViewProps[2].Value <<= sal_Int16(0);
- uno::Reference<container::XIndexContainer> xBox(m_xComponentContext->getServiceManager()->createInstanceWithContext("com.sun.star.document.IndexedPropertyValues",
- m_xComponentContext), uno::UNO_QUERY );
+ uno::Reference<container::XIndexContainer> xBox = document::IndexedPropertyValues::create(m_xComponentContext);
xBox->insertByIndex(sal_Int32(0), uno::makeAny(aViewProps));
uno::Reference<container::XIndexAccess> xIndexAccess(xBox, uno::UNO_QUERY);
uno::Reference<document::XViewDataSupplier> xViewDataSupplier(m_xTextDocument, uno::UNO_QUERY);
diff --git a/xmloff/inc/xmloff/XMLSettingsExportContext.hxx b/xmloff/inc/xmloff/XMLSettingsExportContext.hxx
index 7859b38..46e51ba 100644
--- a/xmloff/inc/xmloff/XMLSettingsExportContext.hxx
+++ b/xmloff/inc/xmloff/XMLSettingsExportContext.hxx
@@ -20,7 +20,7 @@
#ifndef XML_SETTINGS_EXPORT_CONTEXT_HXX
#define XML_SETTINGS_EXPORT_CONTEXT_HXX
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
#include "xmloff/xmltoken.hxx"
@@ -46,8 +46,8 @@ namespace xmloff
virtual void Characters( const ::rtl::OUString& i_rCharacters ) = 0;
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
- GetServiceFactory() const = 0;
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
+ GetComponentContext() const = 0;
protected:
~XMLSettingsExportContext() {}
diff --git a/xmloff/source/core/DocumentSettingsContext.cxx b/xmloff/source/core/DocumentSettingsContext.cxx
index 6ec025c..c0dc4ce 100644
--- a/xmloff/source/core/DocumentSettingsContext.cxx
+++ b/xmloff/source/core/DocumentSettingsContext.cxx
@@ -41,6 +41,8 @@
#include <com/sun/star/util/DateTime.hpp>
#include <com/sun/star/document/XViewDataSupplier.hpp>
#include <com/sun/star/document/PrinterIndependentLayout.hpp>
+#include <com/sun/star/document/IndexedPropertyValues.hpp>
+#include <com/sun/star/document/NamedPropertyValues.hpp>
#include <rtl/ustrbuf.hxx>
#include <xmlenums.hxx>
@@ -52,13 +54,10 @@ class XMLMyList
std::list<beans::PropertyValue> aProps;
sal_uInt32 nCount;
- // #110680#
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxServiceFactory;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
public:
- // #110680#
- XMLMyList(const uno::Reference<lang::XMultiServiceFactory>& xServiceFactory);
- ~XMLMyList();
+ XMLMyList(const uno::Reference<uno::XComponentContext>& rxContext);
void push_back(beans::PropertyValue& aProp) { aProps.push_back(aProp); nCount++; }
uno::Sequence<beans::PropertyValue> GetSequence();
@@ -66,17 +65,11 @@ public:
uno::Reference<container::XIndexContainer> GetIndexContainer();
};
-// #110680#
-XMLMyList::XMLMyList(const uno::Reference<lang::XMultiServiceFactory>& xServiceFactory)
+XMLMyList::XMLMyList(const uno::Reference<uno::XComponentContext>& rxContext)
: nCount(0),
- mxServiceFactory(xServiceFactory)
-{
- DBG_ASSERT( mxServiceFactory.is(), "got no service manager" );
-}
-
-// #110680#
-XMLMyList::~XMLMyList()
+ m_xContext(rxContext)
{
+ DBG_ASSERT( rxContext.is(), "got no service manager" );
}
uno::Sequence<beans::PropertyValue> XMLMyList::GetSequence()
@@ -100,48 +93,29 @@ uno::Sequence<beans::PropertyValue> XMLMyList::GetSequence()
uno::Reference<container::XNameContainer> XMLMyList::GetNameContainer()
{
- uno::Reference<container::XNameContainer> xNameContainer;
-
- // #110680#
-
- if( mxServiceFactory.is() )
+ uno::Reference<container::XNameContainer> xNameContainer = document::NamedPropertyValues::create(m_xContext);
+ std::list<beans::PropertyValue>::iterator aItr = aProps.begin();
+ while (aItr != aProps.end())
{
- rtl::OUString sName("com.sun.star.document.NamedPropertyValues");
- xNameContainer = uno::Reference<container::XNameContainer>(mxServiceFactory->createInstance(sName), uno::UNO_QUERY);
- if (xNameContainer.is())
- {
- std::list<beans::PropertyValue>::iterator aItr = aProps.begin();
- while (aItr != aProps.end())
- {
- xNameContainer->insertByName(aItr->Name, aItr->Value);
- ++aItr;
- }
- }
+ xNameContainer->insertByName(aItr->Name, aItr->Value);
+ ++aItr;
}
+
return xNameContainer;
}
uno::Reference<container::XIndexContainer> XMLMyList::GetIndexContainer()
{
- uno::Reference<container::XIndexContainer> xIndexContainer;
- // #110680#
-
- if( mxServiceFactory.is() )
+ uno::Reference<container::XIndexContainer> xIndexContainer = document::IndexedPropertyValues::create(m_xContext);
+ std::list<beans::PropertyValue>::iterator aItr = aProps.begin();
+ sal_uInt32 i(0);
+ while (aItr != aProps.end())
{
- rtl::OUString sName("com.sun.star.document.IndexedPropertyValues");
- xIndexContainer = uno::Reference<container::XIndexContainer>(mxServiceFactory->createInstance(sName), uno::UNO_QUERY);
- if (xIndexContainer.is())
- {
- std::list<beans::PropertyValue>::iterator aItr = aProps.begin();
- sal_uInt32 i(0);
- while (aItr != aProps.end())
- {
- xIndexContainer->insertByIndex(i, aItr->Value);
- ++aItr;
- ++i;
- }
- }
+ xIndexContainer->insertByIndex(i, aItr->Value);
+ ++aItr;
+ ++i;
}
+
return xIndexContainer;
}
@@ -488,7 +462,7 @@ XMLConfigBaseContext::XMLConfigBaseContext(SvXMLImport& rImport, sal_uInt16 nPrf
XMLConfigBaseContext* pTempBaseContext)
: SvXMLImportContext( rImport, nPrfx, rLName ),
// #110680#
- maProps(rImport.getServiceFactory()),
+ maProps( comphelper::getComponentContext(rImport.getServiceFactory())),
maProp(),
mrAny(rTempAny),
mpBaseContext(pTempBaseContext)
diff --git a/xmloff/source/core/SettingsExportHelper.cxx b/xmloff/source/core/SettingsExportHelper.cxx
index d28dab4..a1de3f7 100644
--- a/xmloff/source/core/SettingsExportHelper.cxx
+++ b/xmloff/source/core/SettingsExportHelper.cxx
@@ -38,6 +38,7 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/formula/SymbolDescriptor.hpp>
#include <com/sun/star/document/PrinterIndependentLayout.hpp>
+#include <com/sun/star/document/IndexedPropertyValues.hpp>
#include <xmloff/XMLSettingsExportContext.hxx>
#include <xmlenums.hxx>
@@ -291,63 +292,53 @@ void XMLSettingsExportHelper::exportSymbolDescriptors(
const uno::Sequence < formula::SymbolDescriptor > &rProps,
const rtl::OUString rName) const
{
- // #110680#
- uno::Reference< lang::XMultiServiceFactory > xServiceFactory( m_rContext.GetServiceFactory() );
- DBG_ASSERT( xServiceFactory.is(), "XMLSettingsExportHelper::exportSymbolDescriptors: got no service manager" );
-
- if( xServiceFactory.is() )
+ uno::Reference< container::XIndexContainer > xBox = document::IndexedPropertyValues::create(m_rContext.GetComponentContext());
+
+ const rtl::OUString sName ( "Name" );
+ const rtl::OUString sExportName ( "ExportName" );
+ const rtl::OUString sSymbolSet ( "SymbolSet" );
+ const rtl::OUString sCharacter ( "Character" );
+ const rtl::OUString sFontName ( "FontName" );
+ const rtl::OUString sCharSet ( "CharSet" );
+ const rtl::OUString sFamily ( "Family" );
+ const rtl::OUString sPitch ( "Pitch" );
+ const rtl::OUString sWeight ( "Weight" );
+ const rtl::OUString sItalic ( "Italic" );
+
+ sal_Int32 nCount = rProps.getLength();
+ const formula::SymbolDescriptor *pDescriptor = rProps.getConstArray();
+
+ for( sal_Int32 nIndex = 0; nIndex < nCount; nIndex++, pDescriptor++ )
{
- uno::Reference< container::XIndexContainer > xBox(xServiceFactory->createInstance( "com.sun.star.document.IndexedPropertyValues" ), uno::UNO_QUERY);
- DBG_ASSERT( xBox.is(), "could not create service com.sun.star.document.IndexedPropertyValues" );
- if (xBox.is() )
- {
- const rtl::OUString sName ( "Name" );
- const rtl::OUString sExportName ( "ExportName" );
- const rtl::OUString sSymbolSet ( "SymbolSet" );
- const rtl::OUString sCharacter ( "Character" );
- const rtl::OUString sFontName ( "FontName" );
- const rtl::OUString sCharSet ( "CharSet" );
- const rtl::OUString sFamily ( "Family" );
- const rtl::OUString sPitch ( "Pitch" );
- const rtl::OUString sWeight ( "Weight" );
- const rtl::OUString sItalic ( "Italic" );
-
- sal_Int32 nCount = rProps.getLength();
- const formula::SymbolDescriptor *pDescriptor = rProps.getConstArray();
-
- for( sal_Int32 nIndex = 0; nIndex < nCount; nIndex++, pDescriptor++ )
- {
- uno::Sequence < beans::PropertyValue > aSequence ( XML_SYMBOL_DESCRIPTOR_MAX );
- beans::PropertyValue *pSymbol = aSequence.getArray();
-
- pSymbol[XML_SYMBOL_DESCRIPTOR_NAME].Name = sName;
- pSymbol[XML_SYMBOL_DESCRIPTOR_NAME].Value <<= pDescriptor->sName;
- pSymbol[XML_SYMBOL_DESCRIPTOR_EXPORT_NAME].Name = sExportName;
- pSymbol[XML_SYMBOL_DESCRIPTOR_EXPORT_NAME].Value<<= pDescriptor->sExportName;
- pSymbol[XML_SYMBOL_DESCRIPTOR_FONT_NAME].Name = sFontName;
- pSymbol[XML_SYMBOL_DESCRIPTOR_FONT_NAME].Value <<= pDescriptor->sFontName;
- pSymbol[XML_SYMBOL_DESCRIPTOR_CHAR_SET].Name = sCharSet;
- pSymbol[XML_SYMBOL_DESCRIPTOR_CHAR_SET].Value <<= pDescriptor->nCharSet;
- pSymbol[XML_SYMBOL_DESCRIPTOR_FAMILY].Name = sFamily;
- pSymbol[XML_SYMBOL_DESCRIPTOR_FAMILY].Value <<= pDescriptor->nFamily;
- pSymbol[XML_SYMBOL_DESCRIPTOR_PITCH].Name = sPitch;
- pSymbol[XML_SYMBOL_DESCRIPTOR_PITCH].Value <<= pDescriptor->nPitch;
- pSymbol[XML_SYMBOL_DESCRIPTOR_WEIGHT].Name = sWeight;
- pSymbol[XML_SYMBOL_DESCRIPTOR_WEIGHT].Value <<= pDescriptor->nWeight;
- pSymbol[XML_SYMBOL_DESCRIPTOR_ITALIC].Name = sItalic;
- pSymbol[XML_SYMBOL_DESCRIPTOR_ITALIC].Value <<= pDescriptor->nItalic;
- pSymbol[XML_SYMBOL_DESCRIPTOR_SYMBOL_SET].Name = sSymbolSet;
- pSymbol[XML_SYMBOL_DESCRIPTOR_SYMBOL_SET].Value <<= pDescriptor->sSymbolSet;
- pSymbol[XML_SYMBOL_DESCRIPTOR_CHARACTER].Name = sCharacter;
- pSymbol[XML_SYMBOL_DESCRIPTOR_CHARACTER].Value <<= pDescriptor->nCharacter;
-
- xBox->insertByIndex(nIndex, uno::makeAny( aSequence ));
- }
-
- uno::Reference< container::XIndexAccess > xIA( xBox, uno::UNO_QUERY );
- exportIndexAccess( xIA, rName );
- }
+ uno::Sequence < beans::PropertyValue > aSequence ( XML_SYMBOL_DESCRIPTOR_MAX );
+ beans::PropertyValue *pSymbol = aSequence.getArray();
+
+ pSymbol[XML_SYMBOL_DESCRIPTOR_NAME].Name = sName;
+ pSymbol[XML_SYMBOL_DESCRIPTOR_NAME].Value <<= pDescriptor->sName;
+ pSymbol[XML_SYMBOL_DESCRIPTOR_EXPORT_NAME].Name = sExportName;
+ pSymbol[XML_SYMBOL_DESCRIPTOR_EXPORT_NAME].Value<<= pDescriptor->sExportName;
+ pSymbol[XML_SYMBOL_DESCRIPTOR_FONT_NAME].Name = sFontName;
+ pSymbol[XML_SYMBOL_DESCRIPTOR_FONT_NAME].Value <<= pDescriptor->sFontName;
+ pSymbol[XML_SYMBOL_DESCRIPTOR_CHAR_SET].Name = sCharSet;
+ pSymbol[XML_SYMBOL_DESCRIPTOR_CHAR_SET].Value <<= pDescriptor->nCharSet;
+ pSymbol[XML_SYMBOL_DESCRIPTOR_FAMILY].Name = sFamily;
+ pSymbol[XML_SYMBOL_DESCRIPTOR_FAMILY].Value <<= pDescriptor->nFamily;
+ pSymbol[XML_SYMBOL_DESCRIPTOR_PITCH].Name = sPitch;
+ pSymbol[XML_SYMBOL_DESCRIPTOR_PITCH].Value <<= pDescriptor->nPitch;
+ pSymbol[XML_SYMBOL_DESCRIPTOR_WEIGHT].Name = sWeight;
+ pSymbol[XML_SYMBOL_DESCRIPTOR_WEIGHT].Value <<= pDescriptor->nWeight;
+ pSymbol[XML_SYMBOL_DESCRIPTOR_ITALIC].Name = sItalic;
+ pSymbol[XML_SYMBOL_DESCRIPTOR_ITALIC].Value <<= pDescriptor->nItalic;
+ pSymbol[XML_SYMBOL_DESCRIPTOR_SYMBOL_SET].Name = sSymbolSet;
+ pSymbol[XML_SYMBOL_DESCRIPTOR_SYMBOL_SET].Value <<= pDescriptor->sSymbolSet;
+ pSymbol[XML_SYMBOL_DESCRIPTOR_CHARACTER].Name = sCharacter;
+ pSymbol[XML_SYMBOL_DESCRIPTOR_CHARACTER].Value <<= pDescriptor->nCharacter;
+
+ xBox->insertByIndex(nIndex, uno::makeAny( aSequence ));
}
+
+ uno::Reference< container::XIndexAccess > xIA( xBox, uno::UNO_QUERY );
+ exportIndexAccess( xIA, rName );
}
void XMLSettingsExportHelper::exportbase64Binary(
const uno::Sequence<sal_Int8>& aProps,
@@ -440,56 +431,45 @@ void XMLSettingsExportHelper::exportForbiddenCharacters(
if( !xForbChars.is() || !xLocales.is() )
return;
- // #110680#
- uno::Reference< lang::XMultiServiceFactory > xServiceFactory( m_rContext.GetServiceFactory() );
- DBG_ASSERT( xServiceFactory.is(), "XMLSettingsExportHelper::exportForbiddenCharacters: got no service manager" );
-
- if( xServiceFactory.is() )
- {
- uno::Reference< container::XIndexContainer > xBox(xServiceFactory->createInstance( "com.sun.star.document.IndexedPropertyValues" ), uno::UNO_QUERY);
- DBG_ASSERT( xBox.is(), "could not create service com.sun.star.document.IndexedPropertyValues" );
- if (xBox.is() )
- {
- const uno::Sequence< lang::Locale > aLocales( xLocales->getLocales() );
- const lang::Locale* pLocales = aLocales.getConstArray();
+ uno::Reference< container::XIndexContainer > xBox = document::IndexedPropertyValues::create(m_rContext.GetComponentContext());
+ const uno::Sequence< lang::Locale > aLocales( xLocales->getLocales() );
+ const lang::Locale* pLocales = aLocales.getConstArray();
- const sal_Int32 nCount = aLocales.getLength();
+ const sal_Int32 nCount = aLocales.getLength();
- const rtl::OUString sLanguage ( "Language" );
- const rtl::OUString sCountry ( "Country" );
- const rtl::OUString sVariant ( "Variant" );
- const rtl::OUString sBeginLine ( "BeginLine" );
- const rtl::OUString sEndLine ( "EndLine" );
-
- sal_Int32 nPos = 0;
- for( sal_Int32 nIndex = 0; nIndex < nCount; nIndex++, pLocales++ )
- {
- if( xForbChars->hasForbiddenCharacters( *pLocales ) )
- {
- const i18n::ForbiddenCharacters aChars( xForbChars->getForbiddenCharacters( *pLocales ) );
-
-
- uno::Sequence < beans::PropertyValue > aSequence ( XML_FORBIDDEN_CHARACTER_MAX );
- beans::PropertyValue *pForChar = aSequence.getArray();
-
- pForChar[XML_FORBIDDEN_CHARACTER_LANGUAGE].Name = sLanguage;
- pForChar[XML_FORBIDDEN_CHARACTER_LANGUAGE].Value <<= pLocales->Language;
- pForChar[XML_FORBIDDEN_CHARACTER_COUNTRY].Name = sCountry;
- pForChar[XML_FORBIDDEN_CHARACTER_COUNTRY].Value <<= pLocales->Country;
- pForChar[XML_FORBIDDEN_CHARACTER_VARIANT].Name = sVariant;
- pForChar[XML_FORBIDDEN_CHARACTER_VARIANT].Value <<= pLocales->Variant;
- pForChar[XML_FORBIDDEN_CHARACTER_BEGIN_LINE].Name = sBeginLine;
- pForChar[XML_FORBIDDEN_CHARACTER_BEGIN_LINE].Value <<= aChars.beginLine;
- pForChar[XML_FORBIDDEN_CHARACTER_END_LINE].Name = sEndLine;
- pForChar[XML_FORBIDDEN_CHARACTER_END_LINE].Value <<= aChars.endLine;
- xBox->insertByIndex(nPos++, uno::makeAny( aSequence ));
- }
- }
+ const rtl::OUString sLanguage ( "Language" );
+ const rtl::OUString sCountry ( "Country" );
+ const rtl::OUString sVariant ( "Variant" );
+ const rtl::OUString sBeginLine ( "BeginLine" );
+ const rtl::OUString sEndLine ( "EndLine" );
- uno::Reference< container::XIndexAccess > xIA( xBox, uno::UNO_QUERY );
- exportIndexAccess( xIA, rName );
+ sal_Int32 nPos = 0;
+ for( sal_Int32 nIndex = 0; nIndex < nCount; nIndex++, pLocales++ )
+ {
+ if( xForbChars->hasForbiddenCharacters( *pLocales ) )
+ {
+ const i18n::ForbiddenCharacters aChars( xForbChars->getForbiddenCharacters( *pLocales ) );
+
+
+ uno::Sequence < beans::PropertyValue > aSequence ( XML_FORBIDDEN_CHARACTER_MAX );
+ beans::PropertyValue *pForChar = aSequence.getArray();
+
+ pForChar[XML_FORBIDDEN_CHARACTER_LANGUAGE].Name = sLanguage;
+ pForChar[XML_FORBIDDEN_CHARACTER_LANGUAGE].Value <<= pLocales->Language;
+ pForChar[XML_FORBIDDEN_CHARACTER_COUNTRY].Name = sCountry;
+ pForChar[XML_FORBIDDEN_CHARACTER_COUNTRY].Value <<= pLocales->Country;
+ pForChar[XML_FORBIDDEN_CHARACTER_VARIANT].Name = sVariant;
+ pForChar[XML_FORBIDDEN_CHARACTER_VARIANT].Value <<= pLocales->Variant;
+ pForChar[XML_FORBIDDEN_CHARACTER_BEGIN_LINE].Name = sBeginLine;
+ pForChar[XML_FORBIDDEN_CHARACTER_BEGIN_LINE].Value <<= aChars.beginLine;
+ pForChar[XML_FORBIDDEN_CHARACTER_END_LINE].Name = sEndLine;
+ pForChar[XML_FORBIDDEN_CHARACTER_END_LINE].Value <<= aChars.endLine;
+ xBox->insertByIndex(nPos++, uno::makeAny( aSequence ));
}
}
+
+ uno::Reference< container::XIndexAccess > xIA( xBox, uno::UNO_QUERY );
+ exportIndexAccess( xIA, rName );
}
void XMLSettingsExportHelper::exportAllSettings(
@@ -525,11 +505,10 @@ void XMLSettingsExportHelper::ManipulateSetting( uno::Any& rAny, const rtl::OUSt
{
if( !mxStringSubsitution.is() )
{
- if( m_rContext.GetServiceFactory().is() ) try
+ try
{
- uno::Reference< uno::XComponentContext > xContext( comphelper::getComponentContext(m_rContext.GetServiceFactory()) );
const_cast< XMLSettingsExportHelper* >(this)->mxStringSubsitution =
- util::PathSubstitution::create(xContext);
+ util::PathSubstitution::create( m_rContext.GetComponentContext() );
}
catch( uno::Exception& )
{
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx
index 1ac3454..94e1454 100644
--- a/xmloff/source/core/xmlexp.cxx
+++ b/xmloff/source/core/xmlexp.cxx
@@ -166,8 +166,8 @@ public:
virtual void Characters( const ::rtl::OUString& i_rCharacters );
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
- GetServiceFactory() const;
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
+ GetComponentContext() const;
private:
SvXMLExport& m_rExport;
::std::stack< ::rtl::OUString > m_aElements;
@@ -202,9 +202,9 @@ void SettingsExportFacade::Characters( const ::rtl::OUString& i_rCharacters )
m_rExport.GetDocHandler()->characters( i_rCharacters );
}
-Reference< XMultiServiceFactory > SettingsExportFacade::GetServiceFactory() const
+Reference< XComponentContext > SettingsExportFacade::GetComponentContext() const
{
- return m_rExport.getServiceFactory();
+ return comphelper::getComponentContext( m_rExport.getServiceFactory() );
}
//==============================================================================
diff --git a/xmloff/source/xforms/xformsexport.cxx b/xmloff/source/xforms/xformsexport.cxx
index 8166f37..44ca5d4 100644
--- a/xmloff/source/xforms/xformsexport.cxx
+++ b/xmloff/source/xforms/xformsexport.cxx
@@ -38,6 +38,7 @@
#include <tools/diagnose_ex.h>
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/document/NamedPropertyValues.hpp>
#include <com/sun/star/xml/dom/XDocument.hpp>
#include <com/sun/star/form/binding/XValueBinding.hpp>
#include <com/sun/star/form/binding/XBindableValue.hpp>
@@ -794,10 +795,7 @@ void getXFormsSettings( const Reference< XNameAccess >& _rXForms, Sequence< Prop
Sequence< ::rtl::OUString > aModelNames( _rXForms->getElementNames() );
- ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
- Reference< XNameContainer > xModelSettings(
- aContext.createComponent( "com.sun.star.document.NamedPropertyValues" ),
- UNO_QUERY_THROW );
+ Reference< XNameContainer > xModelSettings = document::NamedPropertyValues::create( comphelper::getProcessComponentContext() );
for ( const ::rtl::OUString* pModelName = aModelNames.getConstArray();
pModelName != aModelNames.getConstArray() + aModelNames.getLength();
commit ce1b932bba8f90363399a9fa6515b91d7d679efa
Author: Noel Grandin <noel at peralex.com>
Date: Fri Jan 11 09:37:58 2013 +0200
fdo#46808, don't cache the result of comphelper::getProcessComponentContext
Change-Id: I7eb3ce6794b5896ebc56d6f28f7e37b6929a6217
diff --git a/xmloff/inc/xmloff/xmlexp.hxx b/xmloff/inc/xmloff/xmlexp.hxx
index a9ec444..7482971 100644
--- a/xmloff/inc/xmloff/xmlexp.hxx
+++ b/xmloff/inc/xmloff/xmlexp.hxx
@@ -526,9 +526,6 @@ public:
// #110680#
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getServiceFactory();
- ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
- GetComponentContext() const;
-
// Shapes in Writer cannot be named via context menu (#i51726#)
SvtModuleOptions::EFactory GetModelType() const
{
diff --git a/xmloff/source/core/RDFaExportHelper.cxx b/xmloff/source/core/RDFaExportHelper.cxx
index 052c76c..2b278b2 100644
--- a/xmloff/source/core/RDFaExportHelper.cxx
+++ b/xmloff/source/core/RDFaExportHelper.cxx
@@ -27,6 +27,7 @@
#include <comphelper/stlunosequence.hxx>
#include <comphelper/stl_types.hxx>
+#include <comphelper/processfactory.hxx>
#include <com/sun/star/uri/XUriReference.hpp>
#include <com/sun/star/uri/UriReferenceFactory.hpp>
@@ -86,8 +87,7 @@ getRelativeReference(SvXMLExport const& rExport, ::rtl::OUString const& rURI)
rExport.GetModel(), uno::UNO_QUERY_THROW );
::rtl::OUString const baseURI( xModelURI->getStringValue() );
- uno::Reference<uno::XComponentContext> const xContext(
- rExport.GetComponentContext());
+ uno::Reference<uno::XComponentContext> xContext( comphelper::getProcessComponentContext() );
uno::Reference<uri::XUriReferenceFactory> const xUriFactory =
uri::UriReferenceFactory::create( xContext );
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx
index b51e896..1ac3454 100644
--- a/xmloff/source/core/xmlexp.cxx
+++ b/xmloff/source/core/xmlexp.cxx
@@ -265,8 +265,6 @@ public:
/// relative path of stream in package, e.g. "someobject/content.xml"
::rtl::OUString mStreamPath;
- const uno::Reference< uno::XComponentContext > mxComponentContext;
-
/// name of stream in package, e.g., "content.xml"
::rtl::OUString mStreamName;
@@ -293,7 +291,6 @@ SvXMLExport_Impl::SvXMLExport_Impl()
// Written OpenDocument file format doesn't fit to the created text document (#i69627#)
: mbOutlineStyleAsNormalListStyle( false )
,mbSaveBackwardCompatibleODF( sal_True )
- ,mxComponentContext( ::comphelper::getProcessComponentContext() )
,mStreamName()
,mNamespaceMaps()
,mDepth(0)
@@ -301,10 +298,7 @@ SvXMLExport_Impl::SvXMLExport_Impl()
,mbExportTextNumberElement( sal_False )
,mbNullDateInitialized( sal_False )
{
- OSL_ENSURE(mxComponentContext.is(), "SvXMLExport: no ComponentContext");
- if (!mxComponentContext.is()) throw uno::RuntimeException();
- mxUriReferenceFactory = uri::UriReferenceFactory::create(
- mxComponentContext );
+ mxUriReferenceFactory = uri::UriReferenceFactory::create( comphelper::getProcessComponentContext() );
}
//==============================================================================
@@ -430,8 +424,7 @@ void SvXMLExport::_InitCtor()
{
mpImpl->mbSaveBackwardCompatibleODF =
officecfg::Office::Common::Save::Document::
- SaveBackwardCompatibleODF::get(
- mpImpl->mxComponentContext);
+ SaveBackwardCompatibleODF::get( comphelper::getProcessComponentContext() );
}
}
@@ -2377,12 +2370,6 @@ void SvXMLExport::DisposingModel()
return mxServiceFactory;
}
-uno::Reference< uno::XComponentContext >
-SvXMLExport::GetComponentContext() const
-{
- return mpImpl->mxComponentContext;
-}
-
::comphelper::UnoInterfaceToUniqueIdentifierMapper& SvXMLExport::getInterfaceToIdentifierMapper()
{
return mpImpl->maInterfaceToIdentifierMapper;
commit f95a7c2c6d5c2158de12bb3ca6fd94b139e33c62
Author: Noel Grandin <noel at peralex.com>
Date: Thu Jan 10 16:40:27 2013 +0200
fdo#46808, Convert SvNumberFormatter to use XComponentContext
Change-Id: If4e8312dae6bc5eb8bb7655cf250f06ab37b7e5c
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 3a6eb97..b9a2861 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -1966,9 +1966,7 @@ RTLFUNC(DateValue)
if( !bSuccess && ( eLangType != LANGUAGE_ENGLISH_US ) )
{
// Create a new SvNumberFormatter by using LANGUAGE_ENGLISH to get the date value;
- uno::Reference< lang::XMultiServiceFactory >
- xFactory = comphelper::getProcessServiceFactory();
- SvNumberFormatter aFormatter( xFactory, LANGUAGE_ENGLISH_US );
+ SvNumberFormatter aFormatter( comphelper::getProcessComponentContext(), LANGUAGE_ENGLISH_US );
bSuccess = aFormatter.IsNumberFormat( aStr, nIndex, fResult );
nType = aFormatter.GetType( nIndex );
}
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index eba6064..55836e8 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -349,9 +349,6 @@ void SbiInstance::PrepareNumberFormatter( SvNumberFormatter*& rpNumberFormatter,
sal_uInt32 &rnStdDateIdx, sal_uInt32 &rnStdTimeIdx, sal_uInt32 &rnStdDateTimeIdx,
LanguageType* peFormatterLangType, DateFormat* peFormatterDateFormat )
{
- com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >
- xFactory = comphelper::getProcessServiceFactory();
-
LanguageType eLangType;
if( peFormatterLangType )
{
@@ -372,7 +369,7 @@ void SbiInstance::PrepareNumberFormatter( SvNumberFormatter*& rpNumberFormatter,
eDate = aSysLocale.GetLocaleData().getDateFormat();
}
- rpNumberFormatter = new SvNumberFormatter( xFactory, eLangType );
+ rpNumberFormatter = new SvNumberFormatter( comphelper::getProcessComponentContext(), eLangType );
sal_Int32 nCheckPos = 0; short nType;
rnStdTimeIdx = rpNumberFormatter->GetStandardFormat( NUMBERFORMAT_TIME, eLangType );
diff --git a/basic/source/sbx/sbxdate.cxx b/basic/source/sbx/sbxdate.cxx
index 6d0a407..f28c585 100644
--- a/basic/source/sbx/sbxdate.cxx
+++ b/basic/source/sbx/sbxdate.cxx
@@ -98,10 +98,7 @@ double ImpGetDate( const SbxValues* p )
{
LanguageType eLangType = GetpApp()->GetSettings().GetLanguageTag().getLanguageType();
- SvNumberFormatter* pFormatter;
- com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >
- xFactory = comphelper::getProcessServiceFactory();
- pFormatter = new SvNumberFormatter( xFactory, eLangType );
+ SvNumberFormatter* pFormatter = new SvNumberFormatter( comphelper::getProcessComponentContext(), eLangType );
sal_uInt32 nIndex;
sal_Int32 nCheckPos = 0;
@@ -271,10 +268,7 @@ start:
Color* pColor;
LanguageType eLangType = GetpApp()->GetSettings().GetLanguageTag().getLanguageType();
- SvNumberFormatter* pFormatter;
- com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >
- xFactory = comphelper::getProcessServiceFactory();
- pFormatter = new SvNumberFormatter( xFactory, eLangType );
+ SvNumberFormatter* pFormatter = new SvNumberFormatter( comphelper::getProcessComponentContext(), eLangType );
sal_uInt32 nIndex;
sal_Int32 nCheckPos = 0;
diff --git a/basic/source/sbx/sbxscan.cxx b/basic/source/sbx/sbxscan.cxx
index 4febd4c2..856a40d 100644
--- a/basic/source/sbx/sbxscan.cxx
+++ b/basic/source/sbx/sbxscan.cxx
@@ -717,9 +717,7 @@ void SbxValue::Format( OUString& rRes, const OUString* pFmt ) const
}
LanguageType eLangType = GetpApp()->GetSettings().GetLanguageTag().getLanguageType();
- com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >
- xFactory = comphelper::getProcessServiceFactory();
- SvNumberFormatter aFormatter( xFactory, eLangType );
+ SvNumberFormatter aFormatter( comphelper::getProcessComponentContext(), eLangType );
sal_uInt32 nIndex;
double nNumber;
diff --git a/chart2/source/model/main/ChartModel.cxx b/chart2/source/model/main/ChartModel.cxx
index 053bf07..0564add 100644
--- a/chart2/source/model/main/ChartModel.cxx
+++ b/chart2/source/model/main/ChartModel.cxx
@@ -1272,8 +1272,7 @@ Reference< util::XNumberFormatsSupplier > ChartModel::impl_getNumberFormatsSuppl
{
if( !m_xOwnNumberFormatsSupplier.is() )
{
- Reference< lang::XMultiServiceFactory > xFactory( m_xContext->getServiceManager(), uno::UNO_QUERY );
- m_apSvNumberFormatter.reset( new SvNumberFormatter( xFactory, LANGUAGE_SYSTEM ) );
+ m_apSvNumberFormatter.reset( new SvNumberFormatter( m_xContext, LANGUAGE_SYSTEM ) );
m_xOwnNumberFormatsSupplier = new SvNumberFormatsSupplierObj( m_apSvNumberFormatter.get() );
//pOwnNumberFormatter->ChangeStandardPrec( 15 ); todo?
}
diff --git a/cui/source/options/optupdt.cxx b/cui/source/options/optupdt.cxx
index 9dc4b72..3475b56 100644
--- a/cui/source/options/optupdt.cxx
+++ b/cui/source/options/optupdt.cxx
@@ -127,7 +127,7 @@ void SvxOnlineUpdateTabPage::UpdateLastCheckedText()
}
LanguageType eUILang = Application::GetSettings().GetUILanguageTag().getLanguageType();
- SvNumberFormatter *pNumberFormatter = new SvNumberFormatter( ::comphelper::getProcessServiceFactory(), eUILang );
+ SvNumberFormatter *pNumberFormatter = new SvNumberFormatter( ::comphelper::getProcessComponentContext(), eUILang );
String aTmpStr;
Color* pColor = NULL;
Date* pNullDate = pNumberFormatter->GetNullDate();
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index 2bf32d0..4d04490 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -2206,7 +2206,7 @@ IMPL_LINK( SVGFilter, CalcFieldHdl, EditFieldInfo*, pInfo )
{
String sDate;
LanguageType eLang = pInfo->GetOutliner()->GetLanguage( pInfo->GetPara(), pInfo->GetPos() );
- SvNumberFormatter * pNumberFormatter = new SvNumberFormatter( ::comphelper::getProcessServiceFactory(), LANGUAGE_SYSTEM );
+ SvNumberFormatter * pNumberFormatter = new SvNumberFormatter( ::comphelper::getProcessComponentContext(), LANGUAGE_SYSTEM );
// We always collect the characters obtained by using the SVXDATEFORMAT_B (as: 13.02.1996)
// so we are sure to include any unusual day|month|year separator.
Date aDate( 1, 1, 1996 );
diff --git a/forms/source/component/FormattedField.cxx b/forms/source/component/FormattedField.cxx
index cc6e967..0eb9406 100644
--- a/forms/source/component/FormattedField.cxx
+++ b/forms/source/component/FormattedField.cxx
@@ -92,13 +92,13 @@ protected:
static WeakReference< XNumberFormatsSupplier > s_xDefaultFormatsSupplier;
public:
- static Reference< XNumberFormatsSupplier > get( const Reference< XMultiServiceFactory >& _rxORB );
+ static Reference< XNumberFormatsSupplier > get( const Reference< XComponentContext >& _rxORB );
using SvNumberFormatsSupplierObj::operator new;
using SvNumberFormatsSupplierObj::operator delete;
protected:
- StandardFormatsSupplier(const Reference<XMultiServiceFactory>& _rxFactory,LanguageType _eSysLanguage);
+ StandardFormatsSupplier(const Reference< XComponentContext >& _rxFactory,LanguageType _eSysLanguage);
~StandardFormatsSupplier();
protected:
@@ -110,9 +110,9 @@ protected:
WeakReference< XNumberFormatsSupplier > StandardFormatsSupplier::s_xDefaultFormatsSupplier;
//------------------------------------------------------------------
-StandardFormatsSupplier::StandardFormatsSupplier(const Reference< XMultiServiceFactory > & _rxFactory,LanguageType _eSysLanguage)
+StandardFormatsSupplier::StandardFormatsSupplier(const Reference< XComponentContext > & _rxContext,LanguageType _eSysLanguage)
:SvNumberFormatsSupplierObj()
- ,m_pMyPrivateFormatter(new SvNumberFormatter(_rxFactory, _eSysLanguage))
+ ,m_pMyPrivateFormatter(new SvNumberFormatter(_rxContext, _eSysLanguage))
{
SetNumberFormatter(m_pMyPrivateFormatter);
@@ -129,7 +129,7 @@ StandardFormatsSupplier::~StandardFormatsSupplier()
}
//------------------------------------------------------------------
-Reference< XNumberFormatsSupplier > StandardFormatsSupplier::get( const Reference< XMultiServiceFactory >& _rxORB )
+Reference< XNumberFormatsSupplier > StandardFormatsSupplier::get( const Reference< XComponentContext >& _rxORB )
{
LanguageType eSysLanguage = LANGUAGE_SYSTEM;
{
@@ -661,7 +661,7 @@ Reference<XNumberFormatsSupplier> OFormattedModel::calcFormFormatsSupplier() co
//------------------------------------------------------------------------------
Reference< XNumberFormatsSupplier > OFormattedModel::calcDefaultFormatsSupplier() const
{
- return StandardFormatsSupplier::get( getContext().getLegacyServiceFactory() );
+ return StandardFormatsSupplier::get( getContext().getUNOContext() );
}
// XBoundComponent
diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index d86a012..c829268 100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -2847,7 +2847,7 @@ const ScDPCache* ScDPCollection::DBCaches::getCache(
SAL_WNODEPRECATED_DECLARATIONS_PUSH
::std::auto_ptr<ScDPCache> pCache(new ScDPCache(mpDoc));
SAL_WNODEPRECATED_DECLARATIONS_POP
- SvNumberFormatter aFormat(mpDoc->GetServiceManager(), ScGlobal::eLnge);
+ SvNumberFormatter aFormat( comphelper::getComponentContext(mpDoc->GetServiceManager()), ScGlobal::eLnge);
DBConnector aDB(*pCache, xRowSet, *aFormat.GetNullDate());
if (!aDB.isValid())
return NULL;
@@ -2961,7 +2961,7 @@ void ScDPCollection::DBCaches::updateCache(
return;
}
- SvNumberFormatter aFormat(mpDoc->GetServiceManager(), ScGlobal::eLnge);
+ SvNumberFormatter aFormat( comphelper::getComponentContext(mpDoc->GetServiceManager()), ScGlobal::eLnge);
DBConnector aDB(rCache, xRowSet, *aFormat.GetNullDate());
if (!aDB.isValid())
return;
diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index e18d241..5f146c8 100644
--- a/sc/source/core/data/global.cxx
+++ b/sc/source/core/data/global.cxx
@@ -208,7 +208,7 @@ SvNumberFormatter* ScGlobal::GetEnglishFormatter()
if ( !pEnglishFormatter )
{
pEnglishFormatter = new SvNumberFormatter(
- ::comphelper::getProcessServiceFactory(), LANGUAGE_ENGLISH_US );
+ ::comphelper::getProcessComponentContext(), LANGUAGE_ENGLISH_US );
pEnglishFormatter->SetEvalDateFormat( NF_EVALDATEFORMAT_INTL_FORMAT );
}
return pEnglishFormatter;
diff --git a/sc/source/core/data/poolhelp.cxx b/sc/source/core/data/poolhelp.cxx
index c8d4780..c2ba946 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( m_pSourceDoc->GetServiceManager(), ScGlobal::eLnge );
+ pFormTable = new SvNumberFormatter( comphelper::getComponentContext(m_pSourceDoc->GetServiceManager()), ScGlobal::eLnge );
pFormTable->SetColorLink( LINK( m_pSourceDoc, ScDocument, GetUserDefinedColor ) );
pFormTable->SetEvalDateFormat( NF_EVALDATEFORMAT_INTL_FORMAT );
diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx
index a7b8b03..ff39ed4 100644
--- a/sc/source/filter/excel/xestyle.cxx
+++ b/sc/source/filter/excel/xestyle.cxx
@@ -1225,7 +1225,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( rRoot.GetDoc().GetServiceManager(), LANGUAGE_ENGLISH_US ) ),
+ mxFormatter( new SvNumberFormatter( comphelper::getComponentContext(rRoot.GetDoc().GetServiceManager()), LANGUAGE_ENGLISH_US ) ),
mpKeywordTable( new NfKeywordTable ),
mnStdFmt( GetFormatter().GetStandardFormat( ScGlobal::eLnge ) )
{
@@ -2866,7 +2866,7 @@ void XclExpXFBuffer::AddBorderAndFill( const XclExpXF& rXF )
XclExpDxfs::XclExpDxfs( const XclExpRoot& rRoot )
: XclExpRoot( rRoot ),
- mxFormatter( new SvNumberFormatter( rRoot.GetDoc().GetServiceManager(), LANGUAGE_ENGLISH_US ) ),
+ mxFormatter( new SvNumberFormatter( comphelper::getComponentContext(rRoot.GetDoc().GetServiceManager()), LANGUAGE_ENGLISH_US ) ),
mpKeywordTable( new NfKeywordTable )
{
mxFormatter->FillKeywordTable( *mpKeywordTable, LANGUAGE_ENGLISH_US );
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 79e7dd0..21629ce 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -1360,7 +1360,7 @@ sal_Bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
ScRange aRange;
// HTML macht eigenes ColWidth/RowHeight
CalcOutputFactor();
- SvNumberFormatter aNumFormatter(aDocument.GetServiceManager(), eLang);
+ SvNumberFormatter aNumFormatter( comphelper::getComponentContext(aDocument.GetServiceManager()), 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/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 09ec1cd..12d04a1 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -1279,7 +1279,7 @@ bool ScImportExport::ExtText2Doc( SvStream& rStrm )
long nSkipLines = pExtOptions->GetStartRow();
LanguageType eDocLang = pExtOptions->GetLanguage();
- SvNumberFormatter aNumFormatter(pDoc->GetServiceManager(), eDocLang);
+ SvNumberFormatter aNumFormatter( comphelper::getComponentContext(pDoc->GetServiceManager()), eDocLang);
bool bDetectNumFormat = pExtOptions->IsDetectSpecialNumber();
// For date recognition
@@ -2175,7 +2175,7 @@ bool ScImportExport::HTML2Doc( SvStream& rStrm, const String& rBaseURL )
{
// Pick up import options if available.
LanguageType eLang = pExtOptions->GetLanguage();
- SvNumberFormatter aNumFormatter(pDoc->GetServiceManager(), eLang);
+ SvNumberFormatter aNumFormatter( comphelper::getComponentContext(pDoc->GetServiceManager()), eLang);
bool bSpecialNumber = pExtOptions->IsDetectSpecialNumber();
pImp->WriteToDocument(false, 1.0, &aNumFormatter, bSpecialNumber);
}
diff --git a/sc/source/ui/miscdlgs/autofmt.cxx b/sc/source/ui/miscdlgs/autofmt.cxx
index 1a354f8..bf33177 100644
--- a/sc/source/ui/miscdlgs/autofmt.cxx
+++ b/sc/source/ui/miscdlgs/autofmt.cxx
@@ -75,7 +75,7 @@ ScAutoFmtPreview::ScAutoFmtPreview( Window* pParent, const ResId& rRes, ScDocume
aStrMid ( ScResId( STR_MID ) ),
aStrSouth ( ScResId( STR_SOUTH ) ),
aStrSum ( ScResId( STR_SUM ) ),
- pNumFmt ( new SvNumberFormatter( ::comphelper::getProcessServiceFactory(), ScGlobal::eLnge ) )
+ pNumFmt ( new SvNumberFormatter( ::comphelper::getProcessComponentContext(), ScGlobal::eLnge ) )
{
Init();
}
diff --git a/sd/source/ui/app/sdmod.cxx b/sd/source/ui/app/sdmod.cxx
index f84fb44..3ab54fb 100644
--- a/sd/source/ui/app/sdmod.cxx
+++ b/sd/source/ui/app/sdmod.cxx
@@ -245,7 +245,7 @@ SvStorageStreamRef SdModule::GetOptionStream( const String& rOptionName,
SvNumberFormatter* SdModule::GetNumberFormatter()
{
if( !pNumberFormatter )
- pNumberFormatter = new SvNumberFormatter( ::comphelper::getProcessServiceFactory(), LANGUAGE_SYSTEM );
+ pNumberFormatter = new SvNumberFormatter( ::comphelper::getProcessComponentContext(), LANGUAGE_SYSTEM );
return pNumberFormatter;
}
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index c765515..9655c32 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -1712,7 +1712,7 @@ CustomPropertiesWindow::CustomPropertiesWindow(Window* pParent,
m_aYesNoButton ( this, SfxResId( SFX_WIN_PROPERTY_YESNO ) ),
m_aRemoveButton ( this, SfxResId( SFX_PB_PROPERTY_REMOVE ) ),
m_nScrollPos (0),
- m_aNumberFormatter( ::comphelper::getProcessServiceFactory(),
+ m_aNumberFormatter( ::comphelper::getProcessComponentContext(),
Application::GetSettings().GetLanguageTag().getLanguageType() )
{
diff --git a/svl/inc/svl/zforlist.hxx b/svl/inc/svl/zforlist.hxx
index b7e6949..9167bfc 100644
--- a/svl/inc/svl/zforlist.hxx
+++ b/svl/inc/svl/zforlist.hxx
@@ -47,8 +47,8 @@ class ImpSvNumberInputScan;
class SvNumberformat;
namespace com { namespace sun { namespace star {
- namespace lang {
- class XMultiServiceFactory;
+ namespace uno {
+ class XComponentContext;
}
}}}
@@ -325,7 +325,7 @@ public:
/// Preferred ctor with service manager and language/country enum
SvNumberFormatter(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xSMgr,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
LanguageType eLang
);
@@ -788,7 +788,7 @@ public:
static bool IsLocaleInstalled( LanguageType eLang );
private:
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceManager;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
LanguageTag maLanguageTag;
SvNumberFormatTable aFTable; // Table of format keys to format entries
typedef std::map<sal_uInt32, sal_uInt32> DefaultFormatKeysMap;
@@ -936,9 +936,9 @@ public:
// new format codes are appended.
void ReplaceSystemCL( LanguageType eOldLanguage );
- inline ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > GetServiceManager() const
+ inline ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > GetComponentContext() const
{
- return xServiceManager;
+ return m_xContext;
}
diff --git a/svl/source/numbers/supservs.cxx b/svl/source/numbers/supservs.cxx
index 905f2a0..a82bb0a 100644
--- a/svl/source/numbers/supservs.cxx
+++ b/svl/source/numbers/supservs.cxx
@@ -111,7 +111,7 @@ void SAL_CALL SvNumberFormatsSupplierServiceObject::initialize( const Sequence<
#endif
}
- m_pOwnFormatter = new SvNumberFormatter(m_xORB, eNewFormatterLanguage);
+ m_pOwnFormatter = new SvNumberFormatter( comphelper::getComponentContext(m_xORB), eNewFormatterLanguage);
m_pOwnFormatter->SetEvalDateFormat( NF_EVALDATEFORMAT_FORMAT_INTL );
SetNumberFormatter(m_pOwnFormatter);
}
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index 482dee3..e2fa5f6 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -188,9 +188,9 @@ sal_uInt16 SvNumberFormatter::nSystemCurrencyPosition = 0;
const sal_uInt16 SvNumberFormatter::UNLIMITED_PRECISION = ::std::numeric_limits<sal_uInt16>::max();
const sal_uInt16 SvNumberFormatter::INPUTSTRING_PRECISION = ::std::numeric_limits<sal_uInt16>::max()-1;
-SvNumberFormatter::SvNumberFormatter( const Reference< XMultiServiceFactory >& xSMgr,
+SvNumberFormatter::SvNumberFormatter( const Reference< XComponentContext >& rxContext,
LanguageType eLang )
- : xServiceManager( xSMgr )
+ : m_xContext( rxContext )
, maLanguageTag( eLang)
{
ImpConstruct( eLang );
@@ -234,12 +234,12 @@ void SvNumberFormatter::ImpConstruct( LanguageType eLang )
nDefaultSystemCurrencyFormat = NUMBERFORMAT_ENTRY_NOT_FOUND;
maLanguageTag.reset( eLang );
- pCharClass = new CharClass( comphelper::getComponentContext(xServiceManager), maLanguageTag );
- xLocaleData.init( comphelper::getComponentContext(xServiceManager), maLanguageTag );
- xCalendar.init( comphelper::getComponentContext(xServiceManager), maLanguageTag.getLocale() );
- xTransliteration.init( comphelper::getComponentContext(xServiceManager), eLang,
+ pCharClass = new CharClass( m_xContext, maLanguageTag );
+ xLocaleData.init( m_xContext, maLanguageTag );
+ xCalendar.init( m_xContext, maLanguageTag.getLocale() );
+ xTransliteration.init( m_xContext, eLang,
::com::sun::star::i18n::TransliterationModules_IGNORE_CASE );
- xNatNum.init( comphelper::getComponentContext(xServiceManager) );
+ xNatNum.init( m_xContext );
// cached locale data items
const LocaleDataWrapper* pLoc = GetLocaleData();
@@ -474,7 +474,7 @@ void SvNumberFormatter::ReplaceSystemCL( LanguageType eOldLanguage )
pStdFormat->SetLastInsertKey( sal_uInt16(nLastKey - nCLOffset) );
// append new system additional formats
- NumberFormatCodeWrapper aNumberFormatCode( comphelper::getComponentContext(xServiceManager),
+ NumberFormatCodeWrapper aNumberFormatCode( m_xContext,
GetLanguageTag().getLocale() );
ImpGenerateAdditionalFormats( nCLOffset, aNumberFormatCode, true );
}
@@ -736,7 +736,7 @@ bool SvNumberFormatter::Load( SvStream& rStream )
// different SYSTEM locale
if ( !pConverter )
{
- pConverter = new SvNumberFormatter( xServiceManager, eSysLang );
+ pConverter = new SvNumberFormatter( m_xContext, eSysLang );
}
pEntry->ConvertLanguage( *pConverter, eSaveSysLang, eLoadSysLang, true );
}
@@ -781,7 +781,7 @@ bool SvNumberFormatter::Load( SvStream& rStream )
// generate additional i18n standard formats for all used locales
LanguageType eOldLanguage = ActLnge;
- NumberFormatCodeWrapper aNumberFormatCode( comphelper::getComponentContext(xServiceManager),
+ NumberFormatCodeWrapper aNumberFormatCode( m_xContext,
GetLanguageTag().getLocale() );
std::vector<sal_uInt16> aList;
GetUsedLanguages( aList );
@@ -2247,7 +2247,7 @@ void SvNumberFormatter::ImpGenerateFormats( sal_uInt32 CLOffset, bool bNoAdditio
pFormatScanner->SetConvertMode(false); // switch off for this function
}
- NumberFormatCodeWrapper aNumberFormatCode( comphelper::getComponentContext(xServiceManager),
+ NumberFormatCodeWrapper aNumberFormatCode( m_xContext,
GetLanguageTag().getLocale() );
SvNumberformat* pNewFormat = NULL;
sal_Int32 nIdx;
diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx
index 24c14a7..73e6add 100644
--- a/svl/source/numbers/zforscan.cxx
+++ b/svl/source/numbers/zforscan.cxx
@@ -225,7 +225,7 @@ void ImpSvNumberformatScan::SetDependentKeywords()
// requested Locale, otherwise number format codes might not match
const LanguageTag& rLoadedLocale = pLocaleData->getLoadedLanguageTag();
LanguageType eLang = rLoadedLocale.getLanguageType( false);
- NumberFormatCodeWrapper aNumberFormatCode( comphelper::getComponentContext(pFormatter->GetServiceManager()),
+ NumberFormatCodeWrapper aNumberFormatCode( pFormatter->GetComponentContext(),
rLoadedLocale.getLocale() );
i18n::NumberFormatCode aFormat = aNumberFormatCode.getFormatCode( NF_NUMBER_STANDARD );
diff --git a/svtools/source/control/fmtfield.cxx b/svtools/source/control/fmtfield.cxx
index b8b6774..b580109 100644
--- a/svtools/source/control/fmtfield.cxx
+++ b/svtools/source/control/fmtfield.cxx
@@ -286,7 +286,7 @@ SvNumberFormatter* FormattedField::StaticFormatter::GetFormatter()
// get the Office's locale and translate
LanguageType eSysLanguage = SvtSysLocale().GetLanguageTag().getLanguageType( false);
s_cFormatter = new SvNumberFormatter(
- ::comphelper::getProcessServiceFactory(),
+ ::comphelper::getProcessComponentContext(),
eSysLanguage);
}
return s_cFormatter;
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index 484c93c..dec4494 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -2311,8 +2311,7 @@ void SwDoc::_CreateNumberFormatter()
LanguageType eLang = LANGUAGE_SYSTEM;
- Reference< XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
- pNumberFormatter = new SvNumberFormatter( xMSF, eLang );
+ pNumberFormatter = new SvNumberFormatter( comphelper::getProcessComponentContext(), eLang );
pNumberFormatter->SetEvalDateFormat( NF_EVALDATEFORMAT_FORMAT_INTL );
pNumberFormatter->SetYear2000(static_cast<sal_uInt16>(::utl::MiscCfg().GetYear2000()));
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 393a685..3d3bcf4 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -2308,7 +2308,7 @@ bool MSWordExportBase::GetNumberFmt(const SwField& rFld, String& rStr)
if( pNumFmt )
{
sal_uInt16 nLng = rFld.GetLanguage();
- LocaleDataWrapper aLocDat(comphelper::getComponentContext(pNFmtr->GetServiceManager()),
+ LocaleDataWrapper aLocDat(pNFmtr->GetComponentContext(),
LanguageTag(nLng));
String sFmt(pNumFmt->GetMappedFormatstring(GetNfKeywordTable(),
diff --git a/sw/source/ui/table/tautofmt.cxx b/sw/source/ui/table/tautofmt.cxx
index 8995ac0..fcc3642 100644
--- a/sw/source/ui/table/tautofmt.cxx
+++ b/sw/source/ui/table/tautofmt.cxx
@@ -78,7 +78,6 @@ private:
const String aStrSum;
SvNumberFormatter* pNumFmt;
- uno::Reference< lang::XMultiServiceFactory > m_xMSF;
uno::Reference< i18n::XBreakIterator > m_xBreak;
//-------------------------------------------
@@ -544,15 +543,11 @@ AutoFmtPreview::AutoFmtPreview(Window* pParent) :
aStrNorth ( SW_RES( STR_NORTH ) ),
aStrMid ( SW_RES( STR_MID ) ),
aStrSouth ( SW_RES( STR_SOUTH ) ),
- aStrSum ( SW_RES( STR_SUM ) ),
- m_xMSF ( comphelper::getProcessServiceFactory() )
+ aStrSum ( SW_RES( STR_SUM ) )
{
- OSL_ENSURE( m_xMSF.is(), "AutoFmtPreview: no MultiServiceFactory");
- if ( m_xMSF.is() )
- {
- m_xBreak = i18n::BreakIterator::create(comphelper::getComponentContext(m_xMSF));
- }
- pNumFmt = new SvNumberFormatter( m_xMSF, LANGUAGE_SYSTEM );
+ uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext();
+ m_xBreak = i18n::BreakIterator::create(xContext);
+ pNumFmt = new SvNumberFormatter( xContext, LANGUAGE_SYSTEM );
Init();
}
diff --git a/sw/source/ui/utlui/numfmtlb.cxx b/sw/source/ui/utlui/numfmtlb.cxx
index ced1283..7dbfe5c 100644
--- a/sw/source/ui/utlui/numfmtlb.cxx
+++ b/sw/source/ui/utlui/numfmtlb.cxx
@@ -97,9 +97,8 @@ void NumFormatListBox::Init(short nFormatType, sal_Bool bUsrFmts)
eCurLanguage = SvtSysLocale().GetLanguageTag().getLanguageType();
if (bUsrFmts == sal_False)
- {
- Reference< XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
- pOwnFormatter = new SvNumberFormatter(xMSF, eCurLanguage);
+ {
+ pOwnFormatter = new SvNumberFormatter(comphelper::getProcessComponentContext(), eCurLanguage);
}
SetFormatType(nFormatType);
diff --git a/uui/source/iahndl-ssl.cxx b/uui/source/iahndl-ssl.cxx
index 4e34999..c81aefc 100644
--- a/uui/source/iahndl-ssl.cxx
+++ b/uui/source/iahndl-ssl.cxx
@@ -114,8 +114,7 @@ getLocalizedDatTimeStr(
aTime = Time( rDateTime.Hours, rDateTime.Minutes, rDateTime.Seconds );
LanguageType eUILang = Application::GetSettings().GetUILanguageTag().getLanguageType();
- SvNumberFormatter *pNumberFormatter
- = new SvNumberFormatter( uno::Reference<lang::XMultiServiceFactory>(xContext->getServiceManager(), uno::UNO_QUERY_THROW), eUILang );
+ SvNumberFormatter *pNumberFormatter = new SvNumberFormatter( xContext, eUILang );
String aTmpStr;
Color* pColor = NULL;
Date* pNullDate = pNumberFormatter->GetNullDate();
diff --git a/xmloff/inc/xmloff/xmlnumfi.hxx b/xmloff/inc/xmloff/xmlnumfi.hxx
index f162f5b..678d9f2 100644
--- a/xmloff/inc/xmloff/xmlnumfi.hxx
+++ b/xmloff/inc/xmloff/xmlnumfi.hxx
@@ -74,21 +74,14 @@ class SvXMLNumFmtHelper
{
SvXMLNumImpData* pData;
- // #110680#
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxServiceFactory;
-
public:
- // #110680#
- //SvXMLNumFmtHelper( const ::com::sun::star::uno::Reference<
- // ::com::sun::star::util::XNumberFormatsSupplier >& rSupp );
- //SvXMLNumFmtHelper( SvNumberFormatter* pNumberFormatter );
SvXMLNumFmtHelper(
const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier >& rSupp,
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory );
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
SvXMLNumFmtHelper(
SvNumberFormatter* pNumberFormatter,
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory );
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext );
~SvXMLNumFmtHelper();
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index 6b492ef..1db8a01 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -381,7 +381,7 @@ void SvXMLImport::_InitCtor()
msPackageProtocol = "vnd.sun.star.Package:";
if (mxNumberFormatsSupplier.is())
- mpNumImport = new SvXMLNumFmtHelper(mxNumberFormatsSupplier, getServiceFactory());
+ mpNumImport = new SvXMLNumFmtHelper(mxNumberFormatsSupplier, comphelper::getComponentContext(getServiceFactory()));
if (mxModel.is() && !mxEventListener.is())
{
@@ -1649,7 +1649,7 @@ void SvXMLImport::_CreateDataStylesImport()
uno::Reference<util::XNumberFormatsSupplier> xNum =
GetNumberFormatsSupplier();
if ( xNum.is() )
- mpNumImport = new SvXMLNumFmtHelper(xNum, getServiceFactory());
+ mpNumImport = new SvXMLNumFmtHelper(xNum, comphelper::getComponentContext(getServiceFactory()));
}
diff --git a/xmloff/source/draw/ximpstyl.cxx b/xmloff/source/draw/ximpstyl.cxx
index 1a736db..94ca2f7 100644
--- a/xmloff/source/draw/ximpstyl.cxx
+++ b/xmloff/source/draw/ximpstyl.cxx
@@ -1002,8 +1002,8 @@ SdXMLStylesContext::SdXMLStylesContext(
mbIsAutoStyle(bIsAutoStyle)
{
Reference< lang::XMultiServiceFactory > xMSF = rImport.getServiceFactory();
- mpNumFormatter = new SvNumberFormatter( xMSF, LANGUAGE_SYSTEM );
- mpNumFmtHelper = new SvXMLNumFmtHelper( mpNumFormatter, xMSF );
+ mpNumFormatter = new SvNumberFormatter( comphelper::getComponentContext(xMSF), LANGUAGE_SYSTEM );
+ mpNumFmtHelper = new SvXMLNumFmtHelper( mpNumFormatter, comphelper::getComponentContext(xMSF) );
}
//////////////////////////////////////////////////////////////////////////////
diff --git a/xmloff/source/style/xmlnumfe.cxx b/xmloff/source/style/xmlnumfe.cxx
index 98e3e9e..0a12437 100644
--- a/xmloff/source/style/xmlnumfe.cxx
+++ b/xmloff/source/style/xmlnumfe.cxx
@@ -237,9 +237,9 @@ SvXMLNumFmtExport::SvXMLNumFmtExport(
if ( pFormatter )
{
- pCharClass = new CharClass( comphelper::getComponentContext(pFormatter->GetServiceManager()),
+ pCharClass = new CharClass( pFormatter->GetComponentContext(),
pFormatter->GetLanguageTag() );
- pLocaleData = new LocaleDataWrapper( comphelper::getComponentContext(pFormatter->GetServiceManager()),
+ pLocaleData = new LocaleDataWrapper( pFormatter->GetComponentContext(),
pFormatter->GetLanguageTag() );
}
else
@@ -272,9 +272,9 @@ SvXMLNumFmtExport::SvXMLNumFmtExport(
if ( pFormatter )
{
- pCharClass = new CharClass( comphelper::getComponentContext(pFormatter->GetServiceManager()),
+ pCharClass = new CharClass( pFormatter->GetComponentContext(),
pFormatter->GetLanguageTag() );
- pLocaleData = new LocaleDataWrapper( comphelper::getComponentContext(pFormatter->GetServiceManager()),
+ pLocaleData = new LocaleDataWrapper( pFormatter->GetComponentContext(),
pFormatter->GetLanguageTag() );
}
else
diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx
index 8b57734..3e2c545 100644
--- a/xmloff/source/style/xmlnumfi.cxx
+++ b/xmloff/source/style/xmlnumfi.cxx
@@ -93,12 +93,12 @@ class SvXMLNumImpData
LocaleDataWrapper* pLocaleData;
SvXMLNumFmtEntryArr aNameEntries;
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxServiceFactory;
+ uno::Reference< uno::XComponentContext > m_xContext;
public:
SvXMLNumImpData(
SvNumberFormatter* pFmt,
- const uno::Reference<lang::XMultiServiceFactory>& xServiceFactory );
+ const uno::Reference<uno::XComponentContext>& rxContext );
~SvXMLNumImpData();
SvNumberFormatter* GetNumberFormatter() const { return pFormatter; }
@@ -381,17 +381,16 @@ static SvXMLDefaultDateFormat aDefaultDateFormats[] =
SvXMLNumImpData::SvXMLNumImpData(
SvNumberFormatter* pFmt,
- const uno::Reference<lang::XMultiServiceFactory>& xServiceFactory )
+ const uno::Reference<uno::XComponentContext>& rxContext )
: pFormatter(pFmt),
pStylesElemTokenMap(NULL),
pStyleElemTokenMap(NULL),
pStyleAttrTokenMap(NULL),
pStyleElemAttrTokenMap(NULL),
pLocaleData(NULL),
-
- mxServiceFactory(xServiceFactory)
+ m_xContext(rxContext)
{
- DBG_ASSERT( mxServiceFactory.is(), "got no service manager" );
+ DBG_ASSERT( rxContext.is(), "got no service manager" );
}
SvXMLNumImpData::~SvXMLNumImpData()
@@ -600,8 +599,7 @@ const LocaleDataWrapper& SvXMLNumImpData::GetLocaleData( LanguageType nLang )
{
if ( !pLocaleData )
pLocaleData = new LocaleDataWrapper(
- comphelper::getComponentContext(
- pFormatter ? pFormatter->GetServiceManager() : mxServiceFactory),
+ pFormatter ? pFormatter->GetComponentContext() : m_xContext,
LanguageTag( nLang ) );
else
pLocaleData->setLanguageTag( LanguageTag( nLang ) );
@@ -2150,10 +2148,9 @@ sal_Bool SvXMLNumFormatContext::IsSystemLanguage()
SvXMLNumFmtHelper::SvXMLNumFmtHelper(
const uno::Reference<util::XNumberFormatsSupplier>& rSupp,
- const uno::Reference<lang::XMultiServiceFactory>& xServiceFactory )
-: mxServiceFactory(xServiceFactory)
+ const uno::Reference<uno::XComponentContext>& rxContext )
{
- DBG_ASSERT( mxServiceFactory.is(), "got no service manager" );
+ DBG_ASSERT( rxContext.is(), "got no service manager" );
SvNumberFormatter* pFormatter = NULL;
SvNumberFormatsSupplierObj* pObj =
@@ -2161,17 +2158,16 @@ SvXMLNumFmtHelper::SvXMLNumFmtHelper(
if (pObj)
pFormatter = pObj->GetNumberFormatter();
- pData = new SvXMLNumImpData( pFormatter, mxServiceFactory );
+ pData = new SvXMLNumImpData( pFormatter, rxContext );
}
SvXMLNumFmtHelper::SvXMLNumFmtHelper(
SvNumberFormatter* pNumberFormatter,
- const uno::Reference<lang::XMultiServiceFactory>& xServiceFactory )
-: mxServiceFactory(xServiceFactory)
+ const uno::Reference<uno::XComponentContext>& rxContext )
{
- DBG_ASSERT( mxServiceFactory.is(), "got no service manager" );
+ DBG_ASSERT( rxContext.is(), "got no service manager" );
- pData = new SvXMLNumImpData( pNumberFormatter, mxServiceFactory );
+ pData = new SvXMLNumImpData( pNumberFormatter, rxContext );
}
SvXMLNumFmtHelper::~SvXMLNumFmtHelper()
commit b772eb0c728a06bdf72866ef61f800bbf7ec15a9
Author: Noel Grandin <noel at peralex.com>
Date: Thu Jan 10 14:20:08 2013 +0200
fdo#46808, Adapt document::FilterConfigRefresh UNO service to new style
The service already existed, it just did not have an IDL file
Change-Id: I6894a3435159d9f529f2036354e70ee6358fc778
diff --git a/filter/source/config/cache/basecontainer.cxx b/filter/source/config/cache/basecontainer.cxx
index e829d57..4caefb0 100644
--- a/filter/source/config/cache/basecontainer.cxx
+++ b/filter/source/config/cache/basecontainer.cxx
@@ -22,6 +22,7 @@
#include "constant.hxx"
#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
+#include <com/sun/star/document/FilterConfigRefresh.hpp>
#include <com/sun/star/uno/Type.h>
#include <comphelper/enumhelper.hxx>
#include <osl/diagnose.h>
@@ -65,7 +66,7 @@ BaseContainer::~BaseContainer()
-void BaseContainer::init(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR ,
+void BaseContainer::init(const css::uno::Reference< css::uno::XComponentContext >& rxContext ,
const ::rtl::OUString& sImplementationName,
const css::uno::Sequence< ::rtl::OUString >& lServiceNames ,
FilterCache::EItemType eType )
@@ -75,11 +76,8 @@ void BaseContainer::init(const css::uno::Reference< css::lang::XMultiServiceFact
m_sImplementationName = sImplementationName;
m_lServiceNames = lServiceNames ;
- m_xSMGR = xSMGR ;
m_eType = eType ;
- m_xRefreshBroadcaster = css::uno::Reference< css::util::XRefreshable >(
- xSMGR->createInstance(SERVICE_FILTERCONFIGREFRESH),
- css::uno::UNO_QUERY);
+ m_xRefreshBroadcaster = css::document::FilterConfigRefresh::create(rxContext);
// <- SAFE
}
diff --git a/filter/source/config/cache/basecontainer.hxx b/filter/source/config/cache/basecontainer.hxx
index 19000c8..61fb4e9 100644
--- a/filter/source/config/cache/basecontainer.hxx
+++ b/filter/source/config/cache/basecontainer.hxx
@@ -23,7 +23,7 @@
#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/util/XRefreshable.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/container/XContainerQuery.hpp>
#include <com/sun/star/util/XFlushable.hpp>
@@ -64,10 +64,6 @@ class BaseContainer : public BaseLock
protected:
- /** @short reference to an uno service manager, which can be used
- to create own needed services. */
- css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR;
-
// TODO
css::uno::WeakReference< css::util::XRefreshable > m_xRefreshBroadcaster;
@@ -144,7 +140,7 @@ class BaseContainer : public BaseLock
by this special method. Of course this method must be called first before
any other interface method is used.
- @param xSMGR
+ @param rxContext
reference to the uno service manager, which created this service instance.
@param sImplementationName
@@ -159,7 +155,7 @@ class BaseContainer : public BaseLock
specify, which sub container of the used filter cache
must be wrapped by this container interface.
*/
- virtual void init(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR ,
+ virtual void init(const css::uno::Reference< css::uno::XComponentContext >& rxContext ,
const ::rtl::OUString& sImplementationName,
const css::uno::Sequence< ::rtl::OUString >& lServiceNames ,
FilterCache::EItemType eType );
diff --git a/filter/source/config/cache/cacheupdatelistener.cxx b/filter/source/config/cache/cacheupdatelistener.cxx
index 287b076..0455c88 100644
--- a/filter/source/config/cache/cacheupdatelistener.cxx
+++ b/filter/source/config/cache/cacheupdatelistener.cxx
@@ -23,20 +23,20 @@
#include <com/sun/star/util/XChangesNotifier.hpp>
#include <com/sun/star/util/XRefreshable.hpp>
+#include <com/sun/star/document/FilterConfigRefresh.hpp>
#include <salhelper/singletonref.hxx>
#include <unotools/configpaths.hxx>
#include <rtl/ustring.hxx>
+#include <comphelper/processfactory.hxx>
namespace filter{
namespace config{
-CacheUpdateListener::CacheUpdateListener(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR,
- FilterCache &rFilterCache,
+CacheUpdateListener::CacheUpdateListener(FilterCache &rFilterCache,
const css::uno::Reference< css::uno::XInterface >& xConfigAccess,
FilterCache::EItemType eConfigType)
: BaseLock()
- , m_xSMGR(xSMGR)
, m_rCache(rFilterCache)
, m_xConfig(xConfigAccess)
, m_eConfigType(eConfigType)
@@ -91,8 +91,7 @@ void SAL_CALL CacheUpdateListener::changesOccurred(const css::util::ChangesEven
if ( ! m_xConfig.is())
return;
- css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR;
- FilterCache::EItemType eType = m_eConfigType;
+ FilterCache::EItemType eType = m_eConfigType;
aLock.clear();
// <- SAFE
@@ -173,11 +172,10 @@ void SAL_CALL CacheUpdateListener::changesOccurred(const css::util::ChangesEven
// notify sfx cache about the changed filter cache .-)
if (bNotifyRefresh)
{
- css::uno::Reference< css::util::XRefreshable > xRefreshBroadcaster(
- xSMGR->createInstance(SERVICE_FILTERCONFIGREFRESH),
- css::uno::UNO_QUERY);
- if (xRefreshBroadcaster.is())
- xRefreshBroadcaster->refresh();
+ css::uno::Reference< css::uno::XComponentContext > xContext = comphelper::getProcessComponentContext();
+ css::uno::Reference< css::util::XRefreshable > xRefreshBroadcaster =
+ css::document::FilterConfigRefresh::create(xContext);
+ xRefreshBroadcaster->refresh();
}
}
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list