more reverts, first cut at making sidebar optional.
diff --git a/sd/source/ui/app/sddll1.cxx b/sd/source/ui/app/sddll1.cxx
index 09a7346..100f527 100644
--- a/sd/source/ui/app/sddll1.cxx
+++ b/sd/source/ui/app/sddll1.cxx
@@ -37,6 +37,7 @@
#include "DrawDocShell.hxx"
#include "GraphicDocShell.hxx"
#include "SlideSorterViewShell.hxx"
#include "taskpane/ToolPanelViewShell.hxx"
#include "FactoryIds.hxx"
#include "sdmod.hxx"
#include "app.hrc"
@@ -114,6 +115,11 @@ void SdDLL::RegisterInterfaces()

    // View shells for the side panes.
    ::sd::slidesorter::SlideSorterViewShell::RegisterInterface (pMod);

    ::sd::toolpanel::ToolPanelViewShell::RegisterInterface(pMod);
    // Tell the tool panel view shell to register the interfaces of its
    // controls.
    ::sd::toolpanel::ToolPanelViewShell::RegisterControls();
}

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/app/sddll2.cxx b/sd/source/ui/app/sddll2.cxx
index 3088415..d28257d 100644
--- a/sd/source/ui/app/sddll2.cxx
+++ b/sd/source/ui/app/sddll2.cxx
@@ -126,6 +126,7 @@ void SdDLL::RegisterControllers()
    ::avmedia::MediaPlayer::RegisterChildWindow(0, pMod);
    ::sd::LeftPaneImpressChildWindow::RegisterChildWindow(0, pMod);
    ::sd::LeftPaneDrawChildWindow::RegisterChildWindow(0, pMod);
    ::sd::ToolPanelChildWindow::RegisterChildWindow(0, pMod);
    ::sfx2::sidebar::SidebarChildWindow::RegisterChildWindow(0, pMod);

    SvxFillToolBoxControl::RegisterControl(0, pMod);
diff --git a/sd/source/ui/dlg/PaneShells.cxx b/sd/source/ui/dlg/PaneShells.cxx
index 023dbcc..d3338ab 100644
--- a/sd/source/ui/dlg/PaneShells.cxx
+++ b/sd/source/ui/dlg/PaneShells.cxx
@@ -92,6 +92,29 @@ LeftDrawPaneShell::~LeftDrawPaneShell (void)
{
}

//===== ToolPanelPaneShell ========================================================

SFX_SLOTMAP( ToolPanelPaneShell )
{
    { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};

SFX_IMPL_INTERFACE( ToolPanelPaneShell, SfxShell, SdResId( STR_TOOL_PANEL_SHELL ) )
{
    SFX_CHILDWINDOW_REGISTRATION( ::sd::ToolPanelChildWindow::GetChildWindowId() );
}

TYPEINIT1( ToolPanelPaneShell, SfxShell );

ToolPanelPaneShell::ToolPanelPaneShell()
    :SfxShell()
{
    SetName(OUString("ToolPanel"));
}

ToolPanelPaneShell::~ToolPanelPaneShell(void)
{
}

} // end of namespace ::sd

diff --git a/sd/source/ui/framework/factories/BasicPaneFactory.cxx b/sd/source/ui/framework/factories/BasicPaneFactory.cxx
index 5c5a043..c91265f 100644
--- a/sd/source/ui/framework/factories/BasicPaneFactory.cxx
+++ b/sd/source/ui/framework/factories/BasicPaneFactory.cxx
@@ -45,7 +45,8 @@ namespace {
        CenterPaneId,
        FullScreenPaneId,
        LeftImpressPaneId,
        LeftDrawPaneId
        LeftDrawPaneId,
        RightPaneId
    };

    static const sal_Int32 gnConfigurationUpdateStartEvent(0);
@@ -219,6 +220,11 @@ void SAL_CALL BasicPaneFactory::initialize (const Sequence<Any>& aArguments)
                aDescriptor.mePaneId = LeftDrawPaneId;
                mpPaneContainer->push_back(aDescriptor);
                xCC->addResourceFactory(aDescriptor.msPaneURL, this);

                aDescriptor.msPaneURL = FrameworkHelper::msRightPaneURL;
                aDescriptor.mePaneId = RightPaneId;
                mpPaneContainer->push_back(aDescriptor);
                xCC->addResourceFactory(aDescriptor.msPaneURL, this);
            }

            // Register as configuration change listener.
@@ -287,6 +293,7 @@ Reference<XResource> SAL_CALL BasicPaneFactory::createResource (

                case LeftImpressPaneId:
                case LeftDrawPaneId:
                case RightPaneId:
                    xPane = CreateChildWindowPane(
                        rxPaneId,
                        *iDescriptor);
@@ -472,6 +479,11 @@ Reference<XResource> BasicPaneFactory::CreateChildWindowPane (
                nChildWindowId = ::sd::LeftPaneDrawChildWindow::GetChildWindowId();
                break;

            case RightPaneId:
                pShell.reset(new ToolPanelPaneShell());
                nChildWindowId = ::sd::ToolPanelChildWindow::GetChildWindowId();
                break;

            default:
                break;
        }
diff --git a/sd/source/ui/framework/factories/BasicPaneFactory.hxx b/sd/source/ui/framework/factories/BasicPaneFactory.hxx
index de9c81b..472609a 100644
--- a/sd/source/ui/framework/factories/BasicPaneFactory.hxx
+++ b/sd/source/ui/framework/factories/BasicPaneFactory.hxx
@@ -59,6 +59,7 @@ namespace sd { namespace framework {
        private:resource/pane/FullScreenPane
        private:resource/pane/LeftImpressPane
        private:resource/pane/LeftDrawPane
        private:resource/pane/RightPane
    There are two left panes because this is (seems to be) the only way to
    show different titles for the left pane in Draw and Impress.
*/
diff --git a/sd/source/ui/framework/factories/BasicViewFactory.cxx b/sd/source/ui/framework/factories/BasicViewFactory.cxx
index 78d7988..08b903b 100644
--- a/sd/source/ui/framework/factories/BasicViewFactory.cxx
+++ b/sd/source/ui/framework/factories/BasicViewFactory.cxx
@@ -33,6 +33,7 @@
#include "DrawViewShell.hxx"
#include "GraphicViewShell.hxx"
#include "OutlineViewShell.hxx"
#include "taskpane/ToolPanelViewShell.hxx"
#include "PresentationViewShell.hxx"
#include "SlideSorterViewShell.hxx"
#include "FrameView.hxx"
@@ -318,6 +319,7 @@ void SAL_CALL BasicViewFactory::initialize (const Sequence<Any>& aArguments)
            mxConfigurationController->addResourceFactory(FrameworkHelper::msNotesViewURL, this);
            mxConfigurationController->addResourceFactory(FrameworkHelper::msHandoutViewURL, this);
            mxConfigurationController->addResourceFactory(FrameworkHelper::msPresentationViewURL, this);
            mxConfigurationController->addResourceFactory(FrameworkHelper::msTaskPaneURL, this);
            mxConfigurationController->addResourceFactory(FrameworkHelper::msSlideSorterURL, this);
        }
        catch (RuntimeException&)
@@ -456,6 +458,15 @@ void SAL_CALL BasicViewFactory::initialize (const Sequence<Any>& aArguments)
            pFrameView,
            bIsCenterPane);
    }
    else if (rsViewURL.equals(FrameworkHelper::msTaskPaneURL))
    {
        pViewShell.reset(
            new ::sd::toolpanel::ToolPanelViewShell(
                &rFrame,
                *mpBase,
                &rWindow,
                pFrameView));
    }

    return pViewShell;
}
@@ -522,6 +533,8 @@ bool BasicViewFactory::IsCacheable (const ::boost::shared_ptr<ViewDescriptor>& r
                FrameworkHelper::msSlideSorterURL, FrameworkHelper::msLeftDrawPaneURL));
            maCacheableResources.push_back(pHelper->CreateResourceId(
                FrameworkHelper::msSlideSorterURL, FrameworkHelper::msLeftImpressPaneURL));
            maCacheableResources.push_back(pHelper->CreateResourceId(
                FrameworkHelper::msTaskPaneURL, FrameworkHelper::msRightPaneURL));
        }

        ::std::vector<Reference<XResourceId> >::const_iterator iId;
diff --git a/sd/source/ui/framework/module/ToolPanelModule.cxx b/sd/source/ui/framework/module/ToolPanelModule.cxx
index c607fbd..273a22a 100644
--- a/sd/source/ui/framework/module/ToolPanelModule.cxx
+++ b/sd/source/ui/framework/module/ToolPanelModule.cxx
@@ -42,9 +42,10 @@ namespace sd { namespace framework {

ToolPanelModule::ToolPanelModule (
    const Reference<frame::XController>& rxController,
    const OUString& rsSidebarPaneURL)
    const OUString& rsViewURL,
    const OUString& rsPaneURL)
    : ResourceManager(rxController,
        FrameworkHelper::CreateResourceId(FrameworkHelper::msSidebarViewURL, rsSidebarPaneURL)),
        FrameworkHelper::CreateResourceId(rsViewURL, rsPaneURL)),
      mxControllerManager(rxController,UNO_QUERY)
{
    if (mxConfigurationController.is())
diff --git a/sd/source/ui/framework/module/ToolPanelModule.hxx b/sd/source/ui/framework/module/ToolPanelModule.hxx
index ce28ef8..112ffbf 100644
--- a/sd/source/ui/framework/module/ToolPanelModule.hxx
+++ b/sd/source/ui/framework/module/ToolPanelModule.hxx
@@ -35,7 +35,7 @@ class ToolPanelModule
public:
    ToolPanelModule (
        const css::uno::Reference<css::frame::XController>& rxController,
        const OUString& rsRightPaneURL);
        const OUString& rsViewURL, const OUString& rsPaneURL);
    virtual ~ToolPanelModule (void);

    virtual void SaveResourceState (void);