Kaydet (Commit) 5a72bbd4 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

allow also to use non-frame modules for sidebar

One more step away from using the frame as key and moving to the
controller.

Change-Id: I438b7eea2161d49a6f2cbf649bf01b8a2e233ebd
üst d976efde
......@@ -427,6 +427,7 @@ Reference< XUIElement > SAL_CALL UIElementFactoryManager::createUIElement(
throw ( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException, std::exception )
{
Reference< XFrame > xFrame;
OUString aModuleId;
{ // SAFE
osl::MutexGuard g(rBHelper.rMutex);
......@@ -443,6 +444,8 @@ throw ( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::l
{
if ( Args[i].Name == "Frame")
Args[i].Value >>= xFrame;
if (Args[i].Name == "Module")
Args[i].Value >>= aModuleId;
}
} // SAFE
......@@ -451,8 +454,7 @@ throw ( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::l
// Determine the module identifier
try
{
OUString aModuleId;
if ( xFrame.is() && xManager.is() )
if ( aModuleId.isEmpty() && xFrame.is() && xManager.is() )
aModuleId = xManager->identify( Reference<XInterface>( xFrame, UNO_QUERY ) );
Reference< XUIElementFactory > xUIElementFactory = getFactory( ResourceURL, aModuleId );
......
......@@ -807,6 +807,16 @@ Reference<ui::XUIElement> SidebarController::CreateUIElement (
Reference<rendering::XSpriteCanvas> xCanvas (VCLUnoHelper::GetWindow(rxWindow)->GetSpriteCanvas());
aCreationArguments.put("Canvas", makeAny(xCanvas));
}
if (mxCurrentController.is())
{
OUString aModule = Tools::GetModuleName(mxCurrentController);
if (!aModule.isEmpty())
{
aCreationArguments.put("Module", makeAny(aModule));
}
}
aCreationArguments.put("ApplicationName", makeAny(rContext.msApplication));
aCreationArguments.put("ContextName", makeAny(rContext.msContext));
......
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