[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - sc/source
Dennis Francis
dennis.francis at collabora.co.uk
Fri Sep 1 07:43:37 UTC 2017
sc/source/ui/vba/vbarange.cxx | 6 ++++++
1 file changed, 6 insertions(+)
New commits:
commit 980fbcaf9de67013b1e72806de7746543040d48e
Author: Dennis Francis <dennis.francis at collabora.co.uk>
Date: Tue Aug 29 15:32:14 2017 +0530
tdf#111939: Fallback to getting view data from best view shell...
...when ScDocShell::GetViewData() returns nullptr. This is needed
when a macro is run from the macro editor window instead of running
the macro from Tools menu in the Calc window.
Change-Id: I89c23c2ec08e8e9907f02eb1389236111530058b
Reviewed-on: https://gerrit.libreoffice.org/41733
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Dennis Francis <dennis.francis at collabora.co.uk>
(cherry picked from commit c864fc9eab79d0b24036588cf8fc37ef51bd1907)
Reviewed-on: https://gerrit.libreoffice.org/41757
Reviewed-by: Eike Rathke <erack at redhat.com>
diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx
index 151403fa1f31..dbe33eed468d 100644
--- a/sc/source/ui/vba/vbarange.cxx
+++ b/sc/source/ui/vba/vbarange.cxx
@@ -4257,6 +4257,12 @@ static void lcl_SelectAll( ScDocShell* pDocShell, ScQueryParam& aParam )
if ( pDocShell )
{
ScViewData* pViewData = ScDocShell::GetViewData();
+ if ( !pViewData )
+ {
+ ScTabViewShell* pViewSh = pDocShell->GetBestViewShell( true );
+ pViewData = pViewSh ? &pViewSh->GetViewData() : nullptr;
+ }
+
if ( pViewData )
{
pViewData->GetView()->Query( aParam, nullptr, true );
More information about the Libreoffice-commits
mailing list