Kaydet (Commit) 17c8f674 authored tarafından Noel Power's avatar Noel Power

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
üst 3120273a
...@@ -45,6 +45,7 @@ interface XWorksheets ...@@ -45,6 +45,7 @@ interface XWorksheets
void PrintOut( [in] any From, [in] any To, [in] any Copies, [in] any Preview, [in] any ActivePrinter, [in] any PrintToFile, [in] any Collate, [in] any PrToFileName ); void PrintOut( [in] any From, [in] any To, [in] any Copies, [in] any Preview, [in] any ActivePrinter, [in] any PrintToFile, [in] any Collate, [in] any PrToFileName );
void Select( [in] any Replace ); void Select( [in] any Replace );
void Copy( [in] any Before, [in] any After); void Copy( [in] any Before, [in] any After);
void PrintPreview( [in] any EnableChanges );
}; };
}; }; }; }; }; };
......
...@@ -537,4 +537,11 @@ bool ScVbaWorksheets::nameExists( uno::Reference <sheet::XSpreadsheetDocument>& ...@@ -537,4 +537,11 @@ bool ScVbaWorksheets::nameExists( uno::Reference <sheet::XSpreadsheetDocument>&
return false; return false;
} }
void ScVbaWorksheets::PrintPreview( const css::uno::Any& EnableChanges ) throw (css::uno::RuntimeException)
{
// need test, print preview current active sheet
// !! TODO !! get view shell from controller
PrintPreviewHelper( EnableChanges, excel::getBestViewShell( mxModel ) );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -73,6 +73,7 @@ public: ...@@ -73,6 +73,7 @@ public:
virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ); virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource );
virtual void SAL_CALL Select( const css::uno::Any& Replace ) throw (css::uno::RuntimeException); virtual void SAL_CALL Select( const css::uno::Any& Replace ) throw (css::uno::RuntimeException);
virtual void SAL_CALL Copy ( const css::uno::Any& Before, const css::uno::Any& After) throw (css::uno::RuntimeException); virtual void SAL_CALL Copy ( const css::uno::Any& Before, const css::uno::Any& After) throw (css::uno::RuntimeException);
virtual void SAL_CALL PrintPreview( const css::uno::Any& EnableChanges ) throw (css::uno::RuntimeException);
// ScVbaWorksheets_BASE // ScVbaWorksheets_BASE
virtual css::uno::Any SAL_CALL Item( const css::uno::Any& Index1, const css::uno::Any& Index2 ) throw virtual css::uno::Any SAL_CALL Item( const css::uno::Any& Index1, const css::uno::Any& Index2 ) throw
(css::uno::RuntimeException); (css::uno::RuntimeException);
......
...@@ -473,7 +473,18 @@ void PrintOutHelper( SfxViewShell* pViewShell, const uno::Any& From, const uno:: ...@@ -473,7 +473,18 @@ void PrintOutHelper( SfxViewShell* pViewShell, const uno::Any& From, const uno::
void PrintPreviewHelper( const css::uno::Any& /*EnableChanges*/, SfxViewShell* pViewShell ) 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) bool extractBoolFromAny( const uno::Any& rAny ) throw (uno::RuntimeException)
......
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