summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2015-02-19 16:39:06 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-03-11 16:21:43 +0100
commite0ad036eed6b151ea81311fcf9ba46f1726b103c (patch)
tree9508f293ab9e4af6f6132dd5ac6827a35b00530f /sfx2
parent1ef9952e804da953706cc514564db92a4a4a07b5 (diff)
mailmerge doesn't need to use the singlefile technique for printing
It should be sufficient for every record to just update the fields and print the document. The printing code apparently rather expects to do the printing in one go, so split the functions up there. Conflicts: include/sfx2/viewsh.hxx include/vcl/print.hxx sfx2/source/view/viewprn.cxx sw/source/uibase/dbui/dbmgr.cxx sw/source/uibase/uno/unomailmerge.cxx vcl/source/gdi/print3.cxx Change-Id: I4d17c703b3220f47609fc4b054ce048b299a0c92
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/view/viewprn.cxx15
1 files changed, 13 insertions, 2 deletions
diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx
index 0ed526d48670..21045325bc5f 100644
--- a/sfx2/source/view/viewprn.cxx
+++ b/sfx2/source/view/viewprn.cxx
@@ -567,8 +567,10 @@ SfxPrinter* SfxViewShell::SetPrinter_Impl( SfxPrinter *pNewPrinter )
return pDocPrinter;
}
-void SfxViewShell::ExecPrint( const uno::Sequence < beans::PropertyValue >& rProps, bool bIsAPI, bool bIsDirect )
+void SfxViewShell::StartPrint( const uno::Sequence < beans::PropertyValue >& rProps, bool bIsAPI, bool bIsDirect )
{
+ assert( pImp->m_xPrinterController.get() == NULL );
+
// get the current selection; our controller should know it
Reference< frame::XController > xController( GetController() );
Reference< view::XSelectionSupplier > xSupplier( xController, UNO_QUERY );
@@ -610,11 +612,20 @@ void SfxViewShell::ExecPrint( const uno::Sequence < beans::PropertyValue >& rPro
SfxObjectShell *pObjShell = GetObjectShell();
xNewController->setValue( OUString( "JobName" ),
makeAny( OUString( pObjShell->GetTitle(0) ) ) );
+}
+void SfxViewShell::ExecPrint( const uno::Sequence < beans::PropertyValue >& rProps, bool bIsAPI, bool bIsDirect )
+{
+ StartPrint( rProps, bIsAPI, bIsDirect );
// FIXME: job setup
SfxPrinter* pDocPrt = GetPrinter(false);
JobSetup aJobSetup = pDocPrt ? pDocPrt->GetJobSetup() : GetJobSetup();
- Printer::PrintJob( xNewController, aJobSetup );
+ Printer::PrintJob( GetPrinterController(), aJobSetup );
+}
+
+std::shared_ptr< vcl::PrinterController > SfxViewShell::GetPrinterController() const
+{
+ return pImp->m_xPrinterController;
}
Printer* SfxViewShell::GetActivePrinter() const