viewsh.cxx (45fd3b9a) | viewsh.cxx (8ef2f12b) |
---|---|
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 --- 792 unchanged lines hidden (view full) --- 801 _rSh.GetDoc()->SetModified(); 802} 803 804void ViewShell::SetParaSpaceMax( bool bNew ) 805{ 806 IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess(); 807 if( pIDSA->get(IDocumentSettingAccess::PARA_SPACE_MAX) != bNew ) 808 { | 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 --- 792 unchanged lines hidden (view full) --- 801 _rSh.GetDoc()->SetModified(); 802} 803 804void ViewShell::SetParaSpaceMax( bool bNew ) 805{ 806 IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess(); 807 if( pIDSA->get(IDocumentSettingAccess::PARA_SPACE_MAX) != bNew ) 808 { |
809 SwWait aWait( *GetDoc()->GetDocShell(), sal_True ); | 809 SwWait aWait( *GetDoc()->GetDocShell(), true ); |
810 pIDSA->set(IDocumentSettingAccess::PARA_SPACE_MAX, bNew ); 811 const sal_uInt8 nInv = INV_PRTAREA | INV_TABLE | INV_SECTION; 812 lcl_InvalidateAllCntnt( *this, nInv ); 813 } 814} 815 816void ViewShell::SetParaSpaceMaxAtPages( bool bNew ) 817{ 818 IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess(); 819 if( pIDSA->get(IDocumentSettingAccess::PARA_SPACE_MAX_AT_PAGES) != bNew ) 820 { | 810 pIDSA->set(IDocumentSettingAccess::PARA_SPACE_MAX, bNew ); 811 const sal_uInt8 nInv = INV_PRTAREA | INV_TABLE | INV_SECTION; 812 lcl_InvalidateAllCntnt( *this, nInv ); 813 } 814} 815 816void ViewShell::SetParaSpaceMaxAtPages( bool bNew ) 817{ 818 IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess(); 819 if( pIDSA->get(IDocumentSettingAccess::PARA_SPACE_MAX_AT_PAGES) != bNew ) 820 { |
821 SwWait aWait( *GetDoc()->GetDocShell(), sal_True ); | 821 SwWait aWait( *GetDoc()->GetDocShell(), true ); |
822 pIDSA->set(IDocumentSettingAccess::PARA_SPACE_MAX_AT_PAGES, bNew ); 823 const sal_uInt8 nInv = INV_PRTAREA | INV_TABLE | INV_SECTION; 824 lcl_InvalidateAllCntnt( *this, nInv ); 825 } 826} 827 828void ViewShell::SetTabCompat( bool bNew ) 829{ 830 IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess(); 831 if( pIDSA->get(IDocumentSettingAccess::TAB_COMPAT) != bNew ) 832 { | 822 pIDSA->set(IDocumentSettingAccess::PARA_SPACE_MAX_AT_PAGES, bNew ); 823 const sal_uInt8 nInv = INV_PRTAREA | INV_TABLE | INV_SECTION; 824 lcl_InvalidateAllCntnt( *this, nInv ); 825 } 826} 827 828void ViewShell::SetTabCompat( bool bNew ) 829{ 830 IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess(); 831 if( pIDSA->get(IDocumentSettingAccess::TAB_COMPAT) != bNew ) 832 { |
833 SwWait aWait( *GetDoc()->GetDocShell(), sal_True ); | 833 SwWait aWait( *GetDoc()->GetDocShell(), true ); |
834 pIDSA->set(IDocumentSettingAccess::TAB_COMPAT, bNew ); 835 const sal_uInt8 nInv = INV_PRTAREA | INV_SIZE | INV_TABLE | INV_SECTION; 836 lcl_InvalidateAllCntnt( *this, nInv ); 837 } 838} 839 840void ViewShell::SetAddExtLeading( bool bNew ) 841{ 842 IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess(); 843 if ( pIDSA->get(IDocumentSettingAccess::ADD_EXT_LEADING) != bNew ) 844 { | 834 pIDSA->set(IDocumentSettingAccess::TAB_COMPAT, bNew ); 835 const sal_uInt8 nInv = INV_PRTAREA | INV_SIZE | INV_TABLE | INV_SECTION; 836 lcl_InvalidateAllCntnt( *this, nInv ); 837 } 838} 839 840void ViewShell::SetAddExtLeading( bool bNew ) 841{ 842 IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess(); 843 if ( pIDSA->get(IDocumentSettingAccess::ADD_EXT_LEADING) != bNew ) 844 { |
845 SwWait aWait( *GetDoc()->GetDocShell(), sal_True ); | 845 SwWait aWait( *GetDoc()->GetDocShell(), true ); |
846 pIDSA->set(IDocumentSettingAccess::ADD_EXT_LEADING, bNew ); 847 SdrModel* pTmpDrawModel = getIDocumentDrawModelAccess()->GetDrawModel(); 848 if ( pTmpDrawModel ) 849 pTmpDrawModel->SetAddExtLeading( bNew ); 850 const sal_uInt8 nInv = INV_PRTAREA | INV_SIZE | INV_TABLE | INV_SECTION; 851 lcl_InvalidateAllCntnt( *this, nInv ); 852 } 853} 854 855void ViewShell::SetUseVirDev( bool bNewVirtual ) 856{ 857 IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess(); 858 if ( pIDSA->get(IDocumentSettingAccess::USE_VIRTUAL_DEVICE) != bNewVirtual ) 859 { | 846 pIDSA->set(IDocumentSettingAccess::ADD_EXT_LEADING, bNew ); 847 SdrModel* pTmpDrawModel = getIDocumentDrawModelAccess()->GetDrawModel(); 848 if ( pTmpDrawModel ) 849 pTmpDrawModel->SetAddExtLeading( bNew ); 850 const sal_uInt8 nInv = INV_PRTAREA | INV_SIZE | INV_TABLE | INV_SECTION; 851 lcl_InvalidateAllCntnt( *this, nInv ); 852 } 853} 854 855void ViewShell::SetUseVirDev( bool bNewVirtual ) 856{ 857 IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess(); 858 if ( pIDSA->get(IDocumentSettingAccess::USE_VIRTUAL_DEVICE) != bNewVirtual ) 859 { |
860 SwWait aWait( *GetDoc()->GetDocShell(), sal_True ); | 860 SwWait aWait( *GetDoc()->GetDocShell(), true ); |
861 // this sets the flag at the document and calls PrtDataChanged 862 IDocumentDeviceAccess* pIDDA = getIDocumentDeviceAccess(); 863 pIDDA->setReferenceDeviceType( bNewVirtual, true ); 864 } 865} 866 867// OD 2004-02-16 #106629# - control, if paragraph and table spacing is added 868// at bottom of table cells 869void ViewShell::SetAddParaSpacingToTableCells( bool _bAddParaSpacingToTableCells ) 870{ 871 IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess(); 872 if ( pIDSA->get(IDocumentSettingAccess::ADD_PARA_SPACING_TO_TABLE_CELLS) != _bAddParaSpacingToTableCells ) 873 { | 861 // this sets the flag at the document and calls PrtDataChanged 862 IDocumentDeviceAccess* pIDDA = getIDocumentDeviceAccess(); 863 pIDDA->setReferenceDeviceType( bNewVirtual, true ); 864 } 865} 866 867// OD 2004-02-16 #106629# - control, if paragraph and table spacing is added 868// at bottom of table cells 869void ViewShell::SetAddParaSpacingToTableCells( bool _bAddParaSpacingToTableCells ) 870{ 871 IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess(); 872 if ( pIDSA->get(IDocumentSettingAccess::ADD_PARA_SPACING_TO_TABLE_CELLS) != _bAddParaSpacingToTableCells ) 873 { |
874 SwWait aWait( *GetDoc()->GetDocShell(), sal_True ); | 874 SwWait aWait( *GetDoc()->GetDocShell(), true ); |
875 pIDSA->set(IDocumentSettingAccess::ADD_PARA_SPACING_TO_TABLE_CELLS, _bAddParaSpacingToTableCells ); 876 const sal_uInt8 nInv = INV_PRTAREA; 877 lcl_InvalidateAllCntnt( *this, nInv ); 878 } 879} 880 881// OD 06.01.2004 #i11859# - control, if former formatting of text lines with 882// proportional line spacing is used or not. 883void ViewShell::SetUseFormerLineSpacing( bool _bUseFormerLineSpacing ) 884{ 885 IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess(); 886 if ( pIDSA->get(IDocumentSettingAccess::OLD_LINE_SPACING) != _bUseFormerLineSpacing ) 887 { | 875 pIDSA->set(IDocumentSettingAccess::ADD_PARA_SPACING_TO_TABLE_CELLS, _bAddParaSpacingToTableCells ); 876 const sal_uInt8 nInv = INV_PRTAREA; 877 lcl_InvalidateAllCntnt( *this, nInv ); 878 } 879} 880 881// OD 06.01.2004 #i11859# - control, if former formatting of text lines with 882// proportional line spacing is used or not. 883void ViewShell::SetUseFormerLineSpacing( bool _bUseFormerLineSpacing ) 884{ 885 IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess(); 886 if ( pIDSA->get(IDocumentSettingAccess::OLD_LINE_SPACING) != _bUseFormerLineSpacing ) 887 { |
888 SwWait aWait( *GetDoc()->GetDocShell(), sal_True ); | 888 SwWait aWait( *GetDoc()->GetDocShell(), true ); |
889 pIDSA->set(IDocumentSettingAccess::OLD_LINE_SPACING, _bUseFormerLineSpacing ); 890 const sal_uInt8 nInv = INV_PRTAREA; 891 lcl_InvalidateAllCntnt( *this, nInv ); 892 } 893} 894 895// OD 2004-03-12 #i11860# - control, if former object positioning is used or not. 896void ViewShell::SetUseFormerObjectPositioning( bool _bUseFormerObjPos ) 897{ 898 IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess(); 899 if ( pIDSA->get(IDocumentSettingAccess::USE_FORMER_OBJECT_POS) != _bUseFormerObjPos ) 900 { | 889 pIDSA->set(IDocumentSettingAccess::OLD_LINE_SPACING, _bUseFormerLineSpacing ); 890 const sal_uInt8 nInv = INV_PRTAREA; 891 lcl_InvalidateAllCntnt( *this, nInv ); 892 } 893} 894 895// OD 2004-03-12 #i11860# - control, if former object positioning is used or not. 896void ViewShell::SetUseFormerObjectPositioning( bool _bUseFormerObjPos ) 897{ 898 IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess(); 899 if ( pIDSA->get(IDocumentSettingAccess::USE_FORMER_OBJECT_POS) != _bUseFormerObjPos ) 900 { |
901 SwWait aWait( *GetDoc()->GetDocShell(), sal_True ); | 901 SwWait aWait( *GetDoc()->GetDocShell(), true ); |
902 pIDSA->set(IDocumentSettingAccess::USE_FORMER_OBJECT_POS, _bUseFormerObjPos ); 903 lcl_InvalidateAllObjPos( *this ); 904 } 905} 906 907// OD 2004-05-05 #i28701# 908void ViewShell::SetConsiderWrapOnObjPos( bool _bConsiderWrapOnObjPos ) 909{ 910 IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess(); 911 if ( pIDSA->get(IDocumentSettingAccess::CONSIDER_WRAP_ON_OBJECT_POSITION) != _bConsiderWrapOnObjPos ) 912 { | 902 pIDSA->set(IDocumentSettingAccess::USE_FORMER_OBJECT_POS, _bUseFormerObjPos ); 903 lcl_InvalidateAllObjPos( *this ); 904 } 905} 906 907// OD 2004-05-05 #i28701# 908void ViewShell::SetConsiderWrapOnObjPos( bool _bConsiderWrapOnObjPos ) 909{ 910 IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess(); 911 if ( pIDSA->get(IDocumentSettingAccess::CONSIDER_WRAP_ON_OBJECT_POSITION) != _bConsiderWrapOnObjPos ) 912 { |
913 SwWait aWait( *GetDoc()->GetDocShell(), sal_True ); | 913 SwWait aWait( *GetDoc()->GetDocShell(), true ); |
914 pIDSA->set(IDocumentSettingAccess::CONSIDER_WRAP_ON_OBJECT_POSITION, _bConsiderWrapOnObjPos ); 915 lcl_InvalidateAllObjPos( *this ); 916 } 917} 918 919// --> FME #108724# 920void ViewShell::SetUseFormerTextWrapping( bool _bUseFormerTextWrapping ) 921{ 922 IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess(); 923 if ( pIDSA->get(IDocumentSettingAccess::USE_FORMER_TEXT_WRAPPING) != _bUseFormerTextWrapping ) 924 { | 914 pIDSA->set(IDocumentSettingAccess::CONSIDER_WRAP_ON_OBJECT_POSITION, _bConsiderWrapOnObjPos ); 915 lcl_InvalidateAllObjPos( *this ); 916 } 917} 918 919// --> FME #108724# 920void ViewShell::SetUseFormerTextWrapping( bool _bUseFormerTextWrapping ) 921{ 922 IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess(); 923 if ( pIDSA->get(IDocumentSettingAccess::USE_FORMER_TEXT_WRAPPING) != _bUseFormerTextWrapping ) 924 { |
925 SwWait aWait( *GetDoc()->GetDocShell(), sal_True ); | 925 SwWait aWait( *GetDoc()->GetDocShell(), true ); |
926 pIDSA->set(IDocumentSettingAccess::USE_FORMER_TEXT_WRAPPING, _bUseFormerTextWrapping ); 927 const sal_uInt8 nInv = INV_PRTAREA | INV_SIZE | INV_TABLE | INV_SECTION; 928 lcl_InvalidateAllCntnt( *this, nInv ); 929 } 930} 931// <-- 932 933// -> PB 2007-06-11 #i45491# 934void ViewShell::SetDoNotJustifyLinesWithManualBreak( bool _bDoNotJustifyLinesWithManualBreak ) 935{ 936 IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess(); 937 if ( pIDSA->get(IDocumentSettingAccess::DO_NOT_JUSTIFY_LINES_WITH_MANUAL_BREAK) != _bDoNotJustifyLinesWithManualBreak ) 938 { | 926 pIDSA->set(IDocumentSettingAccess::USE_FORMER_TEXT_WRAPPING, _bUseFormerTextWrapping ); 927 const sal_uInt8 nInv = INV_PRTAREA | INV_SIZE | INV_TABLE | INV_SECTION; 928 lcl_InvalidateAllCntnt( *this, nInv ); 929 } 930} 931// <-- 932 933// -> PB 2007-06-11 #i45491# 934void ViewShell::SetDoNotJustifyLinesWithManualBreak( bool _bDoNotJustifyLinesWithManualBreak ) 935{ 936 IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess(); 937 if ( pIDSA->get(IDocumentSettingAccess::DO_NOT_JUSTIFY_LINES_WITH_MANUAL_BREAK) != _bDoNotJustifyLinesWithManualBreak ) 938 { |
939 SwWait aWait( *GetDoc()->GetDocShell(), sal_True ); | 939 SwWait aWait( *GetDoc()->GetDocShell(), true ); |
940 pIDSA->set(IDocumentSettingAccess::DO_NOT_JUSTIFY_LINES_WITH_MANUAL_BREAK, _bDoNotJustifyLinesWithManualBreak ); 941 const sal_uInt8 nInv = INV_PRTAREA | INV_SIZE | INV_TABLE | INV_SECTION; 942 lcl_InvalidateAllCntnt( *this, nInv ); 943 } 944} 945// <-- 946 947/****************************************************************************** 948|* 949|* ViewShell::Reformat 950|* 951|* Ersterstellung BP ??? 952|* Letzte Aenderung MA 13. Feb. 98 953|* 954******************************************************************************/ 955 956void ViewShell::Reformat() 957{ | 940 pIDSA->set(IDocumentSettingAccess::DO_NOT_JUSTIFY_LINES_WITH_MANUAL_BREAK, _bDoNotJustifyLinesWithManualBreak ); 941 const sal_uInt8 nInv = INV_PRTAREA | INV_SIZE | INV_TABLE | INV_SECTION; 942 lcl_InvalidateAllCntnt( *this, nInv ); 943 } 944} 945// <-- 946 947/****************************************************************************** 948|* 949|* ViewShell::Reformat 950|* 951|* Ersterstellung BP ??? 952|* Letzte Aenderung MA 13. Feb. 98 953|* 954******************************************************************************/ 955 956void ViewShell::Reformat() 957{ |
958 SwWait aWait( *GetDoc()->GetDocShell(), sal_True ); | 958 SwWait aWait( *GetDoc()->GetDocShell(), true ); |
959 960 // Wir gehen auf Nummer sicher: 961 // Wir muessen die alten Fontinformationen wegschmeissen, 962 // wenn die Druckeraufloesung oder der Zoomfaktor sich aendert. 963 // Init() und Reformat() sind die sichersten Stellen. 964#ifdef FNTMET 965 aFntMetList.Flush(); 966#else --- 25 unchanged lines hidden (view full) --- 992|* Ersterstellung MA 31. Jan. 94 993|* Letzte Aenderung MA 08. Oct. 96 994|* 995******************************************************************************/ 996 997void ViewShell::CalcLayout() 998{ 999 SET_CURR_SHELL( this ); | 959 960 // Wir gehen auf Nummer sicher: 961 // Wir muessen die alten Fontinformationen wegschmeissen, 962 // wenn die Druckeraufloesung oder der Zoomfaktor sich aendert. 963 // Init() und Reformat() sind die sichersten Stellen. 964#ifdef FNTMET 965 aFntMetList.Flush(); 966#else --- 25 unchanged lines hidden (view full) --- 992|* Ersterstellung MA 31. Jan. 94 993|* Letzte Aenderung MA 08. Oct. 96 994|* 995******************************************************************************/ 996 997void ViewShell::CalcLayout() 998{ 999 SET_CURR_SHELL( this ); |
1000 SwWait aWait( *GetDoc()->GetDocShell(), sal_True ); | 1000 SwWait aWait( *GetDoc()->GetDocShell(), true ); |
1001 1002 //Cache vorbereiten und restaurieren, damit er nicht versaut wird. 1003 SwSaveSetLRUOfst aSaveLRU( *SwTxtFrm::GetTxtCache(), 1004 SwTxtFrm::GetTxtCache()->GetCurMax() - 50 ); 1005 1006 //Progress einschalten wenn noch keiner Lauft. 1007 const sal_Bool bEndProgress = SfxProgress::GetActiveProgress( GetDoc()->GetDocShell() ) == 0; 1008 if ( bEndProgress ) --- 1765 unchanged lines hidden --- | 1001 1002 //Cache vorbereiten und restaurieren, damit er nicht versaut wird. 1003 SwSaveSetLRUOfst aSaveLRU( *SwTxtFrm::GetTxtCache(), 1004 SwTxtFrm::GetTxtCache()->GetCurMax() - 50 ); 1005 1006 //Progress einschalten wenn noch keiner Lauft. 1007 const sal_Bool bEndProgress = SfxProgress::GetActiveProgress( GetDoc()->GetDocShell() ) == 0; 1008 if ( bEndProgress ) --- 1765 unchanged lines hidden --- |