From ebc5777548dea42ed966a16c66d879b1485bbfb4 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Sun, 13 Jun 2010 15:22:56 +0200 Subject: CWS swlayoutrefactoring: #i81480#: enable sw code to use multiple layouts --- sw/source/ui/app/docsh2.cxx | 170 +++++++++++--------------------------------- 1 file changed, 40 insertions(+), 130 deletions(-) (limited to 'sw/source/ui/app/docsh2.cxx') diff --git a/sw/source/ui/app/docsh2.cxx b/sw/source/ui/app/docsh2.cxx index 9cb3caffa7cc..a537a07ce53e 100644 --- a/sw/source/ui/app/docsh2.cxx +++ b/sw/source/ui/app/docsh2.cxx @@ -165,6 +165,44 @@ SfxDocumentInfoDialog* SwDocShell::CreateDocumentInfoDialog( return pDlg; } +// Disable "multiple layout" + +void SwDocShell::ToggleBrowserMode(BOOL bSet, SwView* _pView ) +{ + GetDoc()->set(IDocumentSettingAccess::BROWSE_MODE, bSet ); + UpdateFontList(); + SwView* pTempView = _pView ? _pView : (SwView*)GetView(); + if( pTempView ) + { + pTempView->GetViewFrame()->GetBindings().Invalidate(FN_SHADOWCURSOR); + if( !GetDoc()->getPrinter( false ) ) + pTempView->SetPrinter( GetDoc()->getPrinter( false ), SFX_PRINTER_PRINTER | SFX_PRINTER_JOBSETUP ); + GetDoc()->CheckDefaultPageFmt(); + SfxViewFrame *pTmpFrm = SfxViewFrame::GetFirst(this, FALSE); + do { + if( pTmpFrm != pTempView->GetViewFrame() ) + { + pTmpFrm->DoClose(); + pTmpFrm = SfxViewFrame::GetFirst(this, FALSE); + } + else + pTmpFrm = pTmpFrm->GetNext(*pTmpFrm, this, FALSE); + + } while ( pTmpFrm ); + const SwViewOption& rViewOptions = *pTempView->GetWrtShell().GetViewOptions(); + pTempView->GetWrtShell().CheckBrowseView( TRUE ); + pTempView->CheckVisArea(); + if( bSet ) + { + const SvxZoomType eType = (SvxZoomType)rViewOptions.GetZoomType(); + if ( SVX_ZOOM_PERCENT != eType) + ((SwView*)GetView())->SetZoom( eType ); + } + pTempView->InvalidateBorder(); + pTempView->SetNewWindowAllowed(!bSet); + } +} +// End of disabled "multiple layout" /// update text fields on document properties changes void SwDocShell::DoFlushDocInfo() @@ -655,7 +693,7 @@ void SwDocShell::Execute(SfxRequest& rReq) pDocSh = (SwDocShell*)SfxObjectShell::GetNext( *pDocSh, &aType ) ) { SwDoc* pTmp = pDocSh->GetDoc(); - if ( pTmp->GetRootFrm() ) + if ( pTmp->GetCurrentViewShell() ) //swmod 071108//swmod 071225 pTmp->InvalidateAutoCompleteFlag(); } } @@ -692,11 +730,7 @@ void SwDocShell::Execute(SfxRequest& rReq) USHORT nSlotId = 0; if( bSet && !bFound ) // Keine gefunden, daher neue Preview anlegen - { - //Keine neue anlegen fuer BrowseView! - if( !GetDoc()->get(IDocumentSettingAccess::BROWSE_MODE) ) nSlotId = SID_VIEWSHELL1; - } else if( bFound && !bSet ) nSlotId = bOnly ? SID_VIEWSHELL0 : SID_VIEWSHELL1; @@ -949,6 +983,7 @@ void SwDocShell::Execute(SfxRequest& rReq) //pSavePrinter darf nicht wieder geloescht werden } pViewFrm->GetBindings().SetState(SfxBoolItem(SID_SOURCEVIEW, nSlot == SID_VIEWSHELL2)); + pViewFrm->GetBindings().Invalidate( SID_NEWWINDOW ); pViewFrm->GetBindings().Invalidate( SID_BROWSER_MODE ); pViewFrm->GetBindings().Invalidate( FN_PRINT_LAYOUT ); } @@ -1115,60 +1150,6 @@ void SwDocShell::Execute(SfxRequest& rReq) SW_MOD()->CheckSpellChanges(FALSE, TRUE, TRUE, FALSE ); break; - case SID_BROWSER_MODE: - case FN_PRINT_LAYOUT: //Fuer Web, genau umgekehrt zum BrowserMode - { - int eState = STATE_TOGGLE; - BOOL bSet = sal_True; - const SfxPoolItem* pAttr=NULL; - if ( pArgs && SFX_ITEM_SET == pArgs->GetItemState( nWhich , FALSE, &pAttr )) - { - bSet = ((SfxBoolItem*)pAttr)->GetValue(); - if ( nWhich == FN_PRINT_LAYOUT ) - bSet = !bSet; - eState = bSet ? STATE_ON : STATE_OFF; - } - - if ( STATE_TOGGLE == eState ) - bSet = !GetDoc()->get(IDocumentSettingAccess::BROWSE_MODE); - - ToggleBrowserMode(bSet, 0); - - // OS: numerische Reihenfolge beachten! - static USHORT __READONLY_DATA aInva[] = - { - SID_NEWWINDOW,/*5620*/ - SID_BROWSER_MODE, /*6313*/ - SID_RULER_BORDERS, SID_RULER_PAGE_POS, - SID_ATTR_LONG_LRSPACE, - SID_HTML_MODE, - SID_RULER_PROTECT, - SID_AUTOSPELL_CHECK, - FN_RULER, /*20211*/ - FN_VIEW_GRAPHIC, /*20213*/ - FN_VIEW_BOUNDS, /**/ - FN_VIEW_FIELDS, /*20215*/ - FN_VLINEAL, /*20216*/ - FN_VSCROLLBAR, /*20217*/ - FN_HSCROLLBAR, /*20218*/ - FN_VIEW_META_CHARS, /**/ - FN_VIEW_MARKS, /**/ - FN_VIEW_FIELDNAME, /**/ - FN_VIEW_TABLEGRID, /*20227*/ - FN_PRINT_LAYOUT, /*20237*/ - FN_QRY_MERGE, /*20364*/ - 0 - }; - // the view must not exist! - SfxViewFrame *pTmpFrm = SfxViewFrame::GetFirst( this ); - if( pTmpFrm ) - pTmpFrm->GetBindings().Invalidate( aInva ); - if ( !pAttr ) - rReq.AppendItem( SfxBoolItem( nWhich, bSet ) ); - rReq.Done(); - } - break; - case SID_MAIL_EXPORT_FINISHED: { if(pWrtShell) @@ -1726,77 +1707,6 @@ void SwDocShell::ReloadFromHtml( const String& rStreamName, SwSrcView* pSrcView pDoc->ResetModified(); } -/* -----------------------------14.12.99 16:52-------------------------------- - - ---------------------------------------------------------------------------*/ -void SwDocShell::ToggleBrowserMode(BOOL bSet, SwView* _pView ) -{ - GetDoc()->set(IDocumentSettingAccess::BROWSE_MODE, bSet ); - UpdateFontList(); - SwView* pTempView = _pView ? _pView : (SwView*)GetView(); - if( pTempView ) - { - SfxBindings& rBind = pTempView->GetViewFrame()->GetBindings(); - rBind.Invalidate(FN_SHADOWCURSOR); - rBind.Invalidate(SID_BROWSER_MODE); - rBind.Invalidate(FN_PRINT_LAYOUT); - - if( !GetDoc()->getPrinter( false ) ) - { - pTempView->SetPrinter( GetDoc()->getPrinter( false ), - SFX_PRINTER_PRINTER | SFX_PRINTER_JOBSETUP ); - } - - // --> FME 2005-03-16 #i44963# Good occasion to check if page sizes in - // page descriptions are still set to (LONG_MAX, LONG_MAX) (html import) - GetDoc()->CheckDefaultPageFmt(); - // <-- - - // Currently there can be only one view (layout) if the document is viewed in Web layout - // So if there are more views we are in print layout and for toggling to Web layout all other views must be closed - SfxViewFrame *pTmpFrm = SfxViewFrame::GetFirst(this, FALSE); - do { - if( pTmpFrm != pTempView->GetViewFrame() ) - { - pTmpFrm->DoClose(); - pTmpFrm = SfxViewFrame::GetFirst(this, FALSE); - } - else - pTmpFrm = pTmpFrm->GetNext(*pTmpFrm, this, FALSE); - - } while ( pTmpFrm ); - - const SwViewOption& rViewOptions = *pTempView->GetWrtShell().GetViewOptions(); - - // set view columns before toggling: - if ( bSet ) - { - const USHORT nColumns = rViewOptions.GetViewLayoutColumns(); - const bool bBookMode = rViewOptions.IsViewLayoutBookMode(); - if ( 1 != nColumns || bBookMode ) - { - ((SwView*)GetView())->SetViewLayout( 1, false ); - } - } - - // Triggeres a formatting: - pTempView->GetWrtShell().CheckBrowseView( TRUE ); - pTempView->CheckVisArea(); - - if( GetDoc()->get(IDocumentSettingAccess::BROWSE_MODE) ) - { - const SvxZoomType eType = (SvxZoomType)rViewOptions.GetZoomType(); - - if ( SVX_ZOOM_PERCENT != eType) - { - ((SwView*)GetView())->SetZoom( eType ); - } - } - pTempView->InvalidateBorder(); - pTempView->SetNewWindowAllowed(!bSet); - } -} - ULONG SwDocShell::LoadStylesFromFile( const String& rURL, SwgReaderOption& rOpt, BOOL bUnoCall ) { -- cgit From e22a1e2f5c5ed74c22849c9b5bb59dd8f47bffbc Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Wed, 22 Dec 2010 12:45:53 +0100 Subject: CWS swlayoutrefactoring: conflict resolution after resync to DEV300_m96 --- sw/source/ui/app/docsh2.cxx | 61 ++------------------------------------------- 1 file changed, 2 insertions(+), 59 deletions(-) (limited to 'sw/source/ui/app/docsh2.cxx') diff --git a/sw/source/ui/app/docsh2.cxx b/sw/source/ui/app/docsh2.cxx index a66dbddcb8cf..daf610215421 100644 --- a/sw/source/ui/app/docsh2.cxx +++ b/sw/source/ui/app/docsh2.cxx @@ -1190,63 +1190,6 @@ void SwDocShell::Execute(SfxRequest& rReq) SW_MOD()->CheckSpellChanges(FALSE, TRUE, TRUE, FALSE ); break; -<<<<<<< local - case SID_MAIL_EXPORT_FINISHED: -======= - case SID_BROWSER_MODE: - case FN_PRINT_LAYOUT: //Fuer Web, genau umgekehrt zum BrowserMode - { - int eState = STATE_TOGGLE; - BOOL bSet = sal_True; - const SfxPoolItem* pAttr=NULL; - if ( pArgs && SFX_ITEM_SET == pArgs->GetItemState( nWhich , FALSE, &pAttr )) - { - bSet = ((SfxBoolItem*)pAttr)->GetValue(); - if ( nWhich == FN_PRINT_LAYOUT ) - bSet = !bSet; - eState = bSet ? STATE_ON : STATE_OFF; - } - - if ( STATE_TOGGLE == eState ) - bSet = !GetDoc()->get(IDocumentSettingAccess::BROWSE_MODE); - - ToggleBrowserMode(bSet, 0); - - // OS: numerische Reihenfolge beachten! - static USHORT __READONLY_DATA aInva[] = - { - SID_NEWWINDOW,/*5620*/ - SID_BROWSER_MODE, /*6313*/ - SID_RULER_BORDERS, SID_RULER_PAGE_POS, - SID_ATTR_LONG_LRSPACE, - SID_HTML_MODE, - SID_RULER_PROTECT, - SID_AUTOSPELL_CHECK, - FN_RULER, /*20211*/ - FN_VIEW_GRAPHIC, /*20213*/ - FN_VIEW_BOUNDS, /**/ - FN_VIEW_FIELDS, /*20215*/ - FN_VLINEAL, /*20216*/ - FN_VSCROLLBAR, /*20217*/ - FN_HSCROLLBAR, /*20218*/ - FN_VIEW_META_CHARS, /**/ - FN_VIEW_MARKS, /**/ - FN_VIEW_FIELDNAME, /**/ - FN_VIEW_TABLEGRID, /*20227*/ - FN_PRINT_LAYOUT, /*20237*/ - FN_QRY_MERGE, /*20364*/ - 0 - }; - // the view must not exist! - SfxViewFrame *pTmpFrm = SfxViewFrame::GetFirst( this ); - if( pTmpFrm ) - pTmpFrm->GetBindings().Invalidate( aInva ); - if ( !pAttr ) - rReq.AppendItem( SfxBoolItem( nWhich, bSet ) ); - rReq.Done(); - } - break; - case SID_MAIL_PREPAREEXPORT: { //pWrtShell is not set in page preview @@ -1259,8 +1202,8 @@ void SwDocShell::Execute(SfxRequest& rReq) pWrtShell->EndAllAction(); } break; - case SID_MAIL_EXPORT_FINISHED: ->>>>>>> other + + case SID_MAIL_EXPORT_FINISHED: { if(pWrtShell) pWrtShell->StartAllAction(); -- cgit From 749c27fafbe1e57b7ba25f759272c02de20469e0 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Wed, 9 Feb 2011 15:55:27 +0100 Subject: CWS swlayoutrefactoring: fix merge conflicts --- sw/source/ui/app/docsh2.cxx | 133 -------------------------------------------- 1 file changed, 133 deletions(-) (limited to 'sw/source/ui/app/docsh2.cxx') diff --git a/sw/source/ui/app/docsh2.cxx b/sw/source/ui/app/docsh2.cxx index 0d44efe7a250..9c867a90bf08 100644 --- a/sw/source/ui/app/docsh2.cxx +++ b/sw/source/ui/app/docsh2.cxx @@ -1178,63 +1178,6 @@ void SwDocShell::Execute(SfxRequest& rReq) SW_MOD()->CheckSpellChanges(sal_False, sal_True, sal_True, sal_False ); break; -<<<<<<< local -======= - case SID_BROWSER_MODE: - case FN_PRINT_LAYOUT: //Fuer Web, genau umgekehrt zum BrowserMode - { - int eState = STATE_TOGGLE; - sal_Bool bSet = sal_True; - const SfxPoolItem* pAttr=NULL; - if ( pArgs && SFX_ITEM_SET == pArgs->GetItemState( nWhich , sal_False, &pAttr )) - { - bSet = ((SfxBoolItem*)pAttr)->GetValue(); - if ( nWhich == FN_PRINT_LAYOUT ) - bSet = !bSet; - eState = bSet ? STATE_ON : STATE_OFF; - } - - if ( STATE_TOGGLE == eState ) - bSet = !GetDoc()->get(IDocumentSettingAccess::BROWSE_MODE); - - ToggleBrowserMode(bSet, 0); - - // OS: numerische Reihenfolge beachten! - static sal_uInt16 __READONLY_DATA aInva[] = - { - SID_NEWWINDOW,/*5620*/ - SID_BROWSER_MODE, /*6313*/ - SID_RULER_BORDERS, SID_RULER_PAGE_POS, - SID_ATTR_LONG_LRSPACE, - SID_HTML_MODE, - SID_RULER_PROTECT, - SID_AUTOSPELL_CHECK, - FN_RULER, /*20211*/ - FN_VIEW_GRAPHIC, /*20213*/ - FN_VIEW_BOUNDS, /**/ - FN_VIEW_FIELDS, /*20215*/ - FN_VLINEAL, /*20216*/ - FN_VSCROLLBAR, /*20217*/ - FN_HSCROLLBAR, /*20218*/ - FN_VIEW_META_CHARS, /**/ - FN_VIEW_MARKS, /**/ - FN_VIEW_FIELDNAME, /**/ - FN_VIEW_TABLEGRID, /*20227*/ - FN_PRINT_LAYOUT, /*20237*/ - FN_QRY_MERGE, /*20364*/ - 0 - }; - // the view must not exist! - SfxViewFrame *pTmpFrm = SfxViewFrame::GetFirst( this ); - if( pTmpFrm ) - pTmpFrm->GetBindings().Invalidate( aInva ); - if ( !pAttr ) - rReq.AppendItem( SfxBoolItem( nWhich, bSet ) ); - rReq.Done(); - } - break; - ->>>>>>> other case SID_MAIL_PREPAREEXPORT: { //pWrtShell is not set in page preview @@ -1820,84 +1763,8 @@ void SwDocShell::ReloadFromHtml( const String& rStreamName, SwSrcView* pSrcView pDoc->ResetModified(); } -<<<<<<< local -ULONG SwDocShell::LoadStylesFromFile( const String& rURL, - SwgReaderOption& rOpt, BOOL bUnoCall ) -======= -/* -----------------------------14.12.99 16:52-------------------------------- - - ---------------------------------------------------------------------------*/ -void SwDocShell::ToggleBrowserMode(sal_Bool bSet, SwView* _pView ) -{ - GetDoc()->set(IDocumentSettingAccess::BROWSE_MODE, bSet ); - UpdateFontList(); - SwView* pTempView = _pView ? _pView : (SwView*)GetView(); - if( pTempView ) - { - SfxBindings& rBind = pTempView->GetViewFrame()->GetBindings(); - rBind.Invalidate(FN_SHADOWCURSOR); - rBind.Invalidate(SID_BROWSER_MODE); - rBind.Invalidate(FN_PRINT_LAYOUT); - - if( !GetDoc()->getPrinter( false ) ) - { - pTempView->SetPrinter( GetDoc()->getPrinter( false ), - SFX_PRINTER_PRINTER | SFX_PRINTER_JOBSETUP ); - } - - // --> FME 2005-03-16 #i44963# Good occasion to check if page sizes in - // page descriptions are still set to (LONG_MAX, LONG_MAX) (html import) - GetDoc()->CheckDefaultPageFmt(); - // <-- - - // Currently there can be only one view (layout) if the document is viewed in Web layout - // So if there are more views we are in print layout and for toggling to Web layout all other views must be closed - SfxViewFrame *pTmpFrm = SfxViewFrame::GetFirst(this, sal_False); - do { - if( pTmpFrm != pTempView->GetViewFrame() ) - { - pTmpFrm->DoClose(); - pTmpFrm = SfxViewFrame::GetFirst(this, sal_False); - } - else - pTmpFrm = pTmpFrm->GetNext(*pTmpFrm, this, sal_False); - - } while ( pTmpFrm ); - - const SwViewOption& rViewOptions = *pTempView->GetWrtShell().GetViewOptions(); - - // set view columns before toggling: - if ( bSet ) - { - const sal_uInt16 nColumns = rViewOptions.GetViewLayoutColumns(); - const bool bBookMode = rViewOptions.IsViewLayoutBookMode(); - if ( 1 != nColumns || bBookMode ) - { - ((SwView*)GetView())->SetViewLayout( 1, false ); - } - } - - // Triggeres a formatting: - pTempView->GetWrtShell().CheckBrowseView( sal_True ); - pTempView->CheckVisArea(); - - if( GetDoc()->get(IDocumentSettingAccess::BROWSE_MODE) ) - { - const SvxZoomType eType = (SvxZoomType)rViewOptions.GetZoomType(); - - if ( SVX_ZOOM_PERCENT != eType) - { - ((SwView*)GetView())->SetZoom( eType ); - } - } - pTempView->InvalidateBorder(); - pTempView->SetNewWindowAllowed(!bSet); - } -} - sal_uLong SwDocShell::LoadStylesFromFile( const String& rURL, SwgReaderOption& rOpt, sal_Bool bUnoCall ) ->>>>>>> other { sal_uLong nErr = 0; -- cgit From 9bdf5d2d49574bb0f2bc1ed92704031ad5215ca5 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Wed, 9 Feb 2011 19:07:37 +0100 Subject: CWS swlayoutrefactoring: fixes for compilation on unxlngxi after resync --- sw/source/ui/app/docsh2.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'sw/source/ui/app/docsh2.cxx') diff --git a/sw/source/ui/app/docsh2.cxx b/sw/source/ui/app/docsh2.cxx index 9c867a90bf08..eac710d34efd 100644 --- a/sw/source/ui/app/docsh2.cxx +++ b/sw/source/ui/app/docsh2.cxx @@ -160,7 +160,7 @@ SfxDocumentInfoDialog* SwDocShell::CreateDocumentInfoDialog( // Disable "multiple layout" -void SwDocShell::ToggleBrowserMode(BOOL bSet, SwView* _pView ) +void SwDocShell::ToggleBrowserMode(sal_Bool bSet, SwView* _pView ) { GetDoc()->set(IDocumentSettingAccess::BROWSE_MODE, bSet ); UpdateFontList(); @@ -171,19 +171,19 @@ void SwDocShell::ToggleBrowserMode(BOOL bSet, SwView* _pView ) if( !GetDoc()->getPrinter( false ) ) pTempView->SetPrinter( GetDoc()->getPrinter( false ), SFX_PRINTER_PRINTER | SFX_PRINTER_JOBSETUP ); GetDoc()->CheckDefaultPageFmt(); - SfxViewFrame *pTmpFrm = SfxViewFrame::GetFirst(this, FALSE); + SfxViewFrame *pTmpFrm = SfxViewFrame::GetFirst(this, sal_False); do { if( pTmpFrm != pTempView->GetViewFrame() ) { pTmpFrm->DoClose(); - pTmpFrm = SfxViewFrame::GetFirst(this, FALSE); + pTmpFrm = SfxViewFrame::GetFirst(this, sal_False); } else - pTmpFrm = pTmpFrm->GetNext(*pTmpFrm, this, FALSE); + pTmpFrm = pTmpFrm->GetNext(*pTmpFrm, this, sal_False); } while ( pTmpFrm ); const SwViewOption& rViewOptions = *pTempView->GetWrtShell().GetViewOptions(); - pTempView->GetWrtShell().CheckBrowseView( TRUE ); + pTempView->GetWrtShell().CheckBrowseView( sal_True ); pTempView->CheckVisArea(); if( bSet ) { -- cgit