View | Details | Raw Unified | Return to issue 120105
Collapse All | Expand All

(-)source/ui/unoobj/cellsuno.cxx (-14 / +26 lines)
Lines 7365-7395 Link Here
7365
void ScTableSheetObj::PrintAreaUndo_Impl( ScPrintRangeSaver* pOldRanges )
7365
void ScTableSheetObj::PrintAreaUndo_Impl( ScPrintRangeSaver* pOldRanges )
7366
{
7366
{
7367
	//	Umbrueche und Undo
7367
	//	Umbrueche und Undo
7368
	ScDocShell* pDocSh = GetDocShell();
7369
	ScDocument* pDoc = pDocSh ? pDocSh->GetDocument() : 0;
7368
7370
7369
	ScDocShell* pDocSh = GetDocShell();
7371
    if(pDocSh && pDoc)
7370
	if ( pDocSh )
7371
	{
7372
	{
7372
		ScDocument* pDoc = pDocSh->GetDocument();
7373
		const bool bUndo(pDoc->IsUndoEnabled());
7373
		sal_Bool bUndo(pDoc->IsUndoEnabled());
7374
		const SCTAB nTab(GetTab_Impl());
7374
		SCTAB nTab = GetTab_Impl();
7375
7375
7376
		ScPrintRangeSaver* pNewRanges = pDoc->CreatePrintRangeSaver();
7376
		if(bUndo)
7377
		if (bUndo)
7378
		{
7377
		{
7379
			pDocSh->GetUndoManager()->AddUndoAction(
7378
            pDocSh->GetUndoManager()->AddUndoAction(
7380
						new ScUndoPrintRange( pDocSh, nTab, pOldRanges, pNewRanges ) );
7379
			    new ScUndoPrintRange( 
7380
                    pDocSh, 
7381
                    nTab, 
7382
                    pOldRanges,
7383
                    pDoc->CreatePrintRangeSaver())); // create new ranges
7384
7385
            // #120105# ownership of old ranges has changed, mark as consumed
7386
            pOldRanges = 0;
7381
		}
7387
		}
7382
7388
7383
		ScPrintFunc( pDocSh, pDocSh->GetPrinter(), nTab ).UpdatePages();
7389
		ScPrintFunc(pDocSh, pDocSh->GetPrinter(), nTab).UpdatePages();
7384
7385
		SfxBindings* pBindings = pDocSh->GetViewBindings();
7390
		SfxBindings* pBindings = pDocSh->GetViewBindings();
7386
		if (pBindings)
7387
			pBindings->Invalidate( SID_DELETE_PRINTAREA );
7388
7391
7392
        if(pBindings)
7393
        {
7394
			pBindings->Invalidate(SID_DELETE_PRINTAREA);
7395
        }
7396
7389
		pDocSh->SetDocumentModified();
7397
		pDocSh->SetDocumentModified();
7390
	}
7398
	}
7391
	else
7399
7400
    if(pOldRanges)
7401
    {
7402
        // #120105# pOldRanges not used, need to cleanup
7392
		delete pOldRanges;
7403
		delete pOldRanges;
7404
    }
7393
}
7405
}
7394
7406
7395
uno::Sequence<table::CellRangeAddress> SAL_CALL ScTableSheetObj::getPrintAreas()
7407
uno::Sequence<table::CellRangeAddress> SAL_CALL ScTableSheetObj::getPrintAreas()

Return to issue 120105