diff options
Diffstat (limited to 'sw/source/ui/uiview/view2.cxx')
-rw-r--r-- | sw/source/ui/uiview/view2.cxx | 311 |
1 files changed, 157 insertions, 154 deletions
diff --git a/sw/source/ui/uiview/view2.cxx b/sw/source/ui/uiview/view2.cxx index 08e280884e94..8234a7a3583a 100644 --- a/sw/source/ui/uiview/view2.cxx +++ b/sw/source/ui/uiview/view2.cxx @@ -27,6 +27,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" + #include <com/sun/star/util/SearchOptions.hpp> #include <com/sun/star/util/SearchFlags.hpp> #include <com/sun/star/i18n/TransliterationModules.hpp> @@ -43,7 +44,7 @@ #include <docary.hxx> #include <hintids.hxx> #include <SwRewriter.hxx> -#include <undobj.hxx> +#include <numrule.hxx> #include <swundo.hxx> #include <caption.hxx> #include <svl/PasswordHelper.hxx> @@ -86,6 +87,7 @@ #include <uivwimp.hxx> #include <docsh.hxx> #include <doc.hxx> +#include <IDocumentUndoRedo.hxx> #include <wrtsh.hxx> #include <viewopt.hxx> #include <basesh.hxx> @@ -157,14 +159,14 @@ using namespace ::com::sun::star::container; using namespace ::com::sun::star::ui::dialogs; -static void lcl_SetAllTextToDefaultLanguage( SwWrtShell &rWrtSh, USHORT nWhichId ) +static void lcl_SetAllTextToDefaultLanguage( SwWrtShell &rWrtSh, sal_uInt16 nWhichId ) { if (nWhichId == RES_CHRATR_LANGUAGE || nWhichId == RES_CHRATR_CJK_LANGUAGE || nWhichId == RES_CHRATR_CTL_LANGUAGE) { rWrtSh.StartAction(); - rWrtSh.LockView( TRUE ); + rWrtSh.LockView( sal_True ); rWrtSh.Push(); // prepare to apply new language to all text in document @@ -176,8 +178,8 @@ static void lcl_SetAllTextToDefaultLanguage( SwWrtShell &rWrtSh, USHORT nWhichId aAttribs.Insert( nWhichId ); rWrtSh.ResetAttr( &aAttribs ); - rWrtSh.Pop( FALSE ); - rWrtSh.LockView( FALSE ); + rWrtSh.Pop( sal_False ); + rWrtSh.LockView( sal_False ); rWrtSh.EndAction(); } } @@ -186,7 +188,7 @@ static void lcl_SetAllTextToDefaultLanguage( SwWrtShell &rWrtSh, USHORT nWhichId Beschreibung: String fuer die Seitenanzeige in der Statusbar basteln. ----------------------------------------------------------------------------*/ -String SwView::GetPageStr( USHORT nPg, USHORT nLogPg, +String SwView::GetPageStr( sal_uInt16 nPg, sal_uInt16 nLogPg, const String& rDisplay ) { String aStr( aPageStr ); @@ -208,10 +210,10 @@ String SwView::GetPageStr( USHORT nPg, USHORT nLogPg, int SwView::InsertGraphic( const String &rPath, const String &rFilter, - BOOL bLink, GraphicFilter *pFlt, - Graphic* pPreviewGrf, BOOL bRule ) + sal_Bool bLink, GraphicFilter *pFlt, + Graphic* pPreviewGrf, sal_Bool bRule ) { - SwWait aWait( *GetDocShell(), TRUE ); + SwWait aWait( *GetDocShell(), sal_True ); Graphic aGrf; int nRes = GRFILTER_OK; @@ -226,7 +228,7 @@ int SwView::InsertGraphic( const String &rPath, const String &rFilter, if( GRFILTER_OK == nRes ) { - SwFlyFrmAttrMgr aFrmMgr( TRUE, GetWrtShellPtr(), FRMMGR_TYPE_GRF ); + SwFlyFrmAttrMgr aFrmMgr( sal_True, GetWrtShellPtr(), FRMMGR_TYPE_GRF ); SwWrtShell &rSh = GetWrtShell(); rSh.StartAction(); @@ -253,15 +255,15 @@ int SwView::InsertGraphic( const String &rPath, const String &rFilter, } -BOOL SwView::InsertGraphicDlg( SfxRequest& rReq ) +sal_Bool SwView::InsertGraphicDlg( SfxRequest& rReq ) { #ifndef ENABLE_PROP_WITHOUTLINK #define ENABLE_PROP_WITHOUTLINK 0x08 #endif - BOOL bReturn = FALSE; + sal_Bool bReturn = sal_False; SwDocShell* pDocShell = GetDocShell(); - USHORT nHtmlMode = ::GetHtmlMode(pDocShell); + sal_uInt16 nHtmlMode = ::GetHtmlMode(pDocShell); // im HTML-Mode nur verknuepft einfuegen FileDialogHelper* pFileDlg = new FileDialogHelper( SFXWB_GRAPHIC | SFXWB_SHOWSTYLES ); pFileDlg->SetTitle(SW_RESSTR(STR_INSERT_GRAPHIC )); @@ -278,8 +280,8 @@ BOOL SwView::InsertGraphicDlg( SfxRequest& rReq ) SvStringsSortDtor aFormats; SwDoc* pDoc = pDocShell->GetDoc(); - const USHORT nArrLen = pDoc->GetFrmFmts()->Count(); - USHORT i; + const sal_uInt16 nArrLen = pDoc->GetFrmFmts()->Count(); + sal_uInt16 i; for( i = 0; i < nArrLen; i++ ) { SwFrmFmt* pFmt = (*pDoc->GetFrmFmts())[ i ]; @@ -326,7 +328,7 @@ BOOL SwView::InsertGraphicDlg( SfxRequest& rReq ) } SFX_REQUEST_ARG( rReq, pName, SfxStringItem, SID_INSERT_GRAPHIC , sal_False ); - BOOL bShowError = !pName; + sal_Bool bShowError = !pName; if( pName || ERRCODE_NONE == pFileDlg->Execute() ) { @@ -423,7 +425,7 @@ BOOL SwView::InsertGraphicDlg( SfxRequest& rReq ) if(!pFmt) pFmt = pDoc->MakeFrmFmt(sGraphicFormat, pDocShell->GetDoc()->GetDfltFrmFmt(), - TRUE, FALSE); + sal_True, sal_False); rSh.SetFrmFmt( pFmt ); } @@ -464,12 +466,12 @@ BOOL SwView::InsertGraphicDlg( SfxRequest& rReq ) else { // set the specific graphic attrbutes to the graphic - bReturn = TRUE; + bReturn = sal_True; AutoCaption( GRAPHIC_CAP ); rReq.Done(); } - rSh.EndUndo(UNDO_INSERT); // wegen moegl. Shellwechsel + rSh.EndUndo(); // due to possible change of Shell } delete pFileDlg; @@ -480,10 +482,10 @@ BOOL SwView::InsertGraphicDlg( SfxRequest& rReq ) void __EXPORT SwView::Execute(SfxRequest &rReq) { - USHORT nSlot = rReq.GetSlot(); + sal_uInt16 nSlot = rReq.GetSlot(); const SfxItemSet* pArgs = rReq.GetArgs(); const SfxPoolItem* pItem; - BOOL bIgnore = FALSE; + sal_Bool bIgnore = sal_False; switch( nSlot ) { case SID_CREATE_SW_DRAWVIEW: @@ -529,7 +531,7 @@ void __EXPORT SwView::Execute(SfxRequest &rReq) case FN_REDLINE_ON: { if( pArgs && - SFX_ITEM_SET == pArgs->GetItemState(nSlot, FALSE, &pItem )) + SFX_ITEM_SET == pArgs->GetItemState(nSlot, sal_False, &pItem )) { IDocumentRedlineAccess* pIDRA = pWrtShell->getIDocumentRedlineAccess(); Sequence <sal_Int8> aPasswd = pIDRA->GetRedlinePassword(); @@ -539,7 +541,7 @@ void __EXPORT SwView::Execute(SfxRequest &rReq) // xmlsec05: new password dialog Window* pParent; const SfxPoolItem* pParentItem; - if( SFX_ITEM_SET == pArgs->GetItemState( SID_ATTR_XWINDOW, FALSE, &pParentItem ) ) + if( SFX_ITEM_SET == pArgs->GetItemState( SID_ATTR_XWINDOW, sal_False, &pParentItem ) ) pParent = ( ( const XWindowItem* ) pParentItem )->GetWindowPtr(); else pParent = &GetViewFrame()->GetWindow(); @@ -558,8 +560,8 @@ void __EXPORT SwView::Execute(SfxRequest &rReq) } } - USHORT nOn = ((const SfxBoolItem*)pItem)->GetValue() ? nsRedlineMode_t::REDLINE_ON : 0; - USHORT nMode = pWrtShell->GetRedlineMode(); + sal_uInt16 nOn = ((const SfxBoolItem*)pItem)->GetValue() ? nsRedlineMode_t::REDLINE_ON : 0; + sal_uInt16 nMode = pWrtShell->GetRedlineMode(); pWrtShell->SetRedlineModeAndCheckInsMode( (nMode & ~nsRedlineMode_t::REDLINE_ON) | nOn); } } @@ -568,7 +570,7 @@ void __EXPORT SwView::Execute(SfxRequest &rReq) { IDocumentRedlineAccess* pIDRA = pWrtShell->getIDocumentRedlineAccess(); Sequence <sal_Int8> aPasswd = pIDRA->GetRedlinePassword(); - if( pArgs && SFX_ITEM_SET == pArgs->GetItemState(nSlot, FALSE, &pItem ) + if( pArgs && SFX_ITEM_SET == pArgs->GetItemState(nSlot, sal_False, &pItem ) && ((SfxBoolItem*)pItem)->GetValue() == ( aPasswd.getLength() != 0 ) ) break; @@ -576,7 +578,7 @@ void __EXPORT SwView::Execute(SfxRequest &rReq) // message box for wrong password Window* pParent; const SfxPoolItem* pParentItem; - if( pArgs && SFX_ITEM_SET == pArgs->GetItemState( SID_ATTR_XWINDOW, FALSE, &pParentItem ) ) + if( pArgs && SFX_ITEM_SET == pArgs->GetItemState( SID_ATTR_XWINDOW, sal_False, &pParentItem ) ) pParent = ( ( const XWindowItem* ) pParentItem )->GetWindowPtr(); else pParent = &GetViewFrame()->GetWindow(); @@ -586,7 +588,7 @@ void __EXPORT SwView::Execute(SfxRequest &rReq) aPasswdDlg.ShowExtras(SHOWEXTRAS_CONFIRM); if (aPasswdDlg.Execute()) { - USHORT nOn = nsRedlineMode_t::REDLINE_ON; + sal_uInt16 nOn = nsRedlineMode_t::REDLINE_ON; String sNewPasswd( aPasswdDlg.GetPassword() ); Sequence <sal_Int8> aNewPasswd = pIDRA->GetRedlinePassword(); @@ -600,20 +602,20 @@ void __EXPORT SwView::Execute(SfxRequest &rReq) pIDRA->SetRedlinePassword(Sequence <sal_Int8> ()); nOn = 0; } - USHORT nMode = pIDRA->GetRedlineMode(); + sal_uInt16 nMode = pIDRA->GetRedlineMode(); pWrtShell->SetRedlineModeAndCheckInsMode( (nMode & ~nsRedlineMode_t::REDLINE_ON) | nOn); rReq.AppendItem( SfxBoolItem( FN_REDLINE_PROTECT, ((nMode&nsRedlineMode_t::REDLINE_ON)==0) ) ); } else - bIgnore = TRUE; + bIgnore = sal_True; } break; case FN_REDLINE_SHOW: if( pArgs && - SFX_ITEM_SET == pArgs->GetItemState(nSlot, FALSE, &pItem)) + SFX_ITEM_SET == pArgs->GetItemState(nSlot, sal_False, &pItem)) { - USHORT nMode = ( ~(nsRedlineMode_t::REDLINE_SHOW_INSERT | nsRedlineMode_t::REDLINE_SHOW_DELETE) + sal_uInt16 nMode = ( ~(nsRedlineMode_t::REDLINE_SHOW_INSERT | nsRedlineMode_t::REDLINE_SHOW_DELETE) & pWrtShell->GetRedlineMode() ) | nsRedlineMode_t::REDLINE_SHOW_INSERT; if( ((const SfxBoolItem*)pItem)->GetValue() ) nMode |= nsRedlineMode_t::REDLINE_SHOW_DELETE; @@ -632,8 +634,8 @@ void __EXPORT SwView::Execute(SfxRequest &rReq) Point aCrsrPos = pWrtShell->GetCrsrDocPos( sal_True ); if( pWrtShell->GetContentAtPos( aCrsrPos, aCntntAtPos ) ) { - USHORT nCount = pWrtShell->GetRedlineCount(); - for( USHORT nRedline = 0; nRedline < nCount; ++nRedline ) + sal_uInt16 nCount = pWrtShell->GetRedlineCount(); + for( sal_uInt16 nRedline = 0; nRedline < nCount; ++nRedline ) { const SwRedline& rRedline = pWrtShell->GetRedline( nRedline ); if( *aCntntAtPos.aFnd.pRedl == rRedline ) @@ -652,20 +654,20 @@ void __EXPORT SwView::Execute(SfxRequest &rReq) case SID_DOCUMENT_MERGE: { String sFileName, sFilterName; - INT16 nVersion = 0; + sal_Int16 nVersion = 0; bool bHasFileName = false; pViewImpl->SetParam( 0 ); if( pArgs ) { - if( SFX_ITEM_SET == pArgs->GetItemState( SID_FILE_NAME, FALSE, &pItem )) + if( SFX_ITEM_SET == pArgs->GetItemState( SID_FILE_NAME, sal_False, &pItem )) sFileName = ((const SfxStringItem*)pItem)->GetValue(); bHasFileName = ( sFileName.Len() > 0 ); - if( SFX_ITEM_SET == pArgs->GetItemState( SID_FILTER_NAME, FALSE, &pItem )) + if( SFX_ITEM_SET == pArgs->GetItemState( SID_FILTER_NAME, sal_False, &pItem )) sFilterName = ((const SfxStringItem*)pItem)->GetValue(); - if( SFX_ITEM_SET == pArgs->GetItemState( SID_VERSION, FALSE, &pItem )) + if( SFX_ITEM_SET == pArgs->GetItemState( SID_VERSION, sal_False, &pItem )) { nVersion = ((const SfxInt16Item *)pItem)->GetValue(); pViewImpl->SetParam( nVersion ); @@ -685,7 +687,7 @@ void __EXPORT SwView::Execute(SfxRequest &rReq) pVFrame->ShowChildWindow(FN_REDLINE_ACCEPT); // RedlineDlg neu initialisieren - USHORT nId = SwRedlineAcceptChild::GetChildWindowId(); + sal_uInt16 nId = SwRedlineAcceptChild::GetChildWindowId(); SwRedlineAcceptChild *pRed = (SwRedlineAcceptChild*) pVFrame->GetChildWindow(nId); if (pRed) @@ -693,12 +695,12 @@ void __EXPORT SwView::Execute(SfxRequest &rReq) } } else - bIgnore = TRUE; + bIgnore = sal_True; } break; case FN_SYNC_LABELS: case FN_MAILMERGE_CHILDWINDOW: - GetViewFrame()->ShowChildWindow(nSlot, TRUE); + GetViewFrame()->ShowChildWindow(nSlot, sal_True); break; case FN_ESCAPE: { @@ -745,7 +747,7 @@ void __EXPORT SwView::Execute(SfxRequest &rReq) } else if ( GetEditWin().IsChainMode() ) { - GetEditWin().SetChainMode( FALSE ); + GetEditWin().SetChainMode( sal_False ); } else if( pWrtShell->GetFlyFrmFmt() ) { @@ -758,9 +760,9 @@ void __EXPORT SwView::Execute(SfxRequest &rReq) } else { - SfxBoolItem aItem( SID_WIN_FULLSCREEN, FALSE ); + SfxBoolItem aItem( SID_WIN_FULLSCREEN, sal_False ); GetViewFrame()->GetDispatcher()->Execute( SID_WIN_FULLSCREEN, SFX_CALLMODE_RECORD, &aItem, 0L ); - bIgnore = TRUE; + bIgnore = sal_True; } } break; @@ -780,7 +782,7 @@ void __EXPORT SwView::Execute(SfxRequest &rReq) { if(pArgs) { - const USHORT nCurIdx = pWrtShell->GetCurPageDesc(); + const sal_uInt16 nCurIdx = pWrtShell->GetCurPageDesc(); SwPageDesc aPageDesc( pWrtShell->GetPageDesc( nCurIdx ) ); ::ItemSetToPageDesc( *pArgs, aPageDesc ); // Den Descriptor der Core veraendern. @@ -824,12 +826,12 @@ void __EXPORT SwView::Execute(SfxRequest &rReq) { pWrtShell->StartAction(); pWrtShell->EnterStdMode(); - BOOL bOldCrsrInReadOnly = pWrtShell->IsReadOnlyAvailable(); - pWrtShell->SetReadOnlyAvailable( TRUE ); + sal_Bool bOldCrsrInReadOnly = pWrtShell->IsReadOnlyAvailable(); + pWrtShell->SetReadOnlyAvailable( sal_True ); - for( USHORT i = 0; i < 2; ++i ) + for( sal_uInt16 i = 0; i < 2; ++i ) { - USHORT nCount = pWrtShell->GetTOXCount(); + sal_uInt16 nCount = pWrtShell->GetTOXCount(); if( 1 == nCount ) ++i; @@ -845,13 +847,13 @@ void __EXPORT SwView::Execute(SfxRequest &rReq) pBase = pWrtShell->GetCurTOX(); } - BOOL bAutoMarkApplied = FALSE; + sal_Bool bAutoMarkApplied = sal_False; while( pBase ) { if(TOX_INDEX == pBase->GetType() && !bAutoMarkApplied) { pWrtShell->ApplyAutoMark(); - bAutoMarkApplied = TRUE; + bAutoMarkApplied = sal_True; } // JP 15.07.96: das pBase wird nur fuer die Schnittstelle // benoetigt. Muss mal umgetstellt werden!!! @@ -869,9 +871,9 @@ void __EXPORT SwView::Execute(SfxRequest &rReq) break; case SID_ATTR_BRUSH: { - if(pArgs && SFX_ITEM_SET == pArgs->GetItemState(RES_BACKGROUND, FALSE, &pItem)) + if(pArgs && SFX_ITEM_SET == pArgs->GetItemState(RES_BACKGROUND, sal_False, &pItem)) { - const USHORT nCurIdx = pWrtShell->GetCurPageDesc(); + const sal_uInt16 nCurIdx = pWrtShell->GetCurPageDesc(); SwPageDesc aDesc( pWrtShell->GetPageDesc( nCurIdx )); SwFrmFmt& rMaster = aDesc.GetMaster(); rMaster.SetFmtAttr(*pItem); @@ -892,14 +894,14 @@ void __EXPORT SwView::Execute(SfxRequest &rReq) case FN_INSERT_CTRL: case FN_INSERT_OBJ_CTRL: { - if(pArgs && SFX_ITEM_SET == pArgs->GetItemState(nSlot, FALSE, &pItem)) + if(pArgs && SFX_ITEM_SET == pArgs->GetItemState(nSlot, sal_False, &pItem)) { - USHORT nValue = ((SfxUInt16Item*)pItem)->GetValue(); + sal_uInt16 nValue = ((SfxUInt16Item*)pItem)->GetValue(); switch ( nSlot ) { case FN_INSERT_CTRL: { - BOOL bWeb = 0 != PTR_CAST(SwWebView, this); + sal_Bool bWeb = 0 != PTR_CAST(SwWebView, this); if(bWeb) SwView::nWebInsertCtrlState = nValue; else @@ -922,17 +924,17 @@ void __EXPORT SwView::Execute(SfxRequest &rReq) case SID_ATTR_DEFTABSTOP: { - if(pArgs && SFX_ITEM_SET == pArgs->GetItemState(SID_ATTR_DEFTABSTOP, FALSE, &pItem)) + if(pArgs && SFX_ITEM_SET == pArgs->GetItemState(SID_ATTR_DEFTABSTOP, sal_False, &pItem)) { SvxTabStopItem aDefTabs( 0, 0, SVX_TAB_ADJUST_DEFAULT, RES_PARATR_TABSTOP ); - USHORT nTab = ((const SfxUInt16Item*)pItem)->GetValue(); + sal_uInt16 nTab = ((const SfxUInt16Item*)pItem)->GetValue(); MakeDefTabs( nTab, aDefTabs ); pWrtShell->SetDefault( aDefTabs ); } } break; case SID_ATTR_LANGUAGE : - if(pArgs && SFX_ITEM_SET == pArgs->GetItemState(SID_ATTR_LANGUAGE, FALSE, &pItem)) + if(pArgs && SFX_ITEM_SET == pArgs->GetItemState(SID_ATTR_LANGUAGE, sal_False, &pItem)) { SvxLanguageItem aLang(((SvxLanguageItem*)pItem)->GetLanguage(), RES_CHRATR_LANGUAGE); pWrtShell->SetDefault( aLang ); @@ -940,21 +942,21 @@ void __EXPORT SwView::Execute(SfxRequest &rReq) } break; case SID_ATTR_CHAR_CTL_LANGUAGE: - if(pArgs && SFX_ITEM_SET == pArgs->GetItemState(RES_CHRATR_CTL_LANGUAGE, FALSE, &pItem)) + if(pArgs && SFX_ITEM_SET == pArgs->GetItemState(RES_CHRATR_CTL_LANGUAGE, sal_False, &pItem)) { pWrtShell->SetDefault( *pItem ); lcl_SetAllTextToDefaultLanguage( *pWrtShell, RES_CHRATR_CTL_LANGUAGE ); } break; case SID_ATTR_CHAR_CJK_LANGUAGE: - if(pArgs && SFX_ITEM_SET == pArgs->GetItemState(RES_CHRATR_CJK_LANGUAGE, FALSE, &pItem)) + if(pArgs && SFX_ITEM_SET == pArgs->GetItemState(RES_CHRATR_CJK_LANGUAGE, sal_False, &pItem)) { pWrtShell->SetDefault( *pItem ); lcl_SetAllTextToDefaultLanguage( *pWrtShell, RES_CHRATR_CJK_LANGUAGE ); } break; case FN_SCROLL_NEXT_PREV: - if(pArgs && pArgs->GetItemState(FN_SCROLL_NEXT_PREV, FALSE, &pItem)) + if(pArgs && pArgs->GetItemState(FN_SCROLL_NEXT_PREV, sal_False, &pItem)) { // call the handlers of PageUp/DownButtons, only bool* pbNext = new bool ( ((const SfxBoolItem*)pItem)->GetValue() ); @@ -963,7 +965,7 @@ void __EXPORT SwView::Execute(SfxRequest &rReq) } break; case SID_JUMPTOMARK: - if( pArgs && SFX_ITEM_SET == pArgs->GetItemState(SID_JUMPTOMARK, FALSE, &pItem)) + if( pArgs && SFX_ITEM_SET == pArgs->GetItemState(SID_JUMPTOMARK, sal_False, &pItem)) JumpToSwMark( (( const SfxStringItem*)pItem)->GetValue() ); break; case SID_GALLERY : @@ -979,15 +981,15 @@ void __EXPORT SwView::Execute(SfxRequest &rReq) if(pVFrame->HasChildWindow(SID_BROWSER)) { const SwDBData& rData = GetWrtShell().GetDBDesc(); - SW_MOD()->ShowDBObj(*this, rData, FALSE); + SW_MOD()->ShowDBObj(*this, rData, sal_False); } } break; case FN_INSERT_FIELD_DATA_ONLY : { - BOOL bShow = FALSE; + sal_Bool bShow = sal_False; if( pArgs && - SFX_ITEM_SET == pArgs->GetItemState(nSlot, FALSE, &pItem )) + SFX_ITEM_SET == pArgs->GetItemState(nSlot, sal_False, &pItem )) bShow = ((const SfxBoolItem*)pItem)->GetValue(); //GetViewFrame()->ShowChildWindow(nSlot, bShow && bInMailMerge); if((bShow && bInMailMerge) != GetViewFrame()->HasChildWindow(nSlot)) @@ -1015,7 +1017,7 @@ void __EXPORT SwView::Execute(SfxRequest &rReq) pValues[0].Value <<= aData.sDataSource; pValues[1].Value <<= aData.sCommand; pValues[2].Value <<= aData.nCommandType; - pNewDBMgr->ExecuteFormLetter(rSh, aProperties, TRUE); + pNewDBMgr->ExecuteFormLetter(rSh, aProperties, sal_True); } } bInMailMerge &= bShow; @@ -1024,8 +1026,8 @@ void __EXPORT SwView::Execute(SfxRequest &rReq) break; case FN_QRY_MERGE: { - BOOL bUseCurrentDocument = TRUE; - BOOL bQuery = !pArgs||SFX_ITEM_SET != pArgs->GetItemState(nSlot); + sal_Bool bUseCurrentDocument = sal_True; + sal_Bool bQuery = !pArgs||SFX_ITEM_SET != pArgs->GetItemState(nSlot); if(bQuery) { SfxViewFrame* pTmpFrame = GetViewFrame(); @@ -1086,7 +1088,7 @@ void __EXPORT SwView::Execute(SfxRequest &rReq) case SID_ALIGN_ANY_HDEFAULT : case SID_ALIGN_ANY_VDEFAULT : { - USHORT nAlias = 0; + sal_uInt16 nAlias = 0; if( nSelectionType & (nsSelectionType::SEL_DRW_TXT|nsSelectionType::SEL_TXT) ) { switch( nSlot ) @@ -1160,7 +1162,7 @@ void __EXPORT SwView::Execute(SfxRequest &rReq) Beschreibung: SeitenNr-Feld invalidieren --------------------------------------------------------------------*/ -void SwView::UpdatePageNums(USHORT nPhyNum, USHORT nVirtNum, const String& rPgStr) +void SwView::UpdatePageNums(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const String& rPgStr) { String sTemp(GetPageStr( nPhyNum, nVirtNum, rPgStr )); const SfxStringItem aTmp( FN_STAT_PAGE, sTemp ); @@ -1179,7 +1181,7 @@ void SwView::StateStatusLine(SfxItemSet &rSet) SwWrtShell& rShell = GetWrtShell(); SfxWhichIter aIter( rSet ); - USHORT nWhich = aIter.FirstWhich(); + sal_uInt16 nWhich = aIter.FirstWhich(); ASSERT( nWhich, "leeres Set"); while( nWhich ) @@ -1200,24 +1202,24 @@ void SwView::StateStatusLine(SfxItemSet &rSet) else */ { // Anzahl der Seiten, log. SeitenNr. SeitenNr ermitteln - USHORT nPage, nLogPage; + sal_uInt16 nPage, nLogPage; String sDisplay; rShell.GetPageNumber( -1, rShell.IsCrsrVisible(), nPage, nLogPage, sDisplay ); rSet.Put( SfxStringItem( FN_STAT_PAGE, GetPageStr( nPage, nLogPage, sDisplay) )); - USHORT nCnt = GetWrtShell().GetPageCnt(); + sal_uInt16 nCnt = GetWrtShell().GetPageCnt(); if (nPageCnt != nCnt) // Basic benachrichtigen { nPageCnt = nCnt; - SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_PAGE_COUNT, SwDocShell::GetEventName(STR_SW_EVENT_PAGE_COUNT), GetViewFrame()->GetObjectShell()), FALSE); + SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_PAGE_COUNT, SwDocShell::GetEventName(STR_SW_EVENT_PAGE_COUNT), GetViewFrame()->GetObjectShell()), sal_False); } } break; case FN_STAT_TEMPLATE: { rSet.Put(SfxStringItem( FN_STAT_TEMPLATE, - rShell.GetCurPageStyle(FALSE))); + rShell.GetCurPageStyle(sal_False))); } break; @@ -1249,7 +1251,7 @@ void SwView::StateStatusLine(SfxItemSet &rSet) if ( ( GetDocShell()->GetCreateMode() != SFX_CREATE_MODE_EMBEDDED ) || !GetDocShell()->IsInPlaceActive() ) { const SwViewOption* pVOpt = rShell.GetViewOptions(); - const USHORT nColumns = pVOpt->GetViewLayoutColumns(); + const sal_uInt16 nColumns = pVOpt->GetViewLayoutColumns(); const bool bBookMode = pVOpt->IsViewLayoutBookMode(); SvxViewLayoutItem aViewLayout(nColumns, bBookMode); rSet.Put( aViewLayout ); @@ -1263,13 +1265,13 @@ void SwView::StateStatusLine(SfxItemSet &rSet) if ( ( GetDocShell()->GetCreateMode() != SFX_CREATE_MODE_EMBEDDED ) || !GetDocShell()->IsInPlaceActive() ) { const SwViewOption* pVOpt = rShell.GetViewOptions(); - const USHORT nCurrentZoom = pVOpt->GetZoom(); + const sal_uInt16 nCurrentZoom = pVOpt->GetZoom(); SvxZoomSliderItem aZoomSliderItem( nCurrentZoom, MINZOOM, MAXZOOM ); aZoomSliderItem.AddSnappingPoint( 100 ); if ( !pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) { - const USHORT nColumns = pVOpt->GetViewLayoutColumns(); + const sal_uInt16 nColumns = pVOpt->GetViewLayoutColumns(); const bool bAutomaticViewLayout = 0 == nColumns; const SwPostItMgr* pMgr = GetPostItMgr(); @@ -1387,7 +1389,7 @@ void SwView::StateStatusLine(SfxItemSet &rSet) //const SwNumRule* pNumRule = rShell.GetCurNumRule(); //if (pNumRule) // Cursor in Numerierung //{ - // BYTE nNumLevel = rShell.GetNumLevel(); + // sal_uInt8 nNumLevel = rShell.GetNumLevel(); // if( IsShowNum(nNumLevel) && MAXLEVEL > // ( nNumLevel = GetRealLevel( nNumLevel )) ) // { @@ -1402,7 +1404,7 @@ void SwView::StateStatusLine(SfxItemSet &rSet) // rShell.GetCurAttr(aSet); // /* const SfxPoolItem* pItem; */ // if(SFX_ITEM_AVAILABLE <= - // aSet.GetItemState(RES_PARATR_NUMRULE, TRUE + // aSet.GetItemState(RES_PARATR_NUMRULE, sal_True // /*, &pItem */ )) // { // const String& rNumStyle = @@ -1428,7 +1430,7 @@ void SwView::StateStatusLine(SfxItemSet &rSet) if (pNumRule && !bOutlineNum ) // Cursor in Numerierung { - BYTE nNumLevel = rShell.GetNumLevel(); + sal_uInt8 nNumLevel = rShell.GetNumLevel(); // --> OD 2008-04-02 #refactorlists# // if( IsShowNum(nNumLevel) && MAXLEVEL > // ( nNumLevel = GetRealLevel( nNumLevel )) ) @@ -1442,7 +1444,7 @@ void SwView::StateStatusLine(SfxItemSet &rSet) rShell.GetCurAttr(aSet); /* const SfxPoolItem* pItem; */ if(SFX_ITEM_AVAILABLE <= - aSet.GetItemState(RES_PARATR_NUMRULE, TRUE + aSet.GetItemState(RES_PARATR_NUMRULE, sal_True /*, &pItem */ )) { const String& rNumStyle = @@ -1528,8 +1530,8 @@ void SwView::ExecuteStatusLine(SfxRequest &rReq) SwWrtShell &rSh = GetWrtShell(); const SfxItemSet* pArgs = rReq.GetArgs(); const SfxPoolItem* pItem=NULL; - BOOL bUp = FALSE; - USHORT nWhich = rReq.GetSlot(); + sal_Bool bUp = sal_False; + sal_uInt16 nWhich = rReq.GetSlot(); switch( nWhich ) { case FN_STAT_PAGE: @@ -1542,7 +1544,7 @@ void SwView::ExecuteStatusLine(SfxRequest &rReq) case FN_STAT_BOOKMARK: if ( pArgs ) { - if (SFX_ITEM_SET == pArgs->GetItemState( nWhich, TRUE, &pItem)) + if (SFX_ITEM_SET == pArgs->GetItemState( nWhich, sal_True, &pItem)) { const IDocumentMarkAccess* pMarkAccess = rSh.getIDocumentMarkAccess(); const sal_Int32 nIdx = static_cast<const SfxUInt16Item*>(pItem)->GetValue(); @@ -1614,19 +1616,19 @@ void SwView::ExecuteStatusLine(SfxRequest &rReq) // PAGES01 const SfxPoolItem* pViewLayoutItem = 0; - if ( pSet && SFX_ITEM_SET == pSet->GetItemState(SID_ATTR_VIEWLAYOUT, TRUE, &pViewLayoutItem)) + if ( pSet && SFX_ITEM_SET == pSet->GetItemState(SID_ATTR_VIEWLAYOUT, sal_True, &pViewLayoutItem)) { - const USHORT nColumns = ((const SvxViewLayoutItem *)pViewLayoutItem)->GetValue(); + const sal_uInt16 nColumns = ((const SvxViewLayoutItem *)pViewLayoutItem)->GetValue(); const bool bBookMode = ((const SvxViewLayoutItem *)pViewLayoutItem)->IsBookMode(); SetViewLayout( nColumns, bBookMode ); } - if ( pSet && SFX_ITEM_SET == pSet->GetItemState(SID_ATTR_ZOOM, TRUE, &pItem)) + if ( pSet && SFX_ITEM_SET == pSet->GetItemState(SID_ATTR_ZOOM, sal_True, &pItem)) { enum SvxZoomType eType = ((const SvxZoomItem *)pItem)->GetType(); SetZoom( eType, ((const SvxZoomItem *)pItem)->GetValue() ); } - bUp = TRUE; + bUp = sal_True; if ( pItem ) rReq.AppendItem( *pItem ); rReq.Done(); @@ -1642,9 +1644,9 @@ void SwView::ExecuteStatusLine(SfxRequest &rReq) ( ( GetDocShell()->GetCreateMode() != SFX_CREATE_MODE_EMBEDDED ) || !GetDocShell()->IsInPlaceActive() ) ) { // PAGES01 - if ( SFX_ITEM_SET == pArgs->GetItemState(SID_ATTR_VIEWLAYOUT, TRUE, &pItem )) + if ( SFX_ITEM_SET == pArgs->GetItemState(SID_ATTR_VIEWLAYOUT, sal_True, &pItem )) { - const USHORT nColumns = ((const SvxViewLayoutItem *)pItem)->GetValue(); + const sal_uInt16 nColumns = ((const SvxViewLayoutItem *)pItem)->GetValue(); const bool bBookMode = (0 == nColumns || 0 != (nColumns % 2)) ? false : ((const SvxViewLayoutItem *)pItem)->IsBookMode(); @@ -1652,7 +1654,7 @@ void SwView::ExecuteStatusLine(SfxRequest &rReq) SetViewLayout( nColumns, bBookMode ); } - bUp = TRUE; + bUp = sal_True; rReq.Done(); InvalidateRulerPos(); @@ -1665,13 +1667,13 @@ void SwView::ExecuteStatusLine(SfxRequest &rReq) if ( pArgs && ( ( GetDocShell()->GetCreateMode() != SFX_CREATE_MODE_EMBEDDED ) || !GetDocShell()->IsInPlaceActive() ) ) { // PAGES01 - if ( SFX_ITEM_SET == pArgs->GetItemState(SID_ATTR_ZOOMSLIDER, TRUE, &pItem )) + if ( SFX_ITEM_SET == pArgs->GetItemState(SID_ATTR_ZOOMSLIDER, sal_True, &pItem )) { - const USHORT nCurrentZoom = ((const SvxZoomSliderItem *)pItem)->GetValue(); + const sal_uInt16 nCurrentZoom = ((const SvxZoomSliderItem *)pItem)->GetValue(); SetZoom( SVX_ZOOM_PERCENT, nCurrentZoom ); } - bUp = TRUE; + bUp = sal_True; rReq.Done(); } } @@ -1679,7 +1681,7 @@ void SwView::ExecuteStatusLine(SfxRequest &rReq) case SID_ATTR_SIZE: { - ULONG nId = FN_INSERT_FIELD; + sal_uLong nId = FN_INSERT_FIELD; if( rSh.IsCrsrInTbl() ) nId = FN_FORMAT_TABLE_DLG; else if( rSh.GetCurTOX() ) @@ -1706,7 +1708,7 @@ void SwView::ExecuteStatusLine(SfxRequest &rReq) } if( nId ) GetViewFrame()->GetDispatcher()->Execute( - static_cast< USHORT >( nId ), SFX_CALLMODE_SYNCHRON | SFX_CALLMODE_RECORD ); + static_cast< sal_uInt16 >( nId ), SFX_CALLMODE_SYNCHRON | SFX_CALLMODE_RECORD ); } break; @@ -1714,7 +1716,7 @@ void SwView::ExecuteStatusLine(SfxRequest &rReq) { if ( pArgs ) { - if (SFX_ITEM_SET == pArgs->GetItemState( nWhich, TRUE, &pItem)) + if (SFX_ITEM_SET == pArgs->GetItemState( nWhich, sal_True, &pItem)) { switch ( ((const SfxUInt16Item *)pItem)->GetValue() ) { @@ -1743,23 +1745,23 @@ void SwView::ExecuteStatusLine(SfxRequest &rReq) else rSh.ToggleBlockMode(); } - bUp = TRUE; + bUp = sal_True; break; } case FN_SET_ADD_MODE: rSh.ToggleAddMode(); nWhich = FN_STAT_SELMODE; - bUp = TRUE; + bUp = sal_True; break; case FN_SET_BLOCK_MODE: rSh.ToggleBlockMode(); nWhich = FN_STAT_SELMODE; - bUp = TRUE; + bUp = sal_True; break; case FN_SET_EXT_MODE: rSh.ToggleExtMode(); nWhich = FN_STAT_SELMODE; - bUp = TRUE; + bUp = sal_True; break; case SID_ATTR_INSERT: SwPostItMgr* pMgr = GetPostItMgr(); @@ -1769,7 +1771,7 @@ void SwView::ExecuteStatusLine(SfxRequest &rReq) } else rSh.ToggleInsMode(); - bUp = TRUE; + bUp = sal_True; break; } @@ -1781,11 +1783,11 @@ void SwView::ExecuteStatusLine(SfxRequest &rReq) } } -void SwView::InsFrmMode(USHORT nCols) +void SwView::InsFrmMode(sal_uInt16 nCols) { if ( pWrtShell->HasWholeTabSelection() ) { - SwFlyFrmAttrMgr aMgr( TRUE, pWrtShell, FRMMGR_TYPE_TEXT ); + SwFlyFrmAttrMgr aMgr( sal_True, pWrtShell, FRMMGR_TYPE_TEXT ); const SwFrmFmt &rPageFmt = pWrtShell->GetPageDesc(pWrtShell->GetCurPageDesc()).GetMaster(); @@ -1811,7 +1813,7 @@ void SwView::InsFrmMode(USHORT nCols) void SwView::EditLinkDlg() { - BOOL bWeb = 0 != PTR_CAST(SwWebView, this); + sal_Bool bWeb = 0 != PTR_CAST(SwWebView, this); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); SfxAbstractLinksDialog* pDlg = pFact->CreateLinksDialog( &GetViewFrame()->GetWindow(), &GetWrtShell().GetLinkManager(), bWeb ); if ( pDlg ) @@ -1828,22 +1830,22 @@ void SwView::EditLinkDlg() */ } -BOOL SwView::JumpToSwMark( const String& rMark ) +sal_Bool SwView::JumpToSwMark( const String& rMark ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if( rMark.Len() ) { // wir wollen den Bookmark aber am oberen Rand haben - BOOL bSaveCC = IsCrsrAtCenter(); - BOOL bSaveCT = IsCrsrAtTop(); - SetCrsrAtTop( TRUE ); + sal_Bool bSaveCC = IsCrsrAtCenter(); + sal_Bool bSaveCT = IsCrsrAtTop(); + SetCrsrAtTop( sal_True ); //JP 27.04.98: Bug 49786 // Damit in FrameSet auch gescrollt werden kann, muss die // entsprechende Shell auch das Focus-Flag gesetzt haben! - BOOL bHasShFocus = pWrtShell->HasShFcs(); + sal_Bool bHasShFocus = pWrtShell->HasShFcs(); if( !bHasShFocus ) - pWrtShell->ShGetFcs( FALSE ); + pWrtShell->ShGetFcs( sal_False ); const SwFmtINetFmt* pINet; String sCmp, sMark( INetURLObject::decode( rMark, INET_HEX_ESCAPE, @@ -1899,22 +1901,22 @@ BOOL SwView::JumpToSwMark( const String& rMark ) TransliterationModules_IGNORE_CASE ); //todo/mba: assuming that notes shouldn't be searched - BOOL bSearchInNotes = FALSE; + sal_Bool bSearchInNotes = sal_False; if( pWrtShell->SearchPattern( aSearchOpt, bSearchInNotes, DOCPOS_START, DOCPOS_END )) { pWrtShell->EnterStdMode(); // Selektion wieder aufheben - bRet = TRUE; + bRet = sal_True; } } else if( pMarkAccess->getMarksEnd() != (ppMark = pMarkAccess->findMark(sMark)) ) - pWrtShell->GotoMark( ppMark->get(), FALSE, TRUE ), bRet = TRUE; + pWrtShell->GotoMark( ppMark->get(), sal_False, sal_True ), bRet = sal_True; else if( 0 != ( pINet = pWrtShell->FindINetAttr( sMark ) )) bRet = pWrtShell->GotoINetAttr( *pINet->GetTxtINetFmt() ); // fuer alle Arten von Flys if( FLYCNTTYPE_ALL != eFlyType && pWrtShell->GotoFly( sName, eFlyType )) { - bRet = TRUE; + bRet = sal_True; if( FLYCNTTYPE_FRM == eFlyType ) { // TextFrames: Cursor in den Frame setzen @@ -1929,7 +1931,7 @@ BOOL SwView::JumpToSwMark( const String& rMark ) } } else if( pMarkAccess->getMarksEnd() != (ppMark = pMarkAccess->findMark(sMark))) - pWrtShell->GotoMark( ppMark->get(), FALSE, TRUE ), bRet = TRUE; + pWrtShell->GotoMark( ppMark->get(), sal_False, sal_True ), bRet = sal_True; else if( 0 != ( pINet = pWrtShell->FindINetAttr( sMark ) )) bRet = pWrtShell->GotoINetAttr( *pINet->GetTxtINetFmt() ); @@ -1960,9 +1962,9 @@ sal_uInt16 lcl_PageDescWithHeader( const SwDoc& rDoc ) const SwPageDesc& rPageDesc = rDoc.GetPageDesc( i ); const SwFrmFmt& rMaster = rPageDesc.GetMaster(); const SfxPoolItem* pItem; - if( ( SFX_ITEM_SET == rMaster.GetAttrSet().GetItemState( RES_HEADER, FALSE, &pItem ) && + if( ( SFX_ITEM_SET == rMaster.GetAttrSet().GetItemState( RES_HEADER, sal_False, &pItem ) && ((SwFmtHeader*)pItem)->IsActive() ) || - ( SFX_ITEM_SET == rMaster.GetAttrSet().GetItemState( RES_FOOTER, FALSE, &pItem ) && + ( SFX_ITEM_SET == rMaster.GetAttrSet().GetItemState( RES_FOOTER, sal_False, &pItem ) && ((SwFmtFooter*)pItem)->IsActive()) ) ++nRet; } @@ -1977,7 +1979,7 @@ void SwView::ExecuteInsertDoc( SfxRequest& rRequest, const SfxPoolItem* pItem ) { pViewImpl->InitRequest( rRequest ); pViewImpl->SetParam( pItem ? 1 : 0 ); - USHORT nSlot = rRequest.GetSlot(); + sal_uInt16 nSlot = rRequest.GetSlot(); if ( !pItem ) { @@ -1988,7 +1990,7 @@ void SwView::ExecuteInsertDoc( SfxRequest& rRequest, const SfxPoolItem* pItem ) { String sFile, sFilter; sFile = ( (const SfxStringItem *)pItem )->GetValue(); - if ( SFX_ITEM_SET == rRequest.GetArgs()->GetItemState( FN_PARAM_1, TRUE, &pItem ) ) + if ( SFX_ITEM_SET == rRequest.GetArgs()->GetItemState( FN_PARAM_1, sal_True, &pItem ) ) sFilter = ( (const SfxStringItem *)pItem )->GetValue(); bool bHasFileName = ( sFile.Len() > 0 ); @@ -2002,7 +2004,7 @@ void SwView::ExecuteInsertDoc( SfxRequest& rRequest, const SfxPoolItem* pItem ) } } -long SwView::InsertDoc( USHORT nSlotId, const String& rFileName, const String& rFilterName, INT16 nVersion ) +long SwView::InsertDoc( sal_uInt16 nSlotId, const String& rFileName, const String& rFilterName, sal_Int16 nVersion ) { SfxMedium* pMed = 0; SwDocShell* pDocSh = GetDocShell(); @@ -2013,17 +2015,17 @@ long SwView::InsertDoc( USHORT nSlotId, const String& rFileName, const String& r const SfxFilter* pFilter = rFact.GetFilterContainer()->GetFilter4FilterName( rFilterName ); if ( !pFilter ) { - pMed = new SfxMedium(rFileName, STREAM_READ, TRUE, 0, 0 ); + pMed = new SfxMedium(rFileName, STREAM_READ, sal_True, 0, 0 ); SfxFilterMatcher aMatcher( rFact.GetFilterContainer()->GetName() ); - pMed->UseInteractionHandler( TRUE ); - ErrCode nErr = aMatcher.GuessFilter( *pMed, &pFilter, FALSE ); + pMed->UseInteractionHandler( sal_True ); + ErrCode nErr = aMatcher.GuessFilter( *pMed, &pFilter, sal_False ); if ( nErr ) DELETEZ(pMed); else pMed->SetFilter( pFilter ); } else - pMed = new SfxMedium(rFileName, STREAM_READ, TRUE, pFilter, 0); + pMed = new SfxMedium(rFileName, STREAM_READ, sal_True, pFilter, 0); } else { @@ -2038,21 +2040,21 @@ long SwView::InsertDoc( USHORT nSlotId, const String& rFileName, const String& r return InsertMedium( nSlotId, pMed, nVersion ); } -long SwView::InsertMedium( USHORT nSlotId, SfxMedium* pMedium, INT16 nVersion ) +long SwView::InsertMedium( sal_uInt16 nSlotId, SfxMedium* pMedium, sal_Int16 nVersion ) { - BOOL bInsert = FALSE, bCompare = FALSE, bMerge = FALSE; + sal_Bool bInsert = sal_False, bCompare = sal_False, bMerge = sal_False; long nFound = 0; SwDocShell* pDocSh = GetDocShell(); switch( nSlotId ) { - case SID_DOCUMENT_MERGE: bMerge = TRUE; break; - case SID_DOCUMENT_COMPARE: bCompare = TRUE; break; - case SID_INSERTDOC: bInsert = TRUE; break; + case SID_DOCUMENT_MERGE: bMerge = sal_True; break; + case SID_DOCUMENT_COMPARE: bCompare = sal_True; break; + case SID_INSERTDOC: bInsert = sal_True; break; default: ASSERT( !this, "Unbekannte SlotId!" ); - bInsert = TRUE; + bInsert = sal_True; nSlotId = SID_INSERTDOC; break; } @@ -2092,10 +2094,10 @@ long SwView::InsertMedium( USHORT nSlotId, SfxMedium* pMedium, INT16 nVersion ) SwDoc *pDoc = pDocSh->GetDoc(); if( pRead && pDocSh->GetDoc() ) nUndoCheck = lcl_PageDescWithHeader( *pDoc ); - ULONG nErrno; + sal_uLong nErrno; { //Scope for SwWait-Object, to be able to execute slots //outside this scope. - SwWait aWait( *GetDocShell(), TRUE ); + SwWait aWait( *GetDocShell(), sal_True ); pWrtShell->StartAllAction(); if ( pWrtShell->HasSelection() ) pWrtShell->DelRight(); // Selektionen loeschen @@ -2106,10 +2108,8 @@ long SwView::InsertMedium( USHORT nSlotId, SfxMedium* pMedium, INT16 nVersion ) } else { - sal_Bool bUndo = pDoc->DoesUndo(); - pDoc->DoUndo( sal_False ); + ::sw::UndoGuard const ug(pDoc->GetIDocumentUndoRedo()); nErrno = pDocSh->InsertFrom( *pMedium ) ? 0 : ERR_SWG_READ_ERROR; - pDoc->DoUndo( bUndo ); } } @@ -2119,14 +2119,16 @@ long SwView::InsertMedium( USHORT nSlotId, SfxMedium* pMedium, INT16 nVersion ) { SfxRequest aReq( FN_UPDATE_TOX, SFX_CALLMODE_SLOT, GetPool() ); Execute( aReq ); - pWrtShell->SetUpdateTOX( FALSE ); // wieder zurueck setzen + pWrtShell->SetUpdateTOX( sal_False ); // wieder zurueck setzen } if( pDoc ) { // Disable Undo for .sdw (136991) or // if the number of page styles with header/footer has changed (#i67305) if( !pRead || nUndoCheck != lcl_PageDescWithHeader( *pDoc ) ) - pDoc->DelAllUndoObj(); + { + pDoc->GetIDocumentUndoRedo().DelAllUndoObj(); + } } pWrtShell->EndAllAction(); @@ -2143,18 +2145,19 @@ long SwView::InsertMedium( USHORT nSlotId, SfxMedium* pMedium, INT16 nVersion ) else { SfxObjectShellRef xDocSh; + SfxObjectShellLock xLockRef; -extern int lcl_FindDocShell( SfxObjectShellRef& xDocSh, +extern int lcl_FindDocShell( SfxObjectShellRef& xDocSh, SfxObjectShellLock& xLockRef, const String& rFileName, const String& rPasswd, - String& rFilter, INT16 nVersion, + String& rFilter, sal_Int16 nVersion, SwDocShell* pDestSh ); String sFltNm; - int nRet = lcl_FindDocShell( xDocSh, pMedium->GetName(), aEmptyStr, + int nRet = lcl_FindDocShell( xDocSh, xLockRef, pMedium->GetName(), aEmptyStr, sFltNm, nVersion, pDocSh ); if( nRet ) { - SwWait aWait( *GetDocShell(), TRUE ); + SwWait aWait( *GetDocShell(), sal_True ); pWrtShell->StartAllAction(); pWrtShell->EnterStdMode(); // Selektionen loeschen @@ -2182,7 +2185,7 @@ extern int lcl_FindDocShell( SfxObjectShellRef& xDocSh, /* -----------------05.02.2003 12:06----------------- * * --------------------------------------------------*/ -void SwView::EnableMailMerge(BOOL bEnable ) +void SwView::EnableMailMerge(sal_Bool bEnable ) { bInMailMerge = bEnable; SfxBindings& rBind = GetViewFrame()->GetBindings(); @@ -2258,7 +2261,7 @@ class SwMergeSourceWarningBox_Impl : public ModalDialog -void SwView::GenerateFormLetter(BOOL bUseCurrentDocument) +void SwView::GenerateFormLetter(sal_Bool bUseCurrentDocument) { if(bUseCurrentDocument) { @@ -2275,7 +2278,7 @@ void SwView::GenerateFormLetter(BOOL bUseCurrentDocument) } if(!xDBContext.is()) return ; - BOOL bCallAddressPilot = FALSE; + sal_Bool bCallAddressPilot = sal_False; if ( lcl_NeedAdditionalDataSource( xDBContext ) ) { // no data sources are available - create a new one @@ -2285,7 +2288,7 @@ void SwView::GenerateFormLetter(BOOL bUseCurrentDocument) // no cancel allowed if ( RET_OK != aWarning.Execute() ) return; - bCallAddressPilot = TRUE; + bCallAddressPilot = sal_True; } else { @@ -2315,12 +2318,12 @@ void SwView::GenerateFormLetter(BOOL bUseCurrentDocument) //call insert fields with database field page available, only SfxViewFrame* pVFrame = GetViewFrame(); //at first hide the default field dialog if currently visible - pVFrame->SetChildWindow(FN_INSERT_FIELD, FALSE); + pVFrame->SetChildWindow(FN_INSERT_FIELD, sal_False); //enable the status of the db field dialog - it is disabled in the status method //to prevent creation of the dialog without mail merge active EnableMailMerge(); //then show the "Data base only" field dialog - SfxBoolItem aOn(FN_INSERT_FIELD_DATA_ONLY, TRUE); + SfxBoolItem aOn(FN_INSERT_FIELD_DATA_ONLY, sal_True); pVFrame->GetDispatcher()->Execute(FN_INSERT_FIELD_DATA_ONLY, SFX_CALLMODE_SYNCHRON, &aOn, 0L); return; @@ -2368,7 +2371,7 @@ void SwView::GenerateFormLetter(BOOL bUseCurrentDocument) pValues[0].Value <<= aData.sDataSource; pValues[1].Value <<= aData.sCommand; pValues[2].Value <<= aData.nCommandType; - pNewDBMgr->ExecuteFormLetter(GetWrtShell(), aProperties, TRUE); + pNewDBMgr->ExecuteFormLetter(GetWrtShell(), aProperties, sal_True); } } else @@ -2408,7 +2411,7 @@ IMPL_LINK( SwView, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDlg ) SfxMedium* pMed = pViewImpl->CreateMedium(); if ( pMed ) { - USHORT nSlot = pViewImpl->GetRequest()->GetSlot(); + sal_uInt16 nSlot = pViewImpl->GetRequest()->GetSlot(); long nFound = InsertMedium( nSlot, pMed, pViewImpl->GetParam() ); if ( SID_INSERTDOC == nSlot ) @@ -2434,7 +2437,7 @@ IMPL_LINK( SwView, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDlg ) pVFrame->ShowChildWindow(FN_REDLINE_ACCEPT); // RedlineDlg neu initialisieren - USHORT nId = SwRedlineAcceptChild::GetChildWindowId(); + sal_uInt16 nId = SwRedlineAcceptChild::GetChildWindowId(); SwRedlineAcceptChild* pRed = (SwRedlineAcceptChild*)pVFrame->GetChildWindow( nId ); if ( pRed ) pRed->ReInitDlg( GetDocShell() ); |