summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorDennis Francis <dennis.francis@collabora.co.uk>2017-08-29 15:32:14 +0530
committerAndras Timar <andras.timar@collabora.com>2017-09-04 11:23:47 +0200
commit9d7a81991e350e5eb3216299eec13d23fab86fce (patch)
tree1bdefadc22601ab65c19a9f47a45517e429a75fa /sc
parente53c0f102cc4f0ef31a9fffb5b78fd158cf68738 (diff)
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@libreoffice.org> Reviewed-by: Dennis Francis <dennis.francis@collabora.co.uk> (cherry picked from commit c864fc9eab79d0b24036588cf8fc37ef51bd1907) Reviewed-on: https://gerrit.libreoffice.org/41757 Reviewed-by: Eike Rathke <erack@redhat.com> (cherry picked from commit 980fbcaf9de67013b1e72806de7746543040d48e) Signed-off-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/vba/vbarange.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx
index 744473c80c70..c3cee2c3549c 100644
--- a/sc/source/ui/vba/vbarange.cxx
+++ b/sc/source/ui/vba/vbarange.cxx
@@ -4249,6 +4249,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 )
{
OSL_TRACE("Pushing out SelectAll query");