Kaydet (Commit) cb255075 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Drop lazywrite property, which is silently ignored by configmgr anyway

...at least ever since the "new" configmgr reimplementation,
6b849a6a "#i101955# initial work in progress of
a configmgr reimplementation (for now in an extra module 'configmgr2')" et al

Change-Id: I43430d991647fb2e26762463d51175247db0604b
üst e808bbe1
......@@ -53,12 +53,6 @@ css::uno::Reference< css::uno::XInterface > ConfigurationHelper::openConfig(cons
lParams.push_back(css::uno::Any(aParam));
}
// enable lazy writing
bool bLazy(eMode & EConfigurationModes::LazyWrite);
aParam.Name = "lazywrite";
aParam.Value <<= bLazy;
lParams.push_back(css::uno::Any(aParam));
// open it
css::uno::Reference< css::uno::XInterface > xCFG;
......
......@@ -200,8 +200,7 @@ void GlobalSettings_Access::impl_initConfigAccess()
uno::Sequence<uno::Any> aArgs(comphelper::InitAnyPropertySequence(
{
{"nodepath", uno::Any(OUString("/org.openoffice.Office.UI.GlobalSettings/Toolbars"))},
{"lazywrite", uno::Any(true)}
{"nodepath", uno::Any(OUString("/org.openoffice.Office.UI.GlobalSettings/Toolbars"))}
}));
m_xConfigAccess.set(xConfigProvider->createInstanceWithArguments(
SERVICENAME_CFGREADACCESS, aArgs ),
......
......@@ -1214,8 +1214,7 @@ void ConfigurationAccess_WindowState::impl_initializeConfigAccess()
{
Sequence<Any> aArgs(comphelper::InitAnyPropertySequence(
{
{"nodepath", Any(m_aConfigWindowAccess)},
{"lazywrite", Any(true)}
{"nodepath", Any(m_aConfigWindowAccess)}
}));
m_xConfigAccess.set( m_xConfigProvider->createInstanceWithArguments(
"com.sun.star.configuration.ConfigurationUpdateAccess", aArgs ), UNO_QUERY );
......
......@@ -47,9 +47,7 @@ namespace comphelper
/// configuration will be opened readonly
ReadOnly = 1,
/// all localized nodes will be interpreted as XInterface instead of interpreting it as atomic value nodes
AllLocales = 2,
/// enable lazy writing
LazyWrite = 4
AllLocales = 2
};
......
......@@ -244,8 +244,7 @@ namespace utl
const css::uno::Reference< css::lang::XMultiServiceFactory >& _rxConfProvider,
const OUString& _rPath,
sal_Int32 _nDepth,
CREATION_MODE _eMode,
bool _bLazyWrite = true
CREATION_MODE _eMode
);
/** open a new top-level configuration node<p/>
......@@ -261,7 +260,7 @@ namespace utl
@param _eMode specifies which privileges should be applied when retrieving the node
*/
static OConfigurationTreeRoot createWithComponentContext(const css::uno::Reference< css::uno::XComponentContext >& _rxContext,
const OUString& _rPath, sal_Int32 _nDepth = -1, CREATION_MODE _eMode = CM_UPDATABLE, bool _bLazyWrite = true);
const OUString& _rPath, sal_Int32 _nDepth = -1, CREATION_MODE _eMode = CM_UPDATABLE);
/** tolerant version of the <member>createWithServiceFactory</member>
......
......@@ -83,8 +83,7 @@ CacheConfiguration::CacheConfiguration()
Sequence<Any> aCreationArguments(comphelper::InitAnyPropertySequence(
{
{"nodepath", makeAny(sPathToImpressConfigurationRoot)},
{"depth", makeAny((sal_Int32)-1)},
{"lazywrite", makeAny(true)}
{"depth", makeAny((sal_Int32)-1)}
}));
Reference<XInterface> xRoot (xProvider->createInstanceWithArguments(
......
......@@ -63,8 +63,7 @@ void ConfigurationAccess::Initialize (
Sequence<Any> aCreationArguments(comphelper::InitAnyPropertySequence(
{
{"nodepath", makeAny(rsRootName)},
{"depth", makeAny((sal_Int32)-1)},
{"lazywrite", makeAny(true)}
{"depth", makeAny((sal_Int32)-1)}
}));
OUString sAccessService;
......
......@@ -292,8 +292,7 @@ Reference< XInterface > ConfigurationAccess::OpenConfiguration( bool bReadOnly )
Reference< lang::XMultiServiceFactory > xProvider = configuration::theDefaultProvider::get( mxContext );
uno::Sequence<uno::Any> aCreationArguments(comphelper::InitAnyPropertySequence(
{
{"nodepath", uno::Any(GetPathToConfigurationRoot())},
{"lazywrite", uno::Any(true)}
{"nodepath", uno::Any(GetPathToConfigurationRoot())}
}));
OUString sAccessService;
if ( bReadOnly )
......
......@@ -49,8 +49,7 @@ PresenterConfigurationAccess::PresenterConfigurationAccess (
uno::Sequence<uno::Any> aCreationArguments(comphelper::InitAnyPropertySequence(
{
{"nodepath", uno::Any(rsRootName)},
{"depth", uno::Any((sal_Int32)-1)},
{"lazywrite", uno::Any(true)}
{"depth", uno::Any((sal_Int32)-1)}
}));
OUString sAccessService;
......
......@@ -103,8 +103,6 @@ OUString makeHierarchalNameSegment( const OUString & rIn )
// describe path of cfg entry
#define CFGPROPERTY_NODEPATH "nodepath"
// true->async. update; false->sync. update
#define CFGPROPERTY_LAZYWRITE "lazywrite"
// PropertySetMap_Impl.
typedef std::unordered_map
......@@ -998,8 +996,7 @@ Reference< XInterface > PropertySetRegistry::getConfigWriteAccess(
{
Sequence<Any> aArguments(comphelper::InitAnyPropertySequence(
{
{CFGPROPERTY_NODEPATH, Any(OUString( STORE_CONTENTPROPERTIES_KEY ))},
{CFGPROPERTY_LAZYWRITE, Any(true)}
{CFGPROPERTY_NODEPATH, Any(OUString( STORE_CONTENTPROPERTIES_KEY ))}
}));
m_pImpl->m_bTriedToGetRootWriteAccess = true;
......
......@@ -44,8 +44,6 @@ using namespace hierarchy_ucp;
// describe path of cfg entry
#define CFGPROPERTY_NODEPATH "nodepath"
// true->async. update; false->sync. update
#define CFGPROPERTY_LAZYWRITE "lazywrite"
#define READ_SERVICE_NAME "com.sun.star.ucb.HierarchyDataReadAccess"
#define READWRITE_SERVICE_NAME "com.sun.star.ucb.HierarchyDataReadWriteAccess"
......@@ -355,8 +353,6 @@ HierarchyDataSource::createInstanceWithArguments(
uno::Sequence< uno::Any > aNewArgs( Arguments );
bool bHasLazyWriteProp = bReadOnly; // property must be added only if
// a writable view is requested.
if ( bCheckArgs )
{
// Check arguments.
......@@ -389,8 +385,7 @@ HierarchyDataSource::createInstanceWithArguments(
// Set new path in arguments.
aNewArgs[ n ] <<= aProp;
if ( bHasLazyWriteProp )
break;
break;
}
else
{
......@@ -399,22 +394,6 @@ HierarchyDataSource::createInstanceWithArguments(
return uno::Reference< uno::XInterface >();
}
}
else if ( aProp.Name == CFGPROPERTY_LAZYWRITE )
{
if ( aProp.Value.getValueType() == cppu::UnoType<bool>::get() )
{
bHasLazyWriteProp = true;
if ( bHasNodePath )
break;
}
else
{
OSL_FAIL( "HierarchyDataSource::createInstanceWithArguments - "
"Invalid type for property 'lazywrite'!" );
return uno::Reference< uno::XInterface >();
}
}
}
}
......@@ -443,18 +422,6 @@ HierarchyDataSource::createInstanceWithArguments(
}
else
{
// Append 'lazywrite' property value, if not already present.
if ( !bHasLazyWriteProp )
{
sal_Int32 nLen = aNewArgs.getLength();
aNewArgs.realloc( nLen + 1 );
beans::PropertyValue aProp;
aProp.Name = CFGPROPERTY_LAZYWRITE;
aProp.Value <<= true;
aNewArgs[ nLen ] <<= aProp;
}
// Create configuration read-write access object.
xConfigAccess = xProv->createInstanceWithArguments(
"com.sun.star.configuration.ConfigurationUpdateAccess",
......
......@@ -474,14 +474,13 @@ namespace utl
}
Reference< XInterface > lcl_createConfigurationRoot( const Reference< XMultiServiceFactory >& i_rxConfigProvider,
const OUString& i_rNodePath, const bool i_bUpdatable, const sal_Int32 i_nDepth, const bool i_bLazyWrite )
const OUString& i_rNodePath, const bool i_bUpdatable, const sal_Int32 i_nDepth )
{
ENSURE_OR_RETURN( i_rxConfigProvider.is(), "invalid provider", nullptr );
try
{
::comphelper::NamedValueCollection aArgs;
aArgs.put( "nodepath", i_rNodePath );
aArgs.put( "lazywrite", i_bLazyWrite );
aArgs.put( "depth", i_nDepth );
OUString sAccessService( i_bUpdatable ?
......@@ -510,7 +509,7 @@ namespace utl
OConfigurationTreeRoot::OConfigurationTreeRoot( const Reference<XComponentContext> & i_rContext, const OUString& i_rNodePath, const bool i_bUpdatable )
:OConfigurationNode( lcl_createConfigurationRoot( lcl_getConfigProvider( i_rContext ),
i_rNodePath, i_bUpdatable, -1, false ).get() )
i_rNodePath, i_bUpdatable, -1 ).get() )
,m_xCommitter()
{
if ( i_bUpdatable )
......@@ -547,18 +546,18 @@ namespace utl
return false;
}
OConfigurationTreeRoot OConfigurationTreeRoot::createWithProvider(const Reference< XMultiServiceFactory >& _rxConfProvider, const OUString& _rPath, sal_Int32 _nDepth, CREATION_MODE _eMode, bool _bLazyWrite)
OConfigurationTreeRoot OConfigurationTreeRoot::createWithProvider(const Reference< XMultiServiceFactory >& _rxConfProvider, const OUString& _rPath, sal_Int32 _nDepth, CREATION_MODE _eMode)
{
Reference< XInterface > xRoot( lcl_createConfigurationRoot(
_rxConfProvider, _rPath, _eMode != CM_READONLY, _nDepth, _bLazyWrite ) );
_rxConfProvider, _rPath, _eMode != CM_READONLY, _nDepth ) );
if ( xRoot.is() )
return OConfigurationTreeRoot( xRoot );
return OConfigurationTreeRoot();
}
OConfigurationTreeRoot OConfigurationTreeRoot::createWithComponentContext( const Reference< XComponentContext >& _rxContext, const OUString& _rPath, sal_Int32 _nDepth, CREATION_MODE _eMode, bool _bLazyWrite )
OConfigurationTreeRoot OConfigurationTreeRoot::createWithComponentContext( const Reference< XComponentContext >& _rxContext, const OUString& _rPath, sal_Int32 _nDepth, CREATION_MODE _eMode )
{
return createWithProvider( lcl_getConfigProvider( _rxContext ), _rPath, _nDepth, _eMode, _bLazyWrite );
return createWithProvider( lcl_getConfigProvider( _rxContext ), _rPath, _nDepth, _eMode );
}
OConfigurationTreeRoot OConfigurationTreeRoot::tryCreateWithComponentContext( const Reference< XComponentContext >& rxContext,
......
......@@ -115,14 +115,8 @@ void FilterConfigItem::ImpInitTree( const OUString& rSubTree )
aPathArgument.Name = "nodepath";
aPathArgument.Value <<= sTree;
// creation arguments: commit mode
PropertyValue aModeArgument;
aModeArgument.Name = "lazywrite";
aModeArgument.Value <<= true;
Sequence< Any > aArguments( 2 );
Sequence< Any > aArguments( 1 );
aArguments[ 0 ] <<= aPathArgument;
aArguments[ 1 ] <<= aModeArgument;
try
{
......
......@@ -48,7 +48,7 @@ public abstract class Configuration
final String sView = updateable ? "com.sun.star.configuration.ConfigurationUpdateAccess" : "com.sun.star.configuration.ConfigurationAccess";
Object args[] = new Object[updateable ? 2 : 1];
Object args[] = new Object[1];
PropertyValue aPathArgument = new PropertyValue();
aPathArgument.Name = "nodepath";
......@@ -56,16 +56,6 @@ public abstract class Configuration
args[0] = aPathArgument;
if (updateable)
{
PropertyValue aModeArgument = new PropertyValue();
aModeArgument.Name = "lazywrite";
aModeArgument.Value = Boolean.FALSE;
args[1] = aModeArgument;
}
return confMsf.createInstanceWithArguments(sView, args);
}
......
......@@ -33,15 +33,8 @@ class Configuration(object):
aPathArgument.Value = sPath
args.append(aPathArgument)
if updateable:
sView = "com.sun.star.configuration.ConfigurationUpdateAccess"
aModeArgument = uno.createUnoStruct(
'com.sun.star.beans.PropertyValue')
aModeArgument.Name = "lazywrite"
aModeArgument.Value = False
args.append(aModeArgument)
else:
sView = "com.sun.star.configuration.ConfigurationAccess"
sView = "com.sun.star.configuration.ConfigurationAccess"
return oConfigProvider.createInstanceWithArguments(sView, tuple(args))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment