configure.ac | 6 +-- sfx2/source/sidebar/SidebarController.cxx | 59 ++++++++++++++++-------------- 2 files changed, 36 insertions(+), 29 deletions(-)
New commits: commit 9bd618740ea5da9d5077f755530de56f1e913bea Author: Michael Stahl <mst...@redhat.com> Date: Tue Dec 1 23:59:19 2015 +0100 tdf#96162: sfx2: avoid re-creating existing sidebar Panels Writer's naviagtor crashes when you click on a frame to select it, because the SwContent* that is passed to SwContentTree::GotoContent() is deleted because SidebarController::CreatePanels() re-creates every single panel and then ResetPanels() disposes the existing ones, which deletes the naviagtor's SwContent instances. (regression from 536c259cb9644971d0eb0cdfb7d823c5383a5481) Change-Id: I8f875df816a2d5948026a1d3f30b86bb2418acda (cherry picked from commit 02f2c2f8a160133731d707a8359f5cd576bff434) diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx index aad709f..55f4d0b 100644 --- a/sfx2/source/sidebar/SidebarController.cxx +++ b/sfx2/source/sidebar/SidebarController.cxx @@ -573,35 +573,43 @@ void SidebarController::CreatePanels(const ::rtl::OUString& rDeckId) // init panels bounded to that deck, do not wait them being displayed as may be accessed through API - VclPtr<Deck> pDeck = pDeckDescriptor->mpDeck; + VclPtr<Deck> pDeck = pDeckDescriptor->mpDeck; - ResourceManager::PanelContextDescriptorContainer aPanelContextDescriptors; + ResourceManager::PanelContextDescriptorContainer aPanelContextDescriptors; - css::uno::Reference<css::frame::XController> xController = mxCurrentController.is() ? mxCurrentController : mxFrame->getController(); + css::uno::Reference<css::frame::XController> xController = mxCurrentController.is() ? mxCurrentController : mxFrame->getController(); - mpResourceManager->GetMatchingPanels( - aPanelContextDescriptors, - maCurrentContext, - rDeckId, - xController); + mpResourceManager->GetMatchingPanels( + aPanelContextDescriptors, + maCurrentContext, + rDeckId, + xController); - // Update the panel list. - const sal_Int32 nNewPanelCount (aPanelContextDescriptors.size()); - SharedPanelContainer aNewPanels; + // Update the panel list. + const sal_Int32 nNewPanelCount (aPanelContextDescriptors.size()); + SharedPanelContainer aNewPanels; - aNewPanels.resize(nNewPanelCount); - sal_Int32 nWriteIndex (0); + aNewPanels.resize(nNewPanelCount); + sal_Int32 nWriteIndex (0); - for (sal_Int32 nReadIndex=0; nReadIndex<nNewPanelCount; ++nReadIndex) - { - const ResourceManager::PanelContextDescriptor& rPanelContexDescriptor ( - aPanelContextDescriptors[nReadIndex]); + for (sal_Int32 nReadIndex=0; nReadIndex<nNewPanelCount; ++nReadIndex) + { + const ResourceManager::PanelContextDescriptor& rPanelContexDescriptor ( + aPanelContextDescriptors[nReadIndex]); - // Determine if the panel can be displayed. - const bool bIsPanelVisible (!mbIsDocumentReadOnly || rPanelContexDescriptor.mbShowForReadOnlyDocuments); - if ( ! bIsPanelVisible) - continue; + // Determine if the panel can be displayed. + const bool bIsPanelVisible (!mbIsDocumentReadOnly || rPanelContexDescriptor.mbShowForReadOnlyDocuments); + if ( ! bIsPanelVisible) + continue; + Panel *const pPanel(pDeck->GetPanel(rPanelContexDescriptor.msId)); + if (pPanel != nullptr) + { + aNewPanels[nWriteIndex] = pPanel; + ++nWriteIndex; + } + else + { VclPtr<Panel> aPanel = CreatePanel( rPanelContexDescriptor.msId, pDeck->GetPanelParentWindow(), @@ -625,12 +633,11 @@ void SidebarController::CreatePanels(const ::rtl::OUString& rDeckId) } } + } - // mpCurrentPanels - may miss stuff (?) - aNewPanels.resize(nWriteIndex); - pDeck->ResetPanels(aNewPanels); - - pDeckDescriptor->mpDeck = pDeck; + // mpCurrentPanels - may miss stuff (?) + aNewPanels.resize(nWriteIndex); + pDeck->ResetPanels(aNewPanels); } void SidebarController::SwitchToDeck ( commit 76cd776207ef13d58a7cac838282c0ad2d65bcb8 Author: Michael Stahl <mst...@redhat.com> Date: Mon Nov 30 21:19:52 2015 +0100 configure: check for dlsym(), not dlopen() On Fedora 23, the check for dlopen happens to succeed with gcc -m32 -fsanitize=address, and then linking executables fails due to not finding dlsym. Checking for dlsym results in the proper -ldl. Change-Id: I02108c2c053e07b33848af068937f29967e7dc6a (cherry picked from commit 037584cfe5e58bf6807fb0188d245042baa8c1c0) diff --git a/configure.ac b/configure.ac index 4d63038..71e2090 100644 --- a/configure.ac +++ b/configure.ac @@ -900,9 +900,9 @@ AC_SUBST(PTHREAD_LIBS) if test $_os != "WINNT"; then save_LIBS="$LIBS" - AC_SEARCH_LIBS([dlopen], [dl], - [case "$ac_cv_search_dlopen" in -l*) DLOPEN_LIBS="$ac_cv_search_dlopen";; esac], - [AC_MSG_ERROR([dlopen not found in either libc nor libdl])]) + AC_SEARCH_LIBS([dlsym], [dl], + [case "$ac_cv_search_dlsym" in -l*) DLOPEN_LIBS="$ac_cv_search_dlsym";; esac], + [AC_MSG_ERROR([dlsym not found in either libc nor libdl])]) LIBS="$save_LIBS" fi AC_SUBST(DLOPEN_LIBS) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits