protect more printer code-paths.
Change-Id: Ic5bc5c3325b460cba0d95484454c9bb826684890
This commit is contained in:
@@ -51,7 +51,9 @@ DocShell::DocShell()
|
||||
}
|
||||
|
||||
DocShell::~DocShell()
|
||||
{ }
|
||||
{
|
||||
pPrinter.disposeAndClear();
|
||||
}
|
||||
|
||||
SfxPrinter* DocShell::GetPrinter( bool bCreate )
|
||||
{
|
||||
|
@@ -637,7 +637,7 @@ Printer* SfxViewShell::GetActivePrinter() const
|
||||
void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
|
||||
{
|
||||
sal_uInt16 nDialogRet = RET_CANCEL;
|
||||
SfxPrinter* pPrinter = 0;
|
||||
VclPtr<SfxPrinter> pPrinter;
|
||||
bool bSilent = false;
|
||||
|
||||
// does the function have been called by the user interface or by an API call
|
||||
@@ -774,7 +774,7 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
|
||||
|
||||
// if printer is unknown, it can't be used - now printer from document will be used
|
||||
if ( !pPrinter->IsKnown() )
|
||||
DELETEZ(pPrinter);
|
||||
pPrinter.disposeAndClear();
|
||||
}
|
||||
|
||||
if ( SID_PRINTER_NAME == nId )
|
||||
@@ -816,7 +816,7 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
|
||||
if ( !bIsAPI )
|
||||
{
|
||||
// PrinterDialog needs a temporary printer
|
||||
SfxPrinter* pDlgPrinter = pPrinter->Clone();
|
||||
VclPtr<SfxPrinter> pDlgPrinter = pPrinter->Clone();
|
||||
nDialogRet = 0;
|
||||
|
||||
// execute PrinterSetupDialog
|
||||
@@ -868,13 +868,12 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
|
||||
|
||||
// forget new printer, it was taken over (as pPrinter) or deleted
|
||||
pDlgPrinter = NULL;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// PrinterDialog is used to transfer information on printing,
|
||||
// so it will only be deleted here if dialog was cancelled
|
||||
DELETEZ( pDlgPrinter );
|
||||
pDlgPrinter.disposeAndClear();
|
||||
rReq.Ignore();
|
||||
}
|
||||
}
|
||||
|
@@ -642,7 +642,7 @@ void SmModel::_setPropertyValues(const PropertyMapEntry** ppEntries, const Any*
|
||||
SfxItemSet *pItemSet = new SfxItemSet( pDocSh->GetPool(), nRange );
|
||||
SmModule *pp = SM_MOD();
|
||||
pp->GetConfig()->ConfigToItemSet(*pItemSet);
|
||||
SfxPrinter *pPrinter = SfxPrinter::Create ( aStream, pItemSet );
|
||||
VclPtr<SfxPrinter> pPrinter = SfxPrinter::Create ( aStream, pItemSet );
|
||||
|
||||
pDocSh->SetPrinter( pPrinter );
|
||||
}
|
||||
|
@@ -53,8 +53,9 @@ void ImplFreePrnDlgListBox( ListBox* pBox, bool bClear )
|
||||
|
||||
|
||||
Printer* ImplPrnDlgListBoxSelect( ListBox* pBox, PushButton* pPropBtn,
|
||||
Printer* pPrinter, Printer* pTempPrinter )
|
||||
Printer* pPrinter, Printer* pTempPrinterIn )
|
||||
{
|
||||
VclPtr<Printer> pTempPrinter( pTempPrinterIn );
|
||||
if ( pBox->GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND )
|
||||
{
|
||||
const QueueInfo* pInfo = Printer::GetQueueInfo( pBox->GetSelectEntry(), true );
|
||||
@@ -73,7 +74,7 @@ Printer* ImplPrnDlgListBoxSelect( ListBox* pBox, PushButton* pPropBtn,
|
||||
if ( (pTempPrinter->GetName() != pInfo->GetPrinterName()) ||
|
||||
(pTempPrinter->GetDriverName() != pInfo->GetDriver()) )
|
||||
{
|
||||
VclPtr<Printer>(pTempPrinter).disposeAndClear();
|
||||
pTempPrinter.disposeAndClear();
|
||||
pTempPrinter = new Printer( *pInfo );
|
||||
}
|
||||
}
|
||||
@@ -91,8 +92,9 @@ Printer* ImplPrnDlgListBoxSelect( ListBox* pBox, PushButton* pPropBtn,
|
||||
|
||||
|
||||
|
||||
Printer* ImplPrnDlgUpdatePrinter( Printer* pPrinter, Printer* pTempPrinter )
|
||||
Printer* ImplPrnDlgUpdatePrinter( Printer* pPrinter, Printer* pTempPrinterIn )
|
||||
{
|
||||
VclPtr<Printer> pTempPrinter( pTempPrinterIn );
|
||||
OUString aPrnName;
|
||||
if ( pTempPrinter )
|
||||
aPrnName = pTempPrinter->GetName();
|
||||
@@ -101,7 +103,7 @@ Printer* ImplPrnDlgUpdatePrinter( Printer* pPrinter, Printer* pTempPrinter )
|
||||
|
||||
if ( ! Printer::GetQueueInfo( aPrnName, false ) )
|
||||
{
|
||||
VclPtr<Printer>(pTempPrinter).disposeAndClear();
|
||||
pTempPrinter.disposeAndClear();
|
||||
pTempPrinter = new Printer;
|
||||
}
|
||||
|
||||
|
@@ -425,7 +425,7 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf
|
||||
0
|
||||
};
|
||||
SfxItemSet *pItemSet = new SfxItemSet( mpDoc->GetAttrPool(), nRange );
|
||||
SfxPrinter *pPrinter = SfxPrinter::Create ( aStream, pItemSet );
|
||||
VclPtr<SfxPrinter> pPrinter = SfxPrinter::Create ( aStream, pItemSet );
|
||||
|
||||
// set printer only once; in _postSetValues
|
||||
mpPrinter.disposeAndClear();
|
||||
|
@@ -343,6 +343,9 @@ inline void ImplCalcMapResolution( const MapMode& rMapMode,
|
||||
// #i75163#
|
||||
void OutputDevice::ImplInvalidateViewTransform()
|
||||
{
|
||||
if(!mpOutDevData)
|
||||
return;
|
||||
|
||||
if(mpOutDevData->mpViewTransform)
|
||||
{
|
||||
delete mpOutDevData->mpViewTransform;
|
||||
|
Reference in New Issue
Block a user