unotxdoc.cxx (ad54a8fd) | unotxdoc.cxx (25cebbc8) |
---|---|
1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 1496 unchanged lines hidden (view full) --- 1505 getDrawPage(); 1506 return pDrawPage; 1507} 1508/*-- 18.12.98 11:55:26--------------------------------------------------- 1509 1510 -----------------------------------------------------------------------*/ 1511void SwXTextDocument::Invalidate() 1512{ | 1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 1496 unchanged lines hidden (view full) --- 1505 getDrawPage(); 1506 return pDrawPage; 1507} 1508/*-- 18.12.98 11:55:26--------------------------------------------------- 1509 1510 -----------------------------------------------------------------------*/ 1511void SwXTextDocument::Invalidate() 1512{ |
1513 bObjectValid = sal_False; 1514 if(xNumFmtAgg.is()) 1515 { | 1513 bObjectValid = sal_False; 1514 if(xNumFmtAgg.is()) 1515 { |
1516 const uno::Type& rTunnelType = ::getCppuType((Reference <XUnoTunnel>*)0); 1517 Any aNumTunnel = xNumFmtAgg->queryAggregation(rTunnelType); 1518 SvNumberFormatsSupplierObj* pNumFmt = 0; 1519 Reference< XUnoTunnel > xNumTunnel; 1520 if(aNumTunnel >>= xNumTunnel) 1521 { 1522 pNumFmt = reinterpret_cast<SvNumberFormatsSupplierObj*>( 1523 xNumTunnel->getSomething(SvNumberFormatsSupplierObj::getUnoTunnelId())); 1524 pNumFmt->SetNumberFormatter(0); 1525 } 1526 DBG_ASSERT(pNumFmt, "No number formatter available"); | 1516 const uno::Type& rTunnelType = ::getCppuType((Reference <XUnoTunnel>*)0); 1517 Any aNumTunnel = xNumFmtAgg->queryAggregation(rTunnelType); 1518 SvNumberFormatsSupplierObj* pNumFmt = 0; 1519 Reference< XUnoTunnel > xNumTunnel; 1520 if(aNumTunnel >>= xNumTunnel) 1521 { 1522 pNumFmt = reinterpret_cast<SvNumberFormatsSupplierObj*>( 1523 xNumTunnel->getSomething(SvNumberFormatsSupplierObj::getUnoTunnelId())); 1524 pNumFmt->SetNumberFormatter(0); 1525 } 1526 DBG_ASSERT(pNumFmt, "No number formatter available"); |
1527 } 1528 InitNewDoc(); 1529 pDocShell = 0; 1530 aRefreshCont.Disposing(); | 1527 } 1528 InitNewDoc(); 1529 pDocShell = 0; 1530 aRefreshCont.Disposing(); |
1531} 1532/* -----------------------------13.07.00 15:59-------------------------------- 1533 1534 ---------------------------------------------------------------------------*/ 1535void SwXTextDocument::Reactivate(SwDocShell* pNewDocShell) 1536{ 1537 if(pDocShell && pDocShell != pNewDocShell) 1538 Invalidate(); --- 1117 unchanged lines hidden (view full) --- 2656{ 2657 ::vos::OGuard aGuard(Application::GetSolarMutex()); 2658 if(!IsValid()) 2659 throw RuntimeException(); 2660 2661 const bool bIsPDFExport = !lcl_SeqHasProperty( rxOptions, "IsPrinter" ); 2662 bool bIsSwSrcView = false; 2663 SfxViewShell *pView = GetRenderView( bIsSwSrcView, rxOptions, bIsPDFExport ); | 1531} 1532/* -----------------------------13.07.00 15:59-------------------------------- 1533 1534 ---------------------------------------------------------------------------*/ 1535void SwXTextDocument::Reactivate(SwDocShell* pNewDocShell) 1536{ 1537 if(pDocShell && pDocShell != pNewDocShell) 1538 Invalidate(); --- 1117 unchanged lines hidden (view full) --- 2656{ 2657 ::vos::OGuard aGuard(Application::GetSolarMutex()); 2658 if(!IsValid()) 2659 throw RuntimeException(); 2660 2661 const bool bIsPDFExport = !lcl_SeqHasProperty( rxOptions, "IsPrinter" ); 2662 bool bIsSwSrcView = false; 2663 SfxViewShell *pView = GetRenderView( bIsSwSrcView, rxOptions, bIsPDFExport ); |
2664 2665 if (!bIsSwSrcView && !m_pRenderData) 2666 m_pRenderData = new SwRenderData; 2667 if (!m_pPrintUIOptions) 2668 m_pPrintUIOptions = lcl_GetPrintUIOptions( pDocShell, pView ); 2669 bool bFormat = m_pPrintUIOptions->processPropertiesAndCheckFormat( rxOptions ); 2670 // const bool bIsSkipEmptyPages = !m_pPrintUIOptions->IsPrintEmptyPages( bIsPDFExport ); 2671 | 2664 |
2672 SwDoc *pDoc = GetRenderDoc( pView, rSelection, bIsPDFExport ); 2673 DBG_ASSERT( pDoc && pView, "doc or view shell missing!" ); | 2665 SwDoc *pDoc = GetRenderDoc( pView, rSelection, bIsPDFExport ); 2666 DBG_ASSERT( pDoc && pView, "doc or view shell missing!" ); |
2674 if (!pDoc || !pView) | 2667 if ( pDoc == 0 || pView == 0 ) 2668 { |
2675 return 0; | 2669 return 0; |
2670 } |
|
2676 | 2671 |
2672 // clean up <RenderData> and <PrintUIOptions> 2673 { 2674 if ( m_pRenderData ) 2675 { 2676 delete m_pRenderData; 2677 m_pRenderData = 0; 2678 } 2679 if ( m_pPrintUIOptions ) 2680 { 2681 delete m_pPrintUIOptions; 2682 m_pPrintUIOptions = 0; 2683 } 2684 } 2685 2686 if ( !bIsSwSrcView ) 2687 { 2688 m_pRenderData = new SwRenderData; 2689 } 2690 // new <PrintUIOptions> 2691 m_pPrintUIOptions = lcl_GetPrintUIOptions( pDocShell, pView ); 2692 const bool bFormat = m_pPrintUIOptions->processPropertiesAndCheckFormat( rxOptions ); 2693 |
|
2677 // save current UI options from the print dialog for the next call to that dialog 2678 lcl_SavePrintUIOptionsToDocumentPrintData( *pDoc, *m_pPrintUIOptions, bIsPDFExport ); 2679 2680 sal_Int32 nRet = 0; | 2694 // save current UI options from the print dialog for the next call to that dialog 2695 lcl_SavePrintUIOptionsToDocumentPrintData( *pDoc, *m_pPrintUIOptions, bIsPDFExport ); 2696 2697 sal_Int32 nRet = 0; |
2681 if (bIsSwSrcView) | 2698 if ( bIsSwSrcView ) |
2682 { 2683 SwSrcView *pSwSrcView = dynamic_cast< SwSrcView * >(pView); 2684 OutputDevice *pOutDev = lcl_GetOutputDevice( *m_pPrintUIOptions ); 2685 nRet = pSwSrcView->PrintSource( pOutDev, 1 /* dummy */, true /* get page count only */ ); 2686 } 2687 else 2688 { 2689 SwDocShell *pRenderDocShell = pDoc->GetDocShell(); --- 16 unchanged lines hidden (view full) --- 2706 } 2707 else 2708 pViewShell = ((SwPagePreView*)pView)->GetViewShell(); 2709 } 2710 2711 if (!pViewShell || !pViewShell->GetLayout()) 2712 return 0; 2713 | 2699 { 2700 SwSrcView *pSwSrcView = dynamic_cast< SwSrcView * >(pView); 2701 OutputDevice *pOutDev = lcl_GetOutputDevice( *m_pPrintUIOptions ); 2702 nRet = pSwSrcView->PrintSource( pOutDev, 1 /* dummy */, true /* get page count only */ ); 2703 } 2704 else 2705 { 2706 SwDocShell *pRenderDocShell = pDoc->GetDocShell(); --- 16 unchanged lines hidden (view full) --- 2723 } 2724 else 2725 pViewShell = ((SwPagePreView*)pView)->GetViewShell(); 2726 } 2727 2728 if (!pViewShell || !pViewShell->GetLayout()) 2729 return 0; 2730 |
2714 if (bFormat) | 2731 if ( bFormat ) |
2715 { 2716 // #i38289 2717 if( pViewShell->GetViewOptions()->getBrowseMode() ) 2718 { 2719 SwViewOption aOpt( *pViewShell->GetViewOptions() ); 2720 aOpt.setBrowseMode( false ); 2721 pViewShell->ApplyViewOptions( aOpt ); 2722 pSwView->RecheckBrowseMode(); 2723 } 2724 2725 // reformating the document for printing will show the changes in the view 2726 // which is likely to produce many unwanted and not nice to view actions. 2727 // We don't want that! Thus we disable updating of the view. 2728 pViewShell->StartAction(); 2729 | 2732 { 2733 // #i38289 2734 if( pViewShell->GetViewOptions()->getBrowseMode() ) 2735 { 2736 SwViewOption aOpt( *pViewShell->GetViewOptions() ); 2737 aOpt.setBrowseMode( false ); 2738 pViewShell->ApplyViewOptions( aOpt ); 2739 pSwView->RecheckBrowseMode(); 2740 } 2741 2742 // reformating the document for printing will show the changes in the view 2743 // which is likely to produce many unwanted and not nice to view actions. 2744 // We don't want that! Thus we disable updating of the view. 2745 pViewShell->StartAction(); 2746 |
2730 if (pSwView) | 2747 if ( pSwView ) |
2731 { 2732 if (m_pRenderData && m_pRenderData->NeedNewViewOptionAdjust( *pViewShell ) ) 2733 m_pRenderData->ViewOptionAdjustStop(); 2734 if (m_pRenderData && !m_pRenderData->IsViewOptionAdjust()) 2735 m_pRenderData->ViewOptionAdjustStart( *pViewShell, *pViewShell->GetViewOptions() ); 2736 } 2737 2738 m_pRenderData->SetSwPrtOptions( new SwPrintData ); 2739 m_pRenderData->MakeSwPrtOptions( m_pRenderData->GetSwPrtOptionsRef(), pRenderDocShell, 2740 m_pPrintUIOptions, m_pRenderData, bIsPDFExport ); 2741 | 2748 { 2749 if (m_pRenderData && m_pRenderData->NeedNewViewOptionAdjust( *pViewShell ) ) 2750 m_pRenderData->ViewOptionAdjustStop(); 2751 if (m_pRenderData && !m_pRenderData->IsViewOptionAdjust()) 2752 m_pRenderData->ViewOptionAdjustStart( *pViewShell, *pViewShell->GetViewOptions() ); 2753 } 2754 2755 m_pRenderData->SetSwPrtOptions( new SwPrintData ); 2756 m_pRenderData->MakeSwPrtOptions( m_pRenderData->GetSwPrtOptionsRef(), pRenderDocShell, 2757 m_pPrintUIOptions, m_pRenderData, bIsPDFExport ); 2758 |
2742 if (pSwView) | 2759 if ( pSwView ) |
2743 { 2744 // PDF export should not make use of the SwPrtOptions 2745 const SwPrintData *pPrtOptions = (bIsPDFExport) | 2760 { 2761 // PDF export should not make use of the SwPrtOptions 2762 const SwPrintData *pPrtOptions = (bIsPDFExport) |
2746 ? NULL : m_pRenderData->GetSwPrtOptions(); | 2763 ? NULL 2764 : m_pRenderData->GetSwPrtOptions(); |
2747 m_pRenderData->ViewOptionAdjust( pPrtOptions ); 2748 } 2749 2750 // since printing now also use the API for PDF export this option 2751 // should be set for printing as well ... 2752 pViewShell->SetPDFExportOption( sal_True ); 2753 bool bOrigStatus = pRenderDocShell->IsEnableSetModified(); 2754 // check configuration: shall update of printing information in DocInfo set the document to "modified"? 2755 bool bStateChanged = false; 2756 if ( bOrigStatus && !SvtPrintWarningOptions().IsModifyDocumentOnPrintingAllowed() ) 2757 { 2758 pRenderDocShell->EnableSetModified( sal_False ); 2759 bStateChanged = true; 2760 } | 2765 m_pRenderData->ViewOptionAdjust( pPrtOptions ); 2766 } 2767 2768 // since printing now also use the API for PDF export this option 2769 // should be set for printing as well ... 2770 pViewShell->SetPDFExportOption( sal_True ); 2771 bool bOrigStatus = pRenderDocShell->IsEnableSetModified(); 2772 // check configuration: shall update of printing information in DocInfo set the document to "modified"? 2773 bool bStateChanged = false; 2774 if ( bOrigStatus && !SvtPrintWarningOptions().IsModifyDocumentOnPrintingAllowed() ) 2775 { 2776 pRenderDocShell->EnableSetModified( sal_False ); 2777 bStateChanged = true; 2778 } |
2761 | 2779 |
2762 // --> FME 2005-05-23 #122919# Force field update before PDF export: 2763 pViewShell->ViewShell::UpdateFlds(sal_True); 2764 // <-- 2765 if( bStateChanged ) 2766 pRenderDocShell->EnableSetModified( sal_True ); 2767 2768 // there is some redundancy between those two function calls, but right now 2769 // there is no time to sort this out. 2770 //TODO: check what exatly needs to be done and make just one function for that 2771 pViewShell->CalcLayout(); 2772 pViewShell->CalcPagesForPrint( pViewShell->GetPageCount() ); | 2780 // --> FME 2005-05-23 #122919# Force field update before PDF export: 2781 pViewShell->ViewShell::UpdateFlds(sal_True); 2782 // <-- 2783 if( bStateChanged ) 2784 pRenderDocShell->EnableSetModified( sal_True ); 2785 2786 // there is some redundancy between those two function calls, but right now 2787 // there is no time to sort this out. 2788 //TODO: check what exatly needs to be done and make just one function for that 2789 pViewShell->CalcLayout(); 2790 pViewShell->CalcPagesForPrint( pViewShell->GetPageCount() ); |
2773 | 2791 |
2774 pViewShell->SetPDFExportOption( sal_False ); | 2792 pViewShell->SetPDFExportOption( sal_False ); |
2775 | 2793 |
2776 // enable view again 2777 pViewShell->EndAction(); 2778 } 2779 2780 const sal_Int32 nPageCount = pViewShell->GetPageCount(); 2781 2782 // 2783 // get number of pages to be rendered --- 65 unchanged lines hidden (view full) --- 2849 const bool bIsSkipEmptyPages = !m_pPrintUIOptions->IsPrintEmptyPages( bIsPDFExport ); 2850 const bool bPrintPaperFromSetup = m_pPrintUIOptions->getBoolValue( "PrintPaperFromSetup", false ); 2851 2852 SwDoc *pDoc = GetRenderDoc( pView, rSelection, bIsPDFExport ); 2853 DBG_ASSERT( pDoc && pView, "doc or view shell missing!" ); 2854 if (!pDoc || !pView) 2855 return uno::Sequence< beans::PropertyValue >(); 2856 | 2794 // enable view again 2795 pViewShell->EndAction(); 2796 } 2797 2798 const sal_Int32 nPageCount = pViewShell->GetPageCount(); 2799 2800 // 2801 // get number of pages to be rendered --- 65 unchanged lines hidden (view full) --- 2867 const bool bIsSkipEmptyPages = !m_pPrintUIOptions->IsPrintEmptyPages( bIsPDFExport ); 2868 const bool bPrintPaperFromSetup = m_pPrintUIOptions->getBoolValue( "PrintPaperFromSetup", false ); 2869 2870 SwDoc *pDoc = GetRenderDoc( pView, rSelection, bIsPDFExport ); 2871 DBG_ASSERT( pDoc && pView, "doc or view shell missing!" ); 2872 if (!pDoc || !pView) 2873 return uno::Sequence< beans::PropertyValue >(); 2874 |
2857 // due to #110067# (document page count changes sometimes during 2858 // PDF export/printing) we can not check for the upper bound properly. 2859 // Thus instead of throwing the exception we silently return. 2860 if (0 > nRenderer) | 2875 if ( nRenderer < 0 || nRenderer >= SAL_MAX_UINT16 ) |
2861 throw IllegalArgumentException(); 2862 2863 // TODO/mba: we really need a generic way to get the ViewShell! 2864 ViewShell* pVwSh = 0; 2865 SwView* pSwView = PTR_CAST(SwView, pView); 2866 if ( pSwView ) 2867 pVwSh = pSwView->GetWrtShellPtr(); 2868 else --- 10 unchanged lines hidden (view full) --- 2879 // since SwSrcView::PrintSource is a poor implementation to get the number of pages to print 2880 // we obmit checking of the upper bound in this case. 2881 if (!bIsSwSrcView && m_pRenderData && nRenderer > nMaxRenderer) 2882 return uno::Sequence< beans::PropertyValue >(); 2883 2884 uno::Sequence< beans::PropertyValue > aRenderer; 2885 if (m_pRenderData) 2886 { | 2876 throw IllegalArgumentException(); 2877 2878 // TODO/mba: we really need a generic way to get the ViewShell! 2879 ViewShell* pVwSh = 0; 2880 SwView* pSwView = PTR_CAST(SwView, pView); 2881 if ( pSwView ) 2882 pVwSh = pSwView->GetWrtShellPtr(); 2883 else --- 10 unchanged lines hidden (view full) --- 2894 // since SwSrcView::PrintSource is a poor implementation to get the number of pages to print 2895 // we obmit checking of the upper bound in this case. 2896 if (!bIsSwSrcView && m_pRenderData && nRenderer > nMaxRenderer) 2897 return uno::Sequence< beans::PropertyValue >(); 2898 2899 uno::Sequence< beans::PropertyValue > aRenderer; 2900 if (m_pRenderData) 2901 { |
2887 // --> TL, OD 2010-09-07 #i114210# 2888 // determine the correct page number from the renderer index 2889 // --> OD 2010-10-01 #i114875 2890 // consider brochure print 2891 const sal_uInt16 nPage = bPrintProspect 2892 ? nRenderer + 1 2893 : m_pRenderData->GetPagesToPrint()[ nRenderer ]; 2894 // <-- 2895 | 2902 const sal_Int32 nPage = bPrintProspect 2903 ? nRenderer + 1 2904 : m_pRenderData->GetPagesToPrint()[ nRenderer ]; 2905 |
2896 // get paper tray to use ... 2897 sal_Int32 nPrinterPaperTray = -1; 2898 if (! bPrintPaperFromSetup) 2899 { 2900 // ... from individual page style (see the page tab in Format/Page dialog) 2901 const std::map< sal_Int32, sal_Int32 > &rPaperTrays = m_pRenderData->GetPrinterPaperTrays(); 2902 std::map< sal_Int32, sal_Int32 >::const_iterator aIt( rPaperTrays.find( nPage ) ); 2903 if (aIt != rPaperTrays.end()) --- 19 unchanged lines hidden (view full) --- 2923 Printer *pPrinter = dynamic_cast< Printer * >(lcl_GetOutputDevice( *m_pPrintUIOptions )); 2924 if (pPrinter) 2925 { 2926 // HTML source view and prospect adapt to the printer's paper size 2927 aTmpSize = pPrinter->GetPaperSize(); 2928 aTmpSize = pPrinter->LogicToLogic( aTmpSize, 2929 pPrinter->GetMapMode(), MapMode( MAP_100TH_MM )); 2930 aPageSize = awt::Size( aTmpSize.Width(), aTmpSize.Height() ); | 2906 // get paper tray to use ... 2907 sal_Int32 nPrinterPaperTray = -1; 2908 if (! bPrintPaperFromSetup) 2909 { 2910 // ... from individual page style (see the page tab in Format/Page dialog) 2911 const std::map< sal_Int32, sal_Int32 > &rPaperTrays = m_pRenderData->GetPrinterPaperTrays(); 2912 std::map< sal_Int32, sal_Int32 >::const_iterator aIt( rPaperTrays.find( nPage ) ); 2913 if (aIt != rPaperTrays.end()) --- 19 unchanged lines hidden (view full) --- 2933 Printer *pPrinter = dynamic_cast< Printer * >(lcl_GetOutputDevice( *m_pPrintUIOptions )); 2934 if (pPrinter) 2935 { 2936 // HTML source view and prospect adapt to the printer's paper size 2937 aTmpSize = pPrinter->GetPaperSize(); 2938 aTmpSize = pPrinter->LogicToLogic( aTmpSize, 2939 pPrinter->GetMapMode(), MapMode( MAP_100TH_MM )); 2940 aPageSize = awt::Size( aTmpSize.Width(), aTmpSize.Height() ); |
2931 #if 0 2932 // #i115048# it seems users didn't like getting double the formatted page size 2933 // revert to "old" behavior scaling to the current paper size of the printer 2934 if (bPrintProspect) 2935 { 2936 // we just state what output size we would need 2937 // which may cause vcl to set that page size on the printer 2938 // (if available and not overriden by the user) 2939 aTmpSize = pVwSh->GetPageSize( nPage, bIsSkipEmptyPages ); 2940 aPreferredPageSize = awt::Size ( TWIP_TO_MM100( 2 * aTmpSize.Width() ), 2941 TWIP_TO_MM100( aTmpSize.Height() )); 2942 } 2943 #else | |
2944 if( bPrintProspect ) 2945 { 2946 // just switch to an appropriate portrait/landscape format 2947 // FIXME: brochure printing with landscape pages puts the 2948 // pages next to each other, so landscape is currently always 2949 // the better choice 2950 if( aPageSize.Width < aPageSize.Height ) 2951 { 2952 aPreferredPageSize.Width = aPageSize.Height; 2953 aPreferredPageSize.Height = aPageSize.Width; 2954 } 2955 } | 2941 if( bPrintProspect ) 2942 { 2943 // just switch to an appropriate portrait/landscape format 2944 // FIXME: brochure printing with landscape pages puts the 2945 // pages next to each other, so landscape is currently always 2946 // the better choice 2947 if( aPageSize.Width < aPageSize.Height ) 2948 { 2949 aPreferredPageSize.Width = aPageSize.Height; 2950 aPreferredPageSize.Height = aPageSize.Width; 2951 } 2952 } |
2956 #endif | |
2957 } 2958 } 2959 else 2960 { | 2953 } 2954 } 2955 else 2956 { |
2961 aTmpSize = pVwSh->GetPageSize( nPage, bIsSkipEmptyPages ); | 2957 ASSERT( nPage > 0 && nPage <= SAL_MAX_UINT16, 2958 "<SwXTextDocument::getRenderer(..)> - unexpected value for the page number, it does not fit into sal_uInt16." ); 2959 aTmpSize = pVwSh->GetPageSize( static_cast< sal_uInt16 >(nPage), bIsSkipEmptyPages ); |
2962 aPageSize = awt::Size ( TWIP_TO_MM100( aTmpSize.Width() ), 2963 TWIP_TO_MM100( aTmpSize.Height() )); 2964 } 2965 2966 sal_Int32 nLen = 2; 2967 aRenderer.realloc(2); 2968 aRenderer[0].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "PageSize" ) ); 2969 aRenderer[0].Value <<= aPageSize; --- 10 unchanged lines hidden (view full) --- 2980 { 2981 ++nLen; 2982 aRenderer.realloc( nLen ); 2983 aRenderer[ nLen - 1 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "PrinterPaperTray" ) ); 2984 aRenderer[ nLen - 1 ].Value <<= nPrinterPaperTray; 2985 } 2986 } 2987 | 2960 aPageSize = awt::Size ( TWIP_TO_MM100( aTmpSize.Width() ), 2961 TWIP_TO_MM100( aTmpSize.Height() )); 2962 } 2963 2964 sal_Int32 nLen = 2; 2965 aRenderer.realloc(2); 2966 aRenderer[0].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "PageSize" ) ); 2967 aRenderer[0].Value <<= aPageSize; --- 10 unchanged lines hidden (view full) --- 2978 { 2979 ++nLen; 2980 aRenderer.realloc( nLen ); 2981 aRenderer[ nLen - 1 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "PrinterPaperTray" ) ); 2982 aRenderer[ nLen - 1 ].Value <<= nPrinterPaperTray; 2983 } 2984 } 2985 |
2988 // --> OD #i117783# | |
2989 if ( bApplyPagePrintSettingsFromXPagePrintable ) 2990 { 2991 const SwPagePreViewPrtData* pPagePrintSettings = 2992 pDocShell->GetDoc()->GetPreViewPrtData(); 2993 if ( pPagePrintSettings && 2994 ( pPagePrintSettings->GetRow() > 1 || 2995 pPagePrintSettings->GetCol() > 1 ) ) 2996 { --- 38 unchanged lines hidden (view full) --- 3035 aRenderer[ nRenderDataIdxStart + 8 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "NUpPaperSize" ) ); 3036 aRenderer[ nRenderDataIdxStart + 8 ].Value <<= aNewPageSize; 3037 } 3038 } 3039 } 3040 3041 bApplyPagePrintSettingsFromXPagePrintable = sal_False; 3042 } | 2986 if ( bApplyPagePrintSettingsFromXPagePrintable ) 2987 { 2988 const SwPagePreViewPrtData* pPagePrintSettings = 2989 pDocShell->GetDoc()->GetPreViewPrtData(); 2990 if ( pPagePrintSettings && 2991 ( pPagePrintSettings->GetRow() > 1 || 2992 pPagePrintSettings->GetCol() > 1 ) ) 2993 { --- 38 unchanged lines hidden (view full) --- 3032 aRenderer[ nRenderDataIdxStart + 8 ].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "NUpPaperSize" ) ); 3033 aRenderer[ nRenderDataIdxStart + 8 ].Value <<= aNewPageSize; 3034 } 3035 } 3036 } 3037 3038 bApplyPagePrintSettingsFromXPagePrintable = sal_False; 3039 } |
3043 // <-- | |
3044 3045 m_pPrintUIOptions->appendPrintUIOptions( aRenderer ); 3046 3047 return aRenderer; 3048} 3049/* -----------------------------28.10.02 16:00-------------------------------- 3050 3051 ---------------------------------------------------------------------------*/ --- 29 unchanged lines hidden (view full) --- 3081 break; 3082 pFrame = SfxViewFrame::GetNext( *pFrame, pDocShell, sal_False ); 3083 } 3084 3085 DBG_ASSERT( pSwView || pSwPagePreView || pSwSrcView, "failed to get view shell" ); 3086 if (pView) 3087 rbIsSwSrcView = pSwSrcView != 0; 3088 return pView; | 3040 3041 m_pPrintUIOptions->appendPrintUIOptions( aRenderer ); 3042 3043 return aRenderer; 3044} 3045/* -----------------------------28.10.02 16:00-------------------------------- 3046 3047 ---------------------------------------------------------------------------*/ --- 29 unchanged lines hidden (view full) --- 3077 break; 3078 pFrame = SfxViewFrame::GetNext( *pFrame, pDocShell, sal_False ); 3079 } 3080 3081 DBG_ASSERT( pSwView || pSwPagePreView || pSwSrcView, "failed to get view shell" ); 3082 if (pView) 3083 rbIsSwSrcView = pSwSrcView != 0; 3084 return pView; |
3089// return pSwView ? dynamic_cast< SfxViewShell * >(pSwView) : 3090// (pSwSrcView ? dynamic_cast< SfxViewShell * >(pSwSrcView) : 3091// dynamic_cast< SfxViewShell * >(pSwPagePreView) ); | |
3092} 3093 3094 3095void SAL_CALL SwXTextDocument::render( 3096 sal_Int32 nRenderer, 3097 const uno::Any& rSelection, 3098 const uno::Sequence< beans::PropertyValue >& rxOptions ) 3099 throw (IllegalArgumentException, RuntimeException) --- 6 unchanged lines hidden (view full) --- 3106 // PDF export/printing) we can not check for the upper bound properly. 3107 // Thus instead of throwing the exception we silently return. 3108 if (0 > nRenderer) 3109 throw IllegalArgumentException(); 3110 3111 const bool bIsPDFExport = !lcl_SeqHasProperty( rxOptions, "IsPrinter" ); 3112 bool bIsSwSrcView = false; 3113 SfxViewShell *pView = GetRenderView( bIsSwSrcView, rxOptions, bIsPDFExport ); | 3085} 3086 3087 3088void SAL_CALL SwXTextDocument::render( 3089 sal_Int32 nRenderer, 3090 const uno::Any& rSelection, 3091 const uno::Sequence< beans::PropertyValue >& rxOptions ) 3092 throw (IllegalArgumentException, RuntimeException) --- 6 unchanged lines hidden (view full) --- 3099 // PDF export/printing) we can not check for the upper bound properly. 3100 // Thus instead of throwing the exception we silently return. 3101 if (0 > nRenderer) 3102 throw IllegalArgumentException(); 3103 3104 const bool bIsPDFExport = !lcl_SeqHasProperty( rxOptions, "IsPrinter" ); 3105 bool bIsSwSrcView = false; 3106 SfxViewShell *pView = GetRenderView( bIsSwSrcView, rxOptions, bIsPDFExport ); |
3114 3115 DBG_ASSERT( m_pRenderData, "data should have been created already in getRendererCount..." ); 3116 DBG_ASSERT( m_pPrintUIOptions, "data should have been created already in getRendererCount..." ); 3117 if (!bIsSwSrcView && !m_pRenderData) | 3107 3108 // error handling - avoid crash 3109 if ( !bIsSwSrcView && m_pRenderData == NULL ) 3110 { 3111 DBG_ASSERT( false, "data should have been created already in getRendererCount..." ); |
3118 m_pRenderData = new SwRenderData; | 3112 m_pRenderData = new SwRenderData; |
3119 if (!m_pPrintUIOptions) | 3113 } 3114 if ( m_pPrintUIOptions == 0 ) 3115 { 3116 DBG_ASSERT( false, "data should have been created already in getRendererCount..." ); |
3120 m_pPrintUIOptions = lcl_GetPrintUIOptions( pDocShell, pView ); | 3117 m_pPrintUIOptions = lcl_GetPrintUIOptions( pDocShell, pView ); |
3118 } 3119 |
|
3121 m_pPrintUIOptions->processProperties( rxOptions ); 3122 const bool bPrintProspect = m_pPrintUIOptions->getBoolValue( "PrintProspect", false ); 3123 const bool bLastPage = m_pPrintUIOptions->getBoolValue( "IsLastPage", sal_False ); 3124 3125 SwDoc *pDoc = GetRenderDoc( pView, rSelection, bIsPDFExport ); 3126 DBG_ASSERT( pDoc && pView, "doc or view shell missing!" ); 3127 if (pDoc && pView) 3128 { --- 27 unchanged lines hidden (view full) --- 3156 { 3157 // TODO/mba: we really need a generic way to get the ViewShell! 3158 SwView* pSwView = PTR_CAST(SwView, pView); 3159 if ( pSwView ) 3160 pVwSh = pSwView->GetWrtShellPtr(); 3161 else 3162 pVwSh = ((SwPagePreView*)pView)->GetViewShell(); 3163 } | 3120 m_pPrintUIOptions->processProperties( rxOptions ); 3121 const bool bPrintProspect = m_pPrintUIOptions->getBoolValue( "PrintProspect", false ); 3122 const bool bLastPage = m_pPrintUIOptions->getBoolValue( "IsLastPage", sal_False ); 3123 3124 SwDoc *pDoc = GetRenderDoc( pView, rSelection, bIsPDFExport ); 3125 DBG_ASSERT( pDoc && pView, "doc or view shell missing!" ); 3126 if (pDoc && pView) 3127 { --- 27 unchanged lines hidden (view full) --- 3155 { 3156 // TODO/mba: we really need a generic way to get the ViewShell! 3157 SwView* pSwView = PTR_CAST(SwView, pView); 3158 if ( pSwView ) 3159 pVwSh = pSwView->GetWrtShellPtr(); 3160 else 3161 pVwSh = ((SwPagePreView*)pView)->GetViewShell(); 3162 } |
3164 | 3163 |
3165 // get output device to use 3166 OutputDevice * pOut = lcl_GetOutputDevice( *m_pPrintUIOptions ); 3167 3168 if(pVwSh && pOut && m_pRenderData->HasSwPrtOptions()) 3169 { 3170 const rtl::OUString aPageRange = m_pPrintUIOptions->getStringValue( "PageRange", OUString() ); 3171 const bool bFirstPage = m_pPrintUIOptions->getBoolValue( "IsFirstPage", sal_False ); 3172 bool bIsSkipEmptyPages = !m_pPrintUIOptions->IsPrintEmptyPages( bIsPDFExport ); | 3164 // get output device to use 3165 OutputDevice * pOut = lcl_GetOutputDevice( *m_pPrintUIOptions ); 3166 3167 if(pVwSh && pOut && m_pRenderData->HasSwPrtOptions()) 3168 { 3169 const rtl::OUString aPageRange = m_pPrintUIOptions->getStringValue( "PageRange", OUString() ); 3170 const bool bFirstPage = m_pPrintUIOptions->getBoolValue( "IsFirstPage", sal_False ); 3171 bool bIsSkipEmptyPages = !m_pPrintUIOptions->IsPrintEmptyPages( bIsPDFExport ); |
3173 | 3172 |
3174 DBG_ASSERT(( pView->IsA(aSwViewTypeId) && m_pRenderData->IsViewOptionAdjust()) 3175 || (!pView->IsA(aSwViewTypeId) && !m_pRenderData->IsViewOptionAdjust()), 3176 "SwView / SwViewOptionAdjust_Impl availability mismatch" ); | 3173 DBG_ASSERT(( pView->IsA(aSwViewTypeId) && m_pRenderData->IsViewOptionAdjust()) 3174 || (!pView->IsA(aSwViewTypeId) && !m_pRenderData->IsViewOptionAdjust()), 3175 "SwView / SwViewOptionAdjust_Impl availability mismatch" ); |
3177 | 3176 |
3178 // since printing now also use the API for PDF export this option 3179 // should be set for printing as well ... 3180 pVwSh->SetPDFExportOption( sal_True ); 3181 3182 // --> FME 2004-06-08 #i12836# enhanced pdf export 3183 // 3184 // First, we have to export hyperlinks, notes, and outline to pdf. 3185 // During this process, additional information required for tagging --- 45 unchanged lines hidden (view full) --- 3231 { 3232 lcl_DisposeView( m_pHiddenViewFrame, pDocShell ); 3233 m_pHiddenViewFrame = 0; 3234 3235 // prevent crash described in #i108805 3236 SwDocShell *pRenderDocShell = pDoc->GetDocShell(); 3237 SfxItemSet *pSet = pRenderDocShell->GetMedium()->GetItemSet(); 3238 pSet->Put( SfxBoolItem( SID_HIDDEN, sal_False ) ); | 3177 // since printing now also use the API for PDF export this option 3178 // should be set for printing as well ... 3179 pVwSh->SetPDFExportOption( sal_True ); 3180 3181 // --> FME 2004-06-08 #i12836# enhanced pdf export 3182 // 3183 // First, we have to export hyperlinks, notes, and outline to pdf. 3184 // During this process, additional information required for tagging --- 45 unchanged lines hidden (view full) --- 3230 { 3231 lcl_DisposeView( m_pHiddenViewFrame, pDocShell ); 3232 m_pHiddenViewFrame = 0; 3233 3234 // prevent crash described in #i108805 3235 SwDocShell *pRenderDocShell = pDoc->GetDocShell(); 3236 SfxItemSet *pSet = pRenderDocShell->GetMedium()->GetItemSet(); 3237 pSet->Put( SfxBoolItem( SID_HIDDEN, sal_False ) ); |
3239 | |
3240 } 3241 } 3242 } 3243 } 3244 } 3245 } 3246 if( bLastPage ) 3247 { --- 251 unchanged lines hidden (view full) --- 3499 nCount += 1; 3500 } 3501 } 3502 } 3503 3504 return aLanguages; 3505} 3506 | 3238 } 3239 } 3240 } 3241 } 3242 } 3243 } 3244 if( bLastPage ) 3245 { --- 251 unchanged lines hidden (view full) --- 3497 nCount += 1; 3498 } 3499 } 3500 } 3501 3502 return aLanguages; 3503} 3504 |
3507// #121125# react on ViewShell change; a reference to the ViewShell is 3508// held in SwViewOptionAdjust_Impl, thus needs to be cleaned up 3509void SwXTextDocument::ReactOnViewShellChange() | 3505// #121125#, #122868# 3506// method to assure clean up of the rendering data to restore view options 3507// and to loose hold reference to the ViewShell in SwViewOptionAdjust_Impl. 3508void SwXTextDocument::CleanUpRenderingData() |
3510{ | 3509{ |
3511 if(m_pRenderData) | 3510 if( m_pRenderData != NULL ) |
3512 { | 3511 { |
3513 delete m_pRenderData; | 3512 if ( m_pRenderData->HasPostItData() ) 3513 { 3514 m_pRenderData->DeletePostItData(); 3515 } 3516 delete m_pRenderData; |
3514 m_pRenderData = NULL; 3515 } 3516 | 3517 m_pRenderData = NULL; 3518 } 3519 |
3517 if(m_pPrintUIOptions) | 3520 if( m_pPrintUIOptions != NULL ) |
3518 { | 3521 { |
3519 delete m_pPrintUIOptions; | 3522 delete m_pPrintUIOptions; |
3520 m_pPrintUIOptions = NULL; 3521 } 3522} 3523 3524/* -----------------25.10.99 11:06------------------- 3525 3526 --------------------------------------------------*/ 3527SwXLinkTargetSupplier::SwXLinkTargetSupplier(SwXTextDocument& rxDoc) : --- 775 unchanged lines hidden --- | 3523 m_pPrintUIOptions = NULL; 3524 } 3525} 3526 3527/* -----------------25.10.99 11:06------------------- 3528 3529 --------------------------------------------------*/ 3530SwXLinkTargetSupplier::SwXLinkTargetSupplier(SwXTextDocument& rxDoc) : --- 775 unchanged lines hidden --- |