24#include <com/sun/star/frame/ModuleManager.hpp>
25#include <com/sun/star/frame/XFrame.hpp>
26#include <com/sun/star/frame/XModel.hpp>
27#include <com/sun/star/lang/XInitialization.hpp>
28#include <com/sun/star/ui/theModuleUIConfigurationManagerSupplier.hpp>
29#include <com/sun/star/ui/XUIConfigurationManagerSupplier.hpp>
30#include <com/sun/star/uno/XComponentContext.hpp>
56 const OUString& ResourceURL,
68 ,
const css::uno::Reference< css::uno::XComponentContext >& _rxContext)
70 sal_Int32 nConfigPropertyIndex( Args.getLength() );
71 sal_Int32 nURLPropertyIndex( Args.getLength() );
74 OUString aResourceURL( ResourceURL );
76 for ( sal_Int32
n = 0;
n < Args.getLength();
n++ )
78 if ( Args[
n].
Name ==
"ConfigurationSource" )
80 nConfigPropertyIndex =
n;
81 Args[
n].Value >>= xCfgMgr;
83 else if ( Args[
n].
Name ==
"ResourceURL" )
85 nURLPropertyIndex =
n;
86 Args[
n].Value >>= aResourceURL;
88 else if ( Args[
n].
Name ==
"Frame" )
92 throw IllegalArgumentException();
95 if (
xFrame.is() && !xCfgMgr.is() )
97 bool bHasSettings(
false );
107 if ( xUIConfigurationManagerSupplier.is() )
109 xCfgMgr = xUIConfigurationManagerSupplier->getUIConfigurationManager();
110 bHasSettings = xCfgMgr->hasSettings( aResourceURL );
117 ModuleManager::create( _rxContext );
119 if ( !aModuleIdentifier.isEmpty() )
122 theModuleUIConfigurationManagerSupplier::get( _rxContext );
123 xCfgMgr = xModuleCfgSupplier->getUIConfigurationManager( aModuleIdentifier );
128 sal_Int32 nSeqLength( Args.getLength() );
129 if ( Args.getLength() == nConfigPropertyIndex )
131 if ( Args.getLength() == nURLPropertyIndex )
133 if ( nConfigPropertyIndex == nURLPropertyIndex )
137 auto aPropSeqRange = asNonConstRange(aPropSeq);
138 for ( sal_Int32
n = 0;
n < aPropSeq.getLength();
n++ )
140 PropertyValue aPropValue;
141 if (
n == nURLPropertyIndex )
143 aPropValue.Name =
"ResourceURL";
144 aPropValue.Value <<= aResourceURL;
146 else if (
n == nConfigPropertyIndex )
148 aPropValue.Name =
"ConfigurationSource";
149 aPropValue.Value <<= xCfgMgr;
152 aPropValue = Args[
n];
154 aPropSeqRange[
n] <<= aPropValue;
159 xInit->initialize( aPropSeq );
164extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
166 css::uno::XComponentContext *context,
167 css::uno::Sequence<css::uno::Any>
const &)
css::uno::Reference< css::uno::XComponentContext > m_xContext
Reference< XController > xController
Reference< XFrame > xFrame
Reference< XModel > xModel