summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2017-12-28 14:42:24 +0100
committerMichael Stahl <mstahl@redhat.com>2018-01-03 16:56:33 +0100
commitffca194466e08691e381d642b07154121edefece (patch)
tree3fa8d2f8b5689e2c49c58fccabfa7d622a69c630 /sfx2
parentef3d75d90724b29c6367f6b0dc4502cfb417ac84 (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/47138 Tested-by: Xisco Faulí <xiscofauli@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'sfx2')
-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 a74763572cdb..49815a9ff649 100644
--- a/sfx2/source/sidebar/UnoPanels.cxx
+++ b/sfx2/source/sidebar/UnoPanels.cxx
@@ -108,6 +108,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;
}