diff options
Diffstat (limited to 'vbahelper/source/vbahelper/vbahelper.cxx')
-rw-r--r-- | vbahelper/source/vbahelper/vbahelper.cxx | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/vbahelper/source/vbahelper/vbahelper.cxx b/vbahelper/source/vbahelper/vbahelper.cxx index b91ef85e126d..0ef22fd4fa43 100644 --- a/vbahelper/source/vbahelper/vbahelper.cxx +++ b/vbahelper/source/vbahelper/vbahelper.cxx @@ -473,7 +473,18 @@ void PrintOutHelper( SfxViewShell* pViewShell, const uno::Any& From, const uno:: void PrintPreviewHelper( const css::uno::Any& /*EnableChanges*/, SfxViewShell* pViewShell ) { - dispatchExecute( pViewShell, SID_VIEWSHELL1 ); + SfxViewFrame* pViewFrame = NULL; + if ( pViewShell ) + pViewFrame = pViewShell->GetViewFrame(); + if ( pViewFrame ) + { + if ( !pViewFrame->GetFrame().IsInPlace() ) + { + dispatchExecute( pViewShell, SID_VIEWSHELL1 ); + while ( isInPrintPreview( pViewFrame ) ) + Application::Yield(); + } + } } bool extractBoolFromAny( const uno::Any& rAny ) throw (uno::RuntimeException) |