diff -uPr old/sc/inc/document.hxx new/sc/inc/document.hxx --- old/sc/inc/document.hxx 2009-03-05 15:29:50.000000000 +0800 +++ new/sc/inc/document.hxx 2009-03-05 11:50:24.000000000 +0800 @@ -422,7 +422,7 @@ ScDocument( ScDocumentMode eMode = SCDOCMODE_DOCUMENT, SfxObjectShell* pDocShell = NULL ); ~ScDocument(); - + ScTable** GetTab() { return pTab; } inline ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > GetServiceManager() const { return xServiceManager; } diff -uPr old/sc/inc/table.hxx new/sc/inc/table.hxx --- old/sc/inc/table.hxx 2009-03-05 15:29:44.000000000 +0800 +++ new/sc/inc/table.hxx 2009-03-05 13:40:28.000000000 +0800 @@ -157,6 +157,7 @@ friend class ScHorizontalAttrIterator; friend class ScDocAttrIterator; friend class ScAttrRectIterator; +friend class ScUndoQuery; public: diff -uPr old/sc/source/ui/undo/undodat.cxx new/sc/source/ui/undo/undodat.cxx --- old/sc/source/ui/undo/undodat.cxx 2009-03-05 15:30:02.000000000 +0800 +++ new/sc/source/ui/undo/undodat.cxx 2009-03-05 11:40:42.000000000 +0800 @@ -1025,8 +1025,13 @@ } } else + { pUndoDoc->CopyToDocument( 0, aQueryParam.nRow1, nTab, MAXCOL, aQueryParam.nRow2, nTab, IDF_NONE, FALSE, pDoc ); + SCTAB nTabNo = pViewShell->GetViewData()->GetTabNo(); + ScTable* pTab = pDoc->GetTab()[nTabNo]; + pTab->SetDrawPageSize(); + } if (pUndoDB) pDoc->SetDBCollection( new ScDBCollection( *pUndoDB ), TRUE );