You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by af...@apache.org on 2013/02/19 10:09:05 UTC

svn commit: r1447641 [7/9] - in /openoffice/branches/sidebar/main: default_images/sfx2/res/symphony/ framework/inc/services/ framework/source/services/ offapi/com/sun/star/ui/ officecfg/registry/data/org/openoffice/Office/ officecfg/registry/data/org/o...

Added: 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=1447641&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/RecentMasterPagesSelector.cxx (added)
+++ openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/RecentMasterPagesSelector.cxx Tue Feb 19 09:09:02 2013
@@ -0,0 +1,187 @@
+/**************************************************************
+ * 
+ * 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 "RecentMasterPagesSelector.hxx"
+
+#include "ViewShellBase.hxx"
+#include "RecentlyUsedMasterPages.hxx"
+#include "MasterPageContainerProviders.hxx"
+#include "MasterPageObserver.hxx"
+#include "../SidebarShellManager.hxx"
+#include "sdpage.hxx"
+#include "drawdoc.hxx"
+#include "app.hrc"
+#include "helpids.h"
+
+#include <vcl/bitmap.hxx>
+#include <tools/color.hxx>
+
+namespace sd { namespace sidebar {
+
+
+MasterPagesSelector* RecentMasterPagesSelector::Create (
+    ::Window* pParent,
+    ViewShellBase& rViewShellBase,
+    SidebarShellManager& rSubShellManager)
+{
+    SdDrawDocument* pDocument = rViewShellBase.GetDocument();
+    if (pDocument == NULL)
+        return NULL;
+
+    ::boost::shared_ptr<MasterPageContainer> pContainer (new MasterPageContainer());
+    
+    MasterPagesSelector* pSelector(
+        new RecentMasterPagesSelector (
+            pParent, 
+            *pDocument,
+            rViewShellBase,
+            rSubShellManager,
+            pContainer));
+    pSelector->LateInit();
+    pSelector->SetHelpId(HID_SD_TASK_PANE_PREVIEW_RECENT);
+    rSubShellManager.AddSubShell(
+        SHELLID_SD_TASK_PANE_PREVIEW_RECENT,
+        pSelector,
+        pSelector->GetWindow());
+
+    return pSelector;
+}
+
+
+
+
+RecentMasterPagesSelector::RecentMasterPagesSelector (
+    ::Window* pParent,
+    SdDrawDocument& rDocument,
+    ViewShellBase& rBase,
+    SidebarShellManager& rSubShellManager,
+    const ::boost::shared_ptr<MasterPageContainer>& rpContainer)
+    : MasterPagesSelector (pParent, rDocument, rBase, rSubShellManager, rpContainer)
+{
+	SetName (String(RTL_CONSTASCII_USTRINGPARAM("RecentMasterPagesSelector")));
+}
+
+
+
+
+RecentMasterPagesSelector::~RecentMasterPagesSelector (void)
+{
+    RecentlyUsedMasterPages::Instance().RemoveEventListener (
+        LINK(this,RecentMasterPagesSelector,MasterPageListListener));
+}
+
+
+
+
+void RecentMasterPagesSelector::LateInit (void)
+{
+    MasterPagesSelector::LateInit();
+
+    MasterPagesSelector::Fill();
+    RecentlyUsedMasterPages::Instance().AddEventListener (
+        LINK(this,RecentMasterPagesSelector,MasterPageListListener));
+}
+
+
+
+
+IMPL_LINK(RecentMasterPagesSelector,MasterPageListListener, void*, EMPTYARG)
+{
+    MasterPagesSelector::Fill();
+    return 0;
+}
+
+
+
+
+void RecentMasterPagesSelector::Fill (ItemList& rItemList)
+{
+    // Create a set of names of the master pages used by the document.
+    MasterPageObserver::MasterPageNameSet aCurrentNames;
+    sal_uInt16 nMasterPageCount = mrDocument.GetMasterSdPageCount(PK_STANDARD);
+    sal_uInt16 nIndex;
+    for (nIndex=0; nIndex<nMasterPageCount; nIndex++)
+    {
+        SdPage* pMasterPage = mrDocument.GetMasterSdPage (nIndex, PK_STANDARD);
+        if (pMasterPage != NULL)
+            aCurrentNames.insert (pMasterPage->GetName());
+    }
+    MasterPageObserver::MasterPageNameSet::iterator aI;
+
+    // Insert the recently used master pages that are currently not used.
+    RecentlyUsedMasterPages& rInstance (RecentlyUsedMasterPages::Instance());
+    int nPageCount = rInstance.GetMasterPageCount();
+    for (nIndex=0; nIndex<nPageCount; nIndex++)
+    {
+        // Add an entry when a) the page is already known to the
+        // MasterPageContainer, b) the style name is empty, i.e. it has not yet
+        // been loaded (and thus can not be in use) or otherwise c) the
+        // style name is not currently in use.
+        MasterPageContainer::Token aToken (rInstance.GetTokenForIndex(nIndex));
+        if (aToken != MasterPageContainer::NIL_TOKEN)
+        {
+            String sStyleName (mpContainer->GetStyleNameForToken(aToken));
+            if (sStyleName.Len()==0 
+                || aCurrentNames.find(sStyleName) == aCurrentNames.end())
+            {
+                rItemList.push_back(aToken);
+            }
+        }
+    }
+}
+
+
+
+
+void RecentMasterPagesSelector::AssignMasterPageToPageList (
+    SdPage* pMasterPage,
+    const ::boost::shared_ptr<std::vector<SdPage*> >& rpPageList)
+{
+	sal_uInt16 nSelectedItemId = PreviewValueSet::GetSelectItemId();
+    
+    MasterPagesSelector::AssignMasterPageToPageList(pMasterPage, rpPageList);
+
+    // Restore the selection.
+    if (PreviewValueSet::GetItemCount() > 0)
+    {
+        if (PreviewValueSet::GetItemCount() >= nSelectedItemId)
+            PreviewValueSet::SelectItem(nSelectedItemId);
+        else
+            PreviewValueSet::SelectItem(PreviewValueSet::GetItemCount());
+    }
+}
+
+
+
+
+void RecentMasterPagesSelector::GetState (SfxItemSet& rItemSet)
+{
+    MasterPagesSelector::GetState (rItemSet);
+    if (rItemSet.GetItemState(SID_TP_EDIT_MASTER) == SFX_ITEM_AVAILABLE)
+        rItemSet.DisableItem (SID_TP_EDIT_MASTER);
+}
+
+
+
+
+} } // end of namespace sd::sidebar

Added: openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/RecentMasterPagesSelector.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/RecentMasterPagesSelector.hxx?rev=1447641&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/RecentMasterPagesSelector.hxx (added)
+++ openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/RecentMasterPagesSelector.hxx Tue Feb 19 09:09:02 2013
@@ -0,0 +1,78 @@
+/**************************************************************
+ * 
+ * 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_PANELS_RECENT_MASTER_PAGES_SELECTOR_HXX
+#define SD_SIDEBAR_PANELS_RECENT_MASTER_PAGES_SELECTOR_HXX
+
+#include "MasterPagesSelector.hxx"
+
+namespace sd { namespace sidebar {
+
+
+/** Show the recently used master pages (that are not currently used).
+*/
+class RecentMasterPagesSelector
+    : public MasterPagesSelector
+{
+public:
+    static MasterPagesSelector* Create (
+        ::Window* pParent,
+        ViewShellBase& rViewShellBase,
+        SidebarShellManager& rSubShellManager);
+    virtual void GetState (SfxItemSet& rItemSet);
+
+protected:
+    DECL_LINK(MasterPageListListener, void*);
+    virtual void Fill (ItemList& rItemList);
+
+	using sd::sidebar::MasterPagesSelector::Fill;
+
+    /** Forward this call to the base class but save and restore the
+        currently selected item.
+        Assign the given master page to the list of pages.
+        @param pMasterPage
+            This master page will usually be a member of the list of all
+            available master pages as provided by the MasterPageContainer.
+        @param rPageList
+            The pages to which to assign the master page.  These pages may
+            be slides or master pages themselves.
+    */
+    virtual void AssignMasterPageToPageList (
+        SdPage* pMasterPage,
+        const ::boost::shared_ptr<std::vector<SdPage*> >& rpPageList);
+
+private:
+    RecentMasterPagesSelector (
+        ::Window* pParent, 
+        SdDrawDocument& rDocument,
+        ViewShellBase& rBase,
+        SidebarShellManager& rSubShellManager,
+        const ::boost::shared_ptr<MasterPageContainer>& rpContainer);
+    virtual ~RecentMasterPagesSelector (void);
+
+    virtual void LateInit (void);
+};
+
+} } // end of namespace sd::sidebar
+
+#endif

Added: openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/RecentlyUsedMasterPages.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/RecentlyUsedMasterPages.cxx?rev=1447641&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/RecentlyUsedMasterPages.cxx (added)
+++ openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/RecentlyUsedMasterPages.cxx Tue Feb 19 09:09:02 2013
@@ -0,0 +1,494 @@
+/**************************************************************
+ * 
+ * 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 "RecentlyUsedMasterPages.hxx"
+#include "MasterPageObserver.hxx"
+#include "MasterPagesSelector.hxx"
+#include "MasterPageDescriptor.hxx"
+#include "tools/ConfigurationAccess.hxx"
+#include "drawdoc.hxx"
+#include "sdpage.hxx"
+
+#include <algorithm>
+#include <vector>
+
+#include <comphelper/processfactory.hxx>
+#include "unomodel.hxx"
+#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
+#include <com/sun/star/drawing/XDrawPages.hpp>
+#include <com/sun/star/frame/XComponentLoader.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/beans/PropertyState.hpp>
+#include <tools/urlobj.hxx>
+#include <unotools/confignode.hxx>
+#include <osl/doublecheckedlocking.h>
+#include <osl/getglobalmutex.hxx>
+
+using namespace ::std;
+using ::rtl::OUString;
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
+
+
+namespace {
+
+static const OUString& GetPathToImpressConfigurationRoot (void)
+{
+    static const OUString sPathToImpressConfigurationRoot (
+        RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Office.Impress/"));
+    return sPathToImpressConfigurationRoot;
+}
+static const OUString& GetPathToSetNode (void)
+{
+    static const OUString sPathToSetNode(
+        RTL_CONSTASCII_USTRINGPARAM(
+            "MultiPaneGUI/ToolPanel/RecentlyUsedMasterPages"));
+    return sPathToSetNode;
+}
+
+
+class Descriptor
+{
+public:
+    ::rtl::OUString msURL;
+    ::rtl::OUString msName;
+    ::sd::sidebar::MasterPageContainer::Token maToken;
+    Descriptor (const ::rtl::OUString& rsURL, const ::rtl::OUString& rsName)
+        : msURL(rsURL),
+          msName(rsName),
+          maToken(::sd::sidebar::MasterPageContainer::NIL_TOKEN)
+    {}
+    Descriptor (::sd::sidebar::MasterPageContainer::Token aToken,
+        const ::rtl::OUString& rsURL, const ::rtl::OUString& rsName)
+        : msURL(rsURL),
+          msName(rsName),
+          maToken(aToken)
+    {}
+    class TokenComparator
+    { public:
+        TokenComparator(::sd::sidebar::MasterPageContainer::Token aToken)
+            : maToken(aToken) {}
+        bool operator () (const Descriptor& rDescriptor)
+        { return maToken==rDescriptor.maToken; }
+    private: ::sd::sidebar::MasterPageContainer::Token maToken;
+    };
+};
+
+} // end of anonymous namespace
+
+
+
+
+namespace sd { namespace sidebar {
+
+class RecentlyUsedMasterPages::MasterPageList : public ::std::vector<Descriptor>
+{
+public:
+    MasterPageList (void) {}
+};
+
+
+RecentlyUsedMasterPages* RecentlyUsedMasterPages::mpInstance = NULL;
+
+
+RecentlyUsedMasterPages&  RecentlyUsedMasterPages::Instance (void)
+{
+    if (mpInstance == NULL)
+    {
+        ::osl::GetGlobalMutex aMutexFunctor;
+        ::osl::MutexGuard aGuard (aMutexFunctor());
+        if (mpInstance == NULL)
+        {
+            RecentlyUsedMasterPages* pInstance = new RecentlyUsedMasterPages();
+            pInstance->LateInit();
+            SdGlobalResourceContainer::Instance().AddResource (
+                ::std::auto_ptr<SdGlobalResource>(pInstance));
+            OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
+            mpInstance = pInstance;
+        }
+    }
+    else {
+        OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
+    }
+    
+    return *mpInstance;
+}
+
+
+
+
+RecentlyUsedMasterPages::RecentlyUsedMasterPages (void)
+    : maListeners(),
+      mpMasterPages(new MasterPageList()),
+      mnMaxListSize(8),
+      mpContainer(new MasterPageContainer())
+{
+}
+
+
+
+
+RecentlyUsedMasterPages::~RecentlyUsedMasterPages (void)
+{
+    Link aLink (LINK(this,RecentlyUsedMasterPages,MasterPageContainerChangeListener));
+    mpContainer->RemoveChangeListener(aLink);
+    
+    MasterPageObserver::Instance().RemoveEventListener(
+        LINK(this,RecentlyUsedMasterPages,MasterPageChangeListener));
+}
+
+
+
+
+void RecentlyUsedMasterPages::LateInit (void)
+{
+    Link aLink (LINK(this,RecentlyUsedMasterPages,MasterPageContainerChangeListener));
+    mpContainer->AddChangeListener(aLink);
+    
+    LoadPersistentValues ();
+    MasterPageObserver::Instance().AddEventListener(
+        LINK(this,RecentlyUsedMasterPages,MasterPageChangeListener));
+}
+
+
+
+
+void RecentlyUsedMasterPages::LoadPersistentValues (void)
+{
+    try
+    {
+        do
+        {
+            tools::ConfigurationAccess aConfiguration (
+                GetPathToImpressConfigurationRoot(),
+                tools::ConfigurationAccess::READ_ONLY);
+            Reference<container::XNameAccess> xSet (
+                aConfiguration.GetConfigurationNode(GetPathToSetNode()),
+                UNO_QUERY);
+            if ( ! xSet.is())
+                break;
+
+            const String sURLMemberName (OUString::createFromAscii("URL"));
+            const String sNameMemberName (OUString::createFromAscii("Name"));
+            OUString sURL;
+            OUString sName;
+
+            // Read the names and URLs of the master pages.
+            Sequence<OUString> aKeys (xSet->getElementNames());
+            mpMasterPages->clear();
+            mpMasterPages->reserve(aKeys.getLength());
+            for (int i=0; i<aKeys.getLength(); i++)
+            {
+                Reference<container::XNameAccess> xSetItem (
+                    xSet->getByName(aKeys[i]), UNO_QUERY);
+                if (xSetItem.is())
+                {
+                    Any aURL (xSetItem->getByName(sURLMemberName));
+                    Any aName (xSetItem->getByName(sNameMemberName));
+                    aURL >>= sURL;
+                    aName >>= sName;
+                    SharedMasterPageDescriptor pDescriptor (new MasterPageDescriptor(
+                        MasterPageContainer::TEMPLATE,
+                        -1,
+                        sURL,
+                        String(),
+                        sName,
+                        false,
+                        ::boost::shared_ptr<PageObjectProvider>(
+                            new TemplatePageObjectProvider(sURL)),
+                        ::boost::shared_ptr<PreviewProvider>(
+                            new TemplatePreviewProvider(sURL))));
+                    // For user supplied templates we use a different
+                    // preview provider: The preview in the document shows
+                    // not only shapes on the master page but also shapes on
+                    // the foreground.  This is misleading and therefore
+                    // these previews are discarded and created directly
+                    // from the page objects.
+                    if (pDescriptor->GetURLClassification() == MasterPageDescriptor::URLCLASS_USER)
+                        pDescriptor->mpPreviewProvider = ::boost::shared_ptr<PreviewProvider>(
+                            new PagePreviewProvider());
+                    MasterPageContainer::Token aToken (mpContainer->PutMasterPage(pDescriptor));
+                    mpMasterPages->push_back(Descriptor(aToken,sURL,sName));
+                }
+            }
+
+            ResolveList();
+        }
+        while (false);
+    }
+    catch (Exception&)
+    {
+        // Ignore exception.
+    }
+}
+
+
+
+
+void RecentlyUsedMasterPages::SavePersistentValues (void)
+{
+    try
+    {
+        do
+        {
+            tools::ConfigurationAccess aConfiguration (
+                GetPathToImpressConfigurationRoot(),
+                tools::ConfigurationAccess::READ_WRITE);
+            Reference<container::XNameContainer> xSet (
+                aConfiguration.GetConfigurationNode(GetPathToSetNode()),
+                UNO_QUERY);
+            if ( ! xSet.is())
+                break;
+
+            // Clear the set.
+            Sequence<OUString> aKeys (xSet->getElementNames());
+            sal_Int32 i;
+            for (i=0; i<aKeys.getLength(); i++)
+                xSet->removeByName (aKeys[i]);
+
+            // Fill it with the URLs of this object.
+            const String sURLMemberName (OUString::createFromAscii("URL"));
+            const String sNameMemberName (OUString::createFromAscii("Name"));
+            Any aValue;
+            Reference<lang::XSingleServiceFactory> xChildFactory (
+                xSet, UNO_QUERY);
+            if ( ! xChildFactory.is())
+                break;
+            MasterPageList::const_iterator iDescriptor;
+            sal_Int32 nIndex(0);
+            for (iDescriptor=mpMasterPages->begin();
+                 iDescriptor!=mpMasterPages->end();
+                 ++iDescriptor,++nIndex)
+            {
+                // Create new child.
+                OUString sKey (OUString::createFromAscii("index_"));
+                sKey += OUString::valueOf(nIndex);
+                Reference<container::XNameReplace> xChild(
+                    xChildFactory->createInstance(), UNO_QUERY);
+                if (xChild.is())
+                {
+                    xSet->insertByName (sKey, makeAny(xChild));
+
+                    aValue <<= OUString(iDescriptor->msURL);
+                    xChild->replaceByName (sURLMemberName, aValue);
+
+                    aValue <<= OUString(iDescriptor->msName);
+                    xChild->replaceByName (sNameMemberName, aValue);
+                }
+            }
+
+            // Write the data back to disk.
+            aConfiguration.CommitChanges();
+        }
+        while (false);
+    }
+    catch (Exception&)
+    {
+        // Ignore exception.
+    }
+}
+
+
+
+
+void RecentlyUsedMasterPages::AddEventListener (const Link& rEventListener)
+{
+    if (::std::find (
+        maListeners.begin(),
+        maListeners.end(),
+        rEventListener) == maListeners.end())
+    {
+        maListeners.push_back (rEventListener);
+    }
+}
+
+
+
+
+void RecentlyUsedMasterPages::RemoveEventListener (const Link& rEventListener)
+{
+    maListeners.erase (
+        ::std::find (
+            maListeners.begin(),
+            maListeners.end(),
+            rEventListener));
+}
+
+
+
+
+int RecentlyUsedMasterPages::GetMasterPageCount (void) const
+{
+    return mpMasterPages->size();
+}
+
+
+
+
+MasterPageContainer::Token RecentlyUsedMasterPages::GetTokenForIndex (sal_uInt32 nIndex) const
+{
+    if(nIndex<mpMasterPages->size())
+        return (*mpMasterPages)[nIndex].maToken;
+    else
+        return MasterPageContainer::NIL_TOKEN;
+}
+
+
+
+
+void RecentlyUsedMasterPages::SendEvent (void)
+{
+    ::std::vector<Link>::iterator aLink (maListeners.begin());
+    ::std::vector<Link>::iterator aEnd (maListeners.end());
+    while (aLink!=aEnd)
+    {
+        aLink->Call (NULL);
+        ++aLink;
+    }
+}
+
+
+
+
+IMPL_LINK(RecentlyUsedMasterPages, MasterPageChangeListener,
+    MasterPageObserverEvent*, pEvent)
+{
+    switch (pEvent->meType)
+    {
+        case MasterPageObserverEvent::ET_MASTER_PAGE_ADDED:
+        case MasterPageObserverEvent::ET_MASTER_PAGE_EXISTS:
+            AddMasterPage(
+                mpContainer->GetTokenForStyleName(pEvent->mrMasterPageName));
+            break;
+
+        case MasterPageObserverEvent::ET_MASTER_PAGE_REMOVED:
+            // Do not change the list of recently master pages (the deleted
+            // page was recently used) but tell the listeners.  They may want
+            // to update their lists.
+            SendEvent();
+            break;
+    }
+    return 0;
+}
+
+
+
+
+IMPL_LINK(RecentlyUsedMasterPages, MasterPageContainerChangeListener,
+    MasterPageContainerChangeEvent*, pEvent)
+{
+    if (pEvent != NULL)
+        switch (pEvent->meEventType)
+        {
+            case MasterPageContainerChangeEvent::CHILD_ADDED:
+            case MasterPageContainerChangeEvent::CHILD_REMOVED:
+            case MasterPageContainerChangeEvent::INDEX_CHANGED:
+            case MasterPageContainerChangeEvent::INDEXES_CHANGED:
+                ResolveList();
+                break;
+
+            default:
+                // Ignored.
+                break;
+        }
+    return 0;
+}
+
+
+
+
+void RecentlyUsedMasterPages::AddMasterPage (
+    MasterPageContainer::Token aToken,
+    bool bMakePersistent)
+{
+    // For the page to be inserted the token has to be valid and the page
+    // has to have a valid URL.  This excludes master pages that do not come
+    // from template files.
+    if (aToken != MasterPageContainer::NIL_TOKEN
+        && mpContainer->GetURLForToken(aToken).Len()>0)
+    {
+
+        MasterPageList::iterator aIterator (
+            ::std::find_if(mpMasterPages->begin(),mpMasterPages->end(),
+                Descriptor::TokenComparator(aToken)));
+        if (aIterator != mpMasterPages->end())
+        {
+            // When an entry for the given token already exists then remove
+            // it now and insert it later at the head of the list.
+            mpMasterPages->erase (aIterator);
+        }
+
+        mpMasterPages->insert(mpMasterPages->begin(),
+            Descriptor(
+                aToken,
+                mpContainer->GetURLForToken(aToken),
+                mpContainer->GetStyleNameForToken(aToken)));
+
+        // Shorten list to maximal size.
+        while (mpMasterPages->size() > mnMaxListSize)
+        {
+            mpMasterPages->pop_back ();
+        }
+
+        if (bMakePersistent)
+            SavePersistentValues ();
+        SendEvent();
+    }
+}
+
+
+
+
+void RecentlyUsedMasterPages::ResolveList (void)
+{
+    bool bNotify (false);
+
+    MasterPageList::iterator iDescriptor;
+    for (iDescriptor=mpMasterPages->begin(); iDescriptor!=mpMasterPages->end(); ++iDescriptor)
+    {
+        if (iDescriptor->maToken == MasterPageContainer::NIL_TOKEN)
+        {
+            MasterPageContainer::Token aToken (mpContainer->GetTokenForURL(iDescriptor->msURL));
+            iDescriptor->maToken = aToken;
+            if (aToken != MasterPageContainer::NIL_TOKEN)
+                bNotify = true;
+        }
+        else
+        {
+            if ( ! mpContainer->HasToken(iDescriptor->maToken))
+            {
+                iDescriptor->maToken = MasterPageContainer::NIL_TOKEN;
+                bNotify = true;
+            }
+        }
+    }
+
+    if (bNotify)
+        SendEvent();
+}
+
+
+} } // end of namespace sd::sidebar

Added: openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/RecentlyUsedMasterPages.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/RecentlyUsedMasterPages.hxx?rev=1447641&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/RecentlyUsedMasterPages.hxx (added)
+++ openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/RecentlyUsedMasterPages.hxx Tue Feb 19 09:09:02 2013
@@ -0,0 +1,124 @@
+/**************************************************************
+ * 
+ * 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_PANELS_RECENTLY_USED_MASTER_PAGES_HXX
+#define SD_SIDEBAR_PANELS_RECENTLY_USED_MASTER_PAGES_HXX
+
+#include "tools/SdGlobalResourceContainer.hxx"
+#include <osl/mutex.hxx>
+#include <tools/link.hxx>
+#include <vcl/image.hxx>
+#include <vector>
+#include <tools/string.hxx>
+
+#include "DrawDocShell.hxx"
+#include "MasterPageContainer.hxx"
+#include <com/sun/star/uno/XInterface.hpp>
+
+class SdPage;
+
+namespace sd {
+class MasterPageObserverEvent;
+}
+
+
+namespace sd { namespace sidebar {
+
+/** This singleton holds a list of the most recently used master pages.
+*/
+class RecentlyUsedMasterPages
+    : public SdGlobalResource
+{
+public:
+    /** Return the single instance of this class.
+    */
+    static RecentlyUsedMasterPages& Instance (void);
+
+    void AddEventListener (const Link& rEventListener);
+    void RemoveEventListener (const Link& rEventListener);
+    
+    int GetMasterPageCount (void) const;
+    MasterPageContainer::Token GetTokenForIndex (sal_uInt32 nIndex) const;
+
+private:
+    /** The single instance of this class.  It is created on demand when
+        Instance() is called for the first time.
+    */
+    static RecentlyUsedMasterPages* mpInstance;
+
+    ::std::vector<Link> maListeners;
+
+    class MasterPageList;
+    ::std::auto_ptr<MasterPageList> mpMasterPages;
+    unsigned long int mnMaxListSize;
+    ::boost::shared_ptr<MasterPageContainer> mpContainer;
+    
+    RecentlyUsedMasterPages (void);
+    virtual ~RecentlyUsedMasterPages (void);
+
+    /** Call this method after a new object has been created.
+    */
+    void LateInit (void);
+
+    /// The copy constructor is not implemented.  Do not use!
+    RecentlyUsedMasterPages (const RecentlyUsedMasterPages&);
+
+    /// The assignment operator is not implemented.  Do not use!
+    RecentlyUsedMasterPages& operator= (const RecentlyUsedMasterPages&);
+
+    void SendEvent (void);
+    DECL_LINK(MasterPageChangeListener, MasterPageObserverEvent*);
+    DECL_LINK(MasterPageContainerChangeListener, MasterPageContainerChangeEvent*);
+
+    /** Add a descriptor for the specified master page to the end of the
+        list of most recently used master pages.  When the page is already a
+        member of that list the associated descriptor is moved to the end of
+        the list to make it the most recently used entry.
+        @param bMakePersistent
+            When <TRUE/> is given then the new list of recently used master
+            pages is written back into the configuration to make it
+            persistent.  Giving <FALSE/> to ommit this is used while loading
+            the persistent list from the configuration.
+    */
+    void AddMasterPage (
+        MasterPageContainer::Token aToken,
+        bool bMakePersistent = true);
+
+    /** Load the list of recently used master pages from the registry where
+        it was saved to make it persistent.
+    */
+    void LoadPersistentValues (void);
+
+    /** Save the list of recently used master pages to the registry to make
+        it presistent.
+    */
+    void SavePersistentValues (void);
+
+    void ResolveList (void);
+};
+
+
+
+} } // end of namespace sd::sidebar
+
+#endif

Added: openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/SlideTransitionPanel.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/SlideTransitionPanel.cxx?rev=1447641&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/SlideTransitionPanel.cxx (added)
+++ openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/SlideTransitionPanel.cxx Tue Feb 19 09:09:02 2013
@@ -0,0 +1,77 @@
+/**************************************************************
+ * 
+ * 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 "SlideTransitionPanel.hxx"
+
+#include "SidebarViewShell.hxx"
+#include "ViewShellBase.hxx"
+
+
+namespace sd {
+    extern ::Window* createSlideTransitionPanel (::Window* pParent, ViewShellBase& rBase);
+    extern sal_Int32 getSlideTransitionPanelMinimumHeight (::Window* pParent);
+}
+
+
+
+
+namespace sd { namespace sidebar {
+
+
+SlideTransitionPanel::SlideTransitionPanel (
+    ::Window* pParentWindow,
+    ViewShellBase& rViewShellBase)
+    : PanelBase(pParentWindow, rViewShellBase)
+{
+#ifdef DEBUG
+    SetText(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sd:SlideTransitionPanel")));
+#endif
+}
+
+
+
+
+SlideTransitionPanel::~SlideTransitionPanel (void)
+{
+}
+
+
+
+
+::Window* SlideTransitionPanel::CreateWrappedControl (
+    ::Window* pParentWindow,
+    ViewShellBase& rViewShellBase)
+{
+    return createSlideTransitionPanel(pParentWindow, rViewShellBase);
+}
+
+
+
+
+css::ui::LayoutSize SlideTransitionPanel::GetHeightForWidth (const sal_Int32 nWidth)
+{
+    const sal_Int32 nMinimumHeight(getSlideTransitionPanelMinimumHeight(mpWrappedControl.get()));
+    return css::ui::LayoutSize(nMinimumHeight,-1, nMinimumHeight);
+}
+
+} } // end of namespace sd::sidebar

Added: openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/SlideTransitionPanel.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/SlideTransitionPanel.hxx?rev=1447641&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/SlideTransitionPanel.hxx (added)
+++ openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/SlideTransitionPanel.hxx Tue Feb 19 09:09:02 2013
@@ -0,0 +1,51 @@
+/**************************************************************
+ * 
+ * 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_PANELS_SLIDE_TRANSITION_PANEL_HXX
+#define SD_SIDEBAR_PANELS_SLIDE_TRANSITION_PANEL_HXX
+
+#include "PanelBase.hxx"
+
+namespace sd { namespace sidebar {
+
+class SlideTransitionPanel
+    : public PanelBase
+{
+public:
+    SlideTransitionPanel (
+        ::Window* pParentWindow, 
+        ViewShellBase& rViewShellBase);
+    virtual ~SlideTransitionPanel (void);
+
+    // ILayoutableWindow
+    virtual css::ui::LayoutSize GetHeightForWidth (const sal_Int32 nWidth);
+
+protected:
+    virtual ::Window* CreateWrappedControl (
+        ::Window* pParentWindow,
+        ViewShellBase& rViewShellBase);
+};
+
+} } // end of namespace sd::sidebar
+
+
+#endif

Added: openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/TableDesignPanel.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/TableDesignPanel.cxx?rev=1447641&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/TableDesignPanel.cxx (added)
+++ openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/TableDesignPanel.cxx Tue Feb 19 09:09:02 2013
@@ -0,0 +1,74 @@
+/**************************************************************
+ * 
+ * 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 "TableDesignPanel.hxx"
+
+#include "ViewShellBase.hxx"
+#include "SidebarViewShell.hxx"
+
+
+namespace sd {
+	extern ::Window * createTableDesignPanel (::Window* pParent, ViewShellBase& rBase);
+}
+
+
+namespace sd { namespace sidebar {
+
+
+TableDesignPanel::TableDesignPanel (
+    ::Window* pParentWindow,
+    ViewShellBase& rViewShellBase)
+    : PanelBase(pParentWindow, rViewShellBase)
+{
+#ifdef DEBUG
+    SetText(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sd:TableDesignPanel")));
+#endif
+}
+
+
+
+
+TableDesignPanel::~TableDesignPanel (void)
+{
+}
+
+
+
+
+::Window* TableDesignPanel::CreateWrappedControl (
+    ::Window* pParentWindow,
+    ViewShellBase& rViewShellBase)
+{
+    return createTableDesignPanel(pParentWindow, rViewShellBase);
+}
+
+
+
+
+css::ui::LayoutSize TableDesignPanel::GetHeightForWidth (const sal_Int32 nWidth)
+{
+    //TODO: make the sizes depend on the font size.
+    return css::ui::LayoutSize(350,-1, 400);
+}
+
+} } // end of namespace sd::sidebar

Added: openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/TableDesignPanel.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/TableDesignPanel.hxx?rev=1447641&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/TableDesignPanel.hxx (added)
+++ openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/TableDesignPanel.hxx Tue Feb 19 09:09:02 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_PANELS_TABLE_DESIGN_PANEL_HXX
+#define SD_SIDEBAR_PANELS_TABLE_DESIGN_PANEL_HXX
+
+#include "PanelBase.hxx"
+
+namespace sd { namespace sidebar {
+
+class TableDesignPanel
+    : public PanelBase
+{
+public:
+    TableDesignPanel (
+        ::Window* pParentWindow, 
+        ViewShellBase& rViewShellBase);
+    virtual ~TableDesignPanel (void);
+
+    // ILayoutableWindow
+    virtual css::ui::LayoutSize GetHeightForWidth (const sal_Int32 nWidth);
+
+protected:
+    virtual ::Window* CreateWrappedControl (
+        ::Window* pParentWindow,
+        ViewShellBase& rViewShellBase);
+};
+
+} } // end of namespace sd::sidebar
+
+#endif

Added: 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=1447641&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/makefile.mk (added)
+++ openoffice/branches/sidebar/main/sd/source/ui/sidebar/panels/makefile.mk Tue Feb 19 09:09:02 2013
@@ -0,0 +1,65 @@
+#**************************************************************
+#  
+#  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.
+#  
+#**************************************************************
+
+
+
+PRJ=..$/..$/..$/..
+
+PROJECTPCH=sd
+PROJECTPCHSOURCE=$(PRJ)$/util$/sd
+PRJNAME=sd
+TARGET=sidebarpanels
+ENABLE_EXCEPTIONS=TRUE
+AUTOSEG=true
+PRJINC=..$/..$/ ..$/..$/slidesorter
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE :  settings.mk
+.INCLUDE :  $(PRJ)$/util$/makefile.pmk
+
+# --- Files --------------------------------------------------------
+
+SLOFILES =      							\
+	$(SLO)$/AllMasterPagesSelector.obj		\
+	$(SLO)$/CurrentMasterPagesSelector.obj	\
+	$(SLO)$/CustomAnimationPanel.obj		\
+	$(SLO)$/DocumentHelper.obj				\
+	$(SLO)$/LayoutMenu.obj					\
+	$(SLO)$/MasterPageContainer.obj			\
+	$(SLO)$/MasterPageContainerFiller.obj	\
+	$(SLO)$/MasterPageContainerProviders.obj\
+	$(SLO)$/MasterPageContainerQueue.obj	\
+	$(SLO)$/MasterPageDescriptor.obj		\
+	$(SLO)$/MasterPageObserver.obj			\
+	$(SLO)$/MasterPagesSelector.obj			\
+	$(SLO)$/PanelBase.obj					\
+	$(SLO)$/PreviewValueSet.obj				\
+	$(SLO)$/RecentlyUsedMasterPages.obj		\
+	$(SLO)$/RecentMasterPagesSelector.obj	\
+	$(SLO)$/SlideTransitionPanel.obj		\
+	$(SLO)$/TableDesignPanel.obj
+
+
+# --- Tagets -------------------------------------------------------
+
+.INCLUDE :  target.mk
+

Modified: openoffice/branches/sidebar/main/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx?rev=1447641&r1=1447640&r2=1447641&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx (original)
+++ openoffice/branches/sidebar/main/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx Tue Feb 19 09:09:02 2013
@@ -191,7 +191,8 @@ void SlotManager::FuTemporary (SfxReques
             // in the tool pane.
             if (mrSlideSorter.GetViewShellBase() != NULL)
                 framework::FrameworkHelper::Instance(*mrSlideSorter.GetViewShellBase())
-                    ->RequestTaskPanel(sd::framework::FrameworkHelper::msSlideTransitionTaskPanelURL);
+                    ->RequestSidebarPanel(
+                        sd::framework::FrameworkHelper::msSlideTransitionTaskPanelURL);
             rRequest.Ignore ();
             break;
         }

Modified: openoffice/branches/sidebar/main/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx?rev=1447641&r1=1447640&r2=1447641&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx (original)
+++ openoffice/branches/sidebar/main/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx Tue Feb 19 09:09:02 2013
@@ -220,12 +220,11 @@ SlideSorterViewShell* SlideSorterViewShe
 {
     SlideSorterViewShell* pViewShell = NULL;
     
-    // Test the center, left, and then the right pane for showing a slide sorter.
+    // Test the center and left pane for showing a slide sorter.
     ::rtl::OUString aPaneURLs[] = {
         FrameworkHelper::msCenterPaneURL,
         FrameworkHelper::msFullScreenPaneURL,
         FrameworkHelper::msLeftImpressPaneURL,
-        FrameworkHelper::msRightPaneURL,
         ::rtl::OUString()};
 
     try

Modified: openoffice/branches/sidebar/main/sd/source/ui/table/tablefunction.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sd/source/ui/table/tablefunction.cxx?rev=1447641&r1=1447640&r2=1447641&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sd/source/ui/table/tablefunction.cxx (original)
+++ openoffice/branches/sidebar/main/sd/source/ui/table/tablefunction.cxx Tue Feb 19 09:09:02 2013
@@ -206,7 +206,7 @@ SfxViewShell* pViewShell = GetViewShell(
 		{
 			// Make the slide transition panel visible (expand it) in the
 	        // tool pane.
-		    framework::FrameworkHelper::Instance(GetViewShellBase())->RequestTaskPanel(
+		    framework::FrameworkHelper::Instance(GetViewShellBase())->RequestSidebarPanel(
 			    framework::FrameworkHelper::msTableDesignPanelURL);
 		}
 

Modified: openoffice/branches/sidebar/main/sd/source/ui/unoidl/facreg.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sd/source/ui/unoidl/facreg.cxx?rev=1447641&r1=1447640&r2=1447641&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sd/source/ui/unoidl/facreg.cxx (original)
+++ openoffice/branches/sidebar/main/sd/source/ui/unoidl/facreg.cxx Tue Feb 19 09:09:02 2013
@@ -145,14 +145,13 @@ extern uno::Sequence<OUString> SAL_CALL 
     throw (uno::RuntimeException);
 } }
 
+namespace sd { namespace sidebar {
 
-namespace sd { namespace toolpanel {
-
-extern uno::Reference<uno::XInterface> SAL_CALL ToolPanelFactory_createInstance(
+extern uno::Reference<uno::XInterface> SAL_CALL SidebarFactory_createInstance(
     const uno::Reference<uno::XComponentContext>& rxContext)
     throw(uno::Exception);
-extern OUString ToolPanelFactory_getImplementationName(void) throw (uno::RuntimeException);
-extern uno::Sequence<OUString> SAL_CALL ToolPanelFactory_getSupportedServiceNames (void)
+extern OUString SidebarFactory_getImplementationName(void) throw (uno::RuntimeException);
+extern uno::Sequence<OUString> SAL_CALL SidebarFactory_getSupportedServiceNames (void)
     throw (uno::RuntimeException);
 
 } }
@@ -214,7 +213,7 @@ using namespace ::sd;
 using namespace ::sd::framework;
 using namespace ::sd::presenter;
 using namespace ::sd::slidesorter;
-using namespace ::sd::toolpanel;
+using namespace ::sd::sidebar;
 
 
 
@@ -238,7 +237,7 @@ enum FactoryId
     BasicToolBarFactoryFactoryId,
     BasicViewFactoryFactoryId,
     TaskPanelFactoryFactoryId,
-    ToolPanelFactoryFactoryId,
+    SidebarFactoryFactoryId,
     ResourceIdFactoryId,
     PresentationFactoryProviderFactoryId,
     SlideRendererFactoryId,
@@ -272,7 +271,7 @@ static ::boost::shared_ptr<FactoryMap> s
         (*spFactoryMap)[BasicToolBarFactory_getImplementationName()] = BasicToolBarFactoryFactoryId;
         (*spFactoryMap)[BasicViewFactory_getImplementationName()] = BasicViewFactoryFactoryId;
         (*spFactoryMap)[TaskPanelFactory_getImplementationName()] = TaskPanelFactoryFactoryId;
-        (*spFactoryMap)[ToolPanelFactory_getImplementationName()] = ToolPanelFactoryFactoryId;
+        (*spFactoryMap)[sidebar::SidebarFactory_getImplementationName()] = SidebarFactoryFactoryId;
         (*spFactoryMap)[ResourceId_getImplementationName()] = ResourceIdFactoryId;
         (*spFactoryMap)[PresentationFactoryProvider_getImplementationName()] = PresentationFactoryProviderFactoryId;
         (*spFactoryMap)[SlideRenderer_getImplementationName()] = SlideRendererFactoryId;
@@ -409,11 +408,11 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL com
                         sd::framework::TaskPanelFactory_getSupportedServiceNames());
                     break;
 
-                case ToolPanelFactoryFactoryId:
+                case SidebarFactoryFactoryId:
                     xComponentFactory = ::cppu::createSingleComponentFactory(
-                        sd::toolpanel::ToolPanelFactory_createInstance,
-                        sd::toolpanel::ToolPanelFactory_getImplementationName(),
-                        sd::toolpanel::ToolPanelFactory_getSupportedServiceNames());
+                        sd::sidebar::SidebarFactory_createInstance,
+                        sd::sidebar::SidebarFactory_getImplementationName(),
+                        sd::sidebar::SidebarFactory_getSupportedServiceNames());
                     break;
 
                 case ResourceIdFactoryId:

Modified: openoffice/branches/sidebar/main/sd/source/ui/view/ToolBarManager.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sd/source/ui/view/ToolBarManager.cxx?rev=1447641&r1=1447640&r2=1447641&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sd/source/ui/view/ToolBarManager.cxx (original)
+++ openoffice/branches/sidebar/main/sd/source/ui/view/ToolBarManager.cxx Tue Feb 19 09:09:02 2013
@@ -1230,7 +1230,7 @@ void ToolBarRules::MainViewShellChanged 
 
         case ViewShell::ST_NONE:
         case ViewShell::ST_PRESENTATION:
-        case ViewShell::ST_TASK_PANE:
+        case ViewShell::ST_SIDEBAR:
         default:
             break;
     }

Modified: openoffice/branches/sidebar/main/sd/source/ui/view/ViewShellBase.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sd/source/ui/view/ViewShellBase.cxx?rev=1447641&r1=1447640&r2=1447641&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sd/source/ui/view/ViewShellBase.cxx (original)
+++ openoffice/branches/sidebar/main/sd/source/ui/view/ViewShellBase.cxx Tue Feb 19 09:09:02 2013
@@ -63,7 +63,7 @@
 #include "PresentationViewShell.hxx"
 #include "FormShellManager.hxx"
 #include "ToolBarManager.hxx"
-#include "taskpane/PanelId.hxx"
+#include "SidebarPanelId.hxx"
 #include "Window.hxx"
 #include "framework/ConfigurationController.hxx"
 #include "DocumentRenderer.hxx"
@@ -731,13 +731,6 @@ void ViewShellBase::Execute (SfxRequest&
                 framework::FrameworkHelper::msSlideSorterURL);
             break;
             
-        case SID_TASKPANE:
-            mpImpl->SetPaneVisibility(
-                rRequest,
-                framework::FrameworkHelper::msRightPaneURL,
-                framework::FrameworkHelper::msTaskPaneURL);
-            break;
-
         case SID_NORMAL_MULTI_PANE_GUI:
         case SID_SLIDE_SORTER_MULTI_PANE_GUI:
         case SID_DRAWINGMODE:
@@ -1455,11 +1448,6 @@ void ViewShellBase::Implementation::GetS
                             xContext, FrameworkHelper::msLeftDrawPaneURL);
                         break;
 
-                    case SID_TASKPANE:
-                        xResourceId = ResourceId::create(
-                            xContext, FrameworkHelper::msRightPaneURL);
-                        break;
-            
                     case SID_NORMAL_MULTI_PANE_GUI:
                         xResourceId = ResourceId::createWithAnchorURL(
                             xContext,
@@ -1559,8 +1547,7 @@ void ViewShellBase::Implementation::Proc
     // Set the visibility state of the toolpanel and one of its top
     // level panels.
     sal_Bool bShowToolPanel = sal_True;
-    toolpanel::PanelId nPanelId (
-        toolpanel::PID_UNKNOWN);
+    sidebar::PanelId nPanelId (sidebar::PID_UNKNOWN);
     bool bPanelIdGiven = false;
 
     // Extract the given arguments.
@@ -1580,9 +1567,7 @@ void ViewShellBase::Implementation::Proc
                 ID_VAL_PANEL_INDEX, sal_False);
             if (pPanelId != NULL)
             {
-                nPanelId = static_cast<
-                    toolpanel::PanelId>(
-                        pPanelId->GetValue());
+                nPanelId = static_cast<sidebar::PanelId>(pPanelId->GetValue());
                 bPanelIdGiven = true;
             }
         }
@@ -1591,11 +1576,11 @@ void ViewShellBase::Implementation::Proc
     // Ignore the request for some combinations of panels and view
     // shell types.
     if (bPanelIdGiven
-        && ! (nPanelId==toolpanel::PID_LAYOUT
+        && ! (nPanelId==sidebar::PID_LAYOUT
             && mrBase.GetMainViewShell()!=NULL
             && mrBase.GetMainViewShell()->GetShellType()==ViewShell::ST_OUTLINE))
     {
-        framework::FrameworkHelper::Instance(mrBase)->RequestTaskPanel(
+        framework::FrameworkHelper::Instance(mrBase)->RequestSidebarPanel(
             framework::FrameworkHelper::msLayoutTaskPanelURL);
     }
 }

Modified: openoffice/branches/sidebar/main/sd/source/ui/view/ViewShellImplementation.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sd/source/ui/view/ViewShellImplementation.cxx?rev=1447641&r1=1447640&r2=1447641&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sd/source/ui/view/ViewShellImplementation.cxx (original)
+++ openoffice/branches/sidebar/main/sd/source/ui/view/ViewShellImplementation.cxx Tue Feb 19 09:09:02 2013
@@ -47,7 +47,7 @@
 #include "FrameView.hxx"
 #include "DrawViewShell.hxx"
 #include "ViewShellHint.hxx"
-#include "taskpane/PanelId.hxx"
+#include "SidebarPanelId.hxx"
 #include "framework/FrameworkHelper.hxx"
 
 #include <sfx2/bindings.hxx>
@@ -148,8 +148,7 @@ void ViewShell::Implementation::ProcessM
 
             // Make the layout menu visible in the tool pane.
             SfxBoolItem aMakeToolPaneVisible (ID_VAL_ISVISIBLE, sal_True);
-            SfxUInt32Item aPanelId (ID_VAL_PANEL_INDEX,
-                ::sd::toolpanel::PID_LAYOUT);
+            SfxUInt32Item aPanelId (ID_VAL_PANEL_INDEX, sidebar::PID_LAYOUT);
             SfxViewFrame* pFrame = mrViewShell.GetViewFrame();
             if (pFrame!=NULL && pFrame->GetDispatcher()!=NULL)
             {
@@ -349,7 +348,7 @@ sal_uInt16 ViewShell::Implementation::Ge
         // Since we have to return a view id for every possible shell type
         // and there is not (yet) a proper ViewShellBase sub class for the
         // remaining types we chose the Impress factory as a fall back.
-        case ViewShell::ST_TASK_PANE:
+        case ViewShell::ST_SIDEBAR:
         case ViewShell::ST_NONE:
         default:
             return IMPRESS_FACTORY_ID;

Modified: openoffice/branches/sidebar/main/sd/source/ui/view/ViewShellManager.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sd/source/ui/view/ViewShellManager.cxx?rev=1447641&r1=1447640&r2=1447641&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sd/source/ui/view/ViewShellManager.cxx (original)
+++ openoffice/branches/sidebar/main/sd/source/ui/view/ViewShellManager.cxx Tue Feb 19 09:09:02 2013
@@ -61,6 +61,8 @@ public:
     SfxShell* mpShell;
     ShellId mnId;
     ViewShellManager::SharedShellFactory mpFactory;
+    bool mbIsListenerAddedToWindow;
+    
     ShellDescriptor ();
     ShellDescriptor (SfxShell* pShell, ShellId nId);
     ShellDescriptor (const ShellDescriptor& rDescriptor);
@@ -241,7 +243,7 @@ private:
         ShellId nShellId,
         ::Window* pParentWindow,
         FrameView* pFrameView);
-    void DestroyViewShell (const ShellDescriptor& rDescriptor);
+    void DestroyViewShell (ShellDescriptor& rDescriptor);
     void DestroySubShell (
         const SfxShell& rViewShell,
         const ShellDescriptor& rDescriptor);
@@ -519,8 +521,11 @@ void ViewShellManager::Implementation::A
     {
         ::Window* pWindow = aResult.GetWindow();
         if (pWindow != NULL)
+        {
             pWindow->AddEventListener(
                 LINK(this, ViewShellManager::Implementation, WindowEventHandler));
+            aResult.mbIsListenerAddedToWindow = true;
+        }
         else
         {
             DBG_ASSERT(false,
@@ -1181,6 +1186,23 @@ IMPL_LINK(ViewShellManager::Implementati
 
             case VCLEVENT_WINDOW_LOSEFOCUS:
                 break;
+
+            case VCLEVENT_OBJECT_DYING:
+                // Remember that we do not have to remove the window
+                // listener for this window.
+                for (ActiveShellList::iterator
+                         iShell(maActiveViewShells.begin()),
+                         iEnd(maActiveViewShells.end());
+                     iShell!=iEnd;
+                     ++iShell)
+                {
+                    if (iShell->GetWindow() == pEventWindow)
+                    {
+                        iShell->mbIsListenerAddedToWindow = false;
+                        break;
+                    }
+                }
+                break;
         }
     }
     return sal_True;
@@ -1225,15 +1247,19 @@ ShellDescriptor ViewShellManager::Implem
 
 
 void ViewShellManager::Implementation::DestroyViewShell (
-    const ShellDescriptor& rDescriptor)
+    ShellDescriptor& rDescriptor)
 {
     OSL_ASSERT(rDescriptor.mpShell != NULL);
-    
-    ::Window* pWindow = rDescriptor.GetWindow();
-    if (pWindow != NULL)
+
+    if (rDescriptor.mbIsListenerAddedToWindow)
     {
-        pWindow->RemoveEventListener(
-            LINK(this, ViewShellManager::Implementation, WindowEventHandler));
+        rDescriptor.mbIsListenerAddedToWindow = false;
+        ::Window* pWindow = rDescriptor.GetWindow();
+        if (pWindow != NULL)
+        {
+            pWindow->RemoveEventListener(
+                LINK(this, ViewShellManager::Implementation, WindowEventHandler));
+        }
     }
 
     // Destroy the sub shell factories.
@@ -1395,7 +1421,8 @@ namespace {
 ShellDescriptor::ShellDescriptor (void)
     : mpShell(NULL),
       mnId(0),
-      mpFactory()
+      mpFactory(),
+      mbIsListenerAddedToWindow(false)
 {
 }
 
@@ -1407,7 +1434,8 @@ ShellDescriptor::ShellDescriptor (
     ShellId nId)
     : mpShell(pShell),
       mnId(nId),
-      mpFactory()
+      mpFactory(),
+      mbIsListenerAddedToWindow(false)
 {
 }
 
@@ -1415,9 +1443,10 @@ ShellDescriptor::ShellDescriptor (
 
 
 ShellDescriptor::ShellDescriptor (const ShellDescriptor& rDescriptor)
-        : mpShell(rDescriptor.mpShell),
-          mnId(rDescriptor.mnId),
-          mpFactory(rDescriptor.mpFactory)
+    : mpShell(rDescriptor.mpShell),
+      mnId(rDescriptor.mnId),
+      mpFactory(rDescriptor.mpFactory),
+      mbIsListenerAddedToWindow(rDescriptor.mbIsListenerAddedToWindow)
 {
 }
 
@@ -1426,9 +1455,13 @@ ShellDescriptor::ShellDescriptor (const 
 
 ShellDescriptor& ShellDescriptor::operator= (const ShellDescriptor& rDescriptor)
 {
-    mpShell = rDescriptor.mpShell;
-    mnId = rDescriptor.mnId;
-    mpFactory = rDescriptor.mpFactory;
+    if (this != &rDescriptor)
+    {
+        mpShell = rDescriptor.mpShell;
+        mnId = rDescriptor.mnId;
+        mpFactory = rDescriptor.mpFactory;
+        mbIsListenerAddedToWindow = rDescriptor.mbIsListenerAddedToWindow;
+    }
     return *this;
 }
 

Modified: openoffice/branches/sidebar/main/sd/source/ui/view/drviews6.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sd/source/ui/view/drviews6.cxx?rev=1447641&r1=1447640&r2=1447641&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sd/source/ui/view/drviews6.cxx (original)
+++ openoffice/branches/sidebar/main/sd/source/ui/view/drviews6.cxx Tue Feb 19 09:09:02 2013
@@ -594,7 +594,7 @@ void DrawViewShell::FuTemp04(SfxRequest&
 		{
             // Make the slide transition panel visible (expand it) in the
             // tool pane.
-            framework::FrameworkHelper::Instance(GetViewShellBase())->RequestTaskPanel(
+            framework::FrameworkHelper::Instance(GetViewShellBase())->RequestSidebarPanel(
                 framework::FrameworkHelper::msCustomAnimationTaskPanelURL);
 
 			Cancel();
@@ -606,7 +606,7 @@ void DrawViewShell::FuTemp04(SfxRequest&
 		{
             // Make the slide transition panel visible (expand it) in the
             // tool pane.
-            framework::FrameworkHelper::Instance(GetViewShellBase())->RequestTaskPanel(
+            framework::FrameworkHelper::Instance(GetViewShellBase())->RequestSidebarPanel(
                 framework::FrameworkHelper::msSlideTransitionTaskPanelURL);
 
 			Cancel();

Modified: openoffice/branches/sidebar/main/sd/source/ui/view/drvwshrg.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sd/source/ui/view/drvwshrg.cxx?rev=1447641&r1=1447640&r2=1447641&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sd/source/ui/view/drvwshrg.cxx (original)
+++ openoffice/branches/sidebar/main/sd/source/ui/view/drvwshrg.cxx Tue Feb 19 09:09:02 2013
@@ -33,7 +33,7 @@
 #include <svx/imapdlg.hxx>
 #include <svx/colrctrl.hxx>
 #include <sfx2/objface.hxx>
-#include <sfx2/SidebarChildWindow.hxx>
+#include <sfx2/sidebar/SidebarChildWindow.hxx>
 #include <svx/f3dchild.hxx>
 #include <svx/tbxcustomshapes.hxx>
 
@@ -90,7 +90,7 @@ SFX_IMPL_INTERFACE(DrawViewShell, SfxShe
 	SFX_CHILDWINDOW_REGISTRATION( ::sd::SpellDialogChildWindow::GetChildWindowId() );
 	SFX_CHILDWINDOW_REGISTRATION( SID_SEARCH_DLG );
 	SFX_CHILDWINDOW_REGISTRATION( ::avmedia::MediaPlayer::GetChildWindowId() );
-	SFX_CHILDWINDOW_REGISTRATION(::sfx2::SidebarChildWindow::GetChildWindowId());
+	SFX_CHILDWINDOW_REGISTRATION(::sfx2::sidebar::SidebarChildWindow::GetChildWindowId());
 }
 
 
@@ -117,7 +117,7 @@ SFX_IMPL_INTERFACE(GraphicViewShell, Sfx
 	SFX_CHILDWINDOW_REGISTRATION( ::sd::SpellDialogChildWindow::GetChildWindowId() );
 	SFX_CHILDWINDOW_REGISTRATION( SID_SEARCH_DLG );
 	SFX_CHILDWINDOW_REGISTRATION( ::avmedia::MediaPlayer::GetChildWindowId() );
-	SFX_CHILDWINDOW_REGISTRATION(::sfx2::SidebarChildWindow::GetChildWindowId());
+	SFX_CHILDWINDOW_REGISTRATION(::sfx2::sidebar::SidebarChildWindow::GetChildWindowId());
 }
 
 TYPEINIT1( GraphicViewShell, DrawViewShell );

Modified: openoffice/branches/sidebar/main/sd/source/ui/view/outlnvsh.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sd/source/ui/view/outlnvsh.cxx?rev=1447641&r1=1447640&r2=1447641&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sd/source/ui/view/outlnvsh.cxx (original)
+++ openoffice/branches/sidebar/main/sd/source/ui/view/outlnvsh.cxx Tue Feb 19 09:09:02 2013
@@ -52,7 +52,7 @@
 #include <editeng/editstat.hxx>
 #include <svl/itempool.hxx>
 #include <sfx2/tplpitem.hxx>
-#include <sfx2/SidebarChildWindow.hxx>
+#include <sfx2/sidebar/SidebarChildWindow.hxx>
 #include <svx/svdorect.hxx>
 #include <sot/formats.hxx>
 #include <com/sun/star/linguistic2/XThesaurus.hpp>
@@ -129,7 +129,7 @@ SFX_IMPL_INTERFACE(OutlineViewShell, Sfx
 	SFX_CHILDWINDOW_REGISTRATION( SvxHlinkDlgWrapper::GetChildWindowId() );
 	SFX_CHILDWINDOW_REGISTRATION( ::sd::SpellDialogChildWindow::GetChildWindowId() );
 	SFX_CHILDWINDOW_REGISTRATION( SID_SEARCH_DLG );
-	SFX_CHILDWINDOW_REGISTRATION(::sfx2::SidebarChildWindow::GetChildWindowId());
+	SFX_CHILDWINDOW_REGISTRATION(::sfx2::sidebar::SidebarChildWindow::GetChildWindowId());
 }
 
 

Modified: openoffice/branches/sidebar/main/sd/source/ui/view/viewshel.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sd/source/ui/view/viewshel.cxx?rev=1447641&r1=1447640&r2=1447641&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sd/source/ui/view/viewshel.cxx (original)
+++ openoffice/branches/sidebar/main/sd/source/ui/view/viewshel.cxx Tue Feb 19 09:09:02 2013
@@ -174,7 +174,8 @@ ViewShell::~ViewShell()
 {
     // Keep the content window from accessing in its destructor the
     // WindowUpdater.
-    mpContentWindow->SetViewShell(NULL);
+    if (mpContentWindow)
+        mpContentWindow->SetViewShell(NULL);
 
 	delete mpZoomList;
 
@@ -183,6 +184,13 @@ ViewShell::~ViewShell()
     if (mpImpl->mpSubShellFactory.get() != NULL)
         GetViewShellBase().GetViewShellManager()->RemoveSubShellFactory(
             this,mpImpl->mpSubShellFactory);
+
+    if (mpContentWindow)
+    {
+        OSL_TRACE("destroying mpContentWindow at %x with parent %x", mpContentWindow.get(),
+            mpContentWindow->GetParent());
+        mpContentWindow.reset();
+    }
 }
 
 
@@ -964,9 +972,10 @@ void ViewShell::ArrangeGUIElements (void
     {
         OSL_ASSERT (GetViewShell()!=NULL);
 
-        mpContentWindow->SetPosSizePixel(
-            Point(nLeft,nTop),
-            Size(nRight-nLeft,nBottom-nTop));
+        if (mpContentWindow)
+            mpContentWindow->SetPosSizePixel(
+                Point(nLeft,nTop),
+                Size(nRight-nLeft,nBottom-nTop));
     }
 
     // Windows in the center and rulers at the left and top side.

Modified: openoffice/branches/sidebar/main/sd/util/makefile.mk
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sd/util/makefile.mk?rev=1447641&r1=1447640&r2=1447641&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sd/util/makefile.mk (original)
+++ openoffice/branches/sidebar/main/sd/util/makefile.mk Tue Feb 19 09:09:02 2013
@@ -125,15 +125,15 @@ LIB3FILES=      \
 			$(SLB)$/controller.lib
 
 LIB5TARGET=$(SLB)$/sdraw3_2.lib
-LIB5FILES=      \
-			$(SLB)$/html.lib		\
-			$(SLB)$/filter.lib		\
-			$(SLB)$/unoidl.lib		\
-			$(SLB)$/animui.lib		\
+LIB5FILES=     							\
+			$(SLB)$/html.lib			\
+			$(SLB)$/filter.lib			\
+			$(SLB)$/unoidl.lib			\
+			$(SLB)$/animui.lib			\
 			$(SLB)$/accessibility.lib	\
-			$(SLB)$/toolpanel.lib		\
 			$(SLB)$/uitools.lib			\
-			$(SLB)$/tpcontrols.lib
+			$(SLB)$/sidebar.lib			\
+			$(SLB)$/sidebarpanels.lib
 
 LIB6TARGET=$(SLB)$/sdraw3_3.lib
 LIB6FILES=      								\

Modified: openoffice/branches/sidebar/main/sd/util/sd.component
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sd/util/sd.component?rev=1447641&r1=1447640&r2=1447641&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sd/util/sd.component (original)
+++ openoffice/branches/sidebar/main/sd/util/sd.component Tue Feb 19 09:09:02 2013
@@ -71,6 +71,9 @@
   <implementation name="com.sun.star.comp.Draw.framework.TaskPanelFactory">
     <service name="com.sun.star.drawing.framework.TaskPanelFactory"/>
   </implementation>
+  <implementation name="org.openoffice.comp.Draw.framework.SidebarFactory">
+    <service name="com.sun.star.drawing.framework.SidebarFactory"/>
+  </implementation>
   <implementation name="com.sun.star.comp.Draw.framework.configuration.Configuration">
     <service name="com.sun.star.drawing.framework.Configuration"/>
   </implementation>

Modified: openoffice/branches/sidebar/main/sfx2/Library_sfx.mk
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sfx2/Library_sfx.mk?rev=1447641&r1=1447640&r2=1447641&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sfx2/Library_sfx.mk (original)
+++ openoffice/branches/sidebar/main/sfx2/Library_sfx.mk Tue Feb 19 09:09:02 2013
@@ -216,16 +216,17 @@ $(eval $(call gb_Library_add_exception_o
 	sfx2/source/sidebar/SidebarChildWindow \
 	sfx2/source/sidebar/SidebarDockingWindow \
 	sfx2/source/sidebar/SidebarController \
-	sfx2/source/sidebar/SidebarPanel \
 	sfx2/source/sidebar/SidebarPanelBase \
 	sfx2/source/sidebar/SidebarToolBox \
 	sfx2/source/sidebar/AsynchronousCall \
 	sfx2/source/sidebar/Context \
+	sfx2/source/sidebar/ContextMatcher \
 	sfx2/source/sidebar/ControlFactory \
 	sfx2/source/sidebar/ControllerItem \
 	sfx2/source/sidebar/Deck \
 	sfx2/source/sidebar/DeckConfiguration \
 	sfx2/source/sidebar/DeckDescriptor \
+	sfx2/source/sidebar/DeckLayouter \
 	sfx2/source/sidebar/DeckTitleBar \
 	sfx2/source/sidebar/DrawHelper \
 	sfx2/source/sidebar/EnumContext \

Modified: openoffice/branches/sidebar/main/sfx2/Package_inc.mk
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sfx2/Package_inc.mk?rev=1447641&r1=1447640&r2=1447641&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sfx2/Package_inc.mk (original)
+++ openoffice/branches/sidebar/main/sfx2/Package_inc.mk Tue Feb 19 09:09:02 2013
@@ -131,10 +131,11 @@ $(eval $(call gb_Package_add_file,sfx2_i
 $(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/viewfac.hxx,sfx2/viewfac.hxx))
 $(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/viewfrm.hxx,sfx2/viewfrm.hxx))
 $(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/viewsh.hxx,sfx2/viewsh.hxx))
-$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/SidebarChildWindow.hxx,sfx2/SidebarChildWindow.hxx))
+$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/sidebar/SidebarChildWindow.hxx,sfx2/sidebar/SidebarChildWindow.hxx))
 $(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/sidebar/SidebarPanelBase.hxx,sfx2/sidebar/SidebarPanelBase.hxx))
 $(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/sidebar/ControllerItem.hxx,sfx2/sidebar/ControllerItem.hxx))
 $(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/sidebar/propertypanel.hrc,sfx2/sidebar/propertypanel.hrc))
 $(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/sidebar/EnumContext.hxx,sfx2/sidebar/EnumContext.hxx))
 $(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/sidebar/ControlFactory.hxx,sfx2/sidebar/ControlFactory.hxx))
 $(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/sidebar/Theme.hxx,sfx2/sidebar/Theme.hxx))
+

Modified: openoffice/branches/sidebar/main/sfx2/inc/sfx2/sfxsids.hrc
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sfx2/inc/sfx2/sfxsids.hrc?rev=1447641&r1=1447640&r2=1447641&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sfx2/inc/sfx2/sfxsids.hrc (original)
+++ openoffice/branches/sidebar/main/sfx2/inc/sfx2/sfxsids.hrc Tue Feb 19 09:09:02 2013
@@ -860,7 +860,7 @@
 #define SID_TASKPANE                        (SID_SVX_START + 370)
 #define SID_ZOOM_NEXT                       (SID_SVX_START + 402)
 #define SID_ZOOM_PREV                       (SID_SVX_START + 403)
-#define SID_SIDEBAR                         (SID_SVX_START + 413)
+#define SID_SIDEBAR                         (SID_SVX_START + 414)
 #define SID_INET_DLG                        (SID_SVX_START + 416)
 #define SID_AUTO_CORRECT_DLG                (SID_SVX_START + 424)
 #define SID_SD_AUTOPILOT                    (SID_SVX_START + 425)

Modified: openoffice/branches/sidebar/main/sfx2/inc/sfx2/sidebar/ControlFactory.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sfx2/inc/sfx2/sidebar/ControlFactory.hxx?rev=1447641&r1=1447640&r2=1447641&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sfx2/inc/sfx2/sidebar/ControlFactory.hxx (original)
+++ openoffice/branches/sidebar/main/sfx2/inc/sfx2/sidebar/ControlFactory.hxx Tue Feb 19 09:09:02 2013
@@ -29,12 +29,16 @@ class ToolBox;
 
 namespace sfx2 { namespace sidebar {
 
+class ToolBoxBackground;
+
+
 class SFX2_DLLPUBLIC ControlFactory
 {
 public:
     static CheckBox* CreateMenuButton (Window* pParentWindow);
     static ImageRadioButton* CreateTabItem (Window* pParentWindow);
     static ToolBox* CreateToolBox (Window* pParentWindow, const ResId& rResId);
+    static Window* CreateToolBoxBackground (Window* pParentWindow);
 };
 
 

Modified: openoffice/branches/sidebar/main/sfx2/inc/sfx2/sidebar/ControllerItem.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sfx2/inc/sfx2/sidebar/ControllerItem.hxx?rev=1447641&r1=1447640&r2=1447641&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sfx2/inc/sfx2/sidebar/ControllerItem.hxx (original)
+++ openoffice/branches/sidebar/main/sfx2/inc/sfx2/sidebar/ControllerItem.hxx Tue Feb 19 09:09:02 2013
@@ -29,7 +29,8 @@
 
 namespace sfx2 { namespace sidebar {
 
-class SFX2_DLLPUBLIC ControllerItem : public SfxControllerItem
+class SFX2_DLLPUBLIC ControllerItem
+    : public SfxControllerItem
 {
 public:
     class ItemUpdateReceiverInterface
@@ -40,7 +41,6 @@ public:
             const SfxItemState eState,
             const SfxPoolItem* pState) = 0;
     };
-    
     ControllerItem (
         const sal_uInt16 nId,
         SfxBindings &rBindings,

Modified: openoffice/branches/sidebar/main/sfx2/inc/sfx2/sidebar/EnumContext.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sfx2/inc/sfx2/sidebar/EnumContext.hxx?rev=1447641&r1=1447640&r2=1447641&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sfx2/inc/sfx2/sidebar/EnumContext.hxx (original)
+++ openoffice/branches/sidebar/main/sfx2/inc/sfx2/sidebar/EnumContext.hxx Tue Feb 19 09:09:02 2013
@@ -74,9 +74,6 @@ public:
         __LastContextEnum = Context_Unknown
     };
 
-    Application meApplication;
-    Context meContext;
-
     EnumContext (void);
     EnumContext (
         const Application eApplication,
@@ -117,6 +114,9 @@ public:
     static const ::rtl::OUString& GetContextName (const Context eContext);
 
 private:
+    Application meApplication;
+    Context meContext;
+
     static void ProvideApplicationContainers (void);
     static void ProvideContextContainers (void);
     static void AddEntry (const ::rtl::OUString& rsName, const Application eApplication);

Added: openoffice/branches/sidebar/main/sfx2/inc/sfx2/sidebar/PopupContainer.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sfx2/inc/sfx2/sidebar/PopupContainer.hxx?rev=1447641&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/sfx2/inc/sfx2/sidebar/PopupContainer.hxx (added)
+++ openoffice/branches/sidebar/main/sfx2/inc/sfx2/sidebar/PopupContainer.hxx Tue Feb 19 09:09:02 2013
@@ -0,0 +1,41 @@
+/**************************************************************
+ * 
+ * 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 SFX_SIDEBAR_POPUP_CONTAINER_HXX
+#define SFX_SIDEBAR_POPUP_CONTAINER_HXX
+
+#include "sfx2/dllapi.h"
+#include <vcl/floatwin.hxx>
+
+namespace sfx2 { namespace sidebar {
+
+class SFX2_DLLPUBLIC PopupContainer : public FloatingWindow
+{
+public:
+	PopupContainer (Window* pParent);
+    virtual ~PopupContainer (void);
+    
+	virtual long Notify (NotifyEvent& rNEvt);
+};
+
+} } // end of namespace sfx2::sidebar
+
+#endif

Propchange: openoffice/branches/sidebar/main/sfx2/inc/sfx2/sidebar/PopupContainer.hxx
------------------------------------------------------------------------------
    svn:executable = *

Added: openoffice/branches/sidebar/main/sfx2/inc/sfx2/sidebar/SidebarChildWindow.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sfx2/inc/sfx2/sidebar/SidebarChildWindow.hxx?rev=1447641&view=auto
==============================================================================
--- openoffice/branches/sidebar/main/sfx2/inc/sfx2/sidebar/SidebarChildWindow.hxx (added)
+++ openoffice/branches/sidebar/main/sfx2/inc/sfx2/sidebar/SidebarChildWindow.hxx Tue Feb 19 09:09:02 2013
@@ -0,0 +1,52 @@
+/**************************************************************
+ * 
+ * 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 SFX_SIDEBAR_CHILD_WINDOW_HXX
+#define SFX_SIDEBAR_CHILD_WINDOW_HXX
+
+#include "sfx2/childwin.hxx"
+
+
+namespace sfx2 { namespace sidebar {
+
+/** Outer container of the sidbar window.
+
+    Has to be registered for every application via the
+    RegisterChildWindow() method from the RegisterControllers() method
+    of the applications DLL.
+*/
+class SFX2_DLLPUBLIC SidebarChildWindow
+    : public SfxChildWindow
+{
+public:
+    SidebarChildWindow(
+        Window* pParent,
+        sal_uInt16 nId,
+        SfxBindings* pBindings,
+        SfxChildWinInfo* pInfo);
+
+    SFX_DECL_CHILDWINDOW(SidebarChildWindow);
+};
+
+
+} } // end of namespace sfx2::sidebar
+
+#endif

Modified: openoffice/branches/sidebar/main/sfx2/inc/sfx2/sidebar/SidebarPanelBase.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sfx2/inc/sfx2/sidebar/SidebarPanelBase.hxx?rev=1447641&r1=1447640&r2=1447641&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sfx2/inc/sfx2/sidebar/SidebarPanelBase.hxx (original)
+++ openoffice/branches/sidebar/main/sfx2/inc/sfx2/sidebar/SidebarPanelBase.hxx Tue Feb 19 09:09:02 2013
@@ -31,16 +31,17 @@
 #include <com/sun/star/ui/XContextChangeEventListener.hpp>
 #include <com/sun/star/ui/XUIElement.hpp>
 #include <com/sun/star/ui/XToolPanel.hpp>
-#include <com/sun/star/ui/XVerticalStackLayoutElement.hpp>
+#include <com/sun/star/ui/XSidebarPanel.hpp>
+
 #include <boost/noncopyable.hpp>
+#include <boost/function.hpp>
 
 
 namespace css = ::com::sun::star;
 namespace cssu = ::com::sun::star::uno;
 
 
-class Control;
-
+class Window;
 
 namespace sfx2 { namespace sidebar {
 
@@ -50,7 +51,7 @@ namespace
         css::ui::XContextChangeEventListener,
         css::ui::XUIElement,
         css::ui::XToolPanel,
-        css::ui::XVerticalStackLayoutElement
+        css::ui::XSidebarPanel
         > SidebarPanelBaseInterfaceBase;
 }
 
@@ -73,7 +74,8 @@ public:
     static cssu::Reference<css::ui::XUIElement> Create (
         const ::rtl::OUString& rsResourceURL,
         const cssu::Reference<css::frame::XFrame>& rxFrame,
-        Control* pControl);
+        Window* mpWindow,
+        const ::boost::function<void(void)>& rMenuProvider);
 
     // XContextChangeEventListener
     virtual void SAL_CALL notifyContextChangeEvent (
@@ -102,24 +104,41 @@ public:
     virtual cssu::Reference<css::awt::XWindow> SAL_CALL getWindow (void)
         throw(cssu::RuntimeException);
 
-    // XVerticalStackLayoutElement
-    virtual sal_Int32 SAL_CALL getHeightForWidth (const sal_Int32 nWidth)
+    // XSidebarPanel
+    virtual css::ui::LayoutSize SAL_CALL getHeightForWidth (sal_Int32 nWidth)
         throw(cssu::RuntimeException);
-    
+    virtual void SAL_CALL showMenu (void)
+        throw(cssu::RuntimeException);
+    /** Always return <TRUE/> in the assumption that the panel
+        descriptor in the registry has this covered.
+        If a panel needs finer control then it has to overload this
+        method.
+    */
+    virtual sal_Bool SAL_CALL isContextSupported (
+        const ::rtl::OUString& rsApplicationName,
+        const ::rtl::OUString& rsContextName)
+        throw(cssu::RuntimeException);
+
 protected:
+    cssu::Reference<css::frame::XFrame> mxFrame;
+
     SidebarPanelBase (
         const ::rtl::OUString& rsResourceURL,
         const cssu::Reference<css::frame::XFrame>& rxFrame,
-        Control* pControl);
+        Window* pWindow,
+        const ::boost::function<void(void)>& rMenuProvider);
     virtual ~SidebarPanelBase (void);
 
     virtual void SAL_CALL disposing (void)
         throw (cssu::RuntimeException);
 
+    void SetControl (::Window* pControl);
+    ::Window* GetControl (void) const;
+    
 private:
+    Window* mpControl;
     const ::rtl::OUString msResourceURL;
-    cssu::Reference<css::frame::XFrame> mxFrame;
-    Control* mpControl;
+    const ::boost::function<void(void)> maMenuProvider;
 };
 
 } } // end of namespace sfx2::sidebar

Modified: openoffice/branches/sidebar/main/sfx2/inc/sfx2/sidebar/Theme.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sfx2/inc/sfx2/sidebar/Theme.hxx?rev=1447641&r1=1447640&r2=1447641&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sfx2/inc/sfx2/sidebar/Theme.hxx (original)
+++ openoffice/branches/sidebar/main/sfx2/inc/sfx2/sidebar/Theme.hxx Tue Feb 19 09:09:02 2013
@@ -30,6 +30,7 @@
 #include <cppuhelper/basemutex.hxx>
 #include <tools/gen.hxx>
 #include <rtl/ref.hxx>
+#include <vcl/wall.hxx>
 
 #include <com/sun/star/beans/XPropertySet.hpp>
 
@@ -76,8 +77,10 @@ public:
         Image_Grip,
         Image_Expand,
         Image_Collapse,
-        Image_Menu,
+        Image_TabBarMenu,
+        Image_PanelMenu,
         Image_ToolBoxItemSeparator,
+        Image_Closer,
 
         __Image_Color,
         
@@ -140,6 +143,7 @@ public:
     static Image GetImage (const ThemeItem eItem);
     static Color GetColor (const ThemeItem eItem);
     static const Paint& GetPaint (const ThemeItem eItem);
+    static const Wallpaper GetWallpaper (const ThemeItem eItem);
     static sal_Int32 GetInteger (const ThemeItem eItem);
     static bool GetBoolean (const ThemeItem eItem);
     static Rectangle GetRectangle (const ThemeItem eItem);

Modified: openoffice/branches/sidebar/main/sfx2/source/sidebar/Context.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sfx2/source/sidebar/Context.cxx?rev=1447641&r1=1447640&r2=1447641&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sfx2/source/sidebar/Context.cxx (original)
+++ openoffice/branches/sidebar/main/sfx2/source/sidebar/Context.cxx Tue Feb 19 09:09:02 2013
@@ -26,9 +26,11 @@
 #define AnyApplicationName "any"
 #define AnyContextName "any"
 
-namespace sfx2 {
+namespace sfx2 { namespace sidebar {
 
 const sal_Int32 Context::NoMatch = 4;
+const sal_Int32 Context::ApplicationWildcardMatch = 1;
+const sal_Int32 Context::ContextWildcardMatch = 2;
 const sal_Int32 Context::OptimalMatch = 0;  // Neither application nor context name is "any".
 
 #define A2S(pString) (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(pString)))
@@ -64,8 +66,8 @@ sal_Int32 Context::EvaluateMatch (
         if (rOther.msContext.equals(msContext) || bContextNameIsAny)
         {
             // Context name matches.
-            return (bApplicationNameIsAny ? 1 : 0)
-                + (bContextNameIsAny ? 2 : 0);
+            return (bApplicationNameIsAny ? ApplicationWildcardMatch : 0)
+                + (bContextNameIsAny ? ContextWildcardMatch : 0);
         }
     }
     return NoMatch;
@@ -98,4 +100,23 @@ sal_Int32 Context::EvaluateMatch (const 
     return nBestMatch;
 }
 
-} // end of namespace sfx2
+
+
+
+bool Context::operator== (const Context& rOther) const
+{
+    return msApplication.equals(rOther.msApplication)
+        && msContext.equals(rOther.msContext);
+}
+
+
+
+
+bool Context::operator!= (const Context& rOther) const
+{
+    return ( ! msApplication.equals(rOther.msApplication))
+        || ( ! msContext.equals(rOther.msContext));
+}
+
+
+} } // end of namespace sfx2::sidebar

Modified: openoffice/branches/sidebar/main/sfx2/source/sidebar/Context.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sfx2/source/sidebar/Context.hxx?rev=1447641&r1=1447640&r2=1447641&view=diff
==============================================================================
--- openoffice/branches/sidebar/main/sfx2/source/sidebar/Context.hxx (original)
+++ openoffice/branches/sidebar/main/sfx2/source/sidebar/Context.hxx Tue Feb 19 09:09:02 2013
@@ -26,7 +26,7 @@
 
 #include <vector>
 
-namespace sfx2 {
+namespace sfx2 { namespace sidebar {
 
 class Context
 {
@@ -46,6 +46,8 @@ public:
     */
     const static sal_Int32 NoMatch;
     const static sal_Int32 OptimalMatch;
+    const static sal_Int32 ApplicationWildcardMatch;
+    const static sal_Int32 ContextWildcardMatch;
 
     /** Return the numeric value that describes how good the match
         between two contexts is.
@@ -56,9 +58,12 @@ public:
     /** Return the best match against the given list of contexts.
     */
     sal_Int32 EvaluateMatch (const ::std::vector<Context>& rOthers) const;
+
+    bool operator== (const Context& rOther) const;
+    bool operator!= (const Context& rOther) const;
 };
 
 
-} // end of namespace sfx2
+} } // end of namespace sfx2::sidebar
 
 #endif