Kaydet (Commit) c864fc9e authored tarafından Dennis Francis's avatar Dennis Francis

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/41733Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarDennis Francis <dennis.francis@collabora.co.uk>
üst 0906937a
...@@ -4255,6 +4255,12 @@ static void lcl_SelectAll( const ScDocShell* pDocShell, const ScQueryParam& aPar ...@@ -4255,6 +4255,12 @@ static void lcl_SelectAll( const ScDocShell* pDocShell, const ScQueryParam& aPar
if ( pDocShell ) if ( pDocShell )
{ {
ScViewData* pViewData = ScDocShell::GetViewData(); ScViewData* pViewData = ScDocShell::GetViewData();
if ( !pViewData )
{
ScTabViewShell* pViewSh = pDocShell->GetBestViewShell( true );
pViewData = pViewSh ? &pViewSh->GetViewData() : nullptr;
}
if ( pViewData ) if ( pViewData )
{ {
pViewData->GetView()->Query( aParam, nullptr, true ); pViewData->GetView()->Query( aParam, nullptr, true );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment