fdo#46808 use document::DocumentRevisionListPersistence constructor
Change-Id: I1a591ec4061c73657c26552d41c58b970696038f
This commit is contained in:
parent
f084fc5c80
commit
8c31a6baf0
@ -120,6 +120,7 @@ $(eval $(call gb_CppunitTest_use_components,sc_annotationobj,\
|
||||
unotools/util/utl \
|
||||
unoxml/source/rdf/unordf \
|
||||
unoxml/source/service/unoxml \
|
||||
xmloff/util/xo \
|
||||
))
|
||||
|
||||
$(eval $(call gb_CppunitTest_use_configuration,sc_annotationobj))
|
||||
|
@ -120,6 +120,7 @@ $(eval $(call gb_CppunitTest_use_components,sc_annotationsobj,\
|
||||
unotools/util/utl \
|
||||
unoxml/source/rdf/unordf \
|
||||
unoxml/source/service/unoxml \
|
||||
xmloff/util/xo \
|
||||
))
|
||||
|
||||
$(eval $(call gb_CppunitTest_use_configuration,sc_annotationsobj))
|
||||
|
@ -120,6 +120,7 @@ $(eval $(call gb_CppunitTest_use_components,sc_cellrangesbase,\
|
||||
unotools/util/utl \
|
||||
unoxml/source/rdf/unordf \
|
||||
unoxml/source/service/unoxml \
|
||||
xmloff/util/xo \
|
||||
))
|
||||
|
||||
$(eval $(call gb_CppunitTest_use_configuration,sc_cellrangesbase))
|
||||
|
@ -118,6 +118,7 @@ $(eval $(call gb_CppunitTest_use_components,sc_databaserangeobj,\
|
||||
unotools/util/utl \
|
||||
unoxml/source/rdf/unordf \
|
||||
unoxml/source/service/unoxml \
|
||||
xmloff/util/xo \
|
||||
))
|
||||
|
||||
$(eval $(call gb_CppunitTest_use_configuration,sc_databaserangeobj))
|
||||
|
@ -119,6 +119,7 @@ $(eval $(call gb_CppunitTest_use_components,sc_datapilotfieldobj,\
|
||||
unotools/util/utl \
|
||||
unoxml/source/rdf/unordf \
|
||||
unoxml/source/service/unoxml \
|
||||
xmloff/util/xo \
|
||||
))
|
||||
|
||||
$(eval $(call gb_CppunitTest_use_configuration,sc_datapilotfieldobj))
|
||||
|
@ -119,6 +119,7 @@ $(eval $(call gb_CppunitTest_use_components,sc_datapilottableobj,\
|
||||
unotools/util/utl \
|
||||
unoxml/source/rdf/unordf \
|
||||
unoxml/source/service/unoxml \
|
||||
xmloff/util/xo \
|
||||
))
|
||||
|
||||
$(eval $(call gb_CppunitTest_use_configuration,sc_datapilottableobj))
|
||||
|
@ -129,6 +129,7 @@ $(eval $(call gb_CppunitTest_use_components,sc_filters_test,\
|
||||
unotools/util/utl \
|
||||
unoxml/source/rdf/unordf \
|
||||
unoxml/source/service/unoxml \
|
||||
xmloff/util/xo \
|
||||
))
|
||||
|
||||
$(eval $(call gb_CppunitTest_use_configuration,sc_filters_test))
|
||||
|
@ -119,6 +119,7 @@ $(eval $(call gb_CppunitTest_use_components,sc_macros_test,\
|
||||
unotools/util/utl \
|
||||
unoxml/source/rdf/unordf \
|
||||
unoxml/source/service/unoxml \
|
||||
xmloff/util/xo \
|
||||
))
|
||||
|
||||
$(eval $(call gb_CppunitTest_use_configuration,sc_macros_test))
|
||||
|
@ -119,6 +119,7 @@ $(eval $(call gb_CppunitTest_use_components,sc_modelobj,\
|
||||
unotools/util/utl \
|
||||
unoxml/source/rdf/unordf \
|
||||
unoxml/source/service/unoxml \
|
||||
xmloff/util/xo \
|
||||
))
|
||||
|
||||
$(eval $(call gb_CppunitTest_use_configuration,sc_modelobj))
|
||||
|
@ -119,6 +119,7 @@ $(eval $(call gb_CppunitTest_use_components,sc_namedrangeobj,\
|
||||
unotools/util/utl \
|
||||
unoxml/source/rdf/unordf \
|
||||
unoxml/source/service/unoxml \
|
||||
xmloff/util/xo \
|
||||
))
|
||||
|
||||
$(eval $(call gb_CppunitTest_use_configuration,sc_namedrangeobj))
|
||||
|
@ -119,6 +119,7 @@ $(eval $(call gb_CppunitTest_use_components,sc_namedrangesobj,\
|
||||
unotools/util/utl \
|
||||
unoxml/source/rdf/unordf \
|
||||
unoxml/source/service/unoxml \
|
||||
xmloff/util/xo \
|
||||
))
|
||||
|
||||
$(eval $(call gb_CppunitTest_use_configuration,sc_namedrangesobj))
|
||||
|
@ -120,6 +120,7 @@ $(eval $(call gb_CppunitTest_use_components,sc_outlineobj,\
|
||||
unotools/util/utl \
|
||||
unoxml/source/rdf/unordf \
|
||||
unoxml/source/service/unoxml \
|
||||
xmloff/util/xo \
|
||||
))
|
||||
|
||||
$(eval $(call gb_CppunitTest_use_configuration,sc_outlineobj))
|
||||
|
@ -124,6 +124,7 @@ $(eval $(call gb_CppunitTest_use_components,sc_subsequent_export_test,\
|
||||
unoxml/source/service/unoxml \
|
||||
xmlsecurity/util/xsec_fw \
|
||||
xmlsecurity/util/xmlsecurity \
|
||||
xmloff/util/xo \
|
||||
))
|
||||
|
||||
ifeq ($(OS),WNT)
|
||||
|
@ -120,6 +120,7 @@ $(eval $(call gb_CppunitTest_use_components,sc_spreadsheetobj,\
|
||||
unotools/util/utl \
|
||||
unoxml/source/rdf/unordf \
|
||||
unoxml/source/service/unoxml \
|
||||
xmloff/util/xo \
|
||||
))
|
||||
|
||||
$(eval $(call gb_CppunitTest_use_configuration,sc_spreadsheetobj))
|
||||
|
@ -120,6 +120,7 @@ $(eval $(call gb_CppunitTest_use_components,sc_spreadsheetsobj,\
|
||||
unotools/util/utl \
|
||||
unoxml/source/rdf/unordf \
|
||||
unoxml/source/service/unoxml \
|
||||
xmloff/util/xo \
|
||||
))
|
||||
|
||||
$(eval $(call gb_CppunitTest_use_configuration,sc_spreadsheetsobj))
|
||||
|
@ -111,6 +111,7 @@ using namespace ::com::sun::star::io;
|
||||
#include <sot/stg.hxx>
|
||||
#include <unotools/saveopt.hxx>
|
||||
#include <svl/documentlockfile.hxx>
|
||||
#include <com/sun/star/document/DocumentRevisionListPersistence.hpp>
|
||||
|
||||
#include "helper.hxx"
|
||||
#include <sfx2/request.hxx> // SFX_ITEMSET_SET
|
||||
@ -3101,17 +3102,14 @@ const uno::Sequence < util::RevisionTag >& SfxMedium::GetVersionList( bool _bNoR
|
||||
if ( ( !_bNoReload || !pImp->m_bVersionsAlreadyLoaded ) && !pImp->aVersions.getLength() &&
|
||||
( !pImp->m_aName.isEmpty() || !pImp->m_aLogicName.isEmpty() ) && GetStorage().is() )
|
||||
{
|
||||
uno::Reference < document::XDocumentRevisionListPersistence > xReader( comphelper::getProcessServiceFactory()->createInstance(
|
||||
::rtl::OUString("com.sun.star.document.DocumentRevisionListPersistence") ), uno::UNO_QUERY );
|
||||
if ( xReader.is() )
|
||||
uno::Reference < document::XDocumentRevisionListPersistence > xReader =
|
||||
document::DocumentRevisionListPersistence::create( comphelper::getProcessComponentContext() );
|
||||
try
|
||||
{
|
||||
pImp->aVersions = xReader->load( GetStorage() );
|
||||
}
|
||||
catch ( const uno::Exception& )
|
||||
{
|
||||
try
|
||||
{
|
||||
pImp->aVersions = xReader->load( GetStorage() );
|
||||
}
|
||||
catch ( const uno::Exception& )
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -3123,17 +3121,14 @@ const uno::Sequence < util::RevisionTag >& SfxMedium::GetVersionList( bool _bNoR
|
||||
|
||||
uno::Sequence < util::RevisionTag > SfxMedium::GetVersionList( const uno::Reference < embed::XStorage >& xStorage )
|
||||
{
|
||||
uno::Reference < document::XDocumentRevisionListPersistence > xReader( comphelper::getProcessServiceFactory()->createInstance(
|
||||
::rtl::OUString("com.sun.star.document.DocumentRevisionListPersistence") ), uno::UNO_QUERY );
|
||||
if ( xReader.is() )
|
||||
uno::Reference < document::XDocumentRevisionListPersistence > xReader =
|
||||
document::DocumentRevisionListPersistence::create( comphelper::getProcessComponentContext() );
|
||||
try
|
||||
{
|
||||
return xReader->load( xStorage );
|
||||
}
|
||||
catch ( const uno::Exception& )
|
||||
{
|
||||
try
|
||||
{
|
||||
return xReader->load( xStorage );
|
||||
}
|
||||
catch ( const uno::Exception& )
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
return uno::Sequence < util::RevisionTag >();
|
||||
@ -3210,18 +3205,15 @@ sal_Bool SfxMedium::SaveVersionList_Impl( sal_Bool /*bUseXML*/ )
|
||||
if ( !pImp->aVersions.getLength() )
|
||||
return true;
|
||||
|
||||
uno::Reference < document::XDocumentRevisionListPersistence > xWriter( comphelper::getProcessServiceFactory()->createInstance(
|
||||
::rtl::OUString("com.sun.star.document.DocumentRevisionListPersistence") ), uno::UNO_QUERY );
|
||||
if ( xWriter.is() )
|
||||
uno::Reference < document::XDocumentRevisionListPersistence > xWriter =
|
||||
document::DocumentRevisionListPersistence::create( comphelper::getProcessComponentContext() );
|
||||
try
|
||||
{
|
||||
xWriter->store( GetStorage(), pImp->aVersions );
|
||||
return true;
|
||||
}
|
||||
catch ( const uno::Exception& )
|
||||
{
|
||||
try
|
||||
{
|
||||
xWriter->store( GetStorage(), pImp->aVersions );
|
||||
return true;
|
||||
}
|
||||
catch ( const uno::Exception& )
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1846,7 +1846,7 @@ sal_Bool getTextProperty_Impl( Content& rContent,
|
||||
|
||||
if ( SfxURLRelocator_Impl::propertyCanContainOfficeDir( rPropName ) )
|
||||
{
|
||||
SfxURLRelocator_Impl aRelocImpl( ::comphelper::getProcessServiceFactory() );
|
||||
SfxURLRelocator_Impl aRelocImpl( ::comphelper::getProcessComponentContext() );
|
||||
aRelocImpl.makeAbsoluteURL( rPropValue );
|
||||
}
|
||||
|
||||
|
@ -176,7 +176,7 @@ public:
|
||||
|
||||
class SfxDocTplService_Impl
|
||||
{
|
||||
uno::Reference< XMultiServiceFactory > mxFactory;
|
||||
uno::Reference< XComponentContext > mxContext;
|
||||
uno::Reference< XCommandEnvironment > maCmdEnv;
|
||||
uno::Reference< XDocumentProperties> m_xDocProps;
|
||||
uno::Reference< XTypeDetection > mxType;
|
||||
@ -268,7 +268,7 @@ class SfxDocTplService_Impl
|
||||
void updateData( DocTemplates_EntryData_Impl *pData );
|
||||
|
||||
public:
|
||||
SfxDocTplService_Impl( uno::Reference< XMultiServiceFactory > xFactory );
|
||||
SfxDocTplService_Impl( const uno::Reference< XComponentContext > & xContext );
|
||||
~SfxDocTplService_Impl();
|
||||
|
||||
sal_Bool init() { if ( !mbIsInitialized ) init_Impl(); return mbIsInitialized; }
|
||||
@ -451,7 +451,7 @@ void SfxDocTplService_Impl::init_Impl()
|
||||
}
|
||||
|
||||
OUString const aService = OUString( SERVICENAME_TYPEDETECTION );
|
||||
mxType = uno::Reference< XTypeDetection > ( mxFactory->createInstance( aService ), UNO_QUERY );
|
||||
mxType = uno::Reference< XTypeDetection > ( mxContext->getServiceManager()->createInstanceWithContext(aService, mxContext), UNO_QUERY );
|
||||
|
||||
getDirList();
|
||||
readFolderList();
|
||||
@ -580,9 +580,7 @@ void SfxDocTplService_Impl::getDirList()
|
||||
|
||||
maTemplateDirs = Sequence< OUString >( nCount );
|
||||
|
||||
uno::Reference< XComponentContext > xCtx(
|
||||
comphelper::getComponentContext( mxFactory ) );
|
||||
uno::Reference< util::XMacroExpander > xExpander = util::theMacroExpander::get(xCtx);
|
||||
uno::Reference< util::XMacroExpander > xExpander = util::theMacroExpander::get(mxContext);
|
||||
const rtl::OUString aPrefix(
|
||||
"vnd.sun.star.expand:" );
|
||||
|
||||
@ -1122,10 +1120,10 @@ bool SfxURLRelocator_Impl::propertyCanContainOfficeDir(
|
||||
// public SfxDocTplService_Impl
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
SfxDocTplService_Impl::SfxDocTplService_Impl( uno::Reference< XMultiServiceFactory > xFactory )
|
||||
: maRelocator( xFactory )
|
||||
SfxDocTplService_Impl::SfxDocTplService_Impl( const uno::Reference< XComponentContext > & xContext )
|
||||
: maRelocator( xContext )
|
||||
{
|
||||
mxFactory = xFactory;
|
||||
mxContext = xContext;
|
||||
mpUpdater = NULL;
|
||||
mbIsInitialized = sal_False;
|
||||
mbLocaleSet = sal_False;
|
||||
@ -1290,7 +1288,7 @@ uno::Sequence< beans::StringPair > SfxDocTplService_Impl::ReadUINamesForTemplate
|
||||
{
|
||||
uno::Reference< io::XInputStream > xLocStream = aLocContent.openStream();
|
||||
if ( xLocStream.is() )
|
||||
aUINames = DocTemplLocaleHelper::ReadGroupLocalizationSequence( xLocStream, comphelper::getComponentContext(mxFactory) );
|
||||
aUINames = DocTemplLocaleHelper::ReadGroupLocalizationSequence( xLocStream, mxContext );
|
||||
}
|
||||
catch( uno::Exception& )
|
||||
{}
|
||||
@ -1378,7 +1376,7 @@ sal_Bool SfxDocTplService_Impl::WriteUINamesForTemplateDir_Impl( const ::rtl::OU
|
||||
sal_Bool bResult = sal_False;
|
||||
try {
|
||||
uno::Reference< beans::XPropertySet > xTempFile(
|
||||
io::TempFile::create(comphelper::getComponentContext(mxFactory)),
|
||||
io::TempFile::create(mxContext),
|
||||
uno::UNO_QUERY_THROW );
|
||||
|
||||
::rtl::OUString aTempURL;
|
||||
@ -1390,7 +1388,7 @@ sal_Bool SfxDocTplService_Impl::WriteUINamesForTemplateDir_Impl( const ::rtl::OU
|
||||
if ( !xOutStream.is() )
|
||||
throw uno::RuntimeException();
|
||||
|
||||
DocTemplLocaleHelper::WriteGroupLocalizationSequence( xOutStream, aUINames, comphelper::getComponentContext(mxFactory));
|
||||
DocTemplLocaleHelper::WriteGroupLocalizationSequence( xOutStream, aUINames, mxContext);
|
||||
try {
|
||||
// the SAX writer might close the stream
|
||||
xOutStream->closeOutput();
|
||||
@ -2212,7 +2210,7 @@ SFX_IMPL_SINGLEFACTORY( SfxDocTplService )
|
||||
//-----------------------------------------------------------------------------
|
||||
SfxDocTplService::SfxDocTplService( const uno::Reference< XMultiServiceFactory >& xFactory )
|
||||
{
|
||||
pImp = new SfxDocTplService_Impl( xFactory );
|
||||
pImp = new SfxDocTplService_Impl( comphelper::getComponentContext(xFactory) );
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -2806,8 +2804,8 @@ DocTemplates_EntryData_Impl::DocTemplates_EntryData_Impl( const OUString& rTitle
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
SfxURLRelocator_Impl::SfxURLRelocator_Impl( uno::Reference< XMultiServiceFactory > xFactory )
|
||||
: mxFactory( xFactory )
|
||||
SfxURLRelocator_Impl::SfxURLRelocator_Impl( const uno::Reference< XComponentContext > & xContext )
|
||||
: mxContext( xContext )
|
||||
{
|
||||
}
|
||||
|
||||
@ -2824,12 +2822,9 @@ void SfxURLRelocator_Impl::initOfficeInstDirs()
|
||||
osl::MutexGuard aGuard( maMutex );
|
||||
if ( !mxOfficeInstDirs.is() )
|
||||
{
|
||||
OSL_ENSURE( mxFactory.is(), "No service manager!" );
|
||||
OSL_ENSURE( mxContext.is(), "No service manager!" );
|
||||
|
||||
uno::Reference< XComponentContext > xCtx(
|
||||
comphelper::getComponentContext( mxFactory ) );
|
||||
|
||||
mxOfficeInstDirs = theOfficeInstallationDirectories::get(xCtx);
|
||||
mxOfficeInstDirs = theOfficeInstallationDirectories::get(mxContext);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2846,8 +2841,7 @@ void SfxURLRelocator_Impl::implExpandURL( ::rtl::OUString& io_url )
|
||||
{
|
||||
if ( !mxMacroExpander.is() )
|
||||
{
|
||||
::comphelper::ComponentContext aContext( mxFactory );
|
||||
mxMacroExpander.set( theMacroExpander::get(aContext.getUNOContext()), UNO_QUERY_THROW );
|
||||
mxMacroExpander.set( theMacroExpander::get(mxContext), UNO_QUERY_THROW );
|
||||
}
|
||||
io_url = mxMacroExpander->expandMacros( io_url );
|
||||
}
|
||||
|
@ -20,7 +20,6 @@
|
||||
#ifndef _SFX_SFXURLRELOCATOR_HXX_
|
||||
#define _SFX_SFXURLRELOCATOR_HXX_
|
||||
|
||||
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
|
||||
#include <com/sun/star/util/XOfficeInstallationDirectories.hpp>
|
||||
#include <com/sun/star/util/XMacroExpander.hpp>
|
||||
|
||||
@ -30,7 +29,7 @@
|
||||
class SfxURLRelocator_Impl
|
||||
{
|
||||
::osl::Mutex maMutex;
|
||||
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxFactory;
|
||||
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > mxContext;
|
||||
::com::sun::star::uno::Reference< ::com::sun::star::util::XOfficeInstallationDirectories > mxOfficeInstDirs;
|
||||
::com::sun::star::uno::Reference< ::com::sun::star::util::XMacroExpander > mxMacroExpander;
|
||||
|
||||
@ -40,7 +39,7 @@ public:
|
||||
void makeRelocatableURL( rtl::OUString & rURL );
|
||||
void makeAbsoluteURL( rtl::OUString & rURL );
|
||||
|
||||
SfxURLRelocator_Impl( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory );
|
||||
SfxURLRelocator_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > & xContext );
|
||||
~SfxURLRelocator_Impl();
|
||||
|
||||
private:
|
||||
|
@ -92,6 +92,7 @@ $(eval $(call gb_CppunitTest_use_components,sw_filters_test,\
|
||||
unoxml/source/service/unoxml \
|
||||
$(if $(filter DESKTOP,$(BUILD_TYPE)),xmlhelp/util/ucpchelp1) \
|
||||
xmloff/source/transform/xof \
|
||||
xmloff/util/xo \
|
||||
))
|
||||
|
||||
$(eval $(call gb_CppunitTest_use_configuration,sw_filters_test))
|
||||
|
@ -91,6 +91,7 @@ $(eval $(call gb_CppunitTest_use_components,sw_subsequent_odfexport,\
|
||||
unoxml/source/service/unoxml \
|
||||
uui/util/uui \
|
||||
$(if $(filter DESKTOP,$(BUILD_TYPE)),xmlhelp/util/ucpchelp1) \
|
||||
xmloff/util/xo \
|
||||
))
|
||||
|
||||
$(eval $(call gb_CppunitTest_use_configuration,sw_subsequent_odfexport))
|
||||
|
@ -90,6 +90,7 @@ $(eval $(call gb_CppunitTest_use_components,sw_subsequent_odfimport,\
|
||||
unoxml/source/service/unoxml \
|
||||
uui/util/uui \
|
||||
$(if $(filter DESKTOP,$(BUILD_TYPE)),xmlhelp/util/ucpchelp1) \
|
||||
xmloff/util/xo \
|
||||
))
|
||||
|
||||
$(eval $(call gb_CppunitTest_use_configuration,sw_subsequent_odfimport))
|
||||
|
@ -95,6 +95,7 @@ $(eval $(call gb_CppunitTest_use_components,sw_subsequent_ooxmlexport,\
|
||||
unotools/util/utl \
|
||||
unoxml/source/service/unoxml \
|
||||
writerfilter/util/writerfilter \
|
||||
xmloff/util/xo \
|
||||
))
|
||||
|
||||
$(eval $(call gb_CppunitTest_use_configuration,sw_subsequent_ooxmlexport))
|
||||
|
@ -92,6 +92,7 @@ $(eval $(call gb_CppunitTest_use_components,sw_subsequent_ooxmlimport,\
|
||||
unotools/util/utl \
|
||||
unoxml/source/service/unoxml \
|
||||
writerfilter/util/writerfilter \
|
||||
xmloff/util/xo \
|
||||
))
|
||||
|
||||
$(eval $(call gb_CppunitTest_use_configuration,sw_subsequent_ooxmlimport))
|
||||
|
@ -92,6 +92,7 @@ $(eval $(call gb_CppunitTest_use_components,sw_subsequent_rtfexport,\
|
||||
unotools/util/utl \
|
||||
unoxml/source/service/unoxml \
|
||||
writerfilter/util/writerfilter \
|
||||
xmloff/util/xo \
|
||||
))
|
||||
|
||||
$(eval $(call gb_CppunitTest_use_configuration,sw_subsequent_rtfexport))
|
||||
|
@ -94,6 +94,7 @@ $(eval $(call gb_CppunitTest_use_components,sw_subsequent_ww8export,\
|
||||
unotools/util/utl \
|
||||
unoxml/source/service/unoxml \
|
||||
$(if $(filter DESKTOP,$(BUILD_TYPE)),xmlhelp/util/ucpchelp1) \
|
||||
xmloff/util/xo \
|
||||
))
|
||||
|
||||
$(eval $(call gb_CppunitTest_use_configuration,sw_subsequent_ww8export))
|
||||
|
Loading…
x
Reference in New Issue
Block a user