Author: af
Date: Tue Feb 19 13:29:47 2013
New Revision: 1447713

URL: http://svn.apache.org/r1447713
Log:
i121420: Cleanup.

Added:
    openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/IDisposable.hxx
    
openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/ILayoutableWindow.hxx
    
openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/ISidebarReceiver.hxx
    
openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/SidebarShellManager.cxx
    
openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/SidebarShellManager.hxx
Removed:
    openoffice/branches/sidebar/main/sd/source/ui/sidebar/IDisposable.hxx
    openoffice/branches/sidebar/main/sd/source/ui/sidebar/ILayoutableWindow.hxx
    openoffice/branches/sidebar/main/sd/source/ui/sidebar/ISidebarReceiver.hxx
    
openoffice/branches/sidebar/main/sd/source/ui/sidebar/SidebarShellManager.cxx
    
openoffice/branches/sidebar/main/sd/source/ui/sidebar/SidebarShellManager.hxx
    openoffice/branches/sidebar/main/sfx2/source/sidebar/ToolBoxBackground.hxx_
Modified:
    
openoffice/branches/sidebar/main/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
    openoffice/branches/sidebar/main/sd/source/ui/sidebar/SidebarViewShell.cxx
    openoffice/branches/sidebar/main/sd/source/ui/sidebar/UIElementWrapper.cxx
    openoffice/branches/sidebar/main/sd/source/ui/sidebar/makefile.mk
    
openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/AllMasterPagesSelector.cxx
    
openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/CurrentMasterPagesSelector.cxx
    openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/LayoutMenu.cxx
    openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/LayoutMenu.hxx
    
openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/MasterPagesSelector.cxx
    
openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/MasterPagesSelector.hxx
    openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/PanelBase.hxx
    
openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/RecentMasterPagesSelector.cxx
    openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/makefile.mk
    openoffice/branches/sidebar/main/sfx2/source/control/bindings.cxx
    openoffice/branches/sidebar/main/svx/source/sidebar/PanelFactory.cxx

Modified: 
openoffice/branches/sidebar/main/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
URL: 
http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu?rev=1447713&r1=1447712&r2=1447713&view=diff
==============================================================================
Binary files - no diff available.

Modified: 
openoffice/branches/sidebar/main/sd/source/ui/sidebar/SidebarViewShell.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sd/source/ui/sidebar/SidebarViewShell.cxx?rev=1447713&r1=1447712&r2=1447713&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sd/source/ui/sidebar/SidebarViewShell.cxx 
(original)
+++ openoffice/branches/sidebar/main/sd/source/ui/sidebar/SidebarViewShell.cxx 
Tue Feb 19 13:29:47 2013
@@ -23,7 +23,7 @@
 
 #include "SidebarViewShell.hxx"
 
-#include "SidebarShellManager.hxx"
+#include "panels/SidebarShellManager.hxx"
 #include "SidebarFocusManager.hxx"
 #include "taskpane/SlideSorterCacheDisplay.hxx"
 #include "panels/LayoutMenu.hxx"

Modified: 
openoffice/branches/sidebar/main/sd/source/ui/sidebar/UIElementWrapper.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sd/source/ui/sidebar/UIElementWrapper.cxx?rev=1447713&r1=1447712&r2=1447713&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sd/source/ui/sidebar/UIElementWrapper.cxx 
(original)
+++ openoffice/branches/sidebar/main/sd/source/ui/sidebar/UIElementWrapper.cxx 
Tue Feb 19 13:29:47 2013
@@ -25,7 +25,7 @@
 
 #include "framework/FrameworkHelper.hxx"
 #include "framework/TaskPanelResource.hxx"
-#include "ILayoutableWindow.hxx"
+#include "panels/ILayoutableWindow.hxx"
 #include "panels/LayoutMenu.hxx"
 #include "DrawController.hxx"
 #include <comphelper/make_shared_from_uno.hxx>

Modified: openoffice/branches/sidebar/main/sd/source/ui/sidebar/makefile.mk
URL: 
http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sd/source/ui/sidebar/makefile.mk?rev=1447713&r1=1447712&r2=1447713&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sd/source/ui/sidebar/makefile.mk (original)
+++ openoffice/branches/sidebar/main/sd/source/ui/sidebar/makefile.mk Tue Feb 
19 13:29:47 2013
@@ -41,13 +41,8 @@ PRJINC=..
 SLOFILES =                                                             \
        $(SLO)$/SidebarFactory.obj                              \
        $(SLO)$/UIElementWrapper.obj                    \
-       $(SLO)$/SidebarShellManager.obj                 \
        $(SLO)$/SidebarViewShell.obj                    \
 
-EXCEPTIONSFILES= 
-#SRS2NAME = sidebar
-#SRC2FILES = SlsChildWindow.src
-
 # --- Tagets -------------------------------------------------------
 
 .INCLUDE :  target.mk

Modified: 
openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/AllMasterPagesSelector.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/AllMasterPagesSelector.cxx?rev=1447713&r1=1447712&r2=1447713&view=diff
==============================================================================
--- 
openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/AllMasterPagesSelector.cxx
 (original)
+++ 
openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/AllMasterPagesSelector.cxx
 Tue Feb 19 13:29:47 2013
@@ -24,7 +24,7 @@
 #include "AllMasterPagesSelector.hxx"
 #include "PreviewValueSet.hxx"
 #include "ViewShellBase.hxx"
-#include "../SidebarShellManager.hxx"
+#include "SidebarShellManager.hxx"
 #include "MasterPageContainer.hxx"
 #include "MasterPageDescriptor.hxx"
 #include "app.hrc"

Modified: 
openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/CurrentMasterPagesSelector.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/CurrentMasterPagesSelector.cxx?rev=1447713&r1=1447712&r2=1447713&view=diff
==============================================================================
--- 
openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/CurrentMasterPagesSelector.cxx
 (original)
+++ 
openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/CurrentMasterPagesSelector.cxx
 Tue Feb 19 13:29:47 2013
@@ -24,7 +24,7 @@
 #include "CurrentMasterPagesSelector.hxx"
 #include "PreviewValueSet.hxx"
 #include "ViewShellBase.hxx"
-#include "../SidebarShellManager.hxx"
+#include "SidebarShellManager.hxx"
 #include "DrawViewShell.hxx"
 #include "drawdoc.hxx"
 #include "sdpage.hxx"

Added: 
openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/IDisposable.hxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/IDisposable.hxx?rev=1447713&view=auto
==============================================================================
--- 
openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/IDisposable.hxx 
(added)
+++ 
openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/IDisposable.hxx 
Tue Feb 19 13:29:47 2013
@@ -0,0 +1,44 @@
+/**************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+
+
+
+#ifndef SD_SIDEBAR_DISPOSABLE_INTERFACE_HXX
+#define SD_SIDEBAR_DISPOSABLE_INTERFACE_HXX
+
+#include <tools/gen.hxx>
+#include <sal/types.h>
+
+class Window;
+
+namespace sd { namespace sidebar {
+
+
+class IDisposable
+{
+public:
+    virtual void Dispose (void) = 0;
+};
+
+
+} } // end of namespace ::sd::sidebar
+
+#endif

Added: 
openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/ILayoutableWindow.hxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/ILayoutableWindow.hxx?rev=1447713&view=auto
==============================================================================
--- 
openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/ILayoutableWindow.hxx
 (added)
+++ 
openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/ILayoutableWindow.hxx
 Tue Feb 19 13:29:47 2013
@@ -0,0 +1,49 @@
+/**************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+
+
+
+#ifndef SD_SIDEBAR_LAYOUTABLE_WINDOW_INTERFACE_HXX
+#define SD_SIDEBAR_LAYOUTABLE_WINDOW_INTERFACE_HXX
+
+#include <tools/gen.hxx>
+#include <sal/types.h>
+
+#include <com/sun/star/ui/LayoutSize.hpp>
+
+class Window;
+
+namespace sd { namespace sidebar {
+
+
+class ILayoutableWindow
+{
+public:
+    /** Return the preferred height with the constraint, that the
+        window will be set to the given width.
+    */
+    virtual ::com::sun::star::ui::LayoutSize GetHeightForWidth (const 
sal_Int32 nWidth) = 0;
+};
+
+
+} } // end of namespace ::sd::sidebar
+
+#endif

Added: 
openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/ISidebarReceiver.hxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/ISidebarReceiver.hxx?rev=1447713&view=auto
==============================================================================
--- 
openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/ISidebarReceiver.hxx
 (added)
+++ 
openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/ISidebarReceiver.hxx
 Tue Feb 19 13:29:47 2013
@@ -0,0 +1,40 @@
+/**************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+
+#ifndef SD_SIDEBAR_RECEIVER_INTERFACE_HXX
+#define SD_SIDEBAR_RECEIVER_INTERFACE_HXX
+
+#include <com/sun/star/ui/XSidebar.hpp>
+
+namespace sd { namespace sidebar {
+
+
+class ISidebarReceiver
+{
+public:
+    virtual void SetSidebar (const ::com::sun::star::uno::Reference<
+        ::com::sun::star::ui::XSidebar>& rxSidebar) = 0;
+};
+
+
+} } // end of namespace ::sd::sidebar
+
+#endif

Modified: 
openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/LayoutMenu.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/LayoutMenu.cxx?rev=1447713&r1=1447712&r2=1447713&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/LayoutMenu.cxx 
(original)
+++ openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/LayoutMenu.cxx 
Tue Feb 19 13:29:47 2013
@@ -23,7 +23,7 @@
 
 #include "LayoutMenu.hxx"
 
-#include "../SidebarShellManager.hxx"
+#include "SidebarShellManager.hxx"
 #include "app.hrc"
 #include "controller/SlideSorterController.hxx"
 #include "controller/SlsPageSelector.hxx"

Modified: 
openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/LayoutMenu.hxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/LayoutMenu.hxx?rev=1447713&r1=1447712&r2=1447713&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/LayoutMenu.hxx 
(original)
+++ openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/LayoutMenu.hxx 
Tue Feb 19 13:29:47 2013
@@ -24,9 +24,9 @@
 #ifndef SD_SIDEBAR_LAYOUT_MENU_HXX
 #define SD_SIDEBAR_LAYOUT_MENU_HXX
 
-#include "../IDisposable.hxx"
-#include "../ILayoutableWindow.hxx"
-#include "../ISidebarReceiver.hxx"
+#include "IDisposable.hxx"
+#include "ILayoutableWindow.hxx"
+#include "ISidebarReceiver.hxx"
 
 #include "glob.hxx"
 #include "pres.hxx"

Modified: 
openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/MasterPagesSelector.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/MasterPagesSelector.cxx?rev=1447713&r1=1447712&r2=1447713&view=diff
==============================================================================
--- 
openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/MasterPagesSelector.cxx
 (original)
+++ 
openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/MasterPagesSelector.cxx
 Tue Feb 19 13:29:47 2013
@@ -19,16 +19,13 @@
  * 
  *************************************************************/
 
-
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_sd.hxx"
 
 #include "MasterPagesSelector.hxx"
 
 #include "MasterPageContainer.hxx"
 #include "DocumentHelper.hxx"
-#include "../SidebarShellManager.hxx"
+#include "SidebarShellManager.hxx"
 #include "pres.hxx"
 #include "drawdoc.hxx"
 #include "DrawDocShell.hxx"

Modified: 
openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/MasterPagesSelector.hxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/MasterPagesSelector.hxx?rev=1447713&r1=1447712&r2=1447713&view=diff
==============================================================================
--- 
openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/MasterPagesSelector.hxx
 (original)
+++ 
openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/MasterPagesSelector.hxx
 Tue Feb 19 13:29:47 2013
@@ -25,8 +25,8 @@
 #include "MasterPageContainer.hxx"
 #include "SlideSorterViewShell.hxx"
 #include "PreviewValueSet.hxx"
-#include "../ISidebarReceiver.hxx"
-#include "../ILayoutableWindow.hxx"
+#include "ISidebarReceiver.hxx"
+#include "ILayoutableWindow.hxx"
 
 #include "pres.hxx"
 #include <sfx2/shell.hxx>

Modified: 
openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/PanelBase.hxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/PanelBase.hxx?rev=1447713&r1=1447712&r2=1447713&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/PanelBase.hxx 
(original)
+++ openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/PanelBase.hxx 
Tue Feb 19 13:29:47 2013
@@ -22,9 +22,9 @@
 #ifndef SD_SIDEBAR_PANELS_PANEL_BASE_HXX
 #define SD_SIDEBAR_PANELS_PANEL_BASE_HXX
 
-#include "../IDisposable.hxx"
-#include "../ILayoutableWindow.hxx"
-#include "../ISidebarReceiver.hxx"
+#include "IDisposable.hxx"
+#include "ILayoutableWindow.hxx"
+#include "ISidebarReceiver.hxx"
 
 #include <vcl/ctrl.hxx>
 

Modified: 
openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/RecentMasterPagesSelector.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/RecentMasterPagesSelector.cxx?rev=1447713&r1=1447712&r2=1447713&view=diff
==============================================================================
--- 
openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/RecentMasterPagesSelector.cxx
 (original)
+++ 
openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/RecentMasterPagesSelector.cxx
 Tue Feb 19 13:29:47 2013
@@ -27,7 +27,7 @@
 #include "RecentlyUsedMasterPages.hxx"
 #include "MasterPageContainerProviders.hxx"
 #include "MasterPageObserver.hxx"
-#include "../SidebarShellManager.hxx"
+#include "SidebarShellManager.hxx"
 #include "sdpage.hxx"
 #include "drawdoc.hxx"
 #include "app.hrc"

Added: 
openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/SidebarShellManager.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/SidebarShellManager.cxx?rev=1447713&view=auto
==============================================================================
--- 
openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/SidebarShellManager.cxx
 (added)
+++ 
openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/SidebarShellManager.cxx
 Tue Feb 19 13:29:47 2013
@@ -0,0 +1,176 @@
+/**************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+
+#include "precompiled_sd.hxx"
+
+#include "SidebarShellManager.hxx"
+
+#include "ViewShellManager.hxx"
+#include <tools/diagnose_ex.h>
+#include <vcl/window.hxx>
+
+#include <algorithm>
+
+namespace sd { namespace sidebar {
+
+SidebarShellManager::SidebarShellManager (
+    const ::boost::shared_ptr<ViewShellManager>& rpViewShellManager,
+    const ViewShell& rViewShell)
+    : mpViewShellManager(rpViewShellManager),
+      mrViewShell(rViewShell),
+      maSubShells()
+{
+}
+
+
+
+
+SidebarShellManager::~SidebarShellManager (void)
+{
+    while ( ! maSubShells.empty())
+        RemoveSubShell(maSubShells.begin()->second.mpShell);
+}
+
+
+
+
+SfxShell* SidebarShellManager::CreateShell( ShellId nId, ::Window* , 
FrameView* )
+{
+    SubShells::const_iterator iShell (maSubShells.find(nId));
+    if (iShell != maSubShells.end())
+        return iShell->second.mpShell;
+    else
+        return NULL;
+}
+
+
+
+
+void SidebarShellManager::ReleaseShell (SfxShell* )
+{
+    // Nothing to do.
+}
+
+void SidebarShellManager::AddSubShell (
+    ShellId nId,
+    SfxShell* pShell,
+    ::Window* pWindow)
+{
+    if (pShell != NULL)
+    {
+        maSubShells[nId] = ShellDescriptor(pShell,pWindow);
+        if (pWindow != NULL)
+        {
+            
pWindow->AddEventListener(LINK(this,SidebarShellManager,WindowCallback));
+            if (pWindow->IsReallyVisible())
+                mpViewShellManager->ActivateSubShell(mrViewShell, nId);
+        }
+        else
+            mpViewShellManager->ActivateSubShell(mrViewShell, nId);
+    }
+}
+
+
+
+
+void SidebarShellManager::RemoveSubShell (const ShellId i_nShellId)
+{
+    SubShells::iterator pos = maSubShells.find( i_nShellId );
+    ENSURE_OR_RETURN_VOID( pos != maSubShells.end(), "no shell for this ID" );
+    if ( pos->second.mpWindow != NULL )
+    {
+        pos->second.mpWindow->RemoveEventListener( LINK( this, 
SidebarShellManager, WindowCallback ) );
+    }
+    mpViewShellManager->DeactivateSubShell( mrViewShell, pos->first );
+    maSubShells.erase( pos );
+}
+
+
+
+
+void SidebarShellManager::RemoveSubShell (const SfxShell* pShell)
+{
+    if (pShell != NULL)
+    {
+        SubShells::iterator iShell;
+        for (iShell=maSubShells.begin(); iShell!=maSubShells.end(); ++iShell)
+            if (iShell->second.mpShell == pShell)
+            {
+                if (iShell->second.mpWindow != NULL)
+                    iShell->second.mpWindow->RemoveEventListener(
+                        LINK(this,SidebarShellManager,WindowCallback));
+                
mpViewShellManager->DeactivateSubShell(mrViewShell,iShell->first);
+                maSubShells.erase(iShell);
+                break;
+            }
+    }
+}
+
+
+
+
+void SidebarShellManager::MoveToTop (SfxShell* pShell)
+{
+    SubShells::const_iterator iShell;
+    for (iShell=maSubShells.begin(); iShell!=maSubShells.end(); ++iShell)
+        if (iShell->second.mpShell == pShell)
+        {
+            ViewShellManager::UpdateLock aLocker (mpViewShellManager);
+            mpViewShellManager->MoveSubShellToTop(mrViewShell,iShell->first);
+            mpViewShellManager->MoveToTop(mrViewShell);
+            break;
+        }
+}
+
+
+
+
+IMPL_LINK(SidebarShellManager, WindowCallback, VclWindowEvent*, pEvent)
+{
+    if (pEvent != NULL)
+    {
+        SubShells::const_iterator iShell;
+        ::Window* pWindow = pEvent->GetWindow();
+        for (iShell=maSubShells.begin(); iShell!=maSubShells.end(); ++iShell)
+            if (iShell->second.mpWindow == pWindow)
+                break;
+        if (iShell != maSubShells.end())
+            switch (pEvent->GetId())
+            {
+                case VCLEVENT_WINDOW_SHOW:
+                    
mpViewShellManager->ActivateSubShell(mrViewShell,iShell->first);
+                    break;
+
+                case VCLEVENT_WINDOW_HIDE:
+                    // Do not activate the sub shell.  This leads to
+                    // problems with shapes currently being in text edit
+                    // mode: Deactivating the shell leads to leaving the
+                    // text editing mode.
+                    // 
mpViewShellManager->DeactivateSubShell(mrViewShell,iShell->first);
+                    break;
+            }
+    }
+
+    return 0;
+}
+
+
+} } // end of namespace ::sd::sidebar

Added: 
openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/SidebarShellManager.hxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/SidebarShellManager.hxx?rev=1447713&view=auto
==============================================================================
--- 
openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/SidebarShellManager.hxx
 (added)
+++ 
openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/SidebarShellManager.hxx
 Tue Feb 19 13:29:47 2013
@@ -0,0 +1,117 @@
+/**************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+
+
+
+#ifndef SD_SIDEBAR_SHELL_MANAGER_HXX
+#define SD_SIDEBAR_SHELL_MANAGER_HXX
+
+#include "ShellFactory.hxx"
+#include "ViewShellManager.hxx"
+#include <map>
+
+class FrameView;
+class SfxShell;
+class VclWindowEvent;
+class Window;
+
+namespace sd {
+class ViewShell;
+}
+
+namespace sd { namespace sidebar {
+
+/** The TaskPaneShellManager implements the ViewShellManager::ShellFactory
+    interface.  However, it does not create or delete shells.  It only
+    gives the ViewShellManager access to the sub shells of the
+    ToolPanelViewShell.  Life time control of the sub shells is managed by
+    the sub shells themselves.
+*/
+class SidebarShellManager
+    : public ShellFactory<SfxShell>
+{
+public:
+    /** Create a shell manager that manages the stacked shells for the given
+        view shell.  It works together with the given view shell manager.
+    */
+    SidebarShellManager (
+        const ::boost::shared_ptr<ViewShellManager>& rpViewShellManager,
+        const ViewShell& rViewShell);
+    ~SidebarShellManager (void);
+
+    /** Return the requested sub shell.
+        @param nId
+            The id of the requested sub shell.
+        @return
+            When there is no sub shell currently registered under the given
+            id then NULL is returned.
+    */
+    virtual SfxShell* CreateShell (
+        ShellId nId,
+        ::Window* pParentWindow,
+        FrameView* pFrameView = NULL);
+    
+    virtual void ReleaseShell (SfxShell* pShell);
+
+    /** Add a sub shell to the set of sub shells managed by the
+        TaskPaneShellManager.  Only shells added by this method are returned
+        by CreateShell().
+    */
+    void AddSubShell (ShellId nId, SfxShell* pShell, ::Window* pWindow);
+
+    /** Remove the given shell from the set of sub shells managed by the
+        TaskPaneShellManager.  Following calls to CreateShell() will return
+        NULL when this shell is requested.
+    */
+    void RemoveSubShell (const SfxShell* pShell);
+    /** removes the shell given by its ID from the set of sub shells managed 
by the 
+        TaskPaneShellManager. Subsequent calls to CreateShell() will return
+        NULL when this shell is requested.
+    */
+    void RemoveSubShell (const ShellId i_nShellId);
+
+    /** Move the given sub-shell to the top of the local shell stack.
+        Furthermore move the view shell whose sub-shells this class manages
+        to the top of the global shell stack.
+    */
+    void MoveToTop (SfxShell* pShell);
+
+    DECL_LINK(WindowCallback,VclWindowEvent*);
+
+private:
+    ::boost::shared_ptr<ViewShellManager> mpViewShellManager;
+
+    /// The view shell whose sub-shells this class manages.
+    const ViewShell& mrViewShell;
+
+    class ShellDescriptor { public:
+        SfxShell* mpShell;
+        ::Window* mpWindow;
+        ShellDescriptor(void) : mpShell(NULL),mpWindow(NULL){}
+        ShellDescriptor(SfxShell*pShell,::Window*pWindow) : 
mpShell(pShell),mpWindow(pWindow){}
+    };
+    typedef ::std::map<ShellId,ShellDescriptor> SubShells;
+    SubShells maSubShells;
+};
+
+} } // end of namespace ::sd::sidebar
+
+#endif

Modified: 
openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/makefile.mk
URL: 
http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/makefile.mk?rev=1447713&r1=1447712&r2=1447713&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/makefile.mk 
(original)
+++ openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/makefile.mk 
Tue Feb 19 13:29:47 2013
@@ -55,6 +55,7 @@ SLOFILES =                                                    
        \
        $(SLO)$/PreviewValueSet.obj                             \
        $(SLO)$/RecentlyUsedMasterPages.obj             \
        $(SLO)$/RecentMasterPagesSelector.obj   \
+       $(SLO)$/SidebarShellManager.obj                 \
        $(SLO)$/SlideTransitionPanel.obj                \
        $(SLO)$/TableDesignPanel.obj
 

Modified: openoffice/branches/sidebar/main/sfx2/source/control/bindings.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sfx2/source/control/bindings.cxx?rev=1447713&r1=1447712&r2=1447713&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sfx2/source/control/bindings.cxx (original)
+++ openoffice/branches/sidebar/main/sfx2/source/control/bindings.cxx Tue Feb 
19 13:29:47 2013
@@ -1035,7 +1035,7 @@ void SfxBindings::Register( SfxControlle
 void SfxBindings::Register_Impl( SfxControllerItem& rItem, sal_Bool bInternal )
 {
     DBG_MEMTEST();
-    DBG_ASSERT( nRegLevel > 0, "registration without EnterRegistrations" );
+    //    DBG_ASSERT( nRegLevel > 0, "registration without EnterRegistrations" 
);
     DBG_ASSERT( !pImp->bInNextJob, "SfxBindings::Register while 
status-updating" );
 
     // insert new cache if it does not already exist

Modified: openoffice/branches/sidebar/main/svx/source/sidebar/PanelFactory.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/svx/source/sidebar/PanelFactory.cxx?rev=1447713&r1=1447712&r2=1447713&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/svx/source/sidebar/PanelFactory.cxx 
(original)
+++ openoffice/branches/sidebar/main/svx/source/sidebar/PanelFactory.cxx Tue 
Feb 19 13:29:47 2013
@@ -125,22 +125,20 @@ Reference<ui::XUIElement> SAL_CALL Panel
     if (rsResourceURL.endsWithAsciiL("/TextPropertyPanel", 
strlen("/TextPropertyPanel")))
     {
         TextPropertyPanel* pPanel = TextPropertyPanel::Create(pParentWindow, 
xFrame, pBindings);
-        pPanel->Show();
-        pPanel->GetParent()->Show();
         xElement = sfx2::sidebar::SidebarPanelBase::Create(
             rsResourceURL,
             xFrame,
             pPanel,
             ::boost::bind(&TextPropertyPanel::ShowMenu, pPanel));
     }
-
-    if (rsResourceURL.endsWithAsciiL("/AreaPropertyPanel", 
strlen("/AreaPropertyPanel")))
+    else if (rsResourceURL.endsWithAsciiL("/AreaPropertyPanel", 
strlen("/AreaPropertyPanel")))
     {
         AreaPropertyPanel* pPanel = AreaPropertyPanel::Create(pParentWindow, 
xFrame, pBindings);
         xElement = sfx2::sidebar::SidebarPanelBase::Create(
             rsResourceURL,
             xFrame,
-            pPanel);
+            pPanel,
+            ::boost::function<void(void)>());
     }
 
     return xElement;


Reply via email to