Improvement on previous commit, UCB clean up

* As UCB is only ever initialized with "Local"/"Office", remove this
  configuration vector completely.  The "create" ctor creates an instance
  internally initialized with those "Local"/"Office" keys.  Special (test) code
  can still instantiate an uninitialized one via plain createInstance.  And for
  backwards compatilibity process startup still ensures to create an initialized
  instance early, in case there is still code out there (in extensions) that
  later calls plain createInstance and expects to get the already-initialized
  (single) instance.

* XInitialization is an "implementation detail" of the UniversalContentBroker
  service, do not expose in XUniversalContentBroker.

* ucbhelper/configurationkeys.hxx is no longer needed and is removed.

* ucbhelper/contentbroker.hxx is an empty wrapper and is removed; however, that
  requires ucbhelper::Content constructors to take explicit XComponentContext
  arguments now.

* The only remaining code in ucbhelper/source/client/contentbroker.cxx is
  Android-only InitUCBHelper.  Is that relevant still?

Change-Id: I3f7bddd0456bffbcd13590c66d9011915c760f28
This commit is contained in:
Stephan Bergmann
2012-09-14 18:08:57 +02:00
parent 2e284203da
commit 9ac86f484b
196 changed files with 1159 additions and 2321 deletions

View File

@@ -60,11 +60,11 @@ import com.sun.star.script.framework.container.ParsedScriptUri;
import com.sun.star.script.framework.container.UnoPkgContainer;
import com.sun.star.ucb.Command;
import com.sun.star.ucb.XContentProvider;
import com.sun.star.ucb.UniversalContentBroker;
import com.sun.star.ucb.XContent;
import com.sun.star.ucb.XCommandProcessor;
import com.sun.star.ucb.XContentIdentifier;
import com.sun.star.ucb.XContentIdentifierFactory;
import com.sun.star.ucb.XUniversalContentBroker;
import com.sun.star.sdbc.XRow;
@@ -694,23 +694,12 @@ public abstract class ScriptProvider
XModel xModel = null;
try
{
Object[] args = new String[] {"Local", "Office" };
XUniversalContentBroker ucb = UniversalContentBroker.create( m_xContext );
Object ucb = m_xMultiComponentFactory.createInstanceWithArgumentsAndContext( "com.sun.star.ucb.UniversalContentBroker", args, m_xContext );
XContentIdentifier xCntId = ucb.createContentIdentifier( docUrl );
XContentIdentifierFactory xFac = UnoRuntime.queryInterface( XContentIdentifierFactory.class,
ucb );
XContentIdentifier xCntId = xFac.createContentIdentifier( docUrl );
XContentProvider xCntAccess = UnoRuntime.queryInterface( XContentProvider.class,
ucb );
XContent xCnt = xCntAccess.queryContent( xCntId );
XContent xCnt = ucb.queryContent( xCntId );
XCommandProcessor xCmd = UnoRuntime.queryInterface( XCommandProcessor.class, xCnt );