summaryrefslogtreecommitdiff
path: root/vbahelper
diff options
context:
space:
mode:
authorNoel Power <noel.power@novell.com>2012-04-24 11:23:46 +0100
committerNoel Power <noel.power@novell.com>2012-04-24 11:26:32 +0100
commit7ddb8f73c1a5573eedc593168f702287921ecb7a (patch)
tree53909f45bb66b2c9bf6def612257012b48b027dd /vbahelper
parent061e4e119cc932dadda976d2b8622f671201a6bd (diff)
tweak support Sheets.PrintPreview bnc#75784 allow specific sheet(s) selection
this is a followup to commit 17c8f6745f9f98013c1b08de8ec03be66546c7fc
Diffstat (limited to 'vbahelper')
-rw-r--r--vbahelper/inc/vbahelper/vbahelper.hxx1
-rw-r--r--vbahelper/source/vbahelper/vbahelper.cxx12
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() )