Kaydet (Commit) 95179fe9 authored tarafından Valentin Kettner's avatar Valentin Kettner

Cleaning up of IDocumentDeviceAccess methods in SwDoc.

Moved all SwDoc::getJobSetup and SwDoc::setJobSetup calls to their
appropriate interface methods (SwDoc::getIDocumentDeviceAccess::").

Change-Id: I155a0341363ec42eaad3290d2e6feb8c7d73bbb1
üst cf8a3e70
......@@ -679,8 +679,6 @@ public:
// IDocumentDeviceAccess
const IDocumentDeviceAccess* getIDocumentDeviceAccessConst() const;
IDocumentDeviceAccess* getIDocumentDeviceAccess();
virtual const JobSetup* getJobsetup() const;
virtual void setJobsetup(/*[in]*/ const JobSetup& rJobSetup );
virtual const SwPrintData & getPrintData() const;
virtual void setPrintData(/*[in]*/ const SwPrintData& rPrtData);
......
......@@ -254,16 +254,6 @@ IDocumentDeviceAccess* SwDoc::getIDocumentDeviceAccess()
return m_DeviceAccess.get();
}
const JobSetup* SwDoc::getJobsetup() const
{
return getIDocumentDeviceAccessConst()->getJobsetup();
}
void SwDoc::setJobsetup(/*[in]*/ const JobSetup& rJobSetup )
{
getIDocumentDeviceAccess()->setJobsetup( rJobSetup );
}
const SwPrintData & SwDoc::getPrintData() const
{
return getIDocumentDeviceAccessConst()->getPrintData();
......
......@@ -804,10 +804,10 @@ void SwDocShell::Draw( OutputDevice* pDev, const JobSetup& rSetup,
JobSetup *pOrig = 0;
if ( !rSetup.GetPrinterName().isEmpty() && ASPECT_THUMBNAIL != nAspect )
{
pOrig = const_cast<JobSetup*>(pDoc->getJobsetup());
pOrig = const_cast<JobSetup*>(pDoc->getIDocumentDeviceAccessConst()->getJobsetup());
if( pOrig ) // then we copy that
pOrig = new JobSetup( *pOrig );
pDoc->setJobsetup( rSetup );
pDoc->getIDocumentDeviceAccess()->setJobsetup( rSetup );
}
Rectangle aRect( nAspect == ASPECT_THUMBNAIL ?
......@@ -824,7 +824,7 @@ void SwDocShell::Draw( OutputDevice* pDev, const JobSetup& rSetup,
if( pOrig )
{
pDoc->setJobsetup( *pOrig );
pDoc->getIDocumentDeviceAccess()->setJobsetup( *pOrig );
delete pOrig;
}
if ( bResetModified )
......@@ -882,7 +882,7 @@ OutputDevice* SwDocShell::GetDocumentRefDev()
void SwDocShell::OnDocumentPrinterChanged( Printer * pNewPrinter )
{
if ( pNewPrinter )
GetDoc()->setJobsetup( pNewPrinter->GetJobSetup() );
GetDoc()->getIDocumentDeviceAccess()->setJobsetup( pNewPrinter->GetJobSetup() );
else
GetDoc()->getIDocumentDeviceAccess()->setPrinter( 0, true, true );
}
......
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