From 05863b459fe4ba9095ca333f47c35a2d168e2c1d Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 2 Nov 2010 17:03:34 +0100 Subject: vcl117: #i115056# change direct help texts to help ids to allow for proper help content --- sc/source/ui/src/scstring.src | 9 ------- sc/source/ui/unoobj/docuno.cxx | 55 ++++++++++++++++-------------------------- 2 files changed, 21 insertions(+), 43 deletions(-) diff --git a/sc/source/ui/src/scstring.src b/sc/source/ui/src/scstring.src index 9c47a42239cc..d13f3a807ff0 100644 --- a/sc/source/ui/src/scstring.src +++ b/sc/source/ui/src/scstring.src @@ -749,22 +749,13 @@ StringArray SCSTR_PRINT_OPTIONS { < "Pages"; >; < "~Include output of empty pages"; >; - < "If checked empty pages that have no cell contents or draw objects are not printed."; >; - < "Sheets"; >; - < "Print ~only selected sheets"; >; - < "If checked only contents from selected sheets are printed, even if you specify a wider range in the Format - Print Ranges dialog. Content from sheets that are not selected will not be printed."; >; < "Print content"; >; < "~All sheets"; >; - < "The printout will be created from all sheets in the document."; >; < "~Selected sheets"; >; - < "The printout will be created only from the currently selected sheets."; >; < "Selected cells"; >; - < "The printout will be created only from the currently selected cells."; >; < "Thereof print"; >; < "All ~pages"; >; - < "Print all pages of the printable content."; >; < "Pa~ges"; >; - < "Print only some pages of the printable content."; >; < "%PRODUCTNAME %s"; >; }; }; diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index 3d3f0f479601..5745d8a2e815 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -225,15 +225,15 @@ ScPrintUIOptions::ScPrintUIOptions() sal_Bool bSuppress = rPrintOpt.GetSkipEmpty(); ResStringArray aStrings( ScResId( SCSTR_PRINT_OPTIONS ) ); - DBG_ASSERT( aStrings.Count() >= 19, "resource incomplete" ); - if( aStrings.Count() < 19 ) // bad resource ? + DBG_ASSERT( aStrings.Count() >= 10, "resource incomplete" ); + if( aStrings.Count() < 10 ) // bad resource ? return; m_aUIProperties.realloc( 8 ); // create Section for spreadsheet (results in an extra tab page in dialog) SvtModuleOptions aOpt; - String aAppGroupname( aStrings.GetString( 18 ) ); + String aAppGroupname( aStrings.GetString( 9 ) ); aAppGroupname.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "%s" ) ), aOpt.GetModuleName( SvtModuleOptions::E_SCALC ) ); m_aUIProperties[0].Value = getGroupControlOpt( aAppGroupname, rtl::OUString() ); @@ -243,35 +243,35 @@ ScPrintUIOptions::ScPrintUIOptions() // create a bool option for empty pages m_aUIProperties[2].Value = getBoolControlOpt( rtl::OUString( aStrings.GetString( 1 ) ), - rtl::OUString( aStrings.GetString( 2 ) ), + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:IsIncludeEmptyPages:CheckBox" ) ), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsIncludeEmptyPages" ) ), ! bSuppress ); // create Subgroup for print content vcl::PrinterOptionsHelper::UIControlOptions aPrintRangeOpt; aPrintRangeOpt.maGroupHint = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintRange" ) ); - m_aUIProperties[3].Value = getSubgroupControlOpt( rtl::OUString( aStrings.GetString( 6 ) ), + m_aUIProperties[3].Value = getSubgroupControlOpt( rtl::OUString( aStrings.GetString( 2 ) ), rtl::OUString(), aPrintRangeOpt ); // create a choice for the content to create - uno::Sequence< rtl::OUString > aChoices( 3 ), aHelpTexts( 3 ); - aChoices[0] = aStrings.GetString( 7 ); - aHelpTexts[0] = aStrings.GetString( 8 ); - aChoices[1] = aStrings.GetString( 9 ); - aHelpTexts[1] = aStrings.GetString( 10 ); - aChoices[2] = aStrings.GetString( 11 ); - aHelpTexts[2] = aStrings.GetString( 12 ); + uno::Sequence< rtl::OUString > aChoices( 3 ), aHelpIds( 3 ); + aChoices[0] = aStrings.GetString( 3 ); + aHelpIds[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:0" ) ); + aChoices[1] = aStrings.GetString( 4 ); + aHelpIds[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:1" ) ); + aChoices[2] = aStrings.GetString( 5 ); + aHelpIds[2] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:2" ) ); m_aUIProperties[4].Value = getChoiceControlOpt( rtl::OUString(), - aHelpTexts, + aHelpIds, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintContent" ) ), aChoices, nContent ); // create Subgroup for print range aPrintRangeOpt.mbInternalOnly = sal_True; - m_aUIProperties[5].Value = getSubgroupControlOpt( rtl::OUString( aStrings.GetString( 13 ) ), + m_aUIProperties[5].Value = getSubgroupControlOpt( rtl::OUString( aStrings.GetString( 6 ) ), rtl::OUString(), aPrintRangeOpt ); @@ -279,13 +279,13 @@ ScPrintUIOptions::ScPrintUIOptions() // create a choice for the range to print rtl::OUString aPrintRangeName( RTL_CONSTASCII_USTRINGPARAM( "PrintRange" ) ); aChoices.realloc( 2 ); - aHelpTexts.realloc( 2 ); - aChoices[0] = aStrings.GetString( 14 ); - aHelpTexts[0] = aStrings.GetString( 15 ); - aChoices[1] = aStrings.GetString( 16 ); - aHelpTexts[1] = aStrings.GetString( 17 ); + aHelpIds.realloc( 2 ); + aChoices[0] = aStrings.GetString( 7 ); + aHelpIds[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintRange:RadioButton:0" ) ); + aChoices[1] = aStrings.GetString( 8 ); + aHelpIds[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PrintRange:RadioButton:1" ) ); m_aUIProperties[6].Value = getChoiceControlOpt( rtl::OUString(), - aHelpTexts, + aHelpIds, aPrintRangeName, aChoices, 0 ); @@ -293,24 +293,11 @@ ScPrintUIOptions::ScPrintUIOptions() // create a an Edit dependent on "Pages" selected vcl::PrinterOptionsHelper::UIControlOptions aPageRangeOpt( aPrintRangeName, 1, sal_True ); m_aUIProperties[7].Value = getEditControlOpt( rtl::OUString(), - rtl::OUString(), + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:PageRange:Edit" ) ), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PageRange" ) ), rtl::OUString(), aPageRangeOpt ); - - // "Print only selected sheets" isn't needed because of the "Selected Sheets" choice in "Print content" -#if 0 - // create subgroup for sheets - m_aUIProperties[8].Value = getSubgroupControlOpt( rtl::OUString( aStrings.GetString( 3 ) ), rtl::OUString() ); - - // create a bool option for selected pages only - m_aUIProperties[9].Value = getBoolControlOpt( rtl::OUString( aStrings.GetString( 4 ) ), - rtl::OUString( aStrings.GetString( 5 ) ), - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsOnlySelectedSheets" ) ), - i_bSelectedOnly - ); -#endif } void ScPrintUIOptions::SetDefaults() -- cgit v1.2.3 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 ++++++---------- sc/source/ui/inc/docsh.hxx | 8 ++--- sc/source/ui/inc/prevwsh.hxx | 7 ++-- sc/source/ui/inc/tabvwsh.hxx | 6 ++-- sc/source/ui/view/prevwsh.cxx | 56 ++++++----------------------- sc/source/ui/view/tabvwsh4.cxx | 76 ++++++---------------------------------- 6 files changed, 39 insertions(+), 144 deletions(-) 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; diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx index 19147cfaf61f..624aa5181da7 100644 --- a/sc/source/ui/inc/docsh.hxx +++ b/sc/source/ui/inc/docsh.hxx @@ -45,7 +45,6 @@ class ScEditEngineDefaulter; class FontList; -class PrintDialog; class SfxStyleSheetBasePool; class SfxStyleSheetHint; struct ChartSelectionInfo; @@ -303,10 +302,9 @@ public: void DoRecalc( BOOL bApi ); void DoHardRecalc( BOOL bApi ); - bool CheckPrint( PrintDialog* pPrintDialog, ScMarkData* pMarkData, - bool bForceSelected, bool bIsAPI ); - void PreparePrint( PrintDialog* pPrintDialog, ScMarkData* pMarkData ); - void Print( SfxProgress& rProgress, PrintDialog* pPrintDialog, + bool CheckPrint( ScMarkData* pMarkData, bool bForceSelected, bool bIsAPI ); + void PreparePrint( ScMarkData* pMarkData ); + void Print( SfxProgress& rProgress, ScMarkData* pMarkData, Window* pDialogParent, BOOL bForceSelected, BOOL bIsAPI ); diff --git a/sc/source/ui/inc/prevwsh.hxx b/sc/source/ui/inc/prevwsh.hxx index 7ff97f8d0152..d9f19d48c0c0 100644 --- a/sc/source/ui/inc/prevwsh.hxx +++ b/sc/source/ui/inc/prevwsh.hxx @@ -116,11 +116,10 @@ public: virtual SfxPrinter* GetPrinter( BOOL bCreate = FALSE ); virtual USHORT SetPrinter( SfxPrinter* pNewPrinter, USHORT nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=false ); - virtual PrintDialog* CreatePrintDialog( Window* pParent ); virtual SfxTabPage* CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions ); - virtual void PreparePrint( PrintDialog* pPrintDialog = NULL ); - virtual ErrCode DoPrint( SfxPrinter *pPrinter, PrintDialog *pPrintDialog, BOOL bSilent, BOOL bIsAPI ); - virtual USHORT Print( SfxProgress& rProgress, BOOL bIsAPI, PrintDialog* pPrintDialog = NULL ); + virtual void PreparePrint(); + virtual ErrCode DoPrint( SfxPrinter *pPrinter, BOOL bSilent, BOOL bIsAPI ); + virtual USHORT Print( SfxProgress& rProgress, BOOL bIsAPI ); void AddAccessibilityObject( SfxListener& rObject ); void RemoveAccessibilityObject( SfxListener& rObject ); diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx index 28cc2a823928..27baaa6d9c56 100644 --- a/sc/source/ui/inc/tabvwsh.hxx +++ b/sc/source/ui/inc/tabvwsh.hxx @@ -369,13 +369,11 @@ public: virtual USHORT SetPrinter( SfxPrinter* pNewPrinter, USHORT nDiffFlags = SFX_PRINTER_ALL, bool bIsApi=false ); - virtual PrintDialog* CreatePrintDialog( Window* pParent ); virtual SfxTabPage* CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions ); - virtual void PreparePrint( PrintDialog* pPrintDialog = NULL ); + virtual void PreparePrint(); virtual ErrCode DoPrint( SfxPrinter *pPrinter, - PrintDialog *pPrintDialog, BOOL bSilent, BOOL bIsAPI ); - virtual USHORT Print( SfxProgress& rProgress, BOOL bIsAPI, PrintDialog* pPrintDialog = NULL ); + virtual USHORT Print( SfxProgress& rProgress, BOOL bIsAPI ); void ConnectObject( SdrOle2Obj* pObj ); BOOL ActivateObject( SdrOle2Obj* pObj, long nVerb ); diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx index 48ffd4fd39a4..59e3977e9f89 100644 --- a/sc/source/ui/view/prevwsh.cxx +++ b/sc/source/ui/view/prevwsh.cxx @@ -44,7 +44,6 @@ #include #include #include -#include #include #include #include @@ -485,40 +484,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(); @@ -530,38 +495,37 @@ SfxTabPage* ScPreviewShell::CreatePrintOptionsPage( Window *pParent, const SfxIt return 0; } -void __EXPORT ScPreviewShell::PreparePrint( PrintDialog* pPrintDialog ) +void __EXPORT ScPreviewShell::PreparePrint() { - SfxViewShell::PreparePrint( pPrintDialog ); + SfxViewShell::PreparePrint(); ScMarkData aMarkData; aMarkData.SelectTable( static_cast< SCTAB >( pPreview->GetTab() ), TRUE ); - pDocShell->PreparePrint( pPrintDialog, &aMarkData ); + pDocShell->PreparePrint(&aMarkData ); } -ErrCode ScPreviewShell::DoPrint( SfxPrinter *pPrinter, - PrintDialog *pPrintDialog, BOOL bSilent, BOOL bIsAPI ) +ErrCode ScPreviewShell::DoPrint( SfxPrinter *pPrinter, 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 ) ) + if ( pDocShell->CheckPrint( &aMarkData, false, bIsAPI ) ) { // SfxViewShell::DoPrint calls Print (after StartJob etc.) - nRet = SfxViewShell::DoPrint( pPrinter, pPrintDialog, bSilent, bIsAPI ); + nRet = SfxViewShell::DoPrint( pPrinter, bSilent, bIsAPI ); } return nRet; } -USHORT __EXPORT ScPreviewShell::Print( SfxProgress& rProgress, BOOL bIsAPI, PrintDialog* pPrintDialog ) +USHORT __EXPORT ScPreviewShell::Print( SfxProgress& rProgress, BOOL bIsAPI ) { 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() ); + bool bAllTabs = SC_MOD()->GetPrintOptions().GetAllSheets(); ScMarkData aMarkData; aMarkData.SelectTable( static_cast< SCTAB >( pPreview->GetTab() ), TRUE ); @@ -584,8 +548,8 @@ USHORT __EXPORT ScPreviewShell::Print( SfxProgress& rProgress, BOOL bIsAPI, Prin aProps[0].Value <<= aSheets; SetAdditionalPrintOptions( aProps ); - SfxViewShell::Print( rProgress, bIsAPI, pPrintDialog ); - pDocShell->Print( rProgress, pPrintDialog, &aMarkData, pPreview, FALSE, bIsAPI ); + SfxViewShell::Print( rProgress, bIsAPI ); + pDocShell->Print( rProgress, &aMarkData, pPreview, FALSE, bIsAPI ); return 0; } diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx index 0835d08de9fd..77fbe6bf5ada 100644 --- a/sc/source/ui/view/tabvwsh4.cxx +++ b/sc/source/ui/view/tabvwsh4.cxx @@ -46,7 +46,6 @@ #include #include #include -#include #include #include #include @@ -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 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,22 +1169,21 @@ SfxTabPage* ScTabViewShell::CreatePrintOptionsPage( Window *pParent, const SfxIt return 0; } -void __EXPORT ScTabViewShell::PreparePrint( PrintDialog* pPrintDialog ) +void __EXPORT ScTabViewShell::PreparePrint() { ScDocShell* pDocShell = GetViewData()->GetDocShell(); - SfxViewShell::PreparePrint( pPrintDialog ); - pDocShell->PreparePrint( pPrintDialog, &GetViewData()->GetMarkData() ); + SfxViewShell::PreparePrint(); + pDocShell->PreparePrint( &GetViewData()->GetMarkData() ); } -ErrCode ScTabViewShell::DoPrint( SfxPrinter *pPrinter, - PrintDialog *pPrintDialog, BOOL bSilent, BOOL bIsAPI ) +ErrCode ScTabViewShell::DoPrint( SfxPrinter *pPrinter, 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() ) ) + if ( !bSilent && !bIsAPI && ( rMarkData.IsMarked() || rMarkData.IsMultiMarked() ) ) { SvxPrtQryBox aQuery( GetDialogParent() ); short nBtn = aQuery.Execute(); @@ -1251,10 +1198,10 @@ ErrCode ScTabViewShell::DoPrint( SfxPrinter *pPrinter, ErrCode nRet = ERRCODE_IO_ABORT; ScDocShell* pDocShell = GetViewData()->GetDocShell(); - if ( pDocShell->CheckPrint( pPrintDialog, &GetViewData()->GetMarkData(), bPrintSelected, bIsAPI ) ) + if ( pDocShell->CheckPrint( &GetViewData()->GetMarkData(), bPrintSelected, bIsAPI ) ) { // get the list of affected sheets before SfxViewShell::Print - bool bAllTabs = ( pPrintDialog ? ( pPrintDialog->GetCheckedSheetRange() == PRINTSHEETS_ALL ) : SC_MOD()->GetPrintOptions().GetAllSheets() ); + bool bAllTabs = SC_MOD()->GetPrintOptions().GetAllSheets(); uno::Sequence aSheets; SCTAB nTabCount = pDocShell->GetDocument()->GetTableCount(); @@ -1273,7 +1220,7 @@ ErrCode ScTabViewShell::DoPrint( SfxPrinter *pPrinter, SetAdditionalPrintOptions( aProps ); // SfxViewShell::DoPrint calls Print (after StartJob etc.) - nRet = SfxViewShell::DoPrint( pPrinter, pPrintDialog, bSilent, bIsAPI ); + nRet = SfxViewShell::DoPrint( pPrinter, bSilent, bIsAPI ); } bPrintSelected = FALSE; @@ -1281,14 +1228,13 @@ ErrCode ScTabViewShell::DoPrint( SfxPrinter *pPrinter, return nRet; } -USHORT __EXPORT ScTabViewShell::Print( SfxProgress& rProgress, BOOL bIsAPI, - PrintDialog* pPrintDialog ) +USHORT __EXPORT ScTabViewShell::Print( SfxProgress& rProgress, BOOL bIsAPI ) { ScDocShell* pDocShell = GetViewData()->GetDocShell(); pDocShell->GetDocument()->SetPrintOptions(); // Optionen aus OFA am Printer setzen - SfxViewShell::Print( rProgress, bIsAPI, pPrintDialog ); - pDocShell->Print( rProgress, pPrintDialog, &GetViewData()->GetMarkData(), + SfxViewShell::Print( rProgress, bIsAPI ); + pDocShell->Print( rProgress, &GetViewData()->GetMarkData(), GetDialogParent(), bPrintSelected, bIsAPI ); return 0; } -- cgit v1.2.3 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(-) 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 v1.2.3 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 --------------------------------------- sc/source/ui/inc/docsh.hxx | 4 - sc/source/ui/inc/prevwsh.hxx | 3 - sc/source/ui/inc/tabvwsh.hxx | 4 - sc/source/ui/view/prevwsh.cxx | 59 ------------ sc/source/ui/view/tabvwsh4.cxx | 70 -------------- 6 files changed, 338 deletions(-) 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); diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx index 624aa5181da7..e13bee9d8adc 100644 --- a/sc/source/ui/inc/docsh.hxx +++ b/sc/source/ui/inc/docsh.hxx @@ -303,10 +303,6 @@ public: void DoHardRecalc( BOOL bApi ); bool CheckPrint( ScMarkData* pMarkData, bool bForceSelected, bool bIsAPI ); - void PreparePrint( ScMarkData* pMarkData ); - void Print( SfxProgress& rProgress, - ScMarkData* pMarkData, Window* pDialogParent, - BOOL bForceSelected, BOOL bIsAPI ); void UpdateOle( const ScViewData* pViewData, BOOL bSnapSize = FALSE ); BOOL IsOle(); diff --git a/sc/source/ui/inc/prevwsh.hxx b/sc/source/ui/inc/prevwsh.hxx index d9f19d48c0c0..79f4d799223a 100644 --- a/sc/source/ui/inc/prevwsh.hxx +++ b/sc/source/ui/inc/prevwsh.hxx @@ -117,9 +117,6 @@ public: virtual SfxPrinter* GetPrinter( BOOL bCreate = FALSE ); virtual USHORT SetPrinter( SfxPrinter* pNewPrinter, USHORT nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=false ); virtual SfxTabPage* CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions ); - virtual void PreparePrint(); - virtual ErrCode DoPrint( SfxPrinter *pPrinter, BOOL bSilent, BOOL bIsAPI ); - virtual USHORT Print( SfxProgress& rProgress, BOOL bIsAPI ); void AddAccessibilityObject( SfxListener& rObject ); void RemoveAccessibilityObject( SfxListener& rObject ); diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx index 27baaa6d9c56..c3316092d044 100644 --- a/sc/source/ui/inc/tabvwsh.hxx +++ b/sc/source/ui/inc/tabvwsh.hxx @@ -370,10 +370,6 @@ public: USHORT nDiffFlags = SFX_PRINTER_ALL, bool bIsApi=false ); virtual SfxTabPage* CreatePrintOptionsPage( Window *pParent, const SfxItemSet &rOptions ); - virtual void PreparePrint(); - virtual ErrCode DoPrint( SfxPrinter *pPrinter, - BOOL bSilent, BOOL bIsAPI ); - virtual USHORT Print( SfxProgress& rProgress, BOOL bIsAPI ); void ConnectObject( SdrOle2Obj* pObj ); BOOL ActivateObject( SdrOle2Obj* pObj, long nVerb ); diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx index 59e3977e9f89..12d153dab1e4 100644 --- a/sc/source/ui/view/prevwsh.cxx +++ b/sc/source/ui/view/prevwsh.cxx @@ -495,65 +495,6 @@ SfxTabPage* ScPreviewShell::CreatePrintOptionsPage( Window *pParent, const SfxIt return 0; } -void __EXPORT ScPreviewShell::PreparePrint() -{ - SfxViewShell::PreparePrint(); - - ScMarkData aMarkData; - aMarkData.SelectTable( static_cast< SCTAB >( pPreview->GetTab() ), TRUE ); - pDocShell->PreparePrint(&aMarkData ); -} - -ErrCode ScPreviewShell::DoPrint( SfxPrinter *pPrinter, BOOL bSilent, BOOL bIsAPI ) -{ - ErrCode nRet = ERRCODE_IO_ABORT; - - ScMarkData aMarkData; - aMarkData.SelectTable( static_cast< SCTAB >( pPreview->GetTab() ), TRUE ); - - if ( pDocShell->CheckPrint( &aMarkData, false, bIsAPI ) ) - { - // SfxViewShell::DoPrint calls Print (after StartJob etc.) - nRet = SfxViewShell::DoPrint( pPrinter, bSilent, bIsAPI ); - } - - return nRet; -} - -USHORT __EXPORT ScPreviewShell::Print( SfxProgress& rProgress, BOOL bIsAPI ) -{ - pDocShell->GetDocument()->SetPrintOptions(); // Optionen aus OFA am Printer setzen - - // get the list of affected sheets before SfxViewShell::Print - bool bAllTabs = 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 ); - pDocShell->Print( rProgress, &aMarkData, pPreview, FALSE, bIsAPI ); - - return 0; -} - //------------------------------------------------------------------------ void __EXPORT ScPreviewShell::Activate(BOOL bMDI) diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx index 77fbe6bf5ada..4596880b7fb6 100644 --- a/sc/source/ui/view/tabvwsh4.cxx +++ b/sc/source/ui/view/tabvwsh4.cxx @@ -1169,76 +1169,6 @@ SfxTabPage* ScTabViewShell::CreatePrintOptionsPage( Window *pParent, const SfxIt return 0; } -void __EXPORT ScTabViewShell::PreparePrint() -{ - ScDocShell* pDocShell = GetViewData()->GetDocShell(); - - SfxViewShell::PreparePrint(); - pDocShell->PreparePrint( &GetViewData()->GetMarkData() ); -} - -ErrCode ScTabViewShell::DoPrint( SfxPrinter *pPrinter, 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 ( !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( &GetViewData()->GetMarkData(), bPrintSelected, bIsAPI ) ) - { - // get the list of affected sheets before SfxViewShell::Print - bool bAllTabs = SC_MOD()->GetPrintOptions().GetAllSheets(); - - uno::Sequence aSheets; - SCTAB nTabCount = pDocShell->GetDocument()->GetTableCount(); - USHORT nPrinted = 0; - for ( SCTAB nTab=0; nTab 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, bSilent, bIsAPI ); - } - - bPrintSelected = FALSE; - - return nRet; -} - -USHORT __EXPORT ScTabViewShell::Print( SfxProgress& rProgress, BOOL bIsAPI ) -{ - ScDocShell* pDocShell = GetViewData()->GetDocShell(); - pDocShell->GetDocument()->SetPrintOptions(); // Optionen aus OFA am Printer setzen - - SfxViewShell::Print( rProgress, bIsAPI ); - pDocShell->Print( rProgress, &GetViewData()->GetMarkData(), - GetDialogParent(), bPrintSelected, bIsAPI ); - return 0; -} - void ScTabViewShell::StopEditShell() { if ( pEditShell != NULL && !bDontSwitch ) -- cgit v1.2.3 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/inc/sc.hrc | 1 - sc/source/ui/docshell/docsh4.cxx | 155 --------------------------------------- sc/source/ui/inc/docsh.hxx | 2 - sc/source/ui/src/scstring.src | 5 -- 4 files changed, 163 deletions(-) diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index 159da72a34d2..b38bec784b54 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -928,7 +928,6 @@ #define STR_REPLCELLSWARN (STR_START + 91) #define SCSTR_DPFUNCLISTBOX (STR_START + 92) -#define STR_PRINT_NOTHING (STR_START + 93) #define SCSTR_ALLFILTER (STR_START + 94) #define SCSTR_MOREBTN_MOREOPTIONS (STR_START + 95) #define SCSTR_MOREBTN_FEWEROPTIONS (STR_START + 96) 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); diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx index e13bee9d8adc..fe94db107be0 100644 --- a/sc/source/ui/inc/docsh.hxx +++ b/sc/source/ui/inc/docsh.hxx @@ -302,8 +302,6 @@ public: void DoRecalc( BOOL bApi ); void DoHardRecalc( BOOL bApi ); - bool CheckPrint( ScMarkData* pMarkData, bool bForceSelected, bool bIsAPI ); - void UpdateOle( const ScViewData* pViewData, BOOL bSnapSize = FALSE ); BOOL IsOle(); diff --git a/sc/source/ui/src/scstring.src b/sc/source/ui/src/scstring.src index d13f3a807ff0..17b7b99b2e04 100644 --- a/sc/source/ui/src/scstring.src +++ b/sc/source/ui/src/scstring.src @@ -553,11 +553,6 @@ String STR_REPLCELLSWARN Text [ en-US ] = "You are pasting data into cells that already contain data.\nDo you really want to overwrite the existing data?"; }; -String STR_PRINT_NOTHING -{ - Text [ en-US ] = "There is nothing to print. The selected print range or sheet is empty."; -}; - String SCSTR_ALLFILTER { Text [ en-US ] = "All"; -- cgit v1.2.3 From 09493ee415a4a0d6d2d7bb3f7f8e2b1c5d38683e Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 23 Nov 2010 18:41:04 +0100 Subject: vcl117: removed obsolete header --- chart2/source/controller/inc/ConfigurationAccess.hxx | 2 +- sc/source/core/inc/core_pch.hxx | 2 +- sc/source/filter/inc/filt_pch.hxx | 6 +++--- sc/source/filter/inc/xlescher.hxx | 2 +- sc/source/ui/cctrl/dpcontrol.cxx | 2 +- sc/source/ui/inc/ui_pch.hxx | 3 +-- 6 files changed, 8 insertions(+), 9 deletions(-) diff --git a/chart2/source/controller/inc/ConfigurationAccess.hxx b/chart2/source/controller/inc/ConfigurationAccess.hxx index 0cc8180b3dd2..4b5196e7f902 100644 --- a/chart2/source/controller/inc/ConfigurationAccess.hxx +++ b/chart2/source/controller/inc/ConfigurationAccess.hxx @@ -29,7 +29,7 @@ #define _CHART2_CONFIGURATIONACCESS_HXX // header for enum FieldUnit -#include +#include //............................................................................. namespace chart diff --git a/sc/source/core/inc/core_pch.hxx b/sc/source/core/inc/core_pch.hxx index 899169154d8d..36595fe4c956 100644 --- a/sc/source/core/inc/core_pch.hxx +++ b/sc/source/core/inc/core_pch.hxx @@ -125,7 +125,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sc/source/filter/inc/filt_pch.hxx b/sc/source/filter/inc/filt_pch.hxx index 7ab2aadf1511..d624b7afeaf8 100644 --- a/sc/source/filter/inc/filt_pch.hxx +++ b/sc/source/filter/inc/filt_pch.hxx @@ -126,7 +126,7 @@ #include #include #include -#include +#include #include #include #include @@ -182,7 +182,7 @@ #include #include #include -#include +#include #include #include #include @@ -253,7 +253,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sc/source/filter/inc/xlescher.hxx b/sc/source/filter/inc/xlescher.hxx index 921da6b8741b..cba56eeccc9e 100644 --- a/sc/source/filter/inc/xlescher.hxx +++ b/sc/source/filter/inc/xlescher.hxx @@ -29,7 +29,7 @@ #define SC_XLESCHER_HXX #include -#include +#include #include "fapihelper.hxx" #include "xladdress.hxx" #include "xlstyle.hxx" diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx index b90a51ed6bee..f9e5a4d7679b 100644 --- a/sc/source/ui/cctrl/dpcontrol.cxx +++ b/sc/source/ui/cctrl/dpcontrol.cxx @@ -35,7 +35,7 @@ #include #include -#include +#include #include #include "strload.hxx" #include "global.hxx" diff --git a/sc/source/ui/inc/ui_pch.hxx b/sc/source/ui/inc/ui_pch.hxx index 1ef2f02d405b..ec8da19ba5ea 100644 --- a/sc/source/ui/inc/ui_pch.hxx +++ b/sc/source/ui/inc/ui_pch.hxx @@ -81,7 +81,7 @@ #include #include #include -#include +#include #include #include #include @@ -185,7 +185,6 @@ #include #include //REMOVE #include -#include #include #include #include -- cgit v1.2.3 From 2d0f40ce04bdcc067793bed89395c4e1c3ebf348 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 24 Nov 2010 16:09:43 +0100 Subject: vcl117: header cleanup --- chart2/inc/pch/precompiled_chart2.hxx | 2 +- sc/inc/pch/precompiled_sc.hxx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) mode change 100644 => 100755 chart2/inc/pch/precompiled_chart2.hxx mode change 100644 => 100755 sc/inc/pch/precompiled_sc.hxx diff --git a/chart2/inc/pch/precompiled_chart2.hxx b/chart2/inc/pch/precompiled_chart2.hxx old mode 100644 new mode 100755 index 199564a9f024..fed813c55c76 --- a/chart2/inc/pch/precompiled_chart2.hxx +++ b/chart2/inc/pch/precompiled_chart2.hxx @@ -268,7 +268,7 @@ #include "unotools/configitem.hxx" #include "unotools/eventlisteneradapter.hxx" -#include "vcl/fldunit.hxx" +#include "tools/fldunit.hxx" #include "vos/mutex.hxx" //---MARKER--- diff --git a/sc/inc/pch/precompiled_sc.hxx b/sc/inc/pch/precompiled_sc.hxx old mode 100644 new mode 100755 index 048d7b638d57..e90a8c46b6a3 --- a/sc/inc/pch/precompiled_sc.hxx +++ b/sc/inc/pch/precompiled_sc.hxx @@ -218,7 +218,7 @@ #include #include #include -#include +#include #include #include #include @@ -235,7 +235,7 @@ #include #include #include -#include +#include #include #include #include -- cgit v1.2.3 From e3c9000303f73558849a3e9b493b53ac67678f1f Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 9 Dec 2010 11:30:23 +0100 Subject: vcl117: more HelpID cleanup --- sc/source/ui/unoobj/docuno.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index 1805daa9b5ef..6057721a68b7 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -236,7 +236,7 @@ ScPrintUIOptions::ScPrintUIOptions() String aAppGroupname( aStrings.GetString( 9 ) ); aAppGroupname.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "%s" ) ), aOpt.GetModuleName( SvtModuleOptions::E_SCALC ) ); - m_aUIProperties[0].Value = getGroupControlOpt( aAppGroupname, rtl::OUString() ); + m_aUIProperties[0].Value = getGroupControlOpt( aAppGroupname, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:TabPage:AppPage" ) ) ); // create subgroup for pages m_aUIProperties[1].Value = getSubgroupControlOpt( rtl::OUString( aStrings.GetString( 0 ) ), rtl::OUString() ); -- cgit v1.2.3