diff options
Diffstat (limited to 'vbahelper')
-rw-r--r-- | vbahelper/inc/vbahelper/vbahelper.hxx | 1 | ||||
-rw-r--r-- | vbahelper/source/vbahelper/vbahelper.cxx | 12 |
2 files changed, 9 insertions, 4 deletions
diff --git a/vbahelper/inc/vbahelper/vbahelper.hxx b/vbahelper/inc/vbahelper/vbahelper.hxx index e9a316ba1e8c..0acd625053a2 100644 --- a/vbahelper/inc/vbahelper/vbahelper.hxx +++ b/vbahelper/inc/vbahelper/vbahelper.hxx @@ -98,6 +98,7 @@ namespace ooo VBAHELPER_DLLPUBLIC const css::uno::Any& aNULL(); VBAHELPER_DLLPUBLIC void PrintOutHelper( SfxViewShell* pViewShell, const css::uno::Any& From, const css::uno::Any& To, const css::uno::Any& Copies, const css::uno::Any& Preview, const css::uno::Any& ActivePrinter, const css::uno::Any& PrintToFile, const css::uno::Any& Collate, const css::uno::Any& PrToFileName, sal_Bool bSelection ); VBAHELPER_DLLPUBLIC void PrintPreviewHelper( const css::uno::Any& EnableChanges, SfxViewShell* ); + VBAHELPER_DLLPUBLIC void WaitUntilPreviewIsClosed( SfxViewFrame* ); /** Extracts a boolean value from the passed Any, which may contain a Boolean or an integer or floating-point value. Throws, if the Any is empty or contains an incompatible type. */ diff --git a/vbahelper/source/vbahelper/vbahelper.cxx b/vbahelper/source/vbahelper/vbahelper.cxx index 0ef22fd4fa43..ebfc85476be3 100644 --- a/vbahelper/source/vbahelper/vbahelper.cxx +++ b/vbahelper/source/vbahelper/vbahelper.cxx @@ -450,8 +450,7 @@ void PrintOutHelper( SfxViewShell* pViewShell, const uno::Any& From, const uno:: // #TODO is this necessary ( calc specific ) // SC_MOD()->InputEnterHandler(); pViewFrame->GetDispatcher()->Execute( SID_VIEWSHELL1, SFX_CALLMODE_SYNCHRON ); - while ( isInPrintPreview( pViewFrame ) ) - Application::Yield(); + WaitUntilPreviewIsClosed( pViewFrame ); } } else @@ -481,12 +480,17 @@ void PrintOutHelper( SfxViewShell* pViewShell, const uno::Any& From, const uno:: if ( !pViewFrame->GetFrame().IsInPlace() ) { dispatchExecute( pViewShell, SID_VIEWSHELL1 ); - while ( isInPrintPreview( pViewFrame ) ) - Application::Yield(); + WaitUntilPreviewIsClosed( pViewFrame ); } } } +void WaitUntilPreviewIsClosed( SfxViewFrame* pViewFrame ) +{ + while ( pViewFrame && isInPrintPreview( pViewFrame ) ) + Application::Yield(); +} + bool extractBoolFromAny( const uno::Any& rAny ) throw (uno::RuntimeException) { switch( rAny.getValueType().getTypeClass() ) |