Kaydet (Commit) 3bd78cb6 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

error: reference cannot be bound to dereferenced null pointer

Change-Id: I4a5c83ba0f1e741104edc933459e7aea9c4aac1f
üst 7649a142
......@@ -109,6 +109,7 @@ SfxPrinter::SfxPrinter( SfxItemSet* pTheOptions ) :
bKnown(true)
{
assert(pOptions);
pImpl = new SfxPrinter_Impl;
}
......@@ -121,6 +122,7 @@ SfxPrinter::SfxPrinter( SfxItemSet* pTheOptions,
pOptions ( pTheOptions )
{
assert(pOptions);
pImpl = new SfxPrinter_Impl;
bKnown = GetName() == rTheOrigJobSetup.GetPrinterName();
......@@ -138,6 +140,7 @@ SfxPrinter::SfxPrinter( SfxItemSet* pTheOptions,
bKnown ( GetName() == rPrinterName )
{
assert(pOptions);
pImpl = new SfxPrinter_Impl;
}
......@@ -149,6 +152,7 @@ SfxPrinter::SfxPrinter( const SfxPrinter& rPrinter ) :
pOptions( rPrinter.GetOptions().Clone() ),
bKnown ( rPrinter.IsKnown() )
{
assert(pOptions);
SetJobSetup( rPrinter.GetJobSetup() );
SetPrinterProps( &rPrinter );
SetMapMode( rPrinter.GetMapMode() );
......
......@@ -478,16 +478,11 @@ SfxPrinter* SfxViewShell::SetPrinter_Impl( SfxPrinter *pNewPrinter )
SfxPrinter *pDocPrinter = GetPrinter();
// Evaluate Printer Options
bool bOriToDoc = false;
bool bSizeToDoc = false;
if ( &pDocPrinter->GetOptions() )
{
sal_uInt16 nWhich = GetPool().GetWhich(SID_PRINTER_CHANGESTODOC);
const SfxFlagItem *pFlagItem = 0;
pDocPrinter->GetOptions().GetItemState( nWhich, false, (const SfxPoolItem**) &pFlagItem );
bOriToDoc = pFlagItem ? (pFlagItem->GetValue() & SFX_PRINTER_CHG_ORIENTATION) : sal_False;
bSizeToDoc = pFlagItem ? (pFlagItem->GetValue() & SFX_PRINTER_CHG_SIZE) : sal_False;
}
sal_uInt16 nWhich = GetPool().GetWhich(SID_PRINTER_CHANGESTODOC);
const SfxFlagItem *pFlagItem = 0;
pDocPrinter->GetOptions().GetItemState( nWhich, false, (const SfxPoolItem**) &pFlagItem );
bool bOriToDoc = pFlagItem && (pFlagItem->GetValue() & SFX_PRINTER_CHG_ORIENTATION);
bool bSizeToDoc = pFlagItem && (pFlagItem->GetValue() & SFX_PRINTER_CHG_SIZE);
// Determine the previous format and size
Orientation eOldOri = pDocPrinter->GetOrientation();
......
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