From 17c8f6745f9f98013c1b08de8ec03be66546c7fc Mon Sep 17 00:00:00 2001 From: Noel Power Date: Mon, 23 Apr 2012 13:33:15 +0100 Subject: support Sheets.PrintPreview bnc#757844 there is still a little wrinkle, the preview shell always shows what sheets are selected, it's currently not possible to specify the sheets to preview --- vbahelper/source/vbahelper/vbahelper.cxx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'vbahelper') 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) -- cgit v1.2.3