diff options
-rw-r--r-- | sfx2/source/view/printer.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/view/viewprn.cxx | 15 |
2 files changed, 9 insertions, 10 deletions
diff --git a/sfx2/source/view/printer.cxx b/sfx2/source/view/printer.cxx index ba4f4ebc3a31..94bb8c49705c 100644 --- a/sfx2/source/view/printer.cxx +++ b/sfx2/source/view/printer.cxx @@ -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() ); diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx index 267ab28c4e1f..7ef21f9582cc 100644 --- a/sfx2/source/view/viewprn.cxx +++ b/sfx2/source/view/viewprn.cxx @@ -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(); |