summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2017-12-28 18:02:57 +0100
committerMichael Stahl <mstahl@redhat.com>2018-01-03 16:55:36 +0100
commit6cc44459833deec6a54a0ed8b0572d345d3e7425 (patch)
treeb83fa42470df8ee88b7e7eab324505a030949d15
parent25b66ffe5d4f0fab876972cc471fb82470ebae12 (diff)
tdf#104870 - Impress crashes switching views in read-only mode
We need to check read only mode similar to SidebarController::CreatePanels() method. Otherwise SfxUnoPanels::getByName() creates an invalid panel. Reviewed-on: https://gerrit.libreoffice.org/47116 Tested-by: Xisco Faulí <xiscofauli@libreoffice.org> Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> (cherry picked from commit 23a83639f5a06708074b13bc13ea4f6f819f55f0) Change-Id: Ib7801b81c95f3f505a06c00f749ba4ed5809bfe0 Reviewed-on: https://gerrit.libreoffice.org/47144 Tested-by: Xisco Faulí <xiscofauli@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r--sfx2/source/sidebar/UnoPanels.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/sfx2/source/sidebar/UnoPanels.cxx b/sfx2/source/sidebar/UnoPanels.cxx
index 257c75cea4bc..98708d9cf658 100644
--- a/sfx2/source/sidebar/UnoPanels.cxx
+++ b/sfx2/source/sidebar/UnoPanels.cxx
@@ -114,6 +114,9 @@ sal_Bool SAL_CALL SfxUnoPanels::hasByName( const OUString& aName )
iPanel(aPanels.begin()), iEnd(aPanels.end());
iPanel!=iEnd; ++iPanel)
{
+ // Determine if the panel can be displayed.
+ if(pSidebarController->IsDocumentReadOnly() && !iPanel->mbShowForReadOnlyDocuments)
+ continue;
if (iPanel->msId == aName)
return true;
}