diff options
Diffstat (limited to 'sc/source/ui/view')
-rw-r--r-- | sc/source/ui/view/drawview.cxx | 12 | ||||
-rw-r--r-- | sc/source/ui/view/formatsh.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/view/prevwsh.cxx | 95 | ||||
-rw-r--r--[-rwxr-xr-x] | sc/source/ui/view/printfun.cxx | 0 | ||||
-rw-r--r-- | sc/source/ui/view/tabview3.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwsh4.cxx | 124 | ||||
-rw-r--r-- | sc/source/ui/view/viewfun4.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/view/viewfunc.cxx | 4 |
8 files changed, 16 insertions, 235 deletions
diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx index 489da0cc4899..3307398b5ef8 100644 --- a/sc/source/ui/view/drawview.cxx +++ b/sc/source/ui/view/drawview.cxx @@ -530,19 +530,15 @@ void ScDrawView::MarkListHasChanged() SfxViewFrame* pViewFrame = pViewSh->GetViewFrame(); BOOL bOle = pViewSh->GetViewFrame()->GetFrame().IsInPlace(); + uno::Sequence< embed::VerbDescriptor > aVerbs; if ( pOle2Obj && !bOle ) { uno::Reference < embed::XEmbeddedObject > xObj = pOle2Obj->GetObjRef(); + DBG_ASSERT( xObj.is(), "SdrOle2Obj ohne ObjRef" ); if (xObj.is()) - pViewSh->SetVerbs( xObj->getSupportedVerbs() ); - else - { - DBG_ERROR("SdrOle2Obj ohne ObjRef"); - pViewSh->SetVerbs( 0 ); - } + aVerbs = xObj->getSupportedVerbs(); } - else - pViewSh->SetVerbs( 0 ); + pViewSh->SetVerbs( aVerbs ); // Image-Map Editor diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx index 12a1bb87211b..3ff7222178f3 100644 --- a/sc/source/ui/view/formatsh.cxx +++ b/sc/source/ui/view/formatsh.cxx @@ -453,7 +453,7 @@ void __EXPORT ScFormatShell::ExecuteStyle( SfxRequest& rReq ) { if ( pStyleSheet ) { - pTabViewShell->RemoveStyleSheetInUse( (SfxStyleSheet*)pStyleSheet ); + pTabViewShell->RemoveStyleSheetInUse( pStyleSheet ); pStylePool->Remove( pStyleSheet ); pTabViewShell->InvalidateAttribs(); nRetMask = TRUE; @@ -556,7 +556,7 @@ void __EXPORT ScFormatShell::ExecuteStyle( SfxRequest& rReq ) // Attribute uebernehmen und Style anwenden pStyleSheet->GetItemSet().Put( aAttrSet ); - pTabViewShell->UpdateStyleSheetInUse( (SfxStyleSheet*)pStyleSheet ); + pTabViewShell->UpdateStyleSheetInUse( pStyleSheet ); // call SetStyleSheetToMarked after adding the ScUndoModifyStyle // (pStyleSheet pointer is used!) @@ -578,7 +578,7 @@ void __EXPORT ScFormatShell::ExecuteStyle( SfxRequest& rReq ) } pStyleSheet->GetItemSet().Put( aAttrSet ); - pTabViewShell->UpdateStyleSheetInUse( (SfxStyleSheet*)pStyleSheet ); + pTabViewShell->UpdateStyleSheetInUse( pStyleSheet ); // call SetStyleSheetToMarked after adding the ScUndoModifyStyle // (pStyleSheet pointer is used!) @@ -868,7 +868,7 @@ void __EXPORT ScFormatShell::ExecuteStyle( SfxRequest& rReq ) (const SvxNumberInfoItem&) *(pDocSh->GetItem(SID_ATTR_NUMBERFORMAT_INFO)) ); - pTabViewShell->UpdateStyleSheetInUse( (SfxStyleSheet*)pStyleSheet ); + pTabViewShell->UpdateStyleSheetInUse( pStyleSheet ); pTabViewShell->InvalidateAttribs(); } diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx index 6e28d6ba846d..52d3217d7881 100644 --- a/sc/source/ui/view/prevwsh.cxx +++ b/sc/source/ui/view/prevwsh.cxx @@ -44,7 +44,6 @@ #include <sfx2/dispatch.hxx> #include <sfx2/objface.hxx> #include <sfx2/request.hxx> -#include <svtools/printdlg.hxx> #include <svl/stritem.hxx> #include <svl/whiter.hxx> #include <vcl/msgbox.hxx> @@ -484,40 +483,6 @@ USHORT __EXPORT ScPreviewShell::SetPrinter( SfxPrinter *pNewPrinter, USHORT nDif return pDocShell->SetPrinter( pNewPrinter, nDiffFlags ); } -PrintDialog* __EXPORT ScPreviewShell::CreatePrintDialog( Window* pParent ) -{ - pDocShell->GetDocument()->SetPrintOptions(); // Optionen aus OFA am Printer setzen - (void)GetPrinter(); - - const long nCurPage = pPreview->GetPageNo()+1; - const long nDocPageMax = pPreview->GetTotalPages(); - PrintDialog* pDlg = new PrintDialog( pParent, true ); -// wenn zu langsam wieder einbauen -// if ( pPreview->AllTested() ) -// nPageMax = pPreview->GetTotalPages(); - - pDlg->EnableSheetRange( true, PRINTSHEETS_ALL ); - pDlg->EnableSheetRange( true, PRINTSHEETS_SELECTED_SHEETS ); - pDlg->EnableSheetRange( false, PRINTSHEETS_SELECTED_CELLS ); - bool bAllTabs = SC_MOD()->GetPrintOptions().GetAllSheets(); - pDlg->CheckSheetRange( bAllTabs ? PRINTSHEETS_ALL : PRINTSHEETS_SELECTED_SHEETS ); - - if ( nDocPageMax > 0 ) - pDlg->SetRangeText( String::CreateFromInt32( nCurPage ) ); - - pDlg->EnableRange ( PRINTDIALOG_ALL ); - pDlg->EnableRange ( PRINTDIALOG_RANGE ); - pDlg->SetFirstPage ( 1 ); - pDlg->SetMinPage ( 1 ); - pDlg->SetLastPage ( (USHORT)nDocPageMax ); - pDlg->SetMaxPage ( (USHORT)nDocPageMax ); - pDlg->EnableCollate (); - - // Selektion hier nicht - - return pDlg; -} - SfxTabPage* ScPreviewShell::CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions ) { ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); @@ -529,66 +494,6 @@ SfxTabPage* ScPreviewShell::CreatePrintOptionsPage( Window *pParent, const SfxIt return 0; } -void __EXPORT ScPreviewShell::PreparePrint( PrintDialog* pPrintDialog ) -{ - SfxViewShell::PreparePrint( pPrintDialog ); - - ScMarkData aMarkData; - aMarkData.SelectTable( static_cast< SCTAB >( pPreview->GetTab() ), TRUE ); - pDocShell->PreparePrint( pPrintDialog, &aMarkData ); -} - -ErrCode ScPreviewShell::DoPrint( SfxPrinter *pPrinter, - PrintDialog *pPrintDialog, BOOL bSilent, BOOL bIsAPI ) -{ - ErrCode nRet = ERRCODE_IO_ABORT; - - ScMarkData aMarkData; - aMarkData.SelectTable( static_cast< SCTAB >( pPreview->GetTab() ), TRUE ); - - if ( pDocShell->CheckPrint( pPrintDialog, &aMarkData, false, bIsAPI ) ) - { - // SfxViewShell::DoPrint calls Print (after StartJob etc.) - nRet = SfxViewShell::DoPrint( pPrinter, pPrintDialog, bSilent, bIsAPI ); - } - - return nRet; -} - -USHORT __EXPORT ScPreviewShell::Print( SfxProgress& rProgress, BOOL bIsAPI, PrintDialog* pPrintDialog ) -{ - pDocShell->GetDocument()->SetPrintOptions(); // Optionen aus OFA am Printer setzen - - // get the list of affected sheets before SfxViewShell::Print - bool bAllTabs = ( pPrintDialog ? ( pPrintDialog->GetCheckedSheetRange() == PRINTSHEETS_ALL ) : SC_MOD()->GetPrintOptions().GetAllSheets() ); - - ScMarkData aMarkData; - aMarkData.SelectTable( static_cast< SCTAB >( pPreview->GetTab() ), TRUE ); - - uno::Sequence< sal_Int32 > aSheets; - SCTAB nTabCount = pDocShell->GetDocument()->GetTableCount(); - sal_Int32 nPrinted = 0; - for ( SCTAB nTab = 0; nTab < nTabCount; ++nTab ) - { - if ( bAllTabs || aMarkData.GetTableSelect( nTab ) ) - { - aSheets.realloc( nPrinted + 1 ); - aSheets[nPrinted] = nTab; - ++nPrinted; - } - } - - uno::Sequence < beans::PropertyValue > aProps(1); - aProps[0].Name = ::rtl::OUString::createFromAscii( "PrintSheets" ); - aProps[0].Value <<= aSheets; - SetAdditionalPrintOptions( aProps ); - - SfxViewShell::Print( rProgress, bIsAPI, pPrintDialog ); - pDocShell->Print( rProgress, pPrintDialog, &aMarkData, pPreview, FALSE, bIsAPI ); - - return 0; -} - //------------------------------------------------------------------------ void __EXPORT ScPreviewShell::Activate(BOOL bMDI) diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx index 378ea1233cf9..378ea1233cf9 100755..100644 --- a/sc/source/ui/view/printfun.cxx +++ b/sc/source/ui/view/printfun.cxx diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx index 93d1edd7fee5..886a3035a847 100644 --- a/sc/source/ui/view/tabview3.cxx +++ b/sc/source/ui/view/tabview3.cxx @@ -767,11 +767,13 @@ void ScTabView::AlignToCursor( SCsCOL nCurX, SCsROW nCurY, ScFollowMode eMode, if ( nCurX < nDeltaX || nCurX >= nDeltaX+nSizeX ) { nNewDeltaX = nDeltaX + nCurX - aViewData.GetCurX(); + if (nNewDeltaX < 0) nNewDeltaX = 0; nSizeX = (SCsCOL) aViewData.CellsAtX( nNewDeltaX, 1, eAlignX ); } if ( nCurY < nDeltaY || nCurY >= nDeltaY+nSizeY ) { nNewDeltaY = nDeltaY + nCurY - aViewData.GetCurY(); + if (nNewDeltaY < 0) nNewDeltaY = 0; nSizeY = (SCsROW) aViewData.CellsAtY( nNewDeltaY, 1, eAlignY ); } @@ -780,7 +782,7 @@ void ScTabView::AlignToCursor( SCsCOL nCurX, SCsROW nCurY, ScFollowMode eMode, if ( nCurX < nNewDeltaX || nCurX >= nNewDeltaX+nSizeX ) { nNewDeltaX = nCurX - (nSizeX / 2); - if (nNewDeltaX < 0) nNewDeltaY = 0; + if (nNewDeltaX < 0) nNewDeltaX = 0; nSizeX = (SCsCOL) aViewData.CellsAtX( nNewDeltaX, 1, eAlignX ); } if ( nCurY < nNewDeltaY || nCurY >= nNewDeltaY+nSizeY ) diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx index 0835d08de9fd..4596880b7fb6 100644 --- a/sc/source/ui/view/tabvwsh4.cxx +++ b/sc/source/ui/view/tabvwsh4.cxx @@ -46,7 +46,6 @@ #include <sfx2/request.hxx> #include <sfx2/printer.hxx> #include <sfx2/dispatch.hxx> -#include <svtools/printdlg.hxx> #include <svl/whiter.hxx> #include <unotools/moduleoptions.hxx> #include <rtl/logfile.hxx> @@ -1159,57 +1158,6 @@ USHORT __EXPORT ScTabViewShell::SetPrinter( SfxPrinter *pNewPrinter, USHORT nDif return GetViewData()->GetDocShell()->SetPrinter( pNewPrinter, nDiffFlags ); } -PrintDialog* __EXPORT ScTabViewShell::CreatePrintDialog( Window *pParent ) -{ - ScDocShell* pDocShell = GetViewData()->GetDocShell(); - ScDocument* pDoc = pDocShell->GetDocument(); - - pDoc->SetPrintOptions(); // Optionen aus OFA am Printer setzen - SfxPrinter* pPrinter = GetPrinter(); - - String aStrRange; - PrintDialog* pDlg = new PrintDialog( pParent, true ); - SCTAB nTabCount = pDoc->GetTableCount(); - long nDocPageMax = 0; - - pDlg->EnableSheetRange( true, PRINTSHEETS_ALL ); - pDlg->EnableSheetRange( true, PRINTSHEETS_SELECTED_SHEETS ); - pDlg->EnableSheetRange( true, PRINTSHEETS_SELECTED_CELLS ); - bool bAllTabs = SC_MOD()->GetPrintOptions().GetAllSheets(); - pDlg->CheckSheetRange( bAllTabs ? PRINTSHEETS_ALL : PRINTSHEETS_SELECTED_SHEETS ); - - // update all pending row heights with a single progress bar, - // instead of a separate progress for each sheet from ScPrintFunc - pDocShell->UpdatePendingRowHeights( MAXTAB, true ); - - for ( SCTAB i=0; i<nTabCount; i++ ) - { - ScPrintFunc aPrintFunc( pDocShell, pPrinter, i ); - nDocPageMax += aPrintFunc.GetTotalPages(); - } - - if ( nDocPageMax > 0 ) - { - aStrRange = '1'; - if ( nDocPageMax > 1 ) - { - aStrRange += '-'; - aStrRange += String::CreateFromInt32( nDocPageMax ); - } - } - - pDlg->SetRangeText ( aStrRange ); - pDlg->EnableRange ( PRINTDIALOG_ALL ); - pDlg->EnableRange ( PRINTDIALOG_RANGE ); - pDlg->SetFirstPage ( 1 ); - pDlg->SetMinPage ( 1 ); - pDlg->SetLastPage ( (USHORT)nDocPageMax ); - pDlg->SetMaxPage ( (USHORT)nDocPageMax ); - pDlg->EnableCollate (); - - return pDlg; -} - SfxTabPage* ScTabViewShell::CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions ) { ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); @@ -1221,78 +1169,6 @@ SfxTabPage* ScTabViewShell::CreatePrintOptionsPage( Window *pParent, const SfxIt return 0; } -void __EXPORT ScTabViewShell::PreparePrint( PrintDialog* pPrintDialog ) -{ - ScDocShell* pDocShell = GetViewData()->GetDocShell(); - - SfxViewShell::PreparePrint( pPrintDialog ); - pDocShell->PreparePrint( pPrintDialog, &GetViewData()->GetMarkData() ); -} - -ErrCode ScTabViewShell::DoPrint( SfxPrinter *pPrinter, - PrintDialog *pPrintDialog, BOOL bSilent, BOOL bIsAPI ) -{ - // #72527# if SID_PRINTDOCDIRECT is executed and there's a selection, - // ask if only the selection should be printed - - const ScMarkData& rMarkData = GetViewData()->GetMarkData(); - if ( !pPrintDialog && !bSilent && !bIsAPI && ( rMarkData.IsMarked() || rMarkData.IsMultiMarked() ) ) - { - SvxPrtQryBox aQuery( GetDialogParent() ); - short nBtn = aQuery.Execute(); - - if ( nBtn == RET_CANCEL ) - return ERRCODE_IO_ABORT; - - if ( nBtn == RET_OK ) - bPrintSelected = TRUE; - } - - ErrCode nRet = ERRCODE_IO_ABORT; - - ScDocShell* pDocShell = GetViewData()->GetDocShell(); - if ( pDocShell->CheckPrint( pPrintDialog, &GetViewData()->GetMarkData(), bPrintSelected, bIsAPI ) ) - { - // get the list of affected sheets before SfxViewShell::Print - bool bAllTabs = ( pPrintDialog ? ( pPrintDialog->GetCheckedSheetRange() == PRINTSHEETS_ALL ) : SC_MOD()->GetPrintOptions().GetAllSheets() ); - - uno::Sequence<sal_Int32> aSheets; - SCTAB nTabCount = pDocShell->GetDocument()->GetTableCount(); - USHORT nPrinted = 0; - for ( SCTAB nTab=0; nTab<nTabCount; nTab++ ) - if ( bAllTabs || rMarkData.GetTableSelect(nTab) ) - { - aSheets.realloc( nPrinted + 1 ); - aSheets[nPrinted] = nTab; - ++nPrinted; - } - - uno::Sequence < beans::PropertyValue > aProps(1); - aProps[0].Name=::rtl::OUString::createFromAscii("PrintSheets"); - aProps[0].Value <<= aSheets; - SetAdditionalPrintOptions( aProps ); - - // SfxViewShell::DoPrint calls Print (after StartJob etc.) - nRet = SfxViewShell::DoPrint( pPrinter, pPrintDialog, bSilent, bIsAPI ); - } - - bPrintSelected = FALSE; - - return nRet; -} - -USHORT __EXPORT ScTabViewShell::Print( SfxProgress& rProgress, BOOL bIsAPI, - PrintDialog* pPrintDialog ) -{ - ScDocShell* pDocShell = GetViewData()->GetDocShell(); - pDocShell->GetDocument()->SetPrintOptions(); // Optionen aus OFA am Printer setzen - - SfxViewShell::Print( rProgress, bIsAPI, pPrintDialog ); - pDocShell->Print( rProgress, pPrintDialog, &GetViewData()->GetMarkData(), - GetDialogParent(), bPrintSelected, bIsAPI ); - return 0; -} - void ScTabViewShell::StopEditShell() { if ( pEditShell != NULL && !bDontSwitch ) diff --git a/sc/source/ui/view/viewfun4.cxx b/sc/source/ui/view/viewfun4.cxx index 123464cd5fda..ded411aca9ed 100644 --- a/sc/source/ui/view/viewfun4.cxx +++ b/sc/source/ui/view/viewfun4.cxx @@ -392,9 +392,11 @@ void ScViewFunc::DoThesaurus( BOOL bRecord ) if (pCell) { ((ScEditCell*) pCell)->GetData(pTObject); - pOldTObj = pTObject->Clone(); if (pTObject) + { + pOldTObj = pTObject->Clone(); pThesaurusEngine->SetText(*pTObject); + } } } else diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index 231eb4e67562..e0ebb8f3024f 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -1545,7 +1545,7 @@ void ScViewFunc::SetStyleSheetToMarked( SfxStyleSheet* pStyleSheet, BOOL bRecord } -void ScViewFunc::RemoveStyleSheetInUse( SfxStyleSheet* pStyleSheet ) +void ScViewFunc::RemoveStyleSheetInUse( const SfxStyleSheetBase* pStyleSheet ) { if ( !pStyleSheet) return; // ------------------------------------------------------------------- @@ -1572,7 +1572,7 @@ void ScViewFunc::RemoveStyleSheetInUse( SfxStyleSheet* pStyleSheet ) pHdl->ForgetLastPattern(); } -void ScViewFunc::UpdateStyleSheetInUse( SfxStyleSheet* pStyleSheet ) +void ScViewFunc::UpdateStyleSheetInUse( const SfxStyleSheetBase* pStyleSheet ) { if ( !pStyleSheet) return; // ------------------------------------------------------------------- |