From 466d0a7883918db3d3d88a7d19fe333d34155b73 Mon Sep 17 00:00:00 2001 From: "Daniel Rentz [dr]" Date: Thu, 2 Sep 2010 15:18:49 +0200 Subject: dr77: prepare creation of missing modules --- sc/source/ui/docshell/docfunc.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'sc/source/ui/docshell') diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index 36b6641d94a6..27112d8c62c2 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -2650,8 +2650,7 @@ void VBA_InsertModule( ScDocument& rDoc, SCTAB nTab, String& sModuleName, String uno::Reference< script::vba::XVBAModuleInfo > xVBAModuleInfo( xLib, uno::UNO_QUERY ); if ( xVBAModuleInfo.is() ) { - String sCodeName( genModuleName ); - rDoc.SetCodeName( nTab, sCodeName ); + rDoc.SetCodeName( nTab, genModuleName ); script::ModuleInfo sModuleInfo = lcl_InitModuleInfo( rDocSh, genModuleName ); xVBAModuleInfo->insertModuleInfo( genModuleName, sModuleInfo ); xLib->insertByName( genModuleName, aSourceAny ); -- cgit From 708c1ed37dd34037ecfc9f229270c10bb0366f74 Mon Sep 17 00:00:00 2001 From: "Daniel Rentz [dr]" Date: Tue, 19 Oct 2010 19:41:33 +0200 Subject: dr77: oox: improve consistency of class/struct names and constant names, improvements for web queries --- sc/source/ui/docshell/docfunc.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'sc/source/ui/docshell') diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index 27112d8c62c2..4677eecbf20c 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -4861,9 +4861,11 @@ BOOL ScDocFunc::InsertAreaLink( const String& rFile, const String& rFilter, } // Update hat sein eigenes Undo - - pLink->SetDoInsert(bFitBlock); // beim ersten Update ggf. nichts einfuegen - pLink->Update(); // kein SetInCreate -> Update ausfuehren + if (pDoc->IsExecuteLinkEnabled()) + { + pLink->SetDoInsert(bFitBlock); // beim ersten Update ggf. nichts einfuegen + pLink->Update(); // kein SetInCreate -> Update ausfuehren + } pLink->SetDoInsert(TRUE); // Default = TRUE SfxBindings* pBindings = rDocShell.GetViewBindings(); -- cgit From 09e3535aaaa0b2c889f75974e6a29878254e26d8 Mon Sep 17 00:00:00 2001 From: Niklas Nebel Date: Fri, 22 Oct 2010 15:55:40 +0200 Subject: dr77: #i106108# SetDocumentModified in ScDocFunc::SetWidthOrHeight --- sc/source/ui/docshell/docfunc.cxx | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sc/source/ui/docshell') diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index 4677eecbf20c..915c846b663b 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -3121,6 +3121,8 @@ BOOL ScDocFunc::SetWidthOrHeight( BOOL bWidth, SCCOLROW nRangeCnt, SCCOLROW* pRa ScSizeMode eMode, USHORT nSizeTwips, BOOL bRecord, BOOL bApi ) { + ScDocShellModificator aModificator( rDocShell ); + if (!nRangeCnt) return TRUE; @@ -3282,6 +3284,7 @@ BOOL ScDocFunc::SetWidthOrHeight( BOOL bWidth, SCCOLROW nRangeCnt, SCCOLROW* pRa pDoc->UpdatePageBreaks( nTab ); rDocShell.PostPaint(0,0,nTab,MAXCOL,MAXROW,nTab,PAINT_ALL); + aModificator.SetDocumentModified(); return bSuccess; } -- cgit From c0b1151e425c4467ee8a9defae042497265523c3 Mon Sep 17 00:00:00 2001 From: Niklas Nebel Date: Wed, 27 Oct 2010 12:49:41 +0200 Subject: dr77: #i105279# InvalidateTableArea in SetDocumentModified with locked repaint --- sc/source/ui/docshell/docsh.cxx | 1 + 1 file changed, 1 insertion(+) (limited to 'sc/source/ui/docshell') diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index d5d7f6e09292..40702793e770 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -2618,6 +2618,7 @@ void ScDocShell::SetDocumentModified( BOOL bIsModified /* = TRUE */ ) if ( pPaintLockData && bIsModified ) { //! BCA_BRDCST_ALWAYS etc. also needed here? + aDocument.InvalidateTableArea(); // #i105279# needed here aDocument.BroadcastUno( SfxSimpleHint( SFX_HINT_DATACHANGED ) ); pPaintLockData->SetModified(); // spaeter... -- cgit From e8d5e10eee4e163a359417d342f7edee724b216e Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 4 Nov 2010 18:49:17 +0100 Subject: vcl117: #i115056# remove now unused svtools PrintDialog --- sc/source/ui/docshell/docsh4.cxx | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) (limited to 'sc/source/ui/docshell') diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index bba756b397cb..44fd347e5aed 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -55,7 +55,6 @@ using namespace ::com::sun::star; #include #include #include -#include #include #include #include @@ -1830,7 +1829,7 @@ void ScDocShell::GetStatePageStyle( SfxViewShell& /* rCaller */, void lcl_GetPrintData( ScDocShell* pDocShell /*in*/, ScDocument* pDocument /*in*/, SfxPrinter* pPrinter /*in*/, - PrintDialog* pPrintDialog /*in*/, bool bForceSelected /*in*/, + bool bForceSelected /*in*/, ScMarkData* pMarkData /*inout*/, bool& rbHasOptions /*out*/, ScPrintOptions& rOptions /*out*/, bool& rbAllTabs /*out*/, long& rnTotalPages /*out*/, long aPageArr[] /*out*/, @@ -1868,13 +1867,13 @@ void lcl_GetPrintData( ScDocShell* pDocShell /*in*/, rPageRanges.SetTotalRange( Range( 0, RANGE_MAX ) ); rPageRanges.Select( Range( 1, rnTotalPages ) ); - rbAllTabs = ( pPrintDialog ? ( pPrintDialog->GetCheckedSheetRange() == PRINTSHEETS_ALL ) : SC_MOD()->GetPrintOptions().GetAllSheets() ); + rbAllTabs = SC_MOD()->GetPrintOptions().GetAllSheets(); if ( bForceSelected ) { rbAllTabs = false; } - if ( ( pPrintDialog && pPrintDialog->GetCheckedSheetRange() == PRINTSHEETS_SELECTED_CELLS ) || bForceSelected ) + if ( bForceSelected ) { if ( pMarkData && ( pMarkData->IsMarked() || pMarkData->IsMultiMarked() ) ) { @@ -1885,12 +1884,6 @@ void lcl_GetPrintData( ScDocShell* pDocShell /*in*/, } } - PrintDialogRange eDlgOption = pPrintDialog ? pPrintDialog->GetCheckedRange() : PRINTDIALOG_ALL; - if ( eDlgOption == PRINTDIALOG_RANGE ) - { - rPageRanges = MultiSelection( pPrintDialog->GetRangeText() ); - } - // get number of total pages if selection if ( !rbAllTabs ) { @@ -1907,14 +1900,14 @@ void lcl_GetPrintData( ScDocShell* pDocShell /*in*/, rnTotalPages += aPageArr[nTab]; } } - if ( eDlgOption == PRINTDIALOG_ALL || bForceSelected ) + if ( bForceSelected ) { rPageRanges.Select( Range( 1, rnTotalPages ) ); } } } -bool ScDocShell::CheckPrint( PrintDialog* pPrintDialog, ScMarkData* pMarkData, bool bForceSelected, bool bIsAPI ) +bool ScDocShell::CheckPrint( ScMarkData* pMarkData, bool bForceSelected, bool bIsAPI ) { SfxPrinter* pPrinter = GetPrinter(); if ( !pPrinter ) @@ -1930,7 +1923,7 @@ bool ScDocShell::CheckPrint( PrintDialog* pPrintDialog, ScMarkData* pMarkData, b MultiSelection aPageRanges; // pages to print ScRange* pMarkedRange = NULL; - lcl_GetPrintData( this, &aDocument, pPrinter, pPrintDialog, bForceSelected, + lcl_GetPrintData( this, &aDocument, pPrinter, bForceSelected, pMarkData, bHasOptions, aOptions, bAllTabs, nTotalPages, aPageArr, aPageRanges, &pMarkedRange ); @@ -1950,7 +1943,7 @@ bool ScDocShell::CheckPrint( PrintDialog* pPrintDialog, ScMarkData* pMarkData, b return true; } -void ScDocShell::PreparePrint( PrintDialog* pPrintDialog, ScMarkData* pMarkData ) +void ScDocShell::PreparePrint( ScMarkData* pMarkData ) { SfxPrinter* pPrinter = GetPrinter(); if ( !pPrinter ) @@ -1973,7 +1966,7 @@ void ScDocShell::PreparePrint( PrintDialog* pPrintDialog, ScMarkData* pMarkData MultiSelection aPageRanges; // pages to print ScRange* pMarkedRange = NULL; - lcl_GetPrintData( this, &aDocument, pPrinter, pPrintDialog, false, + lcl_GetPrintData( this, &aDocument, pPrinter, false, pMarkData, bHasOptions, aOptions, bAllTabs, nTotalPages, aPageArr, aPageRanges, &pMarkedRange ); @@ -2043,7 +2036,7 @@ BOOL lcl_HasTransparent( ScDocument* pDoc, SCTAB nTab, const ScRange* pRange ) return bFound; } -void ScDocShell::Print( SfxProgress& rProgress, PrintDialog* pPrintDialog, +void ScDocShell::Print( SfxProgress& rProgress, ScMarkData* pMarkData, Window* pDialogParent, BOOL bForceSelected, BOOL bIsAPI ) { SfxPrinter* pPrinter = GetPrinter(); @@ -2060,14 +2053,11 @@ void ScDocShell::Print( SfxProgress& rProgress, PrintDialog* pPrintDialog, MultiSelection aPageRanges; // pages to print ScRange* pMarkedRange = NULL; - lcl_GetPrintData( this, &aDocument, pPrinter, pPrintDialog, bForceSelected, + lcl_GetPrintData( this, &aDocument, pPrinter, bForceSelected, pMarkData, bHasOptions, aOptions, bAllTabs, nTotalPages, aPageArr, aPageRanges, &pMarkedRange ); USHORT nCollateCopies = 1; - if ( pPrintDialog && pPrintDialog->IsCollateEnabled() && pPrintDialog->IsCollateChecked() ) - nCollateCopies = pPrintDialog->GetCopyCount(); - // test if printed range contains transparent objects BOOL bHasTransp = FALSE; -- cgit From 0304fc8ab143e4fa0a700cb8858fea4ef1b9fdf5 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Mon, 8 Nov 2010 14:43:10 +0100 Subject: vcl117: #i115477# remove unused methods --- sc/source/ui/docshell/docsh4.cxx | 91 +++++++++++++++++++--------------------- 1 file changed, 43 insertions(+), 48 deletions(-) (limited to 'sc/source/ui/docshell') diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index 44fd347e5aed..d6386d040d0c 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -2093,64 +2093,59 @@ void ScDocShell::Print( SfxProgress& rProgress, } } - BOOL bContinue = pPrinter->InitJob( pDialogParent, !bIsAPI && bHasTransp ); - - if ( bContinue ) + for ( USHORT n=0; nGetTableSelect( nTab ) ) { - if ( bAllTabs || !pMarkData || pMarkData->GetTableSelect( nTab ) ) - { - FmFormView* pDrawView = NULL; - Rectangle aFull( 0, 0, LONG_MAX, LONG_MAX ); + FmFormView* pDrawView = NULL; + Rectangle aFull( 0, 0, LONG_MAX, LONG_MAX ); - // #114135# - ScDrawLayer* pModel = aDocument.GetDrawLayer(); // ist nicht NULL + // #114135# + ScDrawLayer* pModel = aDocument.GetDrawLayer(); // ist nicht NULL - if(pModel) - { - pDrawView = new FmFormView( pModel, pPrinter ); - pDrawView->ShowSdrPage(pDrawView->GetModel()->GetPage(nTab)); - pDrawView->SetPrintPreview( TRUE ); - } + if(pModel) + { + pDrawView = new FmFormView( pModel, pPrinter ); + pDrawView->ShowSdrPage(pDrawView->GetModel()->GetPage(nTab)); + pDrawView->SetPrintPreview( TRUE ); + } - ScPrintFunc aPrintFunc( this, pPrinter, nTab, nAttrPage, nTotalPages, pMarkedRange, &aOptions ); - aPrintFunc.SetDrawView( pDrawView ); - nPrinted += aPrintFunc.DoPrint( aPageRanges, nTabStart, nDisplayStart, TRUE, &rProgress, NULL ); + ScPrintFunc aPrintFunc( this, pPrinter, nTab, nAttrPage, nTotalPages, pMarkedRange, &aOptions ); + aPrintFunc.SetDrawView( pDrawView ); + nPrinted += aPrintFunc.DoPrint( aPageRanges, nTabStart, nDisplayStart, TRUE, &rProgress, NULL ); - nTabStart += aPageArr[nTab]; - if ( aDocument.NeedPageResetAfterTab(nTab) ) - nDisplayStart = 0; - else - nDisplayStart += aPageArr[nTab]; - nAttrPage = aPrintFunc.GetFirstPageNo(); // behalten oder aus Vorlage + nTabStart += aPageArr[nTab]; + if ( aDocument.NeedPageResetAfterTab(nTab) ) + nDisplayStart = 0; + else + nDisplayStart += aPageArr[nTab]; + nAttrPage = aPrintFunc.GetFirstPageNo(); // behalten oder aus Vorlage - delete pDrawView; - } + delete pDrawView; } + } - if ( n+1 < nCollateCopies && - (pPrinter->GetDuplexMode() == DUPLEX_SHORTEDGE || pPrinter->GetDuplexMode() == DUPLEX_LONGEDGE) && - ( nPrinted % 2 ) == 1 ) - { - // #105584# when several collated copies are printed in duplex mode, and there is - // an odd number of pages, print an empty page between copies, so the first page of - // the second copy isn't printed on the back of the last page of the first copy. - // (same as in Writer ViewShell::Prt) - - // FIXME: needs to be adapted to XRenderable interface - #if 0 - pPrinter->StartPage(); - pPrinter->EndPage(); - #endif - } + if ( n+1 < nCollateCopies && + (pPrinter->GetDuplexMode() == DUPLEX_SHORTEDGE || pPrinter->GetDuplexMode() == DUPLEX_LONGEDGE) && + ( nPrinted % 2 ) == 1 ) + { + // #105584# when several collated copies are printed in duplex mode, and there is + // an odd number of pages, print an empty page between copies, so the first page of + // the second copy isn't printed on the back of the last page of the first copy. + // (same as in Writer ViewShell::Prt) + + // FIXME: needs to be adapted to XRenderable interface + #if 0 + pPrinter->StartPage(); + pPrinter->EndPage(); + #endif } } -- cgit From 0d3513ca6431804576aef6e294aed3baa305774f Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 9 Nov 2010 15:20:35 +0100 Subject: vcl117: #i115477# clean up unused methods --- sc/source/ui/docshell/docsh4.cxx | 198 --------------------------------------- 1 file changed, 198 deletions(-) (limited to 'sc/source/ui/docshell') diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index d6386d040d0c..4b7f79ddfc51 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -1943,60 +1943,6 @@ bool ScDocShell::CheckPrint( ScMarkData* pMarkData, bool bForceSelected, bool bI return true; } -void ScDocShell::PreparePrint( ScMarkData* pMarkData ) -{ - SfxPrinter* pPrinter = GetPrinter(); - if ( !pPrinter ) - { - return; - } - - delete pOldJobSetup; // gesetzt nur bei Fehler in StartJob() - pOldJobSetup = new ScJobSetup( pPrinter ); // Einstellungen merken - - // Einstellungen fuer die erste gedruckte Seite muessen hier (vor StartJob) gesetzt werden - //! Selection etc. mit Print() zusammenfassen !!! - //! Seiten nur einmal zaehlen - - bool bHasOptions = false; - ScPrintOptions aOptions; - bool bAllTabs = true; - long nTotalPages = 0; - long aPageArr[MAXTABCOUNT]; // pages per sheet - MultiSelection aPageRanges; // pages to print - ScRange* pMarkedRange = NULL; - - lcl_GetPrintData( this, &aDocument, pPrinter, false, - pMarkData, bHasOptions, aOptions, bAllTabs, nTotalPages, - aPageArr, aPageRanges, &pMarkedRange ); - - BOOL bFound = FALSE; // erste Seite gefunden - long nTabStart = 0; - SCTAB nTabCount = aDocument.GetTableCount(); - for ( SCTAB nTab=0; nTabGetTableSelect( nTab ) ) - { - long nNext = nTabStart + aPageArr[nTab]; - BOOL bSelected = FALSE; - for (long nP=nTabStart+1; nP<=nNext; nP++) // 1-basiert - if (aPageRanges.IsSelected( nP )) // eine Seite von dieser Tabelle selektiert? - bSelected = TRUE; - - if (bSelected) - { - ScPrintFunc aPrintFunc( this, pPrinter, nTab ); - - aPrintFunc.ApplyPrintSettings(); // dann Settings fuer diese Tabelle - bFound = TRUE; - } - nTabStart = nNext; - } - } - - delete pMarkedRange; -} - BOOL lcl_HasTransparent( ScDocument* pDoc, SCTAB nTab, const ScRange* pRange ) { BOOL bFound = FALSE; @@ -2036,150 +1982,6 @@ BOOL lcl_HasTransparent( ScDocument* pDoc, SCTAB nTab, const ScRange* pRange ) return bFound; } -void ScDocShell::Print( SfxProgress& rProgress, - ScMarkData* pMarkData, Window* pDialogParent, BOOL bForceSelected, BOOL bIsAPI ) -{ - SfxPrinter* pPrinter = GetPrinter(); - if ( !pPrinter ) - { - return; - } - - bool bHasOptions = false; - ScPrintOptions aOptions; - bool bAllTabs = true; - long nTotalPages = 0; - long aPageArr[MAXTABCOUNT]; // pages per sheet - MultiSelection aPageRanges; // pages to print - ScRange* pMarkedRange = NULL; - - lcl_GetPrintData( this, &aDocument, pPrinter, bForceSelected, - pMarkData, bHasOptions, aOptions, bAllTabs, nTotalPages, - aPageArr, aPageRanges, &pMarkedRange ); - - USHORT nCollateCopies = 1; - // test if printed range contains transparent objects - - BOOL bHasTransp = FALSE; - BOOL bAnyPrintRanges = aDocument.HasPrintRange(); - ScStyleSheetPool* pStylePool = aDocument.GetStyleSheetPool(); - SCTAB nTabCount = aDocument.GetTableCount(); - for ( SCTAB nTab=0; nTabGetTableSelect( nTab ) ) - { - SfxStyleSheetBase* pStyleSheet = pStylePool->Find( - aDocument.GetPageStyle( nTab ), SFX_STYLE_FAMILY_PAGE ); - if ( pStyleSheet ) - { - const SfxItemSet& rSet = pStyleSheet->GetItemSet(); - if ( ((const ScViewObjectModeItem&)rSet.Get(ATTR_PAGE_CHARTS)).GetValue() == VOBJ_MODE_SHOW || - ((const ScViewObjectModeItem&)rSet.Get(ATTR_PAGE_OBJECTS)).GetValue() == VOBJ_MODE_SHOW || - ((const ScViewObjectModeItem&)rSet.Get(ATTR_PAGE_DRAWINGS)).GetValue() == VOBJ_MODE_SHOW ) - { - if ( pMarkedRange ) - bHasTransp = bHasTransp || lcl_HasTransparent( &aDocument, nTab, pMarkedRange ); - else if ( aDocument.GetPrintRangeCount(nTab) ) - { - USHORT nRangeCount = aDocument.GetPrintRangeCount(nTab); - for (USHORT i=0; iGetTableSelect( nTab ) ) - { - FmFormView* pDrawView = NULL; - Rectangle aFull( 0, 0, LONG_MAX, LONG_MAX ); - - // #114135# - ScDrawLayer* pModel = aDocument.GetDrawLayer(); // ist nicht NULL - - if(pModel) - { - pDrawView = new FmFormView( pModel, pPrinter ); - pDrawView->ShowSdrPage(pDrawView->GetModel()->GetPage(nTab)); - pDrawView->SetPrintPreview( TRUE ); - } - - ScPrintFunc aPrintFunc( this, pPrinter, nTab, nAttrPage, nTotalPages, pMarkedRange, &aOptions ); - aPrintFunc.SetDrawView( pDrawView ); - nPrinted += aPrintFunc.DoPrint( aPageRanges, nTabStart, nDisplayStart, TRUE, &rProgress, NULL ); - - nTabStart += aPageArr[nTab]; - if ( aDocument.NeedPageResetAfterTab(nTab) ) - nDisplayStart = 0; - else - nDisplayStart += aPageArr[nTab]; - nAttrPage = aPrintFunc.GetFirstPageNo(); // behalten oder aus Vorlage - - delete pDrawView; - } - } - - if ( n+1 < nCollateCopies && - (pPrinter->GetDuplexMode() == DUPLEX_SHORTEDGE || pPrinter->GetDuplexMode() == DUPLEX_LONGEDGE) && - ( nPrinted % 2 ) == 1 ) - { - // #105584# when several collated copies are printed in duplex mode, and there is - // an odd number of pages, print an empty page between copies, so the first page of - // the second copy isn't printed on the back of the last page of the first copy. - // (same as in Writer ViewShell::Prt) - - // FIXME: needs to be adapted to XRenderable interface - #if 0 - pPrinter->StartPage(); - pPrinter->EndPage(); - #endif - } - } - - delete pMarkedRange; - - if (pOldJobSetup) - { - pPrinter->SetOrientation( pOldJobSetup->eOrientation ); - pPrinter->SetPaperBin ( pOldJobSetup->nPaperBin ); - pPrinter->SetPaper ( pOldJobSetup->ePaper ); - - if ( PAPER_USER == pOldJobSetup->ePaper ) - { - pPrinter->SetMapMode( pOldJobSetup->aUserMapMode ); - pPrinter->SetPaperSizeUser( pOldJobSetup->aUserSize ); - } - - delete pOldJobSetup; - pOldJobSetup = NULL; - } - - if ( bHasOptions ) - { - // remove PrintOptions from printer ItemSet, - // so next time the options from the configuration are used - - SfxItemSet aSet( pPrinter->GetOptions() ); - aSet.ClearItem( SID_SCPRINTOPTIONS ); - pPrinter->SetOptions( aSet ); - } - - PostPaintGridAll(); //! nur wenn geaendert -} - void ScDocShell::GetState( SfxItemSet &rSet ) { SfxWhichIter aIter(rSet); -- cgit From b5864fbb817ceb405eb7da4f34d73d7cae69226e Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 9 Nov 2010 15:33:37 +0100 Subject: vcl117: #i115477# clean up dead code --- sc/source/ui/docshell/docsh4.cxx | 155 --------------------------------------- 1 file changed, 155 deletions(-) (limited to 'sc/source/ui/docshell') diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index 4b7f79ddfc51..78287257c080 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -1827,161 +1827,6 @@ void ScDocShell::GetStatePageStyle( SfxViewShell& /* rCaller */, } } -void lcl_GetPrintData( ScDocShell* pDocShell /*in*/, - ScDocument* pDocument /*in*/, SfxPrinter* pPrinter /*in*/, - bool bForceSelected /*in*/, - ScMarkData* pMarkData /*inout*/, bool& rbHasOptions /*out*/, - ScPrintOptions& rOptions /*out*/, bool& rbAllTabs /*out*/, - long& rnTotalPages /*out*/, long aPageArr[] /*out*/, - MultiSelection& rPageRanges /*out*/, ScRange** ppMarkedRange /*out*/ ) -{ - // get settings from print options sub-dialog - const SfxItemSet& rOptionSet = pPrinter->GetOptions(); - const SfxPoolItem* pItem; - rbHasOptions = ( rOptionSet.GetItemState( SID_SCPRINTOPTIONS, FALSE, &pItem ) == SFX_ITEM_SET ); - if ( rbHasOptions ) - { - rOptions = ((const ScTpPrintItem*)pItem)->GetPrintOptions(); - } - else - { - // use configuration - rOptions = SC_MOD()->GetPrintOptions(); - } - - // update all pending row heights with a single progress bar, - // instead of a separate progress for each sheet from ScPrintFunc - pDocShell->UpdatePendingRowHeights( MAXTAB, true ); - - // get number of total pages - rnTotalPages = 0; - SCTAB nTabCount = pDocument->GetTableCount(); - for ( SCTAB nTab = 0; nTab < nTabCount; ++nTab ) - { - ScPrintFunc aPrintFunc( pDocShell, pPrinter, nTab, 0, 0, NULL, &rOptions ); - long nThisTab = aPrintFunc.GetTotalPages(); - aPageArr[nTab] = nThisTab; - rnTotalPages += nThisTab; - } - - rPageRanges.SetTotalRange( Range( 0, RANGE_MAX ) ); - rPageRanges.Select( Range( 1, rnTotalPages ) ); - - rbAllTabs = SC_MOD()->GetPrintOptions().GetAllSheets(); - if ( bForceSelected ) - { - rbAllTabs = false; - } - - if ( bForceSelected ) - { - if ( pMarkData && ( pMarkData->IsMarked() || pMarkData->IsMultiMarked() ) ) - { - pMarkData->MarkToMulti(); - *ppMarkedRange = new ScRange; - pMarkData->GetMultiMarkArea( **ppMarkedRange ); - pMarkData->MarkToSimple(); - } - } - - // get number of total pages if selection - if ( !rbAllTabs ) - { - rnTotalPages = 0; - for ( SCTAB nTab = 0; nTab < nTabCount; ++nTab ) - { - if ( *ppMarkedRange ) // selected range is used instead of print ranges -> page count is different - { - ScPrintFunc aPrintFunc( pDocShell, pPrinter, nTab, 0, 0, *ppMarkedRange, &rOptions ); - aPageArr[nTab] = aPrintFunc.GetTotalPages(); - } - if ( !pMarkData || pMarkData->GetTableSelect( nTab ) ) - { - rnTotalPages += aPageArr[nTab]; - } - } - if ( bForceSelected ) - { - rPageRanges.Select( Range( 1, rnTotalPages ) ); - } - } -} - -bool ScDocShell::CheckPrint( ScMarkData* pMarkData, bool bForceSelected, bool bIsAPI ) -{ - SfxPrinter* pPrinter = GetPrinter(); - if ( !pPrinter ) - { - return false; - } - - bool bHasOptions = false; - ScPrintOptions aOptions; - bool bAllTabs = true; - long nTotalPages = 0; - long aPageArr[MAXTABCOUNT]; // pages per sheet - MultiSelection aPageRanges; // pages to print - ScRange* pMarkedRange = NULL; - - lcl_GetPrintData( this, &aDocument, pPrinter, bForceSelected, - pMarkData, bHasOptions, aOptions, bAllTabs, nTotalPages, - aPageArr, aPageRanges, &pMarkedRange ); - - delete pMarkedRange; - - if ( nTotalPages == 0 ) - { - if ( !bIsAPI ) - { - WarningBox aWarningBox( GetActiveDialogParent(), WinBits( WB_OK ), - String( ScResId( STR_PRINT_NOTHING ) ) ); - aWarningBox.Execute(); - } - return false; - } - - return true; -} - -BOOL lcl_HasTransparent( ScDocument* pDoc, SCTAB nTab, const ScRange* pRange ) -{ - BOOL bFound = FALSE; - ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer(); - if (pDrawLayer) - { - SdrPage* pPage = pDrawLayer->GetPage(static_cast(nTab)); - DBG_ASSERT(pPage,"Page ?"); - if (pPage) - { - Rectangle aMMRect; - if ( pRange ) - aMMRect = pDoc->GetMMRect( pRange->aStart.Col(), pRange->aStart.Row(), - pRange->aEnd.Col(), pRange->aEnd.Row(), nTab ); - - SdrObjListIter aIter( *pPage, IM_DEEPNOGROUPS ); - SdrObject* pObject = aIter.Next(); - while (pObject && !bFound) - { - if (pObject->IsTransparent()) - { - if ( pRange ) - { - Rectangle aObjRect = pObject->GetLogicRect(); - if ( aObjRect.IsOver( aMMRect ) ) - bFound = TRUE; - } - else - bFound = TRUE; - } - - pObject = aIter.Next(); - } - } - } - - return bFound; -} - void ScDocShell::GetState( SfxItemSet &rSet ) { SfxWhichIter aIter(rSet); -- cgit From 491837143455a6279f33703d0db01e57abc0e8cc Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Mon, 3 Jan 2011 13:40:23 +0100 Subject: fwk162: #i115902# review usage of SfxObjectShellRef, SfxObjecShellLock; remove unused some methods --- sc/source/ui/docshell/arealink.cxx | 4 ++-- sc/source/ui/docshell/docsh4.cxx | 3 ++- sc/source/ui/docshell/tablink.cxx | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) (limited to 'sc/source/ui/docshell') diff --git a/sc/source/ui/docshell/arealink.cxx b/sc/source/ui/docshell/arealink.cxx index d819785c843b..1cd4c4700894 100644 --- a/sc/source/ui/docshell/arealink.cxx +++ b/sc/source/ui/docshell/arealink.cxx @@ -270,9 +270,9 @@ BOOL ScAreaLink::Refresh( const String& rNewFile, const String& rNewFilter, SfxMedium* pMed = new SfxMedium(aNewUrl, STREAM_STD_READ, FALSE, pFilter); + // aRef->DoClose() will be closed explicitly, but it is still more safe to use SfxObjectShellLock here ScDocShell* pSrcShell = new ScDocShell(SFX_CREATE_MODE_INTERNAL); -//REMOVE SvEmbeddedObjectRef aRef = pSrcShell; - SfxObjectShellRef aRef = pSrcShell; + SfxObjectShellLock aRef = pSrcShell; pSrcShell->DoLoad(pMed); ScDocument* pSrcDoc = pSrcShell->GetDocument(); diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index bba756b397cb..a8dd4e09254e 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -782,8 +782,9 @@ void ScDocShell::Execute( SfxRequest& rReq ) { SfxErrorContext aEc( ERRCTX_SFX_OPENDOC, pMed->GetName() ); + // pOtherDocSh->DoClose() will be called explicitly later, but it is still more safe to use SfxObjectShellLock here ScDocShell* pOtherDocSh = new ScDocShell; - SfxObjectShellRef aDocShTablesRef = pOtherDocSh; + SfxObjectShellLock aDocShTablesRef = pOtherDocSh; pOtherDocSh->DoLoad( pMed ); ULONG nErr = pOtherDocSh->GetErrorCode(); if (nErr) diff --git a/sc/source/ui/docshell/tablink.cxx b/sc/source/ui/docshell/tablink.cxx index 697b39052b9f..5414e19c1ca4 100644 --- a/sc/source/ui/docshell/tablink.cxx +++ b/sc/source/ui/docshell/tablink.cxx @@ -219,8 +219,9 @@ BOOL ScTableLink::Refresh(const String& rNewFile, const String& rNewFilter, if ( bInEdit ) // only if using the edit dialog, pMed->UseInteractionHandler( TRUE ); // enable the filter options dialog + // aRef->DoClose() will be called explicitly, but it is still more safe to use SfxObjectShellLock here ScDocShell* pSrcShell = new ScDocShell(SFX_CREATE_MODE_INTERNAL); - SfxObjectShellRef aRef = pSrcShell; + SfxObjectShellLock aRef = pSrcShell; pSrcShell->DoLoad(pMed); // Optionen koennten gesetzt worden sein -- cgit