diff options
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/xml/xmltabi.cxx | 12 | ||||
-rw-r--r-- | sc/source/ui/unoobj/cellsuno.cxx | 7 |
2 files changed, 10 insertions, 9 deletions
diff --git a/sc/source/filter/xml/xmltabi.cxx b/sc/source/filter/xml/xmltabi.cxx index 1069f47605fe..17015291e6c8 100644 --- a/sc/source/filter/xml/xmltabi.cxx +++ b/sc/source/filter/xml/xmltabi.cxx @@ -359,14 +359,12 @@ void ScXMLTableContext::EndElement() SCTAB nCurTab = rTables.GetCurrentSheet(); if (!sPrintRanges.isEmpty()) { - Reference< sheet::XPrintAreas > xPrintAreas( - rTables.GetCurrentXSheet(), UNO_QUERY); - - if( xPrintAreas.is() ) + ScRangeList aRangeList; + ScRangeStringConverter::GetRangeListFromString( aRangeList, sPrintRanges, pDoc, ::formula::FormulaGrammar::CONV_OOO ); + size_t nCount = aRangeList.size(); + for (size_t i=0; i< nCount; i++ ) { - Sequence< table::CellRangeAddress > aRangeList; - ScRangeStringConverter::GetRangeListFromString( aRangeList, sPrintRanges, pDoc, ::formula::FormulaGrammar::CONV_OOO ); - xPrintAreas->setPrintAreas( aRangeList ); + pDoc->AddPrintRange( nCurTab, *aRangeList[i] ); } } else if (!bPrintEntireSheet) diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index 763bf67051cf..1d0a8e8f129c 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -7503,13 +7503,15 @@ void SAL_CALL ScTableSheetObj::setPrintAreas( throw(uno::RuntimeException) { SolarMutexGuard aGuard; + ScPrintRangeSaver* pOldRanges; ScDocShell* pDocSh = GetDocShell(); if ( pDocSh ) { ScDocument* pDoc = pDocSh->GetDocument(); SCTAB nTab = GetTab_Impl(); - ScPrintRangeSaver* pOldRanges = pDoc->CreatePrintRangeSaver(); + if ( pDoc->IsUndoEnabled() ) + pOldRanges = pDoc->CreatePrintRangeSaver(); sal_uInt16 nCount = (sal_uInt16) aPrintAreas.getLength(); pDoc->ClearPrintRanges( nTab ); @@ -7524,7 +7526,8 @@ void SAL_CALL ScTableSheetObj::setPrintAreas( } } - PrintAreaUndo_Impl( pOldRanges ); // Undo, Umbrueche, Modified etc. + if ( pDoc->IsUndoEnabled() ) + PrintAreaUndo_Impl( pOldRanges ); // Undo, Umbrueche, Modified etc. } } |