diff options
Diffstat (limited to 'sw/source/ui/docvw')
-rw-r--r-- | sw/source/ui/docvw/AnnotationMenuButton.cxx | 21 | ||||
-rw-r--r-- | sw/source/ui/docvw/AnnotationWin.cxx | 17 | ||||
-rw-r--r-- | sw/source/ui/docvw/PostItMgr.cxx | 15 | ||||
-rw-r--r-- | sw/source/ui/docvw/SidebarTxtControl.cxx | 11 | ||||
-rw-r--r-- | sw/source/ui/docvw/SidebarTxtControlAcc.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/docvw/SidebarWin.cxx | 27 | ||||
-rw-r--r-- | sw/source/ui/docvw/access.src | 19 | ||||
-rw-r--r-- | sw/source/ui/docvw/docvw.src | 22 | ||||
-rw-r--r-- | sw/source/ui/docvw/edtdd.cxx | 84 | ||||
-rw-r--r-- | sw/source/ui/docvw/edtwin.cxx | 884 | ||||
-rw-r--r-- | sw/source/ui/docvw/edtwin2.cxx | 43 | ||||
-rw-r--r-- | sw/source/ui/docvw/edtwin3.cxx | 24 | ||||
-rw-r--r-- | sw/source/ui/docvw/extedit.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/docvw/makefile.mk | 70 | ||||
-rw-r--r-- | sw/source/ui/docvw/romenu.cxx | 80 | ||||
-rw-r--r-- | sw/source/ui/docvw/romenu.hxx | 8 | ||||
-rw-r--r-- | sw/source/ui/docvw/srcedtw.cxx | 127 |
17 files changed, 705 insertions, 751 deletions
diff --git a/sw/source/ui/docvw/AnnotationMenuButton.cxx b/sw/source/ui/docvw/AnnotationMenuButton.cxx index 27f7ddb78908..4407e1c6fd34 100644 --- a/sw/source/ui/docvw/AnnotationMenuButton.cxx +++ b/sw/source/ui/docvw/AnnotationMenuButton.cxx @@ -47,13 +47,13 @@ namespace sw { namespace annotation { -Color ColorFromAlphaColor( const UINT8 aTransparency, +Color ColorFromAlphaColor( const sal_uInt8 aTransparency, const Color &aFront, const Color &aBack ) { - return Color((UINT8)(aFront.GetRed() * aTransparency/(double)255 + aBack.GetRed() * (1-aTransparency/(double)255)), - (UINT8)(aFront.GetGreen() * aTransparency/(double)255 + aBack.GetGreen() * (1-aTransparency/(double)255)), - (UINT8)(aFront.GetBlue() * aTransparency/(double)255 + aBack.GetBlue() * (1-aTransparency/(double)255))); + return Color((sal_uInt8)(aFront.GetRed() * aTransparency/(double)255 + aBack.GetRed() * (1-aTransparency/(double)255)), + (sal_uInt8)(aFront.GetGreen() * aTransparency/(double)255 + aBack.GetGreen() * (1-aTransparency/(double)255)), + (sal_uInt8)(aFront.GetBlue() * aTransparency/(double)255 + aBack.GetBlue() * (1-aTransparency/(double)255))); } AnnotationMenuButton::AnnotationMenuButton( sw::sidebarwindows::SwSidebarWin& rSidebarWin ) @@ -83,20 +83,13 @@ void AnnotationMenuButton::MouseButtonDown( const MouseEvent& rMEvt ) if ( mrSidebarWin.IsReadOnly() ) { pButtonPopup->EnableItem( FN_REPLY, false ); - pButtonPopup->EnableItem( FN_DELETE_NOTE, false ); + pButtonPopup->EnableItem( FN_DELETE_COMMENT, false ); pButtonPopup->EnableItem( FN_DELETE_NOTE_AUTHOR, false ); pButtonPopup->EnableItem( FN_DELETE_ALL_NOTES, false ); } else { - if ( mrSidebarWin.IsProtected() ) - { - pButtonPopup->EnableItem( FN_DELETE_NOTE, false ); - } - else - { - pButtonPopup->EnableItem( FN_DELETE_NOTE, true ); - } + pButtonPopup->EnableItem( FN_DELETE_COMMENT, !mrSidebarWin.IsProtected() ); pButtonPopup->EnableItem( FN_DELETE_NOTE_AUTHOR, true ); pButtonPopup->EnableItem( FN_DELETE_ALL_NOTES, true ); } @@ -204,7 +197,7 @@ void AnnotationMenuButton::Paint( const Rectangle& /*rRect*/ ) void AnnotationMenuButton::KeyInput( const KeyEvent& rKeyEvt ) { const KeyCode& rKeyCode = rKeyEvt.GetKeyCode(); - const USHORT nKey = rKeyCode.GetCode(); + const sal_uInt16 nKey = rKeyCode.GetCode(); if ( nKey == KEY_TAB ) { mrSidebarWin.ActivatePostIt(); diff --git a/sw/source/ui/docvw/AnnotationWin.cxx b/sw/source/ui/docvw/AnnotationWin.cxx index 7dfd298cfd7b..9cf7dd76d018 100644 --- a/sw/source/ui/docvw/AnnotationWin.cxx +++ b/sw/source/ui/docvw/AnnotationWin.cxx @@ -26,7 +26,6 @@ * ************************************************************************/ - #include "precompiled_sw.hxx" #include <AnnotationWin.hxx> @@ -60,8 +59,10 @@ #include <wrtsh.hxx> #include <docsh.hxx> #include <doc.hxx> +#include <IDocumentUndoRedo.hxx> #include <SwUndoField.hxx> + namespace sw { namespace annotation { SwAnnotationWin::SwAnnotationWin( SwEditWin& rEditWin, @@ -86,7 +87,7 @@ void SwAnnotationWin::SetPostItText() { // get text from SwPostItField and insert into our textview Engine()->SetModifyHdl( Link() ); - Engine()->EnableUndo( FALSE ); + Engine()->EnableUndo( sal_False ); mpFld = static_cast<SwPostItField*>(mpFmtFld->GetFld()); if( mpFld->GetTextObject() ) Engine()->SetText( *mpFld->GetTextObject() ); @@ -99,7 +100,7 @@ void SwAnnotationWin::SetPostItText() Engine()->ClearModifyFlag(); Engine()->GetUndoManager().Clear(); - Engine()->EnableUndo( TRUE ); + Engine()->EnableUndo( sal_True ); Engine()->SetModifyHdl( LINK( this, SwAnnotationWin, ModifyHdl ) ); Invalidate(); } @@ -114,7 +115,8 @@ void SwAnnotationWin::UpdateData() SwField* pOldField = mpFld->Copy(); mpFld->SetPar2(Engine()->GetEditEngine().GetText()); mpFld->SetTextObject(Engine()->CreateParaObject()); - DocView().GetDocShell()->GetDoc()->AppendUndo(new SwUndoFieldFromDoc(aPosition, *pOldField, *mpFld, 0, true)); + DocView().GetDocShell()->GetDoc()->GetIDocumentUndoRedo().AppendUndo( + new SwUndoFieldFromDoc(aPosition, *pOldField, *mpFld, 0, true)); delete pOldField; // so we get a new layout of notes (anchor position is still the same and we would otherwise not get one) Mgr().SetLayout(); @@ -244,7 +246,8 @@ void SwAnnotationWin::InitAnswer(OutlinerParaObject* pText) SwField* pOldField = mpFld->Copy(); mpFld->SetPar2(Engine()->GetEditEngine().GetText()); mpFld->SetTextObject(Engine()->CreateParaObject()); - DocView().GetDocShell()->GetDoc()->AppendUndo(new SwUndoFieldFromDoc(aPosition, *pOldField, *mpFld, 0, true)); + DocView().GetDocShell()->GetDoc()->GetIDocumentUndoRedo().AppendUndo( + new SwUndoFieldFromDoc(aPosition, *pOldField, *mpFld, 0, true)); delete pOldField; Engine()->SetModifyHdl( LINK( this, SwAnnotationWin, ModifyHdl ) ); Engine()->ClearModifyFlag(); @@ -254,8 +257,8 @@ void SwAnnotationWin::InitAnswer(OutlinerParaObject* pText) SvxLanguageItem SwAnnotationWin::GetLanguage(void) { // set initial language for outliner - USHORT nScriptType = SvtLanguageOptions::GetScriptTypeOfLanguage( mpFld->GetLanguage() ); - USHORT nLangWhichId = 0; + sal_uInt16 nScriptType = SvtLanguageOptions::GetScriptTypeOfLanguage( mpFld->GetLanguage() ); + sal_uInt16 nLangWhichId = 0; switch (nScriptType) { case SCRIPTTYPE_LATIN : nLangWhichId = EE_CHAR_LANGUAGE ; break; diff --git a/sw/source/ui/docvw/PostItMgr.cxx b/sw/source/ui/docvw/PostItMgr.cxx index c2f3d9fbb6ac..bd9d8b126c37 100644 --- a/sw/source/ui/docvw/PostItMgr.cxx +++ b/sw/source/ui/docvw/PostItMgr.cxx @@ -60,7 +60,6 @@ #include <redline.hxx> #include <docary.hxx> #include <SwRewriter.hxx> -#include <undobj.hxx> #include <tools/color.hxx> #include <swmodule.hxx> @@ -363,8 +362,8 @@ void SwPostItMgr::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) { if ((*i)->pPostIt) { - USHORT nScriptType = SvtLanguageOptions::GetScriptTypeOfLanguage( (*i)->GetFmtFld()->GetFld()->GetLanguage() ); - USHORT nLangWhichId = 0; + sal_uInt16 nScriptType = SvtLanguageOptions::GetScriptTypeOfLanguage( (*i)->GetFmtFld()->GetFld()->GetLanguage() ); + sal_uInt16 nLangWhichId = 0; switch (nScriptType) { case SCRIPTTYPE_LATIN : nLangWhichId = EE_CHAR_LANGUAGE ; break; @@ -892,7 +891,7 @@ void SwPostItMgr::MakeVisible(const SwSidebarWin* pPostIt,long aPage ) mpWrtShell->MakeVisible(SwRect(mpEditWin->PixelToLogic(aNoteRect))); } -bool SwPostItMgr::ArrowEnabled(USHORT aDirection,unsigned long aPage) const +bool SwPostItMgr::ArrowEnabled(sal_uInt16 aDirection,unsigned long aPage) const { switch (aDirection) { @@ -908,7 +907,7 @@ bool SwPostItMgr::ArrowEnabled(USHORT aDirection,unsigned long aPage) const } } -Color SwPostItMgr::GetArrowColor(USHORT aDirection,unsigned long aPage) const +Color SwPostItMgr::GetArrowColor(sal_uInt16 aDirection,unsigned long aPage) const { if (ArrowEnabled(aDirection,aPage)) { @@ -1164,7 +1163,7 @@ void SwPostItMgr::Delete(String aAuthor) mpWrtShell->GotoField( *(*i) ); mpWrtShell->DelRight(); } - mpWrtShell->EndUndo( UNDO_DELETE ); + mpWrtShell->EndUndo(); PrepareView(); mpWrtShell->EndAllAction(); mbLayout = true; @@ -1193,7 +1192,7 @@ void SwPostItMgr::Delete() mpWrtShell->DelRight(); } - mpWrtShell->EndUndo( UNDO_DELETE ); + mpWrtShell->EndUndo(); PrepareView(); mpWrtShell->EndAllAction(); mbLayout = true; @@ -1266,7 +1265,7 @@ sw::annotation::SwAnnotationWin* SwPostItMgr::GetAnnotationWin(const SwPostItFie return NULL; } -SwSidebarWin* SwPostItMgr::GetNextPostIt( USHORT aDirection, +SwSidebarWin* SwPostItMgr::GetNextPostIt( sal_uInt16 aDirection, SwSidebarWin* aPostIt ) { if (mvPostItFlds.size()>1) diff --git a/sw/source/ui/docvw/SidebarTxtControl.cxx b/sw/source/ui/docvw/SidebarTxtControl.cxx index cff71082298c..473c7b872bb4 100644 --- a/sw/source/ui/docvw/SidebarTxtControl.cxx +++ b/sw/source/ui/docvw/SidebarTxtControl.cxx @@ -62,7 +62,6 @@ #include <wrtsh.hxx> #include <shellres.hxx> #include <SwRewriter.hxx> -#include <undobj.hxx> namespace css = ::com::sun::star; @@ -114,7 +113,7 @@ void SidebarTxtControl::LoseFocus() void SidebarTxtControl::RequestHelp(const HelpEvent &rEvt) { - USHORT nResId = 0; + sal_uInt16 nResId = 0; switch( mrSidebarWin.GetLayoutStatus() ) { case SwPostItHelper::INSERTED: nResId = STR_REDLINE_INSERT; break; @@ -179,7 +178,7 @@ void SidebarTxtControl::Paint( const Rectangle& rRect) void SidebarTxtControl::KeyInput( const KeyEvent& rKeyEvt ) { const KeyCode& rKeyCode = rKeyEvt.GetKeyCode(); - USHORT nKey = rKeyCode.GetCode(); + sal_uInt16 nKey = rKeyCode.GetCode(); if ( ( rKeyCode.IsMod1() && rKeyCode.IsMod2() ) && ( (nKey == KEY_PAGEUP) || (nKey == KEY_PAGEDOWN) ) ) { @@ -234,7 +233,7 @@ void SidebarTxtControl::KeyInput( const KeyEvent& rKeyEvt ) } } - mrDocView.GetViewFrame()->GetBindings().InvalidateAll(FALSE); + mrDocView.GetViewFrame()->GetBindings().InvalidateAll(sal_False); } void SidebarTxtControl::MouseMove( const MouseEvent& rMEvt ) @@ -301,7 +300,7 @@ void SidebarTxtControl::MouseButtonDown( const MouseEvent& rMEvt ) { GetTextView()->MouseButtonDown( rMEvt ); } - mrDocView.GetViewFrame()->GetBindings().InvalidateAll(FALSE); + mrDocView.GetViewFrame()->GetBindings().InvalidateAll(sal_False); } void SidebarTxtControl::MouseButtonUp( const MouseEvent& rMEvt ) @@ -331,7 +330,7 @@ void SidebarTxtControl::Command( const CommandEvent& rCEvt ) { if ( !mrSidebarWin.IsProtected() && GetTextView() && - GetTextView()->IsWrongSpelledWordAtPos( rCEvt.GetMousePosPixel(),TRUE )) + GetTextView()->IsWrongSpelledWordAtPos( rCEvt.GetMousePosPixel(),sal_True )) { Link aLink = LINK(this, SidebarTxtControl, OnlineSpellCallback); GetTextView()->ExecuteSpellPopup(rCEvt.GetMousePosPixel(),&aLink); diff --git a/sw/source/ui/docvw/SidebarTxtControlAcc.cxx b/sw/source/ui/docvw/SidebarTxtControlAcc.cxx index 9197cacf0132..52ddacabb3df 100644 --- a/sw/source/ui/docvw/SidebarTxtControlAcc.cxx +++ b/sw/source/ui/docvw/SidebarTxtControlAcc.cxx @@ -78,7 +78,7 @@ class SidebarTextEditSource : public SvxEditSource, SidebarTextEditSource::SidebarTextEditSource( SidebarTxtControl& rSidebarTxtControl ) : SvxEditSource() , mrSidebarTxtControl( rSidebarTxtControl ) - , mTextForwarder( *(rSidebarTxtControl.GetTextView()->GetOutliner()), FALSE ) + , mTextForwarder( *(rSidebarTxtControl.GetTextView()->GetOutliner()), sal_False ) , mViewForwarder( *(rSidebarTxtControl.GetTextView()) ) { if ( mrSidebarTxtControl.GetTextView() ) diff --git a/sw/source/ui/docvw/SidebarWin.cxx b/sw/source/ui/docvw/SidebarWin.cxx index 600cce9ec38f..4dcb7d7d4c47 100644 --- a/sw/source/ui/docvw/SidebarWin.cxx +++ b/sw/source/ui/docvw/SidebarWin.cxx @@ -332,7 +332,7 @@ void SwSidebarWin::InitControls() SwDocShell* aShell = mrView.GetDocShell(); mpOutliner = new Outliner(&aShell->GetPool(),OUTLINERMODE_TEXTOBJECT); aShell->GetDoc()->SetCalcFieldValueHdl( mpOutliner ); - mpOutliner->SetUpdateMode( TRUE ); + mpOutliner->SetUpdateMode( sal_True ); Rescale(); mpOutlinerView = new OutlinerView ( mpOutliner, mpSidebarTxtControl ); @@ -355,7 +355,7 @@ void SwSidebarWin::InitControls() mpVScrollbar->AddEventListener( LINK( this, SwSidebarWin, WindowEventListener ) ); const SwViewOption* pVOpt = mrView.GetWrtShellPtr()->GetViewOptions(); - ULONG nCntrl = mpOutliner->GetControlWord(); + sal_uLong nCntrl = mpOutliner->GetControlWord(); // TODO: crash when AUTOCOMPLETE enabled nCntrl |= EE_CNTRL_MARKFIELDS | EE_CNTRL_PASTESPECIAL | EE_CNTRL_AUTOCORRECT | EV_CNTRL_AUTOSCROLL | EE_CNTRL_URLSFXEXECUTE; // | EE_CNTRL_AUTOCOMPLETE; if (pVOpt->IsFieldShadings()) @@ -771,7 +771,7 @@ void SwSidebarWin::SetSidebarPosition(sw::sidebarwindows::SidebarPosition eSideb meSidebarPosition = eSidebarPosition; } -void SwSidebarWin::SetReadonly(BOOL bSet) +void SwSidebarWin::SetReadonly(sal_Bool bSet) { mbReadonly = bSet; GetOutlinerView()->SetReadOnly(bSet); @@ -783,7 +783,7 @@ void SwSidebarWin::SetLanguage(const SvxLanguageItem aNewItem) Engine()->SetModifyHdl( Link() ); ESelection aOld = GetOutlinerView()->GetSelection(); - ESelection aNewSelection( 0, 0, (USHORT)Engine()->GetParagraphCount()-1, USHRT_MAX ); + ESelection aNewSelection( 0, 0, (sal_uInt16)Engine()->GetParagraphCount()-1, USHRT_MAX ); GetOutlinerView()->SetSelection( aNewSelection ); SfxItemSet aEditAttr(GetOutlinerView()->GetAttribs()); aEditAttr.Put(aNewItem); @@ -793,7 +793,7 @@ void SwSidebarWin::SetLanguage(const SvxLanguageItem aNewItem) Engine()->SetModifyHdl( pLink ); const SwViewOption* pVOpt = mrView.GetWrtShellPtr()->GetViewOptions(); - ULONG nCntrl = Engine()->GetControlWord(); + sal_uLong nCntrl = Engine()->GetControlWord(); // turn off if (!pVOpt->IsOnlineSpell()) nCntrl &= ~EE_CNTRL_ONLINESPELLING; @@ -913,7 +913,7 @@ void SwSidebarWin::ToggleInsMode() } } -void SwSidebarWin::ExecuteCommand(USHORT nSlot) +void SwSidebarWin::ExecuteCommand(sal_uInt16 nSlot) { mrMgr.AssureStdModeAtShell(); @@ -936,7 +936,6 @@ void SwSidebarWin::ExecuteCommand(USHORT nSlot) break; } case FN_DELETE_COMMENT: - case FN_DELETE_NOTE: //Delete(); // do not kill the parent of our open popup menu mnEventId = Application::PostUserEvent( LINK( this, SwSidebarWin, DeleteHdl), 0 ); @@ -972,7 +971,7 @@ long SwSidebarWin::GetPostItTextHeight() return mpOutliner ? LogicToPixel(mpOutliner->CalcTextSize()).Height() : 0; } -void SwSidebarWin::SwitchToPostIt(USHORT aDirection) +void SwSidebarWin::SwitchToPostIt(sal_uInt16 aDirection) { SwSidebarWin* pPostIt = mrMgr.GetNextPostIt(aDirection, this); if (pPostIt) @@ -1012,8 +1011,8 @@ IMPL_LINK( SwSidebarWin, WindowEventListener, VclSimpleEvent*, pEvent ) else if ( pWinEvent->GetId() == VCLEVENT_WINDOW_ACTIVATE && pWinEvent->GetWindow() == mpSidebarTxtControl ) { - const BOOL bLockView = mrView.GetWrtShell().IsViewLocked(); - mrView.GetWrtShell().LockView( TRUE ); + const sal_Bool bLockView = mrView.GetWrtShell().IsViewLocked(); + mrView.GetWrtShell().LockView( sal_True ); if ( !IsPreview() ) { @@ -1069,8 +1068,8 @@ IMPL_LINK(SwSidebarWin, DeleteHdl, void*, EMPTYARG) void SwSidebarWin::ResetAttributes() { - mpOutlinerView->RemoveAttribsKeepLanguages(TRUE); - mpOutliner->RemoveFields(TRUE); + mpOutlinerView->RemoveAttribsKeepLanguages(sal_True); + mpOutliner->RemoveFields(sal_True); mpOutlinerView->SetAttribs(DefaultItem()); } @@ -1108,7 +1107,7 @@ sal_Int32 SwSidebarWin::GetMinimumSizeWithoutMeta() void SwSidebarWin::SetSpellChecking() { const SwViewOption* pVOpt = mrView.GetWrtShellPtr()->GetViewOptions(); - ULONG nCntrl = mpOutliner->GetControlWord(); + sal_uLong nCntrl = mpOutliner->GetControlWord(); if (pVOpt->IsOnlineSpell()) nCntrl |= EE_CNTRL_ONLINESPELLING; else @@ -1204,7 +1203,7 @@ void SwSidebarWin::SwitchToFieldPos() GotoPos(); sal_uInt32 aCount = MoveCaret(); if (aCount) - mrView.GetDocShell()->GetWrtShell()->SwCrsrShell::Right(aCount, 0, FALSE); + mrView.GetDocShell()->GetWrtShell()->SwCrsrShell::Right(aCount, 0, sal_False); GrabFocusToDocument(); } diff --git a/sw/source/ui/docvw/access.src b/sw/source/ui/docvw/access.src index 42081d3ab7e7..d455c01d0cf3 100644 --- a/sw/source/ui/docvw/access.src +++ b/sw/source/ui/docvw/access.src @@ -100,3 +100,22 @@ String STR_ACCESS_ANNOTATION_BUTTON_DESC Text [ en-US ] = "Activate this button to open a list of actions which can be performed on this comment and other comments"; }; +//IAccessibility2 Implementation 2009----- +String STR_ACCESS_PREVIEW_DOC_NAME +{ + Text [ en-US ] = "Document preview"; +}; +String STR_ACCESS_PREVIEW_DOC_SUFFIX +{ + Text [ en-US ] = "(Preview mode)"; +}; +String STR_ACCESS_DOC_WORDPROCESSING +{ + Text [ en-US ] = "%PRODUCTNAME Document"; +}; +String STR_ACCESS_DOC_WORDPROCESSING_READONLY +{ + Text [ en-US ] = "(read-only)"; +}; +//-----IAccessibility2 Implementation 2009 + diff --git a/sw/source/ui/docvw/docvw.src b/sw/source/ui/docvw/docvw.src index 658690396bf0..b4f57bbcc215 100644 --- a/sw/source/ui/docvw/docvw.src +++ b/sw/source/ui/docvw/docvw.src @@ -36,56 +36,56 @@ Menu MN_READONLY_POPUP MenuItem { Identifier = MN_READONLY_OPENURL ; - HelpID = SID_OPENDOC ; + HelpId = CMD_SID_OPENDOC ; Text [ en-US ] = "~Open" ; }; MenuItem { Identifier = MN_READONLY_OPENURLNEW ; - HelpID = SID_OPENDOC ; + HelpId = CMD_SID_OPENDOC ; Text [ en-US ] = "Open in New Window" ; }; MenuItem { Identifier = MN_READONLY_EDITDOC ; - HelpID = SID_EDITDOC ; + HelpId = CMD_SID_EDITDOC ; Text [ en-US ] = "~Edit" ; }; MenuItem { Identifier = MN_READONLY_SELECTION_MODE ; - HelpID = FN_READONLY_SELECTION_MODE ; + HelpId = CMD_FN_READONLY_SELECTION_MODE ; Text [ en-US ] = "Select Text"; }; MenuItem { Identifier = MN_READONLY_RELOAD; - HelpID = SID_RELOAD; + HelpId = CMD_SID_RELOAD; Text [ en-US ] = "Re~load"; }; MenuItem { Identifier = MN_READONLY_RELOAD_FRAME; - HelpID = SID_RELOAD; + HelpId = CMD_SID_RELOAD; Text [ en-US ] = "Reload Frame"; }; MenuItem { Identifier = MN_READONLY_SOURCEVIEW ; - HelpID = HID_SOURCEVIEW ; + HelpId = HID_SOURCEVIEW ; Text [ en-US ] = "HT~ML Source" ; }; SEPARATOR MenuItem { Identifier = MN_READONLY_BROWSE_BACKWARD ; - HelpID = SID_BROWSE_BACKWARD ; + HelpId = CMD_SID_BROWSE_BACKWARD ; Text [ en-US ] = "Backwards" ; }; MenuItem { Identifier = MN_READONLY_BROWSE_FORWARD ; - HelpID = SID_BROWSE_FORWARD ; + HelpId = CMD_SID_BROWSE_FORWARD ; Text [ en-US ] = "~Forward" ; }; SEPARATOR @@ -187,14 +187,14 @@ Menu MN_READONLY_POPUP MenuItem { Identifier = SID_WIN_FULLSCREEN; - HelpID = SID_WIN_FULLSCREEN; + HelpId = CMD_SID_WIN_FULLSCREEN; Text [ en-US ] = "Leave Full-Screen Mode" ; }; SEPARATOR MenuItem { Identifier = MN_READONLY_COPY ; - HelpID = SID_COPY; + HelpId = CMD_SID_COPY; Text [ en-US ] = "~Copy" ; }; }; diff --git a/sw/source/ui/docvw/edtdd.cxx b/sw/source/ui/docvw/edtdd.cxx index 544d407ec5bf..c5589a57d351 100644 --- a/sw/source/ui/docvw/edtdd.cxx +++ b/sw/source/ui/docvw/edtdd.cxx @@ -57,27 +57,27 @@ using namespace ::com::sun::star; // no include "dbgoutsw.hxx" here!!!!!! -extern BOOL bNoInterrupt; -extern BOOL bFrmDrag; -extern BOOL bDDTimerStarted; +extern sal_Bool bNoInterrupt; +extern sal_Bool bFrmDrag; +extern sal_Bool bDDTimerStarted; -BOOL bExecuteDrag = FALSE; +sal_Bool bExecuteDrag = sal_False; void SwEditWin::StartDDTimer() { aTimer.SetTimeoutHdl(LINK(this, SwEditWin, DDHandler)); aTimer.SetTimeout(480); aTimer.Start(); - bDDTimerStarted = TRUE; + bDDTimerStarted = sal_True; } void SwEditWin::StopDDTimer(SwWrtShell *pSh, const Point &rPt) { aTimer.Stop(); - bDDTimerStarted = FALSE; + bDDTimerStarted = sal_False; if(!pSh->IsSelFrmMode()) - (pSh->*pSh->fnSetCrsr)(&rPt,FALSE); + (pSh->*pSh->fnSetCrsr)(&rPt,sal_False); aTimer.SetTimeoutHdl(LINK(this,SwEditWin, TimerHandler)); } @@ -86,36 +86,36 @@ void SwEditWin::StartDrag( sal_Int8 /*nAction*/, const Point& rPosPixel ) SwWrtShell &rSh = rView.GetWrtShell(); if( rSh.GetDrawView() ) { - CommandEvent aDragEvent( rPosPixel, COMMAND_STARTDRAG, TRUE ); + CommandEvent aDragEvent( rPosPixel, COMMAND_STARTDRAG, sal_True ); if( rSh.GetDrawView()->Command( aDragEvent, this ) ) { - rView.GetViewFrame()->GetBindings().InvalidateAll(FALSE); + rView.GetViewFrame()->GetBindings().InvalidateAll(sal_False); return; // Event von der SdrView ausgewertet } } if ( !pApplyTempl && !rSh.IsDrawCreate() && !IsDrawAction()) { - BOOL bStart = FALSE, bDelSelect = FALSE; + sal_Bool bStart = sal_False, bDelSelect = sal_False; SdrObject *pObj = NULL; Point aDocPos( PixelToLogic( rPosPixel ) ); - if ( !rSh.IsInSelect() && rSh.ChgCurrPam( aDocPos, TRUE, TRUE)) + if ( !rSh.IsInSelect() && rSh.ChgCurrPam( aDocPos, sal_True, sal_True)) //We are not selecting and aren't at a selection - bStart = TRUE; + bStart = sal_True; else if ( !bFrmDrag && rSh.IsSelFrmMode() && rSh.IsInsideSelectedObj( aDocPos ) ) { //We are not dragging internally and are not at an //object (frame, draw object) - bStart = TRUE; + bStart = sal_True; } else if( !bFrmDrag && rView.GetDocShell()->IsReadOnly() && OBJCNT_NONE != rSh.GetObjCntType( aDocPos, pObj )) { rSh.LockPaint(); if( rSh.SelectObj( aDocPos, 0, pObj )) - bStart = bDelSelect = TRUE; + bStart = bDelSelect = sal_True; else rSh.UnlockPaint(); } @@ -124,15 +124,15 @@ void SwEditWin::StartDrag( sal_Int8 /*nAction*/, const Point& rPosPixel ) SwContentAtPos aSwContentAtPos( SwContentAtPos::SW_INETATTR ); bStart = rSh.GetContentAtPos( aDocPos, aSwContentAtPos, - FALSE ); + sal_False ); } if ( bStart && !bIsInDrag ) { - bMBPressed = FALSE; + bMBPressed = sal_False; ReleaseMouse(); - bFrmDrag = FALSE; - bExecuteDrag = TRUE; + bFrmDrag = sal_False; + bExecuteDrag = sal_True; SwEditWin::nDDStartPosY = aDocPos.Y(); SwEditWin::nDDStartPosX = aDocPos.X(); aMovePos = aDocPos; @@ -151,7 +151,7 @@ void SwEditWin::StartExecuteDrag() if( !bExecuteDrag || bIsInDrag ) return; - bIsInDrag = TRUE; + bIsInDrag = sal_True; SwTransferable* pTransfer = new SwTransferable( rView.GetWrtShell() ); uno::Reference< @@ -164,7 +164,7 @@ void SwEditWin::DragFinished() { DropCleanup(); aTimer.SetTimeoutHdl( LINK(this,SwEditWin, TimerHandler) ); - bIsInDrag = FALSE; + bIsInDrag = sal_False; } @@ -173,11 +173,11 @@ void SwEditWin::DropCleanup() SwWrtShell &rSh = rView.GetWrtShell(); // reset statuses - bNoInterrupt = FALSE; + bNoInterrupt = sal_False; if ( bOldIdleSet ) { ((SwViewOption*)rSh.GetViewOptions())->SetIdle( bOldIdle ); - bOldIdleSet = FALSE; + bOldIdleSet = sal_False; } if ( pUserMarker ) CleanupDropUserMarker(); @@ -238,7 +238,7 @@ sal_Int8 SwEditWin::ExecuteDrop( const ExecuteDropEvent& rEvt ) // (according to KA due to Java D&D), we'll have to // reevaluate the drop action once more _with_ the // Transferable. - USHORT nEventAction; + sal_uInt16 nEventAction; sal_Int8 nUserOpt = rEvt.mbDefault ? EXCHG_IN_ACTION_DEFAULT : rEvt.mnAction; m_nDropAction = SotExchange::GetExchangeAction( @@ -252,17 +252,17 @@ sal_Int8 SwEditWin::ExecuteDrop( const ExecuteDropEvent& rEvt ) TransferableDataHelper aData( rEvt.maDropEvent.Transferable ); nRet = rEvt.mnAction; if( !SwTransferable::PasteData( aData, rSh, m_nDropAction, m_nDropFormat, - m_nDropDestination, FALSE, rEvt.mbDefault, &aDocPt, nRet)) + m_nDropDestination, sal_False, rEvt.mbDefault, &aDocPt, nRet)) nRet = DND_ACTION_NONE; else if ( SW_MOD()->pDragDrop ) //Don't clean up anymore at internal D&D! - SW_MOD()->pDragDrop->SetCleanUp( FALSE ); + SW_MOD()->pDragDrop->SetCleanUp( sal_False ); return nRet; } -USHORT SwEditWin::GetDropDestination( const Point& rPixPnt, SdrObject ** ppObj ) +sal_uInt16 SwEditWin::GetDropDestination( const Point& rPixPnt, SdrObject ** ppObj ) { SwWrtShell &rSh = rView.GetWrtShell(); const Point aDocPt( PixelToLogic( rPixPnt ) ); @@ -287,7 +287,7 @@ USHORT SwEditWin::GetDropDestination( const Point& rPixPnt, SdrObject ** ppObj ) } //What do we want to drop on now? - USHORT nDropDestination = 0; + sal_uInt16 nDropDestination = 0; //Did anything else arrive from the DrawingEngine? if( OBJCNT_NONE != eType ) @@ -296,7 +296,7 @@ USHORT SwEditWin::GetDropDestination( const Point& rPixPnt, SdrObject ** ppObj ) { case OBJCNT_GRF: { - BOOL bLink, + sal_Bool bLink, bIMap = 0 != rSh.GetFmtFromObj( aDocPt )->GetURL().GetMap(); String aDummy; rSh.GetGrfAtPos( aDocPt, aDummy, bLink ); @@ -362,14 +362,14 @@ sal_Int8 SwEditWin::AcceptDrop( const AcceptDropEvent& rEvt ) aWin.Right() -= nMargin; aWin.Bottom() -= nMargin; if(!aWin.IsInside(aPixPt)) { - static ULONG last_tick = 0; - ULONG current_tick = Time::GetSystemTicks(); + static sal_uLong last_tick = 0; + sal_uLong current_tick = Time::GetSystemTicks(); if((current_tick-last_tick) > 500) { last_tick = current_tick; if(!bOldIdleSet) { bOldIdle = rSh.GetViewOptions()->IsIdle(); - ((SwViewOption *)rSh.GetViewOptions())->SetIdle(FALSE); - bOldIdleSet = TRUE; + ((SwViewOption *)rSh.GetViewOptions())->SetIdle(sal_False); + bOldIdleSet = sal_True; } CleanupDropUserMarker(); if(aPixPt.X() > aWin.Right()) aPixPt.X() += nMargin; @@ -384,7 +384,7 @@ sal_Int8 SwEditWin::AcceptDrop( const AcceptDropEvent& rEvt ) if(bOldIdleSet) { ((SwViewOption *)rSh.GetViewOptions())->SetIdle( bOldIdle ); - bOldIdleSet = FALSE; + bOldIdleSet = sal_False; } SdrObject *pObj = NULL; @@ -392,7 +392,7 @@ sal_Int8 SwEditWin::AcceptDrop( const AcceptDropEvent& rEvt ) if( !m_nDropDestination ) return DND_ACTION_NONE; - USHORT nEventAction; + sal_uInt16 nEventAction; sal_Int8 nUserOpt = rEvt.mbDefault ? EXCHG_IN_ACTION_DEFAULT : rEvt.mnAction; @@ -410,21 +410,21 @@ sal_Int8 SwEditWin::AcceptDrop( const AcceptDropEvent& rEvt ) SwModule *pMod = SW_MOD(); if( pMod->pDragDrop ) { - BOOL bCleanup = FALSE; + sal_Bool bCleanup = sal_False; //Drawing objects in Headers/Footers are not allowed SwWrtShell *pSrcSh = pMod->pDragDrop->GetShell(); if( (pSrcSh->GetSelFrmType() == FRMTYPE_DRAWOBJ) && pSrcSh->IsSelContainsControl() && - (rSh.GetFrmType( &aDocPt, FALSE ) & (FRMTYPE_HEADER|FRMTYPE_FOOTER)) ) + (rSh.GetFrmType( &aDocPt, sal_False ) & (FRMTYPE_HEADER|FRMTYPE_FOOTER)) ) { - bCleanup = TRUE; + bCleanup = sal_True; } // don't more position protected objects! else if( DND_ACTION_MOVE == rEvt.mnAction && pSrcSh->IsSelObjProtected( FLYPROTECT_POS ) ) { - bCleanup = TRUE; + bCleanup = sal_True; } else if( rEvt.mbDefault ) { @@ -496,16 +496,16 @@ sal_Int8 SwEditWin::AcceptDrop( const AcceptDropEvent& rEvt ) IMPL_LINK( SwEditWin, DDHandler, Timer *, EMPTYARG ) { - bDDTimerStarted = FALSE; + bDDTimerStarted = sal_False; aTimer.Stop(); aTimer.SetTimeout(240); - bMBPressed = FALSE; + bMBPressed = sal_False; ReleaseMouse(); - bFrmDrag = FALSE; + bFrmDrag = sal_False; if ( rView.GetViewFrame() ) { - bExecuteDrag = TRUE; + bExecuteDrag = sal_True; StartExecuteDrag(); } return 0; diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx index b0fc9177e30a..47eb5f3680a3 100644 --- a/sw/source/ui/docvw/edtwin.cxx +++ b/sw/source/ui/docvw/edtwin.cxx @@ -147,22 +147,22 @@ using namespace ::com::sun::star; --------------------------------------------------------------------*/ static bool bInputLanguageSwitched = false; -extern BOOL bNoInterrupt; // in mainwn.cxx +extern sal_Bool bNoInterrupt; // in mainwn.cxx // Usually in MouseButtonUp a selection is revoked when the selection is // not currently being pulled open. Unfortunately in MouseButtonDown there // is being selected at double/triple click. That selection is completely // finished in the Handler and thus can't be distinguished in the Up. // To resolve this bHoldSelection is set in Down at evaluated in Up. -static BOOL bHoldSelection = FALSE; - -BOOL bFrmDrag = FALSE; -BOOL bValidCrsrPos = FALSE; -BOOL bModePushed = FALSE; -BOOL bDDTimerStarted = FALSE; -BOOL bFlushCharBuffer = FALSE; -BOOL SwEditWin::bReplaceQuote = FALSE; -BOOL bDDINetAttr = FALSE; +static sal_Bool bHoldSelection = sal_False; + +sal_Bool bFrmDrag = sal_False; +sal_Bool bValidCrsrPos = sal_False; +sal_Bool bModePushed = sal_False; +sal_Bool bDDTimerStarted = sal_False; +sal_Bool bFlushCharBuffer = sal_False; +sal_Bool SwEditWin::bReplaceQuote = sal_False; +sal_Bool bDDINetAttr = sal_False; SdrHdlKind eSdrMoveHdl = HDL_USER; QuickHelpData* SwEditWin::pQuickHlpData = 0; @@ -171,9 +171,9 @@ long SwEditWin::nDDStartPosY = 0; long SwEditWin::nDDStartPosX = 0; Color SwEditWin::aTextBackColor(COL_YELLOW); Color SwEditWin::aTextColor(COL_RED); -BOOL SwEditWin::bTransparentBackColor = FALSE; // background not transparent +sal_Bool SwEditWin::bTransparentBackColor = sal_False; // background not transparent -extern BOOL bExecuteDrag; +extern sal_Bool bExecuteDrag; SfxShell* lcl_GetShellFromDispatcher( SwView& rView, TypeId nType ); @@ -226,27 +226,27 @@ public: struct QuickHelpData { SvStringsISortDtor aArr; - USHORT* pAttrs; + sal_uInt16* pAttrs; CommandExtTextInputData* pCETID; - ULONG nTipId; - USHORT nLen, nCurArrPos; - BOOL bClear : 1, bChkInsBlank : 1, bIsTip : 1, bIsAutoText : 1; + sal_uLong nTipId; + sal_uInt16 nLen, nCurArrPos; + sal_Bool bClear : 1, bChkInsBlank : 1, bIsTip : 1, bIsAutoText : 1; QuickHelpData() : pAttrs( 0 ), pCETID( 0 ) { ClearCntnt(); } void Move( QuickHelpData& rCpy ); void ClearCntnt(); - void Start( SwWrtShell& rSh, USHORT nWrdLen ); + void Start( SwWrtShell& rSh, sal_uInt16 nWrdLen ); void Stop( SwWrtShell& rSh ); - BOOL HasCntnt() const { return aArr.Count() && 0 != nLen; } + sal_Bool HasCntnt() const { return aArr.Count() && 0 != nLen; } - void Inc( BOOL bEndLess ) + void Inc( sal_Bool bEndLess ) { if( ++nCurArrPos >= aArr.Count() ) nCurArrPos = (bEndLess && !bIsAutoText )? 0 : nCurArrPos-1; } - void Dec( BOOL bEndLess ) + void Dec( sal_Bool bEndLess ) { if( 0 == nCurArrPos-- ) nCurArrPos = (bEndLess && !bIsAutoText ) ? aArr.Count()-1 : 0; @@ -261,7 +261,7 @@ struct QuickHelpData #define HIT_PIX 2 /* hit tolerance in pixel */ #define MIN_MOVE 4 -inline BOOL IsMinMove(const Point &rStartPos, const Point &rLPt) +inline sal_Bool IsMinMove(const Point &rStartPos, const Point &rLPt) { return Abs(rStartPos.X() - rLPt.X()) > MIN_MOVE || Abs(rStartPos.Y() - rLPt.Y()) > MIN_MOVE; @@ -273,9 +273,9 @@ inline BOOL IsMinMove(const Point &rStartPos, const Point &rLPt) in selecting, with DrawObjects; at SwgFlys to trigger hyperlinks if applicable (DownLoad/NewWindow!) --------------------------------------------------------------------*/ -inline BOOL IsDrawObjSelectable( const SwWrtShell& rSh, const Point& rPt ) +inline sal_Bool IsDrawObjSelectable( const SwWrtShell& rSh, const Point& rPt ) { - BOOL bRet = TRUE; + sal_Bool bRet = sal_True; SdrObject* pObj; switch( rSh.GetObjCntType( rPt, pObj )) { @@ -283,7 +283,7 @@ inline BOOL IsDrawObjSelectable( const SwWrtShell& rSh, const Point& rPt ) case OBJCNT_FLY: case OBJCNT_GRF: case OBJCNT_OLE: - bRet = FALSE; + bRet = sal_False; break; default:; //prevent warning } @@ -294,7 +294,7 @@ inline BOOL IsDrawObjSelectable( const SwWrtShell& rSh, const Point& rPt ) Description: switch pointer --------------------------------------------------------------------*/ -void SwEditWin::UpdatePointer(const Point &rLPt, USHORT nModifier ) +void SwEditWin::UpdatePointer(const Point &rLPt, sal_uInt16 nModifier ) { SwWrtShell &rSh = rView.GetWrtShell(); if( pApplyTempl ) @@ -377,43 +377,43 @@ void SwEditWin::UpdatePointer(const Point &rLPt, USHORT nModifier ) return; } - BOOL bExecHyperlinks = rView.GetDocShell()->IsReadOnly(); + sal_Bool bExecHyperlinks = rView.GetDocShell()->IsReadOnly(); if ( !bExecHyperlinks ) { SvtSecurityOptions aSecOpts; - const BOOL bSecureOption = aSecOpts.IsOptionSet( SvtSecurityOptions::E_CTRLCLICK_HYPERLINK ); + const sal_Bool bSecureOption = aSecOpts.IsOptionSet( SvtSecurityOptions::E_CTRLCLICK_HYPERLINK ); if ( ( bSecureOption && nModifier == KEY_MOD1 ) || ( !bSecureOption && nModifier != KEY_MOD1 ) ) - bExecHyperlinks = TRUE; + bExecHyperlinks = sal_True; } - const BOOL bExecSmarttags = nModifier == KEY_MOD1; + const sal_Bool bExecSmarttags = nModifier == KEY_MOD1; SdrView *pSdrView = rSh.GetDrawView(); - BOOL bPrefSdrPointer = FALSE; - BOOL bHitHandle = FALSE; - BOOL bCntAtPos = FALSE; - BOOL bIsDocReadOnly = rView.GetDocShell()->IsReadOnly() && + sal_Bool bPrefSdrPointer = sal_False; + sal_Bool bHitHandle = sal_False; + sal_Bool bCntAtPos = sal_False; + sal_Bool bIsDocReadOnly = rView.GetDocShell()->IsReadOnly() && rSh.IsCrsrReadonly(); aActHitType = SDRHIT_NONE; PointerStyle eStyle = POINTER_TEXT; if ( !pSdrView ) - bCntAtPos = TRUE; - else if ( TRUE == (bHitHandle = pSdrView->PickHandle( rLPt ) != 0) ) + bCntAtPos = sal_True; + else if ( sal_True == (bHitHandle = pSdrView->PickHandle( rLPt ) != 0) ) { aActHitType = SDRHIT_OBJECT; - bPrefSdrPointer = TRUE; + bPrefSdrPointer = sal_True; } else { - const BOOL bNotInSelObj = !rSh.IsInsideSelectedObj( rLPt ); + const sal_Bool bNotInSelObj = !rSh.IsInsideSelectedObj( rLPt ); if ( rView.GetDrawFuncPtr() && !bInsDraw && bNotInSelObj ) { aActHitType = SDRHIT_OBJECT; if (IsObjectSelect()) eStyle = POINTER_ARROW; else - bPrefSdrPointer = TRUE; + bPrefSdrPointer = sal_True; } else { @@ -438,7 +438,7 @@ void SwEditWin::UpdatePointer(const Point &rLPt, USHORT nModifier ) if (pSdrView->IsTextEdit()) { aActHitType = SDRHIT_NONE; - bPrefSdrPointer = TRUE; + bPrefSdrPointer = sal_True; } else { @@ -448,7 +448,7 @@ void SwEditWin::UpdatePointer(const Point &rLPt, USHORT nModifier ) if (eHit == SDRHIT_URLFIELD && bExecHyperlinks) { aActHitType = SDRHIT_OBJECT; - bPrefSdrPointer = TRUE; + bPrefSdrPointer = sal_True; } else { @@ -487,9 +487,9 @@ void SwEditWin::UpdatePointer(const Point &rLPt, USHORT nModifier ) else { if ( rView.GetDrawFuncPtr() ) - bPrefSdrPointer = TRUE; + bPrefSdrPointer = sal_True; else - bCntAtPos = TRUE; + bCntAtPos = sal_True; } } } @@ -552,7 +552,7 @@ IMPL_LINK( SwEditWin, TimerHandler, Timer *, EMPTYARG ) SwWrtShell &rSh = rView.GetWrtShell(); Point aModPt( aMovePos ); const SwRect aOldVis( rSh.VisArea() ); - BOOL bDone = FALSE; + sal_Bool bDone = sal_False; if ( !rSh.VisArea().IsInside( aModPt ) ) { @@ -560,12 +560,12 @@ IMPL_LINK( SwEditWin, TimerHandler, Timer *, EMPTYARG ) { const int nMaxScroll = 40; rView.Scroll( Rectangle(aModPt,Size(1,1)), nMaxScroll, nMaxScroll); - bDone = TRUE; + bDone = sal_True; } else if ( bFrmDrag ) { - (rSh.*rSh.fnDrag)(&aModPt,FALSE); - bDone = TRUE; + (rSh.*rSh.fnDrag)(&aModPt,sal_False); + bDone = sal_True; } if ( !bDone ) aModPt = rSh.GetCntntPos( aModPt,aModPt.Y() > rSh.VisArea().Bottom() ); @@ -578,7 +578,7 @@ IMPL_LINK( SwEditWin, TimerHandler, Timer *, EMPTYARG ) rSh.SelectTableRowCol( *pRowColumnSelectionStart, &aPos, bIsRowDrag ); } else - (rSh.*rSh.fnSetCrsr)( &aModPt, FALSE ); + (rSh.*rSh.fnSetCrsr)( &aModPt, sal_False ); // It can be that a "jump" over a table cannot be accomplished like // that. So we jump over the table by Up/Down here. @@ -588,9 +588,9 @@ IMPL_LINK( SwEditWin, TimerHandler, Timer *, EMPTYARG ) // take the center point of VisArea to // decide in which direction the user want. if( aModPt.Y() < ( rVisArea.Top() + rVisArea.Height() / 2 ) ) - rSh.Up( TRUE, 1 ); + rSh.Up( sal_True, 1 ); else - rSh.Down( TRUE, 1 ); + rSh.Down( sal_True, 1 ); } } @@ -634,14 +634,14 @@ inline void SwEditWin::EnterArea() Description: insert mode for frames ------------------------------------------------------------------------*/ -void SwEditWin::InsFrm(USHORT nCols) +void SwEditWin::InsFrm(sal_uInt16 nCols) { - StdDrawMode( OBJ_NONE, FALSE ); - bInsFrm = TRUE; + StdDrawMode( OBJ_NONE, sal_False ); + bInsFrm = sal_True; nInsFrmColCount = nCols; } -void SwEditWin::StdDrawMode( SdrObjKind eSdrObjectKind, BOOL bObjSelect ) +void SwEditWin::StdDrawMode( SdrObjKind eSdrObjectKind, sal_Bool bObjSelect ) { SetSdrDrawMode( eSdrObjectKind ); @@ -655,8 +655,8 @@ void SwEditWin::StdDrawMode( SdrObjKind eSdrObjectKind, BOOL bObjSelect ) if (bObjSelect) rView.GetDrawFuncPtr()->Activate( SID_OBJECT_SELECT ); else - rView.GetDrawFuncPtr()->Activate( sal::static_int_cast< USHORT >(eSdrObjectKind) ); - bInsFrm = FALSE; + rView.GetDrawFuncPtr()->Activate( sal::static_int_cast< sal_uInt16 >(eSdrObjectKind) ); + bInsFrm = sal_False; nInsFrmColCount = 1; } @@ -668,23 +668,23 @@ void SwEditWin::StopInsFrm() rView.SetDrawFuncPtr(NULL); } rView.LeaveDrawCreate(); // leave construction mode - bInsFrm = FALSE; + bInsFrm = sal_False; nInsFrmColCount = 1; } /*-------------------------------------------------------------------- --------------------------------------------------------------------*/ -BOOL SwEditWin::IsInputSequenceCheckingRequired( const String &rText, const SwPaM& rCrsr ) const +sal_Bool SwEditWin::IsInputSequenceCheckingRequired( const String &rText, const SwPaM& rCrsr ) const { const SvtCTLOptions& rCTLOptions = SW_MOD()->GetCTLOptions(); if ( !rCTLOptions.IsCTLFontEnabled() || !rCTLOptions.IsCTLSequenceChecking() ) - return FALSE; + return sal_False; const xub_StrLen nFirstPos = rCrsr.Start()->nContent.GetIndex(); if ( 0 == nFirstPos ) /* first char needs not to be checked */ - return FALSE; + return sal_False; SwBreakIt *pBreakIter = SwBreakIt::Get(); uno::Reference < i18n::XBreakIterator > xBI = pBreakIter->GetBreakIter(); @@ -796,7 +796,7 @@ void SwEditWin::FlushInBuffer() // at this point now we will insert the buffer text 'normally' some lines below... - rSh.Pop( FALSE ); // pop old cursor from stack + rSh.Pop( sal_False ); // pop old cursor from stack if (!aInBuffer.Len()) return; @@ -831,7 +831,7 @@ void SwEditWin::FlushInBuffer() sal_Bool bLang = true; if(eBufferLanguage != LANGUAGE_DONTKNOW) { - USHORT nWhich = 0; + sal_uInt16 nWhich = 0; switch( GetI18NScriptTypeOfLanguage( eBufferLanguage )) { case i18n::ScriptType::ASIAN: nWhich = RES_CHRATR_CJK_LANGUAGE; break; @@ -843,7 +843,7 @@ void SwEditWin::FlushInBuffer() { SfxItemSet aLangSet(rView.GetPool(), nWhich, nWhich); rSh.GetCurAttr(aLangSet); - if(SFX_ITEM_DEFAULT <= aLangSet.GetItemState(nWhich, TRUE)) + if(SFX_ITEM_DEFAULT <= aLangSet.GetItemState(nWhich, sal_True)) { LanguageType eLang = static_cast<const SvxLanguageItem&>(aLangSet.Get(nWhich)).GetLanguage(); if ( eLang == eBufferLanguage ) @@ -910,7 +910,7 @@ void SwEditWin::FlushInBuffer() rSh.Insert( aInBuffer ); eBufferLanguage = LANGUAGE_DONTKNOW; aInBuffer.Erase(); - bFlushCharBuffer = FALSE; + bFlushCharBuffer = sal_False; } } @@ -923,7 +923,7 @@ void SwEditWin::FlushInBuffer() #define MOVE_RIGHT_SMALL 6 #define MOVE_DOWN_SMALL 7 -void SwEditWin::ChangeFly( BYTE nDir, BOOL bWeb ) +void SwEditWin::ChangeFly( sal_uInt8 nDir, sal_Bool bWeb ) { SwWrtShell &rSh = rView.GetWrtShell(); SwRect aTmp = rSh.GetFlyRect(); @@ -952,10 +952,10 @@ void SwEditWin::ChangeFly( BYTE nDir, BOOL bWeb ) aSnap = rSh.GetViewOptions()->GetSnapSize(); short nDiv = rSh.GetViewOptions()->GetDivisionX(); if ( nDiv > 0 ) - aSnap.Width() = Max( (ULONG)1, (ULONG)aSnap.Width() / nDiv ); + aSnap.Width() = Max( (sal_uLong)1, (sal_uLong)aSnap.Width() / nDiv ); nDiv = rSh.GetViewOptions()->GetDivisionY(); if ( nDiv > 0 ) - aSnap.Height() = Max( (ULONG)1, (ULONG)aSnap.Height() / nDiv ); + aSnap.Height() = Max( (sal_uLong)1, (sal_uLong)aSnap.Height() / nDiv ); } SwRect aBoundRect; @@ -991,7 +991,7 @@ void SwEditWin::ChangeFly( BYTE nDir, BOOL bWeb ) case MOVE_DOWN_BIG: aTmp.Top( aTmp.Top() + nDown ); break; default: OSL_ENSURE(true, "ChangeFly: Unknown direction." ); } - BOOL bSet = FALSE; + sal_Bool bSet = sal_False; if ((FLY_AS_CHAR == eAnchorId) && ( nDir % 2 )) { long aDiff = aTmp.Top() - aRefPoint.Y(); @@ -1004,7 +1004,7 @@ void SwEditWin::ChangeFly( BYTE nDir, BOOL bWeb ) if( bWeb ) { eNew = aVert.GetVertOrient(); - BOOL bDown = 0 != ( nDir & 0x02 ); + sal_Bool bDown = 0 != ( nDir & 0x02 ); switch( eNew ) { case text::VertOrientation::CHAR_TOP: @@ -1035,7 +1035,7 @@ void SwEditWin::ChangeFly( BYTE nDir, BOOL bWeb ) } aVert.SetVertOrient( eNew ); aSet.Put( aVert ); - bSet = TRUE; + bSet = sal_True; } if (bWeb && (FLY_AT_PARA == eAnchorId) && ( nDir==MOVE_LEFT_SMALL || nDir==MOVE_RIGHT_BIG )) @@ -1059,23 +1059,23 @@ void SwEditWin::ChangeFly( BYTE nDir, BOOL bWeb ) { aHori.SetHoriOrient( eNew ); aSet.Put( aHori ); - bSet = TRUE; + bSet = sal_True; } } rSh.StartAllAction(); if( bSet ) rSh.SetFlyFrmAttr( aSet ); - BOOL bSetPos = (FLY_AS_CHAR != eAnchorId); + sal_Bool bSetPos = (FLY_AS_CHAR != eAnchorId); if(bSetPos && bWeb) { if (FLY_AT_PAGE != eAnchorId) { - bSetPos = FALSE; + bSetPos = sal_False; } else { bSetPos = (::GetHtmlMode(rView.GetDocShell()) & HTMLMODE_SOME_ABS_POS) ? - TRUE : FALSE; + sal_True : sal_False; } } if( bSetPos ) @@ -1084,7 +1084,7 @@ void SwEditWin::ChangeFly( BYTE nDir, BOOL bWeb ) } } -void SwEditWin::ChangeDrawing( BYTE nDir ) +void SwEditWin::ChangeDrawing( sal_uInt8 nDir ) { // start undo action in order to get only one // undo action for this change. @@ -1094,7 +1094,7 @@ void SwEditWin::ChangeDrawing( BYTE nDir ) long nX = 0; long nY = 0; sal_Bool bOnePixel = sal_False; - USHORT nAnchorDir = SW_MOVE_UP; + sal_uInt16 nAnchorDir = SW_MOVE_UP; switch(nDir) { case MOVE_LEFT_SMALL: @@ -1128,14 +1128,14 @@ void SwEditWin::ChangeDrawing( BYTE nDir ) if(0 != nX || 0 != nY) { - BYTE nProtect = rSh.IsSelObjProtected( FLYPROTECT_POS|FLYPROTECT_SIZE ); + sal_uInt8 nProtect = rSh.IsSelObjProtected( FLYPROTECT_POS|FLYPROTECT_SIZE ); Size aSnap( rSh.GetViewOptions()->GetSnapSize() ); short nDiv = rSh.GetViewOptions()->GetDivisionX(); if ( nDiv > 0 ) - aSnap.Width() = Max( (ULONG)1, (ULONG)aSnap.Width() / nDiv ); + aSnap.Width() = Max( (sal_uLong)1, (sal_uLong)aSnap.Width() / nDiv ); nDiv = rSh.GetViewOptions()->GetDivisionY(); if ( nDiv > 0 ) - aSnap.Height() = Max( (ULONG)1, (ULONG)aSnap.Height() / nDiv ); + aSnap.Height() = Max( (sal_uLong)1, (sal_uLong)aSnap.Height() / nDiv ); if(bOnePixel) aSnap = PixelToLogic(Size(1,1)); @@ -1154,8 +1154,8 @@ void SwEditWin::ChangeDrawing( BYTE nDir ) if(0 == (nProtect&FLYPROTECT_POS)) { // Check if object is anchored as character and move direction - BOOL bDummy; - bool bVertAnchor = rSh.IsFrmVertical( TRUE, bDummy ); + sal_Bool bDummy1, bDummy2; + const bool bVertAnchor = rSh.IsFrmVertical( sal_True, bDummy1, bDummy2 ); bool bHoriMove = !bVertAnchor == !( nDir % 2 ); bool bMoveAllowed = !bHoriMove || (rSh.GetAnchorId() != FLY_AS_CHAR); @@ -1191,14 +1191,14 @@ void SwEditWin::ChangeDrawing( BYTE nDir ) if(pSdrView->IsDragObj()) { - BOOL bWasNoSnap = static_cast< BOOL >(rDragStat.IsNoSnap()); - BOOL bWasSnapEnabled = pSdrView->IsSnapEnabled(); + sal_Bool bWasNoSnap = static_cast< sal_Bool >(rDragStat.IsNoSnap()); + sal_Bool bWasSnapEnabled = pSdrView->IsSnapEnabled(); // switch snapping off if(!bWasNoSnap) - ((SdrDragStat&)rDragStat).SetNoSnap(TRUE); + ((SdrDragStat&)rDragStat).SetNoSnap(sal_True); if(bWasSnapEnabled) - pSdrView->SetSnapEnabled(FALSE); + pSdrView->SetSnapEnabled(sal_False); pSdrView->MovAction(aEndPoint); pSdrView->EndDragObj(); @@ -1244,7 +1244,7 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt) aKeyInputFlushTimer.Stop(); SwWrtShell &rSh = rView.GetWrtShell(); - BOOL bIsDocReadOnly = rView.GetDocShell()->IsReadOnly() && + sal_Bool bIsDocReadOnly = rView.GetDocShell()->IsReadOnly() && rSh.IsCrsrReadonly(); //if the language changes the buffer must be flushed @@ -1265,7 +1265,7 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt) // OS:the DrawView also needs a readonly-Flag as well if ( !bIsDocReadOnly && rSh.GetDrawView() && rSh.GetDrawView()->KeyInput( rKEvt, this ) ) { - rSh.GetView().GetViewFrame()->GetBindings().InvalidateAll( FALSE ); + rSh.GetView().GetViewFrame()->GetBindings().InvalidateAll( sal_False ); rSh.SetModified(); return; // Event evaluated by SdrView } @@ -1276,10 +1276,10 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt) rSh.Edit(); } - BOOL bFlushBuffer = FALSE; - BOOL bNormalChar = FALSE; - BOOL bChkInsBlank = pQuickHlpData->bChkInsBlank; - pQuickHlpData->bChkInsBlank = FALSE; + sal_Bool bFlushBuffer = sal_False; + sal_Bool bNormalChar = sal_False; + sal_Bool bChkInsBlank = pQuickHlpData->bChkInsBlank; + pQuickHlpData->bChkInsBlank = sal_False; #if OSL_DEBUG_LEVEL > 1 if (rKEvt.GetKeyCode().GetCode() == KEY_F12) @@ -1305,7 +1305,7 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt) // must changed from switch to if, because the Linux // compiler has problem with the code. Has to remove if the new general // handler exist. - USHORT nKey = rKEvt.GetKeyCode().GetCode(); + sal_uInt16 nKey = rKEvt.GetKeyCode().GetCode(); if( KEY_UP == nKey || KEY_DOWN == nKey || KEY_LEFT == nKey || KEY_RIGHT == nKey ) @@ -1322,11 +1322,14 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt) if( ( bVertText && ( !bTblCrsr || bVertTable ) ) || ( bTblCrsr && bVertTable ) ) { + // Attempt to integrate cursor travelling for mongolian layout does not work. + // Thus, back to previous mapping of cursor keys to direction keys. if( KEY_UP == nKey ) nKey = KEY_LEFT; else if( KEY_DOWN == nKey ) nKey = KEY_RIGHT; else if( KEY_LEFT == nKey ) nKey = KEY_DOWN; else if( KEY_RIGHT == nKey ) nKey = KEY_UP; } + if ( rSh.IsInRightToLeftText() ) { if( KEY_LEFT == nKey ) nKey = KEY_RIGHT; @@ -1355,7 +1358,7 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt) const SwFrmFmt* pFlyFmt = rSh.GetFlyFrmFmt(); if( pFlyFmt ) { - USHORT nEvent; + sal_uInt16 nEvent; if( 32 <= aCh && 0 == (( KEY_MOD1 | KEY_MOD2 ) & rKeyCode.GetModifier() )) @@ -1416,8 +1419,8 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt) SwModuleOptions* pModOpt = SW_MOD()->GetModuleConfig(); TblChgWidthHeightType eTblChgMode = nsTblChgWidthHeightType::WH_COL_LEFT; // initialization just for warning-free code - USHORT nTblChgSize = 0; - BOOL bStopKeyInputTimer = TRUE; + sal_uInt16 nTblChgSize = 0; + sal_Bool bStopKeyInputTimer = sal_True; String sFmlEntry; enum SW_KeyState { KS_Start, @@ -1464,7 +1467,7 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt) SW_KeyState eKeyState = bIsDocReadOnly ? KS_CheckDocReadOnlyKeys : KS_CheckKey, eNextKeyState = KS_Ende; - BYTE nDir = 0; + sal_uInt8 nDir = 0; if (nKS_NUMDOWN_Count > 0) nKS_NUMDOWN_Count--; @@ -1508,12 +1511,12 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt) else rSh.SttSelect(); rSh.MoveSection( fnSectionCurr, fnSectionEnd ); - rSh.Pop( TRUE ); + rSh.Pop( sal_True ); rSh.EndSelect(); sFmlEntry = '='; } else - rSh.Pop( FALSE ); + rSh.Pop( sal_False ); } else { @@ -1606,7 +1609,7 @@ KEYINPUT_CHECKTABLE: case KEY_LEFT: case KEY_LEFT | KEY_MOD1: { - BOOL bMod1 = 0 != (rKeyCode.GetModifier() & KEY_MOD1); + sal_Bool bMod1 = 0 != (rKeyCode.GetModifier() & KEY_MOD1); if(!bMod1) { eFlyState = KS_Fly_Change; @@ -1628,7 +1631,7 @@ KEYINPUT_CHECKTABLE: case KEY_UP: case KEY_UP | KEY_MOD1: { - BOOL bMod1 = 0 != (rKeyCode.GetModifier() & KEY_MOD1); + sal_Bool bMod1 = 0 != (rKeyCode.GetModifier() & KEY_MOD1); if(!bMod1) { eFlyState = KS_Fly_Change; @@ -1644,7 +1647,7 @@ KEYINPUT_CHECKTABLE: case KEY_DOWN: case KEY_DOWN | KEY_MOD1: { - BOOL bMod1 = 0 != (rKeyCode.GetModifier() & KEY_MOD1); + sal_Bool bMod1 = 0 != (rKeyCode.GetModifier() & KEY_MOD1); if(!bMod1) { eFlyState = KS_Fly_Change; @@ -1661,7 +1664,7 @@ KEYINPUT_CHECKTABLE: KEYINPUT_CHECKTABLE_INSDEL: if( rSh.IsTableMode() || !rSh.GetTableFmt() || !bTblInsDelMode || - FALSE /* table protected */ + sal_False /* table protected */ ) { const int nSelectionType = rSh.GetSelectionType(); @@ -1688,7 +1691,7 @@ KEYINPUT_CHECKTABLE_INSDEL: if ( !rSh.HasReadonlySel() ) { if (rSh.IsInFrontOfLabel() && - rSh.NumOrNoNum(FALSE)) + rSh.NumOrNoNum(sal_False)) eKeyState = KS_NumOrNoNum; } else @@ -1702,22 +1705,22 @@ KEYINPUT_CHECKTABLE_INSDEL: if( !rSh.IsTableMode() && rSh.GetTableFmt() ) { eKeyState = KS_Ende; - bTblInsDelMode = TRUE; - bTblIsInsMode = FALSE; - bTblIsColMode = TRUE; + bTblInsDelMode = sal_True; + bTblIsInsMode = sal_False; + bTblIsColMode = sal_True; aKeyInputTimer.Start(); - bStopKeyInputTimer = FALSE; + bStopKeyInputTimer = sal_False; } break; case KEY_INSERT | KEY_MOD2: if( !rSh.IsTableMode() && rSh.GetTableFmt() ) { eKeyState = KS_Ende; - bTblInsDelMode = TRUE; - bTblIsInsMode = TRUE; - bTblIsColMode = TRUE; + bTblInsDelMode = sal_True; + bTblIsInsMode = sal_True; + bTblIsColMode = sal_True; aKeyInputTimer.Start(); - bStopKeyInputTimer = FALSE; + bStopKeyInputTimer = sal_False; } break; @@ -1768,7 +1771,7 @@ KEYINPUT_CHECKTABLE_INSDEL: case KEY_BACKSPACE | KEY_SHIFT: if( !rSh.HasReadonlySel() ) { - BOOL bDone = FALSE; + sal_Bool bDone = sal_False; // try to add comment for code snip: // Remove the paragraph indent, if the cursor is at the // beginning of a paragraph, there is no selection @@ -1798,13 +1801,13 @@ KEYINPUT_CHECKTABLE_INSDEL: { eKeyState = KS_NumUp; nKS_NUMDOWN_Count = 2; - bDone = TRUE; + bDone = sal_True; } else if (nKS_NUMINDENTINC_Count > 0) { eKeyState = KS_NumIndentDec; nKS_NUMINDENTINC_Count = 2; - bDone = TRUE; + bDone = sal_True; } } @@ -1845,7 +1848,7 @@ KEYINPUT_CHECKTABLE_INSDEL: } } if ( bCallNumOrNoNum && - rSh.NumOrNoNum( !bOnlyBackspaceKey, TRUE ) ) + rSh.NumOrNoNum( !bOnlyBackspaceKey, sal_True ) ) { eKeyState = KS_NumOrNoNum; } @@ -1870,9 +1873,9 @@ KEYINPUT_CHECKTABLE_INSDEL: { #ifdef SW_CRSR_TIMER - BOOL bOld = rSh.ChgCrsrTimerFlag( FALSE ); + sal_Bool bOld = rSh.ChgCrsrTimerFlag( sal_False ); #endif - if (rSh.IsFormProtected() || rSh.GetCurrentFieldmark() || rSh.GetChar(FALSE)==CH_TXT_ATR_FORMELEMENT) + if (rSh.IsFormProtected() || rSh.GetCurrentFieldmark() || rSh.GetChar(sal_False)==CH_TXT_ATR_FORMELEMENT) { eKeyState=KS_GotoNextFieldMark; } @@ -1922,9 +1925,10 @@ KEYINPUT_CHECKTABLE_INSDEL: case KEY_TAB | KEY_SHIFT: { #ifdef SW_CRSR_TIMER - BOOL bOld = rSh.ChgCrsrTimerFlag( FALSE ); + sal_Bool bOld = rSh.ChgCrsrTimerFlag( sal_False ); + sal_Bool bOld = rSh.ChgCrsrTimerFlag( sal_False ); #endif - if (rSh.IsFormProtected() || rSh.GetCurrentFieldmark()|| rSh.GetChar(FALSE)==CH_TXT_ATR_FORMELEMENT) { + if (rSh.IsFormProtected() || rSh.GetCurrentFieldmark()|| rSh.GetChar(sal_False)==CH_TXT_ATR_FORMELEMENT) { eKeyState=KS_GotoPrevFieldMark; } else if( rSh.GetCurNumRule() && rSh.IsSttOfPara() && @@ -2028,7 +2032,7 @@ KEYINPUT_CHECKTABLE_INSDEL: { case KEY_TAB: case KEY_TAB | KEY_SHIFT: - bNormalChar = FALSE; + bNormalChar = sal_False; eKeyState = KS_Ende; if ( rSh.GetSelectionType() & (nsSelectionType::SEL_GRF | @@ -2054,10 +2058,10 @@ KEYINPUT_CHECKTABLE_INSDEL: { SfxItemSet aSet(rSh.GetAttrPool(), RES_TXTATR_INETFMT, RES_TXTATR_INETFMT); rSh.GetCurAttr(aSet); - if(SFX_ITEM_SET == aSet.GetItemState(RES_TXTATR_INETFMT, FALSE)) + if(SFX_ITEM_SET == aSet.GetItemState(RES_TXTATR_INETFMT, sal_False)) { - const SfxPoolItem& rItem = aSet.Get(RES_TXTATR_INETFMT, TRUE); - bNormalChar = FALSE; + const SfxPoolItem& rItem = aSet.Get(RES_TXTATR_INETFMT, sal_True); + bNormalChar = sal_False; eKeyState = KS_Ende; rSh.ClickToINetAttr((const SwFmtINetFmt&)rItem, URLLOAD_NOFILTER); } @@ -2074,12 +2078,12 @@ KEYINPUT_CHECKTABLE_INSDEL: switch ( rKeyCode.GetModifier() | rKeyCode.GetCode() ) { case KEY_RIGHT | KEY_MOD2: - rSh.Right( CRSR_SKIP_CHARS, FALSE, 1, FALSE ); + rSh.Right( CRSR_SKIP_CHARS, sal_False, 1, sal_False ); eKeyState = KS_Ende; FlushInBuffer(); break; case KEY_LEFT | KEY_MOD2: - rSh.Left( CRSR_SKIP_CHARS, FALSE, 1, FALSE ); + rSh.Left( CRSR_SKIP_CHARS, sal_False, 1, sal_False ); eKeyState = KS_Ende; FlushInBuffer(); break; @@ -2098,14 +2102,14 @@ KEYINPUT_CHECKTABLE_INSDEL: if (bNormalChar && rSh.IsInFrontOfLabel()) { - rSh.NumOrNoNum(FALSE); + rSh.NumOrNoNum(sal_False); } if( aInBuffer.Len() && ( !bNormalChar || bIsDocReadOnly )) FlushInBuffer(); if( rView.KeyInput( aKeyEvent ) ) - bFlushBuffer = TRUE, bNormalChar = FALSE; + bFlushBuffer = sal_True, bNormalChar = sal_False; else { // Because Sfx accelerators are only called when they were @@ -2141,7 +2145,7 @@ KEYINPUT_CHECKTABLE_INSDEL: } else { - bNormalChar = FALSE; + bNormalChar = sal_False; Window::KeyInput( aKeyEvent ); } } @@ -2190,7 +2194,7 @@ KEYINPUT_CHECKTABLE_INSDEL: aCh = '\t'; // no break! case KS_InsChar: - if (rSh.GetChar(FALSE)==CH_TXT_ATR_FORMELEMENT) + if (rSh.GetChar(sal_False)==CH_TXT_ATR_FORMELEMENT) { ::sw::mark::ICheckboxFieldmark* pFieldmark = dynamic_cast< ::sw::mark::ICheckboxFieldmark* > @@ -2223,7 +2227,7 @@ KEYINPUT_CHECKTABLE_INSDEL: } else if(!rSh.HasReadonlySel()) { - BOOL bIsNormalChar = GetAppCharClass().isLetterNumeric( + sal_Bool bIsNormalChar = GetAppCharClass().isLetterNumeric( String( aCh ), 0 ); if( bChkInsBlank && bIsNormalChar && (aInBuffer.Len() || !rSh.IsSttPara() || !rSh.IsEndPara() )) @@ -2233,8 +2237,8 @@ KEYINPUT_CHECKTABLE_INSDEL: aInBuffer.Expand( aInBuffer.Len() + 1, ' ' ); } - BOOL bIsAutoCorrectChar = SvxAutoCorrect::IsAutoCorrectChar( aCh ); - BOOL bRunNext = pACorr && pACorr->HasRunNext(); + sal_Bool bIsAutoCorrectChar = SvxAutoCorrect::IsAutoCorrectChar( aCh ); + sal_Bool bRunNext = pACorr && pACorr->HasRunNext(); if( !aKeyEvent.GetRepeat() && pACorr && ( bIsAutoCorrectChar || bRunNext ) && pACfg->IsAutoFmtByInput() && (( pACorr->IsAutoCorrFlag( ChgWeightUnderl ) && @@ -2294,7 +2298,7 @@ KEYINPUT_CHECKTABLE_INSDEL: default: { - USHORT nSlotId = 0; + sal_uInt16 nSlotId = 0; FlushInBuffer(); switch( eKeyState ) { @@ -2315,11 +2319,11 @@ KEYINPUT_CHECKTABLE_INSDEL: break; case KS_NumDown: - rSh.NumUpDown( TRUE ); + rSh.NumUpDown( sal_True ); nKS_NUMDOWN_Count = 2; break; case KS_NumUp: - rSh.NumUpDown( FALSE ); + rSh.NumUpDown( sal_False ); break; case KS_NumIndentInc: @@ -2362,7 +2366,7 @@ KEYINPUT_CHECKTABLE_INSDEL: nSlotId = FN_GOTO_PREV_CELL; break; case KS_AutoFmtByInput: - rSh.SplitNode( TRUE ); + rSh.SplitNode( sal_True ); break; case KS_NextObject: @@ -2395,11 +2399,11 @@ KEYINPUT_CHECKTABLE_INSDEL: if(pList->GetShortName( sFnd, sShrtNm, sGroup)) { rSh.SttSelect(); - rSh.ExtendSelection( FALSE, aTmpQHD.nLen ); + rSh.ExtendSelection( sal_False, aTmpQHD.nLen ); SwGlossaryHdl* pGlosHdl = GetView().GetGlosHdl(); - pGlosHdl->SetCurGroup(sGroup, TRUE); + pGlosHdl->SetCurGroup(sGroup, sal_True); pGlosHdl->InsertGlossary( sShrtNm); - pQuickHlpData->bChkInsBlank = TRUE; + pQuickHlpData->bChkInsBlank = sal_True; } } else @@ -2419,7 +2423,7 @@ KEYINPUT_CHECKTABLE_INSDEL: case KS_EditFormula: { - const USHORT nId = SwInputChild::GetChildWindowId(); + const sal_uInt16 nId = SwInputChild::GetChildWindowId(); SfxViewFrame* pVFrame = GetView().GetViewFrame(); pVFrame->ToggleChildWindow( nId ); @@ -2494,7 +2498,7 @@ KEYINPUT_CHECKTABLE_INSDEL: if( bStopKeyInputTimer ) { aKeyInputTimer.Stop(); - bTblInsDelMode = FALSE; + bTblInsDelMode = sal_False; } // in case the buffered characters are inserted @@ -2502,7 +2506,7 @@ KEYINPUT_CHECKTABLE_INSDEL: { // bFlushCharBuffer was not resetted here // why not? - BOOL bSave = bFlushCharBuffer; + sal_Bool bSave = bFlushCharBuffer; FlushInBuffer(); bFlushCharBuffer = bSave; @@ -2528,7 +2532,7 @@ void SwEditWin::RstMBDownFlags() // of the modal dialog (like on WINDOWS). // So reset the statuses here and release the mouse // for the dialog. - bMBPressed = bNoInterrupt = FALSE; + bMBPressed = bNoInterrupt = sal_False; EnterArea(); ReleaseMouse(); } @@ -2544,7 +2548,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) // the contex menu is closed by VCL asynchronously which in the end // would work on deleted objects or the context menu has no parent anymore) SfxInPlaceClient* pIPClient = rSh.GetSfxViewShell()->GetIPClient(); - BOOL bIsOleActive = ( pIPClient && pIPClient->IsObjectInPlaceActive() ); + sal_Bool bIsOleActive = ( pIPClient && pIPClient->IsObjectInPlaceActive() ); if ( bIsOleActive && PopupMenu::IsInExecute() ) return; @@ -2560,7 +2564,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) //ignore key modifiers for format paintbrush { - BOOL bExecFormatPaintbrush = pApplyTempl && pApplyTempl->pFormatClipboard + sal_Bool bExecFormatPaintbrush = pApplyTempl && pApplyTempl->pFormatClipboard && pApplyTempl->pFormatClipboard->HasContent(); if( bExecFormatPaintbrush ) rMEvt = MouseEvent( _rMEvt.GetPosPixel(), _rMEvt.GetClicks(), @@ -2575,7 +2579,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) if ( IsChainMode() ) { - SetChainMode( FALSE ); + SetChainMode( sal_False ); SwRect aDummy; SwFlyFrmFmt *pFmt = (SwFlyFrmFmt*)rSh.GetFlyFrmFmt(); if ( !rSh.Chainable( aDummy, *pFmt, aDocPos ) ) @@ -2588,12 +2592,12 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) // work but in practice ... lcl_SelectShellForDrop( rView ); - BOOL bIsDocReadOnly = rView.GetDocShell()->IsReadOnly(); - BOOL bCallBase = TRUE; + sal_Bool bIsDocReadOnly = rView.GetDocShell()->IsReadOnly(); + sal_Bool bCallBase = sal_True; if( pQuickHlpData->bClear ) pQuickHlpData->Stop( rSh ); - pQuickHlpData->bChkInsBlank = FALSE; + pQuickHlpData->bChkInsBlank = sal_False; if( rSh.FinishOLEObj() ) return; // end InPlace and the click doesn't count anymore @@ -2605,17 +2609,17 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) { if (pSdrView->MouseButtonDown( rMEvt, this ) ) { - rSh.GetView().GetViewFrame()->GetBindings().InvalidateAll(FALSE); + rSh.GetView().GetViewFrame()->GetBindings().InvalidateAll(sal_False); return; // SdrView's event evaluated } } - bIsInMove = FALSE; + bIsInMove = sal_False; aStartPos = rMEvt.GetPosPixel(); aRszMvHdlPt.X() = 0, aRszMvHdlPt.Y() = 0; - BYTE nMouseTabCol = 0; - const BOOL bTmp = !rSh.IsDrawCreate() && !pApplyTempl && !rSh.IsInSelect() && + sal_uInt8 nMouseTabCol = 0; + const sal_Bool bTmp = !rSh.IsDrawCreate() && !pApplyTempl && !rSh.IsInSelect() && rMEvt.GetClicks() == 1 && MOUSE_LEFT == rMEvt.GetButtons(); if ( bTmp && 0 != (nMouseTabCol = rSh.WhichMouseTabCol( aDocPos ) ) && @@ -2631,7 +2635,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) bIsRowDrag = SW_TABROWSEL_HORI == nMouseTabCol|| SW_TABROWSEL_HORI_RTL == nMouseTabCol || SW_TABCOLSEL_VERT == nMouseTabCol; - bMBPressed = TRUE; + bMBPressed = sal_True; CaptureMouse(); } return; @@ -2641,9 +2645,9 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) { // comes from table columns out of the document. if(SW_TABCOL_VERT == nMouseTabCol || SW_TABCOL_HORI == nMouseTabCol) - rView.SetTabColFromDoc( TRUE ); + rView.SetTabColFromDoc( sal_True ); else - rView.SetTabRowFromDoc( TRUE ); + rView.SetTabRowFromDoc( sal_True ); rView.SetTabColFromDocPos( aDocPos ); rView.InvalidateRulerPos(); @@ -2652,11 +2656,11 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) if ( RulerColumnDrag( rMEvt, (SW_TABCOL_VERT == nMouseTabCol || SW_TABROW_HORI == nMouseTabCol)) ) { - rView.SetTabColFromDoc( FALSE ); - rView.SetTabRowFromDoc( FALSE ); + rView.SetTabColFromDoc( sal_False ); + rView.SetTabRowFromDoc( sal_False ); rView.InvalidateRulerPos(); rBind.Update(); - bCallBase = FALSE; + bCallBase = sal_False; } else { @@ -2679,7 +2683,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) rView.SetNumRuleNodeFromDoc( NULL ); rView.InvalidateRulerPos(); rBind.Update(); - bCallBase = FALSE; + bCallBase = sal_False; } else { @@ -2703,8 +2707,8 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) // click releases the selection. if ( MOUSE_LEFT == rMEvt.GetButtons() ) { - BOOL bOnlyText = FALSE; - bMBPressed = bNoInterrupt = TRUE; + sal_Bool bOnlyText = sal_False; + bMBPressed = bNoInterrupt = sal_True; nKS_NUMDOWN_Count = 0; CaptureMouse(); @@ -2733,7 +2737,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) } if ( EnterDrawMode( rMEvt, aDocPos ) ) { - bNoInterrupt = FALSE; + bNoInterrupt = sal_False; return; } else if ( rView.GetDrawFuncPtr() && bInsFrm ) @@ -2748,7 +2752,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) if ( rSh.IsSelFrmMode()) { SdrHdl* pHdl = rSh.GetDrawView()->PickHandle(aDocPos); - BOOL bHitHandle = pHdl && pHdl->GetKind() != HDL_ANCHOR && + sal_Bool bHitHandle = pHdl && pHdl->GetKind() != HDL_ANCHOR && pHdl->GetKind() != HDL_ANCHOR_TR; if ((rSh.IsInsideSelectedObj(aDocPos) || bHitHandle) && @@ -2764,30 +2768,30 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) SwEditWin::nDDStartPosY = aDocPos.Y(); SwEditWin::nDDStartPosX = aDocPos.X(); } - bFrmDrag = TRUE; + bFrmDrag = sal_True; } - bNoInterrupt = FALSE; + bNoInterrupt = sal_False; return; } } } } - BOOL bExecHyperlinks = rView.GetDocShell()->IsReadOnly(); + sal_Bool bExecHyperlinks = rView.GetDocShell()->IsReadOnly(); if ( !bExecHyperlinks ) { SvtSecurityOptions aSecOpts; - const BOOL bSecureOption = aSecOpts.IsOptionSet( SvtSecurityOptions::E_CTRLCLICK_HYPERLINK ); + const sal_Bool bSecureOption = aSecOpts.IsOptionSet( SvtSecurityOptions::E_CTRLCLICK_HYPERLINK ); if ( ( bSecureOption && rMEvt.GetModifier() == KEY_MOD1 ) || ( !bSecureOption && rMEvt.GetModifier() != KEY_MOD1 ) ) - bExecHyperlinks = TRUE; + bExecHyperlinks = sal_True; } - BYTE nNumberOfClicks = static_cast< BYTE >(rMEvt.GetClicks() % 4); + sal_uInt8 nNumberOfClicks = static_cast< sal_uInt8 >(rMEvt.GetClicks() % 4); if ( 0 == nNumberOfClicks && 0 < rMEvt.GetClicks() ) nNumberOfClicks = 4; - BOOL bExecDrawTextLink = FALSE; + sal_Bool bExecDrawTextLink = sal_False; switch ( rMEvt.GetModifier() + rMEvt.GetButtons() ) { @@ -2809,7 +2813,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) pSdrView->PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt); if (aVEvt.eEvent == SDREVENT_EXECUTEURL) - bExecDrawTextLink = TRUE; + bExecDrawTextLink = sal_True; } // only try to select frame, if pointer already was @@ -2826,12 +2830,12 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) rView.NoRotate(); rSh.HideCrsr(); - BOOL bUnLockView = !rSh.IsViewLocked(); - rSh.LockView( TRUE ); - BOOL bSelObj = rSh.SelectObj( aDocPos, + sal_Bool bUnLockView = !rSh.IsViewLocked(); + rSh.LockView( sal_True ); + sal_Bool bSelObj = rSh.SelectObj( aDocPos, rMEvt.IsMod1() ? SW_ENTER_GROUP : 0); if( bUnLockView ) - rSh.LockView( FALSE ); + rSh.LockView( sal_False ); if( bSelObj ) { @@ -2850,13 +2854,13 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) } rSh.EnterSelFrmMode( &aDocPos ); - bFrmDrag = TRUE; + bFrmDrag = sal_True; UpdatePointer( aDocPos, rMEvt.GetModifier() ); } return; } else - bOnlyText = static_cast< BOOL >(rSh.IsObjSelectable( aDocPos )); + bOnlyText = static_cast< sal_Bool >(rSh.IsObjSelectable( aDocPos )); if (!rView.GetDrawFuncPtr()) rSh.ShowCrsr(); @@ -2881,9 +2885,9 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) } else { - BOOL bUnLockView = !rSh.IsViewLocked(); - rSh.LockView( TRUE ); - BYTE nFlag = rMEvt.IsShift() ? SW_ADD_SELECT :0; + sal_Bool bUnLockView = !rSh.IsViewLocked(); + rSh.LockView( sal_True ); + sal_uInt8 nFlag = rMEvt.IsShift() ? SW_ADD_SELECT :0; if( rMEvt.IsMod1() ) nFlag = nFlag | SW_ENTER_GROUP; @@ -2894,18 +2898,18 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) rView.AttrChangedNotify(&rSh); } - BOOL bSelObj = rSh.SelectObj( aDocPos, nFlag ); + sal_Bool bSelObj = rSh.SelectObj( aDocPos, nFlag ); if( bUnLockView ) - rSh.LockView( FALSE ); + rSh.LockView( sal_False ); if( !bSelObj ) { // move cursor here so that it is not drawn in the // frame first; ShowCrsr() happens in LeaveSelFrmMode() - bValidCrsrPos = !(CRSR_POSCHG & (rSh.*rSh.fnSetCrsr)(&aDocPos,FALSE)); + bValidCrsrPos = !(CRSR_POSCHG & (rSh.*rSh.fnSetCrsr)(&aDocPos,sal_False)); rSh.LeaveSelFrmMode(); rView.AttrChangedNotify( &rSh ); - bCallBase = FALSE; + bCallBase = sal_False; } else { @@ -2913,7 +2917,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) rSh.EnterSelFrmMode( &aDocPos ); rSh.SelFlyGrabCrsr(); rSh.MakeSelVisible(); - bFrmDrag = TRUE; + bFrmDrag = sal_True; if( rSh.IsFrmSelected() && rView.GetDrawFuncPtr() ) { @@ -2932,7 +2936,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) } case 2: { - bFrmDrag = FALSE; + bFrmDrag = sal_False; if ( !bIsDocReadOnly && rSh.IsInsideSelectedObj(aDocPos) && 0 == rSh.IsSelObjProtected( FLYPROTECT_CONTENT|FLYPROTECT_PARENT ) ) @@ -2978,7 +2982,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) return; SwField *pFld; - BOOL bFtn = FALSE; + sal_Bool bFtn = sal_False; if( !bIsDocReadOnly && ( 0 != ( pFld = rSh.GetCurFld() ) || @@ -2989,7 +2993,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) GetView().GetViewFrame()->GetBindings().Execute( FN_EDIT_FOOTNOTE ); else { - USHORT nTypeId = pFld->GetTypeId(); + sal_uInt16 nTypeId = pFld->GetTypeId(); SfxViewFrame* pVFrame = GetView().GetViewFrame(); switch( nTypeId ) { @@ -2997,8 +3001,8 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) case TYP_SCRIPTFLD: { // if it's a Readonly region, status has to be enabled - USHORT nSlot = TYP_POSTITFLD == nTypeId ? FN_POSTIT : FN_JAVAEDIT; - SfxBoolItem aItem(nSlot, TRUE); + sal_uInt16 nSlot = TYP_POSTITFLD == nTypeId ? FN_POSTIT : FN_JAVAEDIT; + SfxBoolItem aItem(nSlot, sal_True); pVFrame->GetBindings().SetState(aItem); pVFrame->GetBindings().Execute(nSlot); break; @@ -3026,13 +3030,13 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) } else rSh.SelWrd( &aDocPos ); - bHoldSelection = TRUE; + bHoldSelection = sal_True; return; } case 3: case 4: { - bFrmDrag = FALSE; + bFrmDrag = sal_False; // in extended mode double and triple // click has no effect. if ( rSh.IsExtMode() ) @@ -3058,7 +3062,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) if ( bMod ) rSh.LeaveAddMode(); - bHoldSelection = TRUE; + bHoldSelection = sal_True; return; } @@ -3069,7 +3073,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) case MOUSE_LEFT + KEY_SHIFT: case MOUSE_LEFT + KEY_SHIFT + KEY_MOD1: { - BOOL bLockView = bWasShdwCrsr; + sal_Bool bLockView = bWasShdwCrsr; switch ( rMEvt.GetModifier() ) { @@ -3087,7 +3091,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) rSh.EnterSelFrmMode( &aDocPos ); SwEditWin::nDDStartPosY = aDocPos.Y(); SwEditWin::nDDStartPosX = aDocPos.X(); - bFrmDrag = TRUE; + bFrmDrag = sal_True; return; } } @@ -3095,8 +3099,8 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) else if( rSh.IsSelFrmMode() && rSh.GetDrawView()->PickHandle( aDocPos )) { - bFrmDrag = TRUE; - bNoInterrupt = FALSE; + bFrmDrag = sal_True; + bNoInterrupt = sal_False; return; } } @@ -3116,7 +3120,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) rSh.EnterSelFrmMode( &aDocPos ); SwEditWin::nDDStartPosY = aDocPos.Y(); SwEditWin::nDDStartPosX = aDocPos.X(); - bFrmDrag = TRUE; + bFrmDrag = sal_True; return; } } @@ -3124,8 +3128,8 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) else if( rSh.IsSelFrmMode() && rSh.GetDrawView()->PickHandle( aDocPos )) { - bFrmDrag = TRUE; - bNoInterrupt = FALSE; + bFrmDrag = sal_True; + bNoInterrupt = sal_False; return; } else @@ -3133,15 +3137,15 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) if ( !rSh.IsAddMode() && !rSh.IsExtMode() && !rSh.IsBlockMode() ) { rSh.PushMode(); - bModePushed = TRUE; + bModePushed = sal_True; - BOOL bUnLockView = !rSh.IsViewLocked(); - rSh.LockView( TRUE ); + sal_Bool bUnLockView = !rSh.IsViewLocked(); + rSh.LockView( sal_True ); rSh.EnterAddMode(); if( bUnLockView ) - rSh.LockView( FALSE ); + rSh.LockView( sal_False ); } - bCallBase = FALSE; + bCallBase = sal_False; } } break; @@ -3150,14 +3154,14 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) if ( !rSh.IsAddMode() && !rSh.IsExtMode() && !rSh.IsBlockMode() ) { rSh.PushMode(); - bModePushed = TRUE; - BOOL bUnLockView = !rSh.IsViewLocked(); - rSh.LockView( TRUE ); + bModePushed = sal_True; + sal_Bool bUnLockView = !rSh.IsViewLocked(); + rSh.LockView( sal_True ); rSh.EnterBlockMode(); if( bUnLockView ) - rSh.LockView( FALSE ); + rSh.LockView( sal_False ); } - bCallBase = FALSE; + bCallBase = sal_False; } break; case KEY_SHIFT: @@ -3175,7 +3179,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) { rSh.LeaveSelFrmMode(); rView.AttrChangedNotify(&rSh); - bFrmDrag = FALSE; + bFrmDrag = sal_False; } } else @@ -3184,7 +3188,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) rSh.EnterSelFrmMode( &aDocPos ); SwEditWin::nDDStartPosY = aDocPos.Y(); SwEditWin::nDDStartPosX = aDocPos.X(); - bFrmDrag = TRUE; + bFrmDrag = sal_True; return; } } @@ -3197,7 +3201,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) rSh.EnterSelFrmMode( &aDocPos ); SwEditWin::nDDStartPosY = aDocPos.Y(); SwEditWin::nDDStartPosX = aDocPos.X(); - bFrmDrag = TRUE; + bFrmDrag = sal_True; return; } if ( rSh.IsSelFrmMode() ) @@ -3205,18 +3209,18 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) rSh.UnSelectFrm(); rSh.LeaveSelFrmMode(); rView.AttrChangedNotify(&rSh); - bFrmDrag = FALSE; + bFrmDrag = sal_False; } if ( !rSh.IsExtMode() ) { // don't start a selection when an // URL field or a graphic is clicked - BOOL bSttSelect = rSh.HasSelection() || + sal_Bool bSttSelect = rSh.HasSelection() || Pointer(POINTER_REFHAND) != GetPointer(); if( !bSttSelect ) { - bSttSelect = TRUE; + bSttSelect = sal_True; if( bExecHyperlinks ) { SwContentAtPos aCntntAtPos( @@ -3228,12 +3232,12 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) if( !rSh.IsViewLocked() && !rSh.IsReadOnlyAvailable() && aCntntAtPos.IsInProtectSect() ) - bLockView = TRUE; + bLockView = sal_True; - bSttSelect = FALSE; + bSttSelect = sal_False; } else if( rSh.IsURLGrfAtPos( aDocPos )) - bSttSelect = FALSE; + bSttSelect = sal_False; } } @@ -3241,7 +3245,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) rSh.SttSelect(); } } - bCallBase = FALSE; + bCallBase = sal_False; break; } default: @@ -3249,10 +3253,10 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) { SwContentAtPos aCntntAtPos( SwContentAtPos::SW_CLICKFIELD | SwContentAtPos::SW_INETATTR ); - if( rSh.GetContentAtPos( aDocPos, aCntntAtPos, FALSE ) && + if( rSh.GetContentAtPos( aDocPos, aCntntAtPos, sal_False ) && !rSh.IsReadOnlyAvailable() && aCntntAtPos.IsInProtectSect() ) - bLockView = TRUE; + bLockView = sal_True; } } @@ -3262,19 +3266,19 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) rSh.ClearGCAttr(); } - BOOL bOverSelect = rSh.ChgCurrPam( aDocPos ), bOverURLGrf = FALSE; + sal_Bool bOverSelect = rSh.ChgCurrPam( aDocPos ), bOverURLGrf = sal_False; if( !bOverSelect ) bOverURLGrf = bOverSelect = 0 != rSh.IsURLGrfAtPos( aDocPos ); if ( !bOverSelect ) { - const BOOL bTmpNoInterrupt = bNoInterrupt; - bNoInterrupt = FALSE; + const sal_Bool bTmpNoInterrupt = bNoInterrupt; + bNoInterrupt = sal_False; if( !rSh.IsViewLocked() && bLockView ) - rSh.LockView( TRUE ); + rSh.LockView( sal_True ); else - bLockView = FALSE; + bLockView = sal_False; int nTmpSetCrsr = 0; @@ -3283,7 +3287,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) MV_KONTEXT( &rSh ); nTmpSetCrsr = (rSh.*rSh.fnSetCrsr)(&aDocPos,bOnlyText); bValidCrsrPos = !(CRSR_POSCHG & nTmpSetCrsr); - bCallBase = FALSE; + bCallBase = sal_False; } // notify the edit window that from now on we do not use the input language @@ -3291,7 +3295,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) SetUseInputLanguage( sal_False ); if( bLockView ) - rSh.LockView( FALSE ); + rSh.LockView( sal_False ); bNoInterrupt = bTmpNoInterrupt; } @@ -3308,7 +3312,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) if( !rSh.IsFrmSelected() ) rSh.GotoNextFly(); rSh.EnterSelFrmMode(); - bCallBase = FALSE; + bCallBase = sal_False; } } // don't reset here any longer so that, in case through MouseMove @@ -3332,7 +3336,7 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) //ignore key modifiers for format paintbrush { - BOOL bExecFormatPaintbrush = pApplyTempl && pApplyTempl->pFormatClipboard + sal_Bool bExecFormatPaintbrush = pApplyTempl && pApplyTempl->pFormatClipboard && pApplyTempl->pFormatClipboard->HasContent(); if( bExecFormatPaintbrush ) rMEvt = MouseEvent( _rMEvt.GetPosPixel(), _rMEvt.GetClicks(), @@ -3348,7 +3352,7 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) if( pShadCrsr && 0 != (rMEvt.GetModifier() + rMEvt.GetButtons() ) ) delete pShadCrsr, pShadCrsr = 0; - BOOL bIsDocReadOnly = rView.GetDocShell()->IsReadOnly(); + sal_Bool bIsDocReadOnly = rView.GetDocShell()->IsReadOnly(); SET_CURR_SHELL( &rSh ); @@ -3377,7 +3381,7 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) } const Point aOldPt( rSh.VisArea().Pos() ); - const BOOL bInsWin = rSh.VisArea().IsInside( aDocPt ); + const sal_Bool bInsWin = rSh.VisArea().IsInside( aDocPt ); if( pShadCrsr && !bInsWin ) delete pShadCrsr, pShadCrsr = 0; @@ -3437,13 +3441,13 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) } } - BYTE nMouseTabCol; + sal_uInt8 nMouseTabCol; if( !bIsDocReadOnly && bInsWin && !pApplyTempl && !rSh.IsInSelect() ) { if ( SW_TABCOL_NONE != (nMouseTabCol = rSh.WhichMouseTabCol( aDocPt ) ) && !rSh.IsObjSelectable( aDocPt ) ) { - USHORT nPointer = USHRT_MAX; + sal_uInt16 nPointer = USHRT_MAX; bool bChkTblSel = false; switch ( nMouseTabCol ) @@ -3491,7 +3495,7 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) { // i#42921 - consider vertical mode SwTxtNode* pNodeAtPos = rSh.GetNumRuleNodeAtPos( aDocPt ); - const USHORT nPointer = + const sal_uInt16 nPointer = rSh.IsVerticalModeAtNdAndPos( *pNodeAtPos, aDocPt ) ? POINTER_VSIZEBAR : POINTER_HSIZEBAR; @@ -3501,7 +3505,7 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) } } - BOOL bDelShadCrsr = TRUE; + sal_Bool bDelShadCrsr = sal_True; switch ( rMEvt.GetModifier() + rMEvt.GetButtons() ) { @@ -3551,10 +3555,10 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) EnterArea(); if ( rView.GetDrawFuncPtr() ) { - pSdrView->SetOrtho(FALSE); + pSdrView->SetOrtho(sal_False); rView.GetDrawFuncPtr()->MouseMove( rMEvt ); } - bIsInMove = TRUE; + bIsInMove = sal_True; } return; } @@ -3585,7 +3589,7 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) eSdrMoveHdl = pHdl ? pHdl->GetKind() : HDL_MOVE; } - USHORT nEvent = HDL_MOVE == eSdrMoveHdl + sal_uInt16 nEvent = HDL_MOVE == eSdrMoveHdl ? SW_EVENT_FRM_MOVE : SW_EVENT_FRM_RESIZE; @@ -3596,7 +3600,7 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) aRszMvHdlPt != aDocPt ) { aRszMvHdlPt = aDocPt; - USHORT nPos = 0; + sal_uInt16 nPos = 0; String sRet; SbxArrayRef xArgs = new SbxArray; SbxVariableRef xVar = new SbxVariable; @@ -3606,7 +3610,7 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) if( SW_EVENT_FRM_RESIZE == nEvent ) { xVar = new SbxVariable; - xVar->PutUShort( static_cast< UINT16 >(eSdrMoveHdl) ); + xVar->PutUShort( static_cast< sal_uInt16 >(eSdrMoveHdl) ); xArgs->Put( &xVar, ++nPos ); } @@ -3634,17 +3638,17 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) if ( rMEvt.IsShift() ) { - pSdrView->SetOrtho(TRUE); - pSdrView->SetAngleSnapEnabled(TRUE); + pSdrView->SetOrtho(sal_True); + pSdrView->SetAngleSnapEnabled(sal_True); } else { - pSdrView->SetOrtho(FALSE); - pSdrView->SetAngleSnapEnabled(FALSE); + pSdrView->SetOrtho(sal_False); + pSdrView->SetAngleSnapEnabled(sal_False); } (rSh.*rSh.fnDrag)( &aDocPt, rMEvt.IsShift() ); - bIsInMove = TRUE; + bIsInMove = sal_True; } else if( bIsDocReadOnly ) break; @@ -3666,9 +3670,9 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) if ( pSdrView ) { if ( rMEvt.IsShift() ) - pSdrView->SetOrtho(TRUE); + pSdrView->SetOrtho(sal_True); else - pSdrView->SetOrtho(FALSE); + pSdrView->SetOrtho(sal_False); } if ( !bInsWin ) { @@ -3683,14 +3687,14 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) rMEvt.GetModifier() + rMEvt.GetButtons() ) && rSh.Is_FnDragEQBeginDrag() && !rSh.IsAddMode() )) { - (rSh.*rSh.fnDrag)( &aDocPt,FALSE ); + (rSh.*rSh.fnDrag)( &aDocPt,sal_False ); - bValidCrsrPos = !(CRSR_POSCHG & (rSh.*rSh.fnSetCrsr)(&aDocPt,FALSE)); + bValidCrsrPos = !(CRSR_POSCHG & (rSh.*rSh.fnSetCrsr)(&aDocPt,sal_False)); EnterArea(); } } } - bDDINetAttr = FALSE; + bDDINetAttr = sal_False; break; case 0: { @@ -3703,7 +3707,7 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) // TODO: do the same thing for redlines SW_REDLINE SwRect aFldRect; SwContentAtPos aCntntAtPos( SwContentAtPos::SW_FIELD); - if( rSh.GetContentAtPos( aDocPt, aCntntAtPos, FALSE, &aFldRect ) ) + if( rSh.GetContentAtPos( aDocPt, aCntntAtPos, sal_False, &aFldRect ) ) { const SwField* pFld = aCntntAtPos.aFnd.pFld; if (pFld->Which()== RES_POSTITFLD) @@ -3722,7 +3726,7 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) case KEY_MOD1: if ( !bInsDraw ) { - BOOL bTstShdwCrsr = TRUE; + sal_Bool bTstShdwCrsr = sal_True; UpdatePointer( aDocPt, rMEvt.GetModifier() ); @@ -3737,7 +3741,7 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) if( pINet || 0 != ( pTmp = pFmt = rSh.GetFmtFromAnyObj( aDocPt ))) { - bTstShdwCrsr = FALSE; + bTstShdwCrsr = sal_False; if( pTmp == pINet ) aSaveCallEvent.Set( pINet ); else @@ -3755,7 +3759,7 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) { if( aLastCallEvent.HasEvent() ) rSh.CallEvent( SFX_EVENT_MOUSEOUT_OBJECT, - aLastCallEvent, TRUE ); + aLastCallEvent, sal_True ); // 0 says that the object doesn't have any table if( !rSh.CallEvent( SFX_EVENT_MOUSEOVER_OBJECT, aSaveCallEvent )) @@ -3766,7 +3770,7 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) { // cursor was on an object rSh.CallEvent( SFX_EVENT_MOUSEOUT_OBJECT, - aLastCallEvent, TRUE ); + aLastCallEvent, sal_True ); } if( bTstShdwCrsr && bInsWin && !bIsDocReadOnly && @@ -3786,8 +3790,8 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) SwViewOption::GetDirectCursorColor() ); if( text::HoriOrientation::RIGHT != eOrient && text::HoriOrientation::CENTER != eOrient ) eOrient = text::HoriOrientation::LEFT; - pShadCrsr->SetPos( aRect.Pos(), aRect.Height(), static_cast< USHORT >(eOrient) ); - bDelShadCrsr = FALSE; + pShadCrsr->SetPos( aRect.Pos(), aRect.Height(), static_cast< sal_uInt16 >(eOrient) ); + bDelShadCrsr = sal_False; } } } @@ -3795,8 +3799,8 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) case MOUSE_LEFT + KEY_MOD2: if( rSh.IsBlockMode() && !rMEvt.IsSynthetic() ) { - (rSh.*rSh.fnDrag)( &aDocPt,FALSE ); - bValidCrsrPos = !(CRSR_POSCHG & (rSh.*rSh.fnSetCrsr)(&aDocPt,FALSE)); + (rSh.*rSh.fnDrag)( &aDocPt,sal_False ); + bValidCrsrPos = !(CRSR_POSCHG & (rSh.*rSh.fnSetCrsr)(&aDocPt,sal_False)); EnterArea(); } break; @@ -3804,7 +3808,7 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) if( bDelShadCrsr && pShadCrsr ) delete pShadCrsr, pShadCrsr = 0; - bWasShdwCrsr = FALSE; + bWasShdwCrsr = sal_False; } /*-------------------------------------------------------------------- @@ -3813,10 +3817,10 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) { - BOOL bCallBase = TRUE; + sal_Bool bCallBase = sal_True; - BOOL bCallShadowCrsr = bWasShdwCrsr; - bWasShdwCrsr = FALSE; + sal_Bool bCallShadowCrsr = bWasShdwCrsr; + bWasShdwCrsr = sal_False; if( pShadCrsr ) delete pShadCrsr, pShadCrsr = 0; @@ -3827,7 +3831,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) eSdrMoveHdl = HDL_USER; // for MoveEvents - reset again // preventively reset - rView.SetTabColFromDoc( FALSE ); + rView.SetTabColFromDoc( sal_False ); rView.SetNumRuleNodeFromDoc(NULL); SwWrtShell &rSh = rView.GetWrtShell(); @@ -3835,11 +3839,11 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) SdrView *pSdrView = rSh.GetDrawView(); if ( pSdrView ) { - pSdrView->SetOrtho(FALSE); + pSdrView->SetOrtho(sal_False); if ( pSdrView->MouseButtonUp( rMEvt,this ) ) { - rSh.GetView().GetViewFrame()->GetBindings().InvalidateAll(FALSE); + rSh.GetView().GetViewFrame()->GetBindings().InvalidateAll(sal_False); return; // SdrView's event evaluated } } @@ -3857,13 +3861,13 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) if ( bDDTimerStarted ) { StopDDTimer( &rSh, aDocPt ); - bMBPressed = FALSE; + bMBPressed = sal_False; if ( rSh.IsSelFrmMode() ) { - (rSh.*rSh.fnEndDrag)( &aDocPt, FALSE ); - bFrmDrag = FALSE; + (rSh.*rSh.fnEndDrag)( &aDocPt, sal_False ); + bFrmDrag = sal_False; } - bNoInterrupt = FALSE; + bNoInterrupt = sal_False; ReleaseMouse(); return; } @@ -3873,7 +3877,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) Point aPnt( pAnchorMarker->GetLastPos() ); DELETEZ( pAnchorMarker ); if( aPnt.X() || aPnt.Y() ) - rSh.FindAnchorPos( aPnt, TRUE ); + rSh.FindAnchorPos( aPnt, sal_True ); } if ( bInsDraw && rView.GetDrawFuncPtr() ) { @@ -3896,7 +3900,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) { rSh.EnterSelFrmMode(); if (!rView.GetDrawFuncPtr()) - StdDrawMode( OBJ_NONE, TRUE ); + StdDrawMode( OBJ_NONE, sal_True ); } else if ( rSh.IsFrmSelected() ) { @@ -3906,7 +3910,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) else { const Point aDocPos( PixelToLogic( aStartPos ) ); - bValidCrsrPos = !(CRSR_POSCHG & (rSh.*rSh.fnSetCrsr)(&aDocPos,FALSE)); + bValidCrsrPos = !(CRSR_POSCHG & (rSh.*rSh.fnSetCrsr)(&aDocPos,sal_False)); rSh.Edit(); } @@ -3915,17 +3919,17 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) else if (rMEvt.GetButtons() == MOUSE_RIGHT && rSh.IsDrawCreate()) rView.GetDrawFuncPtr()->BreakCreate(); // abort drawing - bNoInterrupt = FALSE; + bNoInterrupt = sal_False; ReleaseMouse(); return; } - BOOL bPopMode = FALSE; + sal_Bool bPopMode = sal_False; switch ( rMEvt.GetModifier() + rMEvt.GetButtons() ) { case MOUSE_LEFT: if ( bInsDraw && rSh.IsDrawCreate() ) { - if ( rView.GetDrawFuncPtr() && rView.GetDrawFuncPtr()->MouseButtonUp(rMEvt) == TRUE ) + if ( rView.GetDrawFuncPtr() && rView.GetDrawFuncPtr()->MouseButtonUp(rMEvt) == sal_True ) { rView.GetDrawFuncPtr()->Deactivate(); rView.AttrChangedNotify( &rSh ); @@ -3934,7 +3938,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) if ( rView.GetDrawFuncPtr() && bInsFrm ) StopInsFrm(); } - bCallBase = FALSE; + bCallBase = sal_False; break; } case MOUSE_LEFT + KEY_MOD1: @@ -3964,12 +3968,12 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) if ( aSttPt != aEndPt ) { rSh.StartUndo( UNDO_UI_DRAG_AND_COPY ); - rSh.Copy(&rSh, aSttPt, aEndPt, FALSE); + rSh.Copy(&rSh, aSttPt, aEndPt, sal_False); rSh.EndUndo( UNDO_UI_DRAG_AND_COPY ); } } else - (rSh.*rSh.fnEndDrag)( &aDocPt,FALSE ); + (rSh.*rSh.fnEndDrag)( &aDocPt,sal_False ); } else { @@ -3977,7 +3981,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) const SwFrmFmt* pFlyFmt; const SvxMacro* pMacro; - USHORT nEvent = HDL_MOVE == eOldSdrMoveHdl + sal_uInt16 nEvent = HDL_MOVE == eOldSdrMoveHdl ? SW_EVENT_FRM_MOVE : SW_EVENT_FRM_RESIZE; @@ -3987,7 +3991,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) { const Point aSttPt( PixelToLogic( aStartPos ) ); aRszMvHdlPt = aDocPt; - USHORT nPos = 0; + sal_uInt16 nPos = 0; SbxArrayRef xArgs = new SbxArray; SbxVariableRef xVar = new SbxVariable; xVar->PutString( pFlyFmt->GetName() ); @@ -3996,7 +4000,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) if( SW_EVENT_FRM_RESIZE == nEvent ) { xVar = new SbxVariable; - xVar->PutUShort( static_cast< UINT16 >(eOldSdrMoveHdl) ); + xVar->PutUShort( static_cast< sal_uInt16 >(eOldSdrMoveHdl) ); xArgs->Put( &xVar, ++nPos ); } @@ -4018,82 +4022,82 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) CaptureMouse(); } } - (rSh.*rSh.fnEndDrag)( &aDocPt,FALSE ); + (rSh.*rSh.fnEndDrag)( &aDocPt,sal_False ); } - bFrmDrag = FALSE; - bCallBase = FALSE; + bFrmDrag = sal_False; + bCallBase = sal_False; break; } - bPopMode = TRUE; + bPopMode = sal_True; // no break case MOUSE_LEFT + KEY_SHIFT: if (rSh.IsSelFrmMode()) { - (rSh.*rSh.fnEndDrag)( &aDocPt, FALSE ); - bFrmDrag = FALSE; - bCallBase = FALSE; + (rSh.*rSh.fnEndDrag)( &aDocPt, sal_False ); + bFrmDrag = sal_False; + bCallBase = sal_False; break; } if( bHoldSelection ) { // the EndDrag should be called in any case - bHoldSelection = FALSE; - (rSh.*rSh.fnEndDrag)( &aDocPt, FALSE ); + bHoldSelection = sal_False; + (rSh.*rSh.fnEndDrag)( &aDocPt, sal_False ); } else { if ( !rSh.IsInSelect() && rSh.ChgCurrPam( aDocPt ) ) { - const BOOL bTmpNoInterrupt = bNoInterrupt; - bNoInterrupt = FALSE; + const sal_Bool bTmpNoInterrupt = bNoInterrupt; + bNoInterrupt = sal_False; { // create only temporary move context because otherwise // the query to the content form doesn't work!!! MV_KONTEXT( &rSh ); const Point aDocPos( PixelToLogic( aStartPos ) ); - bValidCrsrPos = !(CRSR_POSCHG & (rSh.*rSh.fnSetCrsr)(&aDocPos,FALSE)); + bValidCrsrPos = !(CRSR_POSCHG & (rSh.*rSh.fnSetCrsr)(&aDocPos,sal_False)); } bNoInterrupt = bTmpNoInterrupt; } else { - BOOL bInSel = rSh.IsInSelect(); - (rSh.*rSh.fnEndDrag)( &aDocPt, FALSE ); + sal_Bool bInSel = rSh.IsInSelect(); + (rSh.*rSh.fnEndDrag)( &aDocPt, sal_False ); // Internetfield? --> call link (load doc!!) if( !bInSel ) { - USHORT nFilter = URLLOAD_NOFILTER; + sal_uInt16 nFilter = URLLOAD_NOFILTER; if( KEY_MOD1 == rMEvt.GetModifier() ) nFilter |= URLLOAD_NEWVIEW; - BOOL bExecHyperlinks = rView.GetDocShell()->IsReadOnly(); + sal_Bool bExecHyperlinks = rView.GetDocShell()->IsReadOnly(); if ( !bExecHyperlinks ) { SvtSecurityOptions aSecOpts; - const BOOL bSecureOption = aSecOpts.IsOptionSet( SvtSecurityOptions::E_CTRLCLICK_HYPERLINK ); + const sal_Bool bSecureOption = aSecOpts.IsOptionSet( SvtSecurityOptions::E_CTRLCLICK_HYPERLINK ); if ( ( bSecureOption && rMEvt.GetModifier() == KEY_MOD1 ) || ( !bSecureOption && rMEvt.GetModifier() != KEY_MOD1 ) ) - bExecHyperlinks = TRUE; + bExecHyperlinks = sal_True; } - const BOOL bExecSmarttags = rMEvt.GetModifier() == KEY_MOD1; + const sal_Bool bExecSmarttags = rMEvt.GetModifier() == KEY_MOD1; if(pApplyTempl) - bExecHyperlinks = FALSE; + bExecHyperlinks = sal_False; SwContentAtPos aCntntAtPos( SwContentAtPos::SW_CLICKFIELD | SwContentAtPos::SW_INETATTR | SwContentAtPos::SW_SMARTTAG | SwContentAtPos::SW_FORMCTRL); - if( rSh.GetContentAtPos( aDocPt, aCntntAtPos, TRUE ) ) + if( rSh.GetContentAtPos( aDocPt, aCntntAtPos, sal_True ) ) { - BOOL bViewLocked = rSh.IsViewLocked(); + sal_Bool bViewLocked = rSh.IsViewLocked(); if( !bViewLocked && !rSh.IsReadOnlyAvailable() && aCntntAtPos.IsInProtectSect() ) - rSh.LockView( TRUE ); + rSh.LockView( sal_True ); ReleaseMouse(); @@ -4135,12 +4139,12 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) } rSh.LockView( bViewLocked ); - bCallShadowCrsr = FALSE; + bCallShadowCrsr = sal_False; } else { aCntntAtPos = SwContentAtPos( SwContentAtPos::SW_FTN ); - if( !rSh.GetContentAtPos( aDocPt, aCntntAtPos, TRUE ) && bExecHyperlinks ) + if( !rSh.GetContentAtPos( aDocPt, aCntntAtPos, sal_True ) && bExecHyperlinks ) { SdrViewEvent aVEvt; @@ -4157,14 +4161,14 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) String sTarget(pField->GetTargetFrame()); ::LoadURL( sURL, &rSh, nFilter, &sTarget); } - bCallShadowCrsr = FALSE; + bCallShadowCrsr = sal_False; } else { // hit graphic ReleaseMouse(); if( rSh.ClickToINetGrf( aDocPt, nFilter )) - bCallShadowCrsr = FALSE; + bCallShadowCrsr = sal_False; } } } @@ -4176,14 +4180,20 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) !GetConnectMetaFile() && rSh.VisArea().IsInside( aDocPt )) { - if( UNDO_INS_FROM_SHADOWCRSR == rSh.GetUndoIds() ) - rSh.Undo(); + SwUndoId nLastUndoId(UNDO_EMPTY); + if (rSh.GetLastUndoInfo(0, & nLastUndoId)) + { + if (UNDO_INS_FROM_SHADOWCRSR == nLastUndoId) + { + rSh.Undo(); + } + } SwFillMode eMode = (SwFillMode)rSh.GetViewOptions()->GetShdwCrsrFillMode(); rSh.SetShadowCrsrPos( aDocPt, eMode ); } } } - bCallBase = FALSE; + bCallBase = sal_False; } @@ -4191,8 +4201,8 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) if ( bPopMode && bModePushed ) { rSh.PopMode(); - bModePushed = FALSE; - bCallBase = FALSE; + bModePushed = sal_False; + bCallBase = sal_False; } break; @@ -4230,7 +4240,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) } else if( pApplyTempl->nColor ) { - USHORT nId = 0; + sal_uInt16 nId = 0; switch( pApplyTempl->nColor ) { case SID_ATTR_CHAR_COLOR_EXT: @@ -4257,8 +4267,8 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) rSh.EnterStdMode(); rSh.SetVisCrsr(aDocPt); - pApplyTempl->bUndo = TRUE; - bCallBase = FALSE; + pApplyTempl->bUndo = sal_True; + bCallBase = sal_False; aTemplateTimer.Stop(); } else if(rMEvt.GetClicks() == 1) @@ -4278,8 +4288,8 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) & eSelection ) && !rSh.HasReadonlySel() ) { rSh.SetTxtFmtColl( pApplyTempl->aColl.pTxtColl ); - pApplyTempl->bUndo = TRUE; - bCallBase = FALSE; + pApplyTempl->bUndo = sal_True; + bCallBase = sal_False; if ( pApplyTempl->aColl.pTxtColl ) aStyleName = pApplyTempl->aColl.pTxtColl->GetName(); } @@ -4292,8 +4302,8 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) rSh.UnSetVisCrsr(); rSh.EnterStdMode(); rSh.SetVisCrsr(aDocPt); - pApplyTempl->bUndo = TRUE; - bCallBase = FALSE; + pApplyTempl->bUndo = sal_True; + bCallBase = sal_False; if ( pApplyTempl->aColl.pCharFmt ) aStyleName = pApplyTempl->aColl.pCharFmt->GetName(); } @@ -4303,9 +4313,9 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) const SwFrmFmt* pFmt = rSh.GetFmtFromObj( aDocPt ); if(PTR_CAST(SwFlyFrmFmt, pFmt)) { - rSh.SetFrmFmt( pApplyTempl->aColl.pFrmFmt, FALSE, &aDocPt ); - pApplyTempl->bUndo = TRUE; - bCallBase = FALSE; + rSh.SetFrmFmt( pApplyTempl->aColl.pFrmFmt, sal_False, &aDocPt ); + pApplyTempl->bUndo = sal_True; + bCallBase = sal_False; if( pApplyTempl->aColl.pFrmFmt ) aStyleName = pApplyTempl->aColl.pFrmFmt->GetName(); } @@ -4316,7 +4326,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) rSh.ChgCurPageDesc( *pApplyTempl->aColl.pPageDesc ); if ( pApplyTempl->aColl.pPageDesc ) aStyleName = pApplyTempl->aColl.pPageDesc->GetName(); - bCallBase = FALSE; + bCallBase = sal_False; break; case SFX_STYLE_FAMILY_PSEUDO: if( !rSh.HasReadonlySel() ) @@ -4324,8 +4334,8 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) rSh.SetCurNumRule( *pApplyTempl->aColl.pNumRule, false, pApplyTempl->aColl.pNumRule->GetDefaultListId() ); - bCallBase = FALSE; - pApplyTempl->bUndo = TRUE; + bCallBase = sal_False; + pApplyTempl->bUndo = sal_True; if( pApplyTempl->aColl.pNumRule ) aStyleName = pApplyTempl->aColl.pNumRule->GetName(); } @@ -4341,7 +4351,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) { SfxRequest aReq( rView.GetViewFrame(), SID_STYLE_APPLY ); aReq.AppendItem( SfxStringItem( SID_STYLE_APPLY, aStyleName ) ); - aReq.AppendItem( SfxUInt16Item( SID_STYLE_FAMILY, (USHORT) pApplyTempl->eType ) ); + aReq.AppendItem( SfxUInt16Item( SID_STYLE_FAMILY, (sal_uInt16) pApplyTempl->eType ) ); aReq.Done(); } } @@ -4351,12 +4361,12 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) ReleaseMouse(); // Only processed MouseEvents arrive here; only at these the moduses can // be resetted. - bMBPressed = FALSE; + bMBPressed = sal_False; //sicherheitshalber aufrufen, da jetzt das Selektieren bestimmt zu Ende ist. //Andernfalls koennte der Timeout des Timers Kummer machen. EnterArea(); - bNoInterrupt = FALSE; + bNoInterrupt = sal_False; if (bCallBase) Window::MouseButtonUp(rMEvt); @@ -4368,7 +4378,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) void SwEditWin::SetApplyTemplate(const SwApplyTemplate &rTempl) { - static BOOL bIdle = FALSE; + static sal_Bool bIdle = sal_False; DELETEZ(pApplyTempl); SwWrtShell &rSh = rView.GetWrtShell(); @@ -4376,25 +4386,25 @@ void SwEditWin::SetApplyTemplate(const SwApplyTemplate &rTempl) { pApplyTempl = new SwApplyTemplate( rTempl ); SetPointer( POINTER_FILL );//@todo #i20119# maybe better a new brush pointer here in future - rSh.NoEdit( FALSE ); + rSh.NoEdit( sal_False ); bIdle = rSh.GetViewOptions()->IsIdle(); - ((SwViewOption *)rSh.GetViewOptions())->SetIdle( FALSE ); + ((SwViewOption *)rSh.GetViewOptions())->SetIdle( sal_False ); } else if(rTempl.nColor) { pApplyTempl = new SwApplyTemplate( rTempl ); SetPointer( POINTER_FILL ); - rSh.NoEdit( FALSE ); + rSh.NoEdit( sal_False ); bIdle = rSh.GetViewOptions()->IsIdle(); - ((SwViewOption *)rSh.GetViewOptions())->SetIdle( FALSE ); + ((SwViewOption *)rSh.GetViewOptions())->SetIdle( sal_False ); } else if( rTempl.eType ) { pApplyTempl = new SwApplyTemplate( rTempl ); SetPointer( POINTER_FILL ); - rSh.NoEdit( FALSE ); + rSh.NoEdit( sal_False ); bIdle = rSh.GetViewOptions()->IsIdle(); - ((SwViewOption *)rSh.GetViewOptions())->SetIdle( FALSE ); + ((SwViewOption *)rSh.GetViewOptions())->SetIdle( sal_False ); } else { @@ -4406,7 +4416,7 @@ void SwEditWin::SetApplyTemplate(const SwApplyTemplate &rTempl) rSh.Edit(); } - static USHORT const aInva[] = + static sal_uInt16 aInva[] = { SID_STYLE_WATERCAN, SID_ATTR_CHAR_COLOR_EXT, @@ -4443,8 +4453,8 @@ SwEditWin::SwEditWin(Window *pParent, SwView &rMyView): nInsFrmColCount( 1 ), eDrawMode(OBJ_NONE), - bLockInput(FALSE), - bObjectSelect( FALSE ), + bLockInput(sal_False), + bObjectSelect( sal_False ), nKS_NUMDOWN_Count(0), nKS_NUMINDENTINC_Count(0) { @@ -4453,7 +4463,7 @@ SwEditWin::SwEditWin(Window *pParent, SwView &rMyView): SetDialogControlFlags( WINDOW_DLGCTRL_RETURN | WINDOW_DLGCTRL_WANTFOCUS ); bLinkRemoved = bMBPressed = bInsDraw = bInsFrm = - bIsInDrag = bOldIdle = bOldIdleSet = bChainMode = bWasShdwCrsr = FALSE; + bIsInDrag = bOldIdle = bOldIdleSet = bChainMode = bWasShdwCrsr = sal_False; // initially use the input language bUseInputLanguage = sal_True; @@ -4462,7 +4472,7 @@ SwEditWin::SwEditWin(Window *pParent, SwView &rMyView): SetPointer( POINTER_TEXT ); aTimer.SetTimeoutHdl(LINK(this, SwEditWin, TimerHandler)); - bTblInsDelMode = FALSE; + bTblInsDelMode = sal_False; aKeyInputTimer.SetTimeout( 3000 ); aKeyInputTimer.SetTimeoutHdl(LINK(this, SwEditWin, KeyInputTimerHandler)); @@ -4491,7 +4501,7 @@ SwEditWin::~SwEditWin() delete pRowColumnSelectionStart; if( pQuickHlpData->bClear && rView.GetWrtShellPtr() ) pQuickHlpData->Stop( rView.GetWrtShell() ); - bExecuteDrag = FALSE; + bExecuteDrag = sal_False; delete pApplyTempl; rView.SetDrawFuncPtr(NULL); @@ -4509,7 +4519,7 @@ SwEditWin::~SwEditWin() void SwEditWin::EnterDrawTextMode( const Point& aDocPos ) { - if ( rView.EnterDrawTextMode(aDocPos) == TRUE ) + if ( rView.EnterDrawTextMode(aDocPos) == sal_True ) { if (rView.GetDrawFuncPtr()) { @@ -4526,7 +4536,7 @@ void SwEditWin::EnterDrawTextMode( const Point& aDocPos ) * Description: turn on DrawMode ******************************************************************************/ -BOOL SwEditWin::EnterDrawMode(const MouseEvent& rMEvt, const Point& aDocPos) +sal_Bool SwEditWin::EnterDrawMode(const MouseEvent& rMEvt, const Point& aDocPos) { SwWrtShell &rSh = rView.GetWrtShell(); SdrView *pSdrView = rSh.GetDrawView(); @@ -4534,17 +4544,17 @@ BOOL SwEditWin::EnterDrawMode(const MouseEvent& rMEvt, const Point& aDocPos) if ( rView.GetDrawFuncPtr() ) { if (rSh.IsDrawCreate()) - return TRUE; + return sal_True; - BOOL bRet = rView.GetDrawFuncPtr()->MouseButtonDown( rMEvt ); + sal_Bool bRet = rView.GetDrawFuncPtr()->MouseButtonDown( rMEvt ); rView.AttrChangedNotify( &rSh ); return bRet; } if ( pSdrView && pSdrView->IsTextEdit() ) { - BOOL bUnLockView = !rSh.IsViewLocked(); - rSh.LockView( TRUE ); + sal_Bool bUnLockView = !rSh.IsViewLocked(); + rSh.LockView( sal_True ); rSh.EndTextEdit(); // clicked aside, end Edit rSh.SelectObj( aDocPos ); @@ -4554,17 +4564,17 @@ BOOL SwEditWin::EnterDrawMode(const MouseEvent& rMEvt, const Point& aDocPos) { SwEditWin::nDDStartPosY = aDocPos.Y(); SwEditWin::nDDStartPosX = aDocPos.X(); - bFrmDrag = TRUE; + bFrmDrag = sal_True; } if( bUnLockView ) - rSh.LockView( FALSE ); + rSh.LockView( sal_False ); rView.AttrChangedNotify( &rSh ); - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } -BOOL SwEditWin::IsDrawSelMode() +sal_Bool SwEditWin::IsDrawSelMode() { return IsObjectSelect(); } @@ -4608,20 +4618,20 @@ void SwEditWin::Command( const CommandEvent& rCEvt ) // to deactivate the inplace client without any problem regarding parent // windows and code on the stack. SfxInPlaceClient* pIPClient = rSh.GetSfxViewShell()->GetIPClient(); - BOOL bIsOleActive = ( pIPClient && pIPClient->IsObjectInPlaceActive() ); + sal_Bool bIsOleActive = ( pIPClient && pIPClient->IsObjectInPlaceActive() ); if ( bIsOleActive && ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU )) { rSh.FinishOLEObj(); return; } - BOOL bCallBase = TRUE; + sal_Bool bCallBase = sal_True; switch ( rCEvt.GetCommand() ) { case COMMAND_CONTEXTMENU: { - const USHORT nId = SwInputChild::GetChildWindowId(); + const sal_uInt16 nId = SwInputChild::GetChildWindowId(); SwInputChild* pChildWin = (SwInputChild*)GetView().GetViewFrame()-> GetChildWindow( nId ); @@ -4634,11 +4644,11 @@ void SwEditWin::Command( const CommandEvent& rCEvt ) SET_CURR_SHELL( &rSh ); if (!pApplyTempl) { - if (bNoInterrupt == TRUE) + if (bNoInterrupt == sal_True) { ReleaseMouse(); - bNoInterrupt = FALSE; - bMBPressed = FALSE; + bNoInterrupt = sal_False; + bMBPressed = sal_False; } Point aDocPos( PixelToLogic( rCEvt.GetMousePosPixel() ) ); if ( !rCEvt.IsMouseEvent() ) @@ -4665,7 +4675,7 @@ void SwEditWin::Command( const CommandEvent& rCEvt ) { if ( pMenu ) { - USHORT nExecId = ((PopupMenu*)pMenu)->Execute(this, aPixPos); + sal_uInt16 nExecId = ((PopupMenu*)pMenu)->Execute(this, aPixPos); if( !::ExecuteMenuCommand( *static_cast<PopupMenu*>(pMenu), *rView.GetViewFrame(), nExecId )) pROPopup->Execute(this, nExecId); } @@ -4679,7 +4689,7 @@ void SwEditWin::Command( const CommandEvent& rCEvt ) } else if (pApplyTempl->bUndo) rSh.Do(SwWrtShell::UNDO); - bCallBase = FALSE; + bCallBase = sal_False; } } break; @@ -4697,7 +4707,7 @@ void SwEditWin::Command( const CommandEvent& rCEvt ) // forward to Outliner if applicable if ( rSh.HasDrawView() && rSh.GetDrawView()->IsTextEdit() ) { - bCallBase = FALSE; + bCallBase = sal_False; rSh.GetDrawView()->GetTextEditOutlinerView()->Command( rCEvt ); break; } @@ -4706,7 +4716,7 @@ void SwEditWin::Command( const CommandEvent& rCEvt ) if ( VOICECOMMANDTYPE_CONTROL == pCData->GetType() ) break; - USHORT nSlotId = 0; + sal_uInt16 nSlotId = 0; SfxPoolItem *pItem = 0; switch ( pCData->GetCommand() ) @@ -4765,7 +4775,7 @@ void SwEditWin::Command( const CommandEvent& rCEvt ) } if ( nSlotId ) { - bCallBase = FALSE; + bCallBase = sal_False; if ( pItem ) { const SfxPoolItem* aArgs[2]; @@ -4783,13 +4793,13 @@ void SwEditWin::Command( const CommandEvent& rCEvt ) case COMMAND_STARTEXTTEXTINPUT: { - BOOL bIsDocReadOnly = rView.GetDocShell()->IsReadOnly() && + sal_Bool bIsDocReadOnly = rView.GetDocShell()->IsReadOnly() && rSh.IsCrsrReadonly(); if(!bIsDocReadOnly) { if( rSh.HasDrawView() && rSh.GetDrawView()->IsTextEdit() ) { - bCallBase = FALSE; + bCallBase = sal_False; rSh.GetDrawView()->GetTextEditOutlinerView()->Command( rCEvt ); } else @@ -4797,7 +4807,7 @@ void SwEditWin::Command( const CommandEvent& rCEvt ) if( rSh.HasSelection() ) rSh.DelRight(); - bCallBase = FALSE; + bCallBase = sal_False; LanguageType eInputLanguage = GetInputLanguage(); rSh.CreateExtTextInput(eInputLanguage); } @@ -4806,18 +4816,18 @@ void SwEditWin::Command( const CommandEvent& rCEvt ) } case COMMAND_ENDEXTTEXTINPUT: { - BOOL bIsDocReadOnly = rView.GetDocShell()->IsReadOnly() && + sal_Bool bIsDocReadOnly = rView.GetDocShell()->IsReadOnly() && rSh.IsCrsrReadonly(); if(!bIsDocReadOnly) { if( rSh.HasDrawView() && rSh.GetDrawView()->IsTextEdit() ) { - bCallBase = FALSE; + bCallBase = sal_False; rSh.GetDrawView()->GetTextEditOutlinerView()->Command( rCEvt ); } else { - bCallBase = FALSE; + bCallBase = sal_False; String sRecord = rSh.DeleteExtTextInput(); uno::Reference< frame::XDispatchRecorder > xRecorder = rView.GetViewFrame()->GetBindings().GetRecorder(); @@ -4857,7 +4867,7 @@ void SwEditWin::Command( const CommandEvent& rCEvt ) break; case COMMAND_EXTTEXTINPUT: { - BOOL bIsDocReadOnly = rView.GetDocShell()->IsReadOnly() && + sal_Bool bIsDocReadOnly = rView.GetDocShell()->IsReadOnly() && rSh.IsCrsrReadonly(); if(!bIsDocReadOnly) { @@ -4870,7 +4880,7 @@ void SwEditWin::Command( const CommandEvent& rCEvt ) String sWord; if( rSh.HasDrawView() && rSh.GetDrawView()->IsTextEdit() ) { - bCallBase = FALSE; + bCallBase = sal_False; rSh.GetDrawView()->GetTextEditOutlinerView()->Command( rCEvt ); } else @@ -4879,7 +4889,7 @@ void SwEditWin::Command( const CommandEvent& rCEvt ) if( pData ) { sWord = pData->GetText(); - bCallBase = FALSE; + bCallBase = sal_False; rSh.SetExtTextInputData( *pData ); } } @@ -4912,8 +4922,8 @@ void SwEditWin::Command( const CommandEvent& rCEvt ) if( !aDataHelper.GetXTransferable().is() ) break; - ULONG nDropFormat; - USHORT nEventAction, nDropAction, nDropDestination; + sal_uLong nDropFormat; + sal_uInt16 nEventAction, nDropAction, nDropDestination; nDropDestination = GetDropDestination( rCEvt.GetMousePosPixel() ); if( !nDropDestination ) break; @@ -4927,9 +4937,9 @@ void SwEditWin::Command( const CommandEvent& rCEvt ) { const Point aDocPt( PixelToLogic( rCEvt.GetMousePosPixel() ) ); SwTransferable::PasteData( aDataHelper, rSh, nDropAction, - nDropFormat, nDropDestination, FALSE, - FALSE, &aDocPt, EXCHG_IN_ACTION_COPY, - TRUE ); + nDropFormat, nDropDestination, sal_False, + sal_False, &aDocPt, EXCHG_IN_ACTION_COPY, + sal_True ); } } break; @@ -4938,7 +4948,7 @@ void SwEditWin::Command( const CommandEvent& rCEvt ) const CommandModKeyData* pCommandData = (const CommandModKeyData*)rCEvt.GetData(); if(pCommandData->IsMod1() && !pCommandData->IsMod2()) { - USHORT nSlot = 0; + sal_uInt16 nSlot = 0; if(pCommandData->IsLeftShift() && !pCommandData->IsRightShift()) nSlot = SID_ATTR_PARA_LEFT_TO_RIGHT; else if(!pCommandData->IsLeftShift() && pCommandData->IsRightShift()) @@ -4961,10 +4971,10 @@ void SwEditWin::Command( const CommandEvent& rCEvt ) const CommandSelectionChangeData *pData = rCEvt.GetSelectionChangeData(); rSh.SttCrsrMove(); rSh.GoStartSentence(); - rSh.GetCrsr()->GetPoint()->nContent += sal::static_int_cast<sal_uInt16, ULONG>(pData->GetStart()); + rSh.GetCrsr()->GetPoint()->nContent += sal::static_int_cast<sal_uInt16, sal_uLong>(pData->GetStart()); rSh.SetMark(); - rSh.GetCrsr()->GetMark()->nContent += sal::static_int_cast<sal_uInt16, ULONG>(pData->GetEnd() - pData->GetStart()); - rSh.EndCrsrMove( TRUE ); + rSh.GetCrsr()->GetMark()->nContent += sal::static_int_cast<sal_uInt16, sal_uLong>(pData->GetEnd() - pData->GetStart()); + rSh.EndCrsrMove( sal_True ); } break; case COMMAND_PREPARERECONVERSION: @@ -4988,9 +4998,9 @@ void SwEditWin::Command( const CommandEvent& rCEvt ) if( pCrsr ) { - ULONG nPosNodeIdx = pCrsr->GetPoint()->nNode.GetIndex(); + sal_uLong nPosNodeIdx = pCrsr->GetPoint()->nNode.GetIndex(); xub_StrLen nPosIdx = pCrsr->GetPoint()->nContent.GetIndex(); - ULONG nMarkNodeIdx = pCrsr->GetMark()->nNode.GetIndex(); + sal_uLong nMarkNodeIdx = pCrsr->GetMark()->nNode.GetIndex(); xub_StrLen nMarkIdx = pCrsr->GetMark()->nContent.GetIndex(); if( !rSh.GetCrsr()->HasMark() ) @@ -5004,7 +5014,7 @@ void SwEditWin::Command( const CommandEvent& rCEvt ) rSh.GetCrsr()->GetPoint()->nContent = nPosIdx; rSh.GetCrsr()->GetMark()->nNode = nPosNodeIdx; rSh.GetCrsr()->GetMark()->nContent = - rSh.GetCrsr()->GetCntntNode( TRUE )->Len(); + rSh.GetCrsr()->GetCntntNode( sal_True )->Len(); } else if( nPosNodeIdx == nMarkNodeIdx ) { @@ -5019,10 +5029,10 @@ void SwEditWin::Command( const CommandEvent& rCEvt ) rSh.GetCrsr()->GetMark()->nContent = nMarkIdx; rSh.GetCrsr()->GetPoint()->nNode = nMarkNodeIdx; rSh.GetCrsr()->GetPoint()->nContent = - rSh.GetCrsr()->GetCntntNode( FALSE )->Len(); + rSh.GetCrsr()->GetCntntNode( sal_False )->Len(); } - rSh.EndCrsrMove( TRUE ); + rSh.EndCrsrMove( sal_True ); } } break; @@ -5037,9 +5047,9 @@ void SwEditWin::Command( const CommandEvent& rCEvt ) /* i#18686 select the object/cursor at the mouse position of the context menu request */ -BOOL SwEditWin::SelectMenuPosition(SwWrtShell& rSh, const Point& rMousePos ) +sal_Bool SwEditWin::SelectMenuPosition(SwWrtShell& rSh, const Point& rMousePos ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; const Point aDocPos( PixelToLogic( rMousePos ) ); const bool bIsInsideSelectedObj( rSh.IsInsideSelectedObj( aDocPos ) ); //create a synthetic mouse event out of the coordinates @@ -5069,7 +5079,7 @@ BOOL SwEditWin::SelectMenuPosition(SwWrtShell& rSh, const Point& rMousePos ) if(!aSelection.IsZero()) { SdrOutliner* pOutliner = pSdrView->GetTextEditOutliner(); - BOOL bVertical = pOutliner->IsVertical(); + sal_Bool bVertical = pOutliner->IsVertical(); const EditEngine& rEditEng = pOutliner->GetEditEngine(); Point aEEPos(aDocPos); const Rectangle& rOutputArea = pOLV->GetOutputArea(); @@ -5091,7 +5101,7 @@ BOOL SwEditWin::SelectMenuPosition(SwWrtShell& rSh, const Point& rMousePos ) aSelection.Adjust(); if(!aCompare.IsLess(aSelection) && !aCompare.IsGreater(aSelection)) { - return FALSE; + return sal_False; } } @@ -5100,15 +5110,15 @@ BOOL SwEditWin::SelectMenuPosition(SwWrtShell& rSh, const Point& rMousePos ) if (pSdrView->MouseButtonDown( aMEvt, this ) ) { pSdrView->MouseButtonUp( aMEvt, this ); - rSh.GetView().GetViewFrame()->GetBindings().InvalidateAll(FALSE); - return TRUE; + rSh.GetView().GetViewFrame()->GetBindings().InvalidateAll(sal_False); + return sal_True; } } rSh.ResetCursorStack(); if ( EnterDrawMode( aMEvt, aDocPos ) ) { - return TRUE; + return sal_True; } if ( rView.GetDrawFuncPtr() && bInsFrm ) { @@ -5129,15 +5139,15 @@ BOOL SwEditWin::SelectMenuPosition(SwWrtShell& rSh, const Point& rMousePos ) rView.NoRotate(); rSh.HideCrsr(); - BOOL bUnLockView = !rSh.IsViewLocked(); - rSh.LockView( TRUE ); - BOOL bSelObj = rSh.SelectObj( aDocPos, 0); + sal_Bool bUnLockView = !rSh.IsViewLocked(); + rSh.LockView( sal_True ); + sal_Bool bSelObj = rSh.SelectObj( aDocPos, 0); if( bUnLockView ) - rSh.LockView( FALSE ); + rSh.LockView( sal_False ); if( bSelObj ) { - bRet = TRUE; + bRet = sal_True; // in case the frame was deselected in the macro // just the cursor has to be displayed again. if( FRMTYPE_NONE == rSh.GetSelFrmType() ) @@ -5153,7 +5163,7 @@ BOOL SwEditWin::SelectMenuPosition(SwWrtShell& rSh, const Point& rMousePos ) } rSh.EnterSelFrmMode( &aDocPos ); - bFrmDrag = TRUE; + bFrmDrag = sal_True; UpdatePointer( aDocPos, 0 ); return bRet; } @@ -5168,31 +5178,31 @@ BOOL SwEditWin::SelectMenuPosition(SwWrtShell& rSh, const Point& rMousePos ) !bIsInsideSelectedObj)) { rView.NoRotate(); - BOOL bUnLockView = !rSh.IsViewLocked(); - rSh.LockView( TRUE ); - BYTE nFlag = 0; + sal_Bool bUnLockView = !rSh.IsViewLocked(); + rSh.LockView( sal_True ); + sal_uInt8 nFlag = 0; if ( rSh.IsSelFrmMode() ) { rSh.UnSelectFrm(); rSh.LeaveSelFrmMode(); rView.AttrChangedNotify(&rSh); - bRet = TRUE; + bRet = sal_True; } - BOOL bSelObj = rSh.SelectObj( aDocPos, nFlag ); + sal_Bool bSelObj = rSh.SelectObj( aDocPos, nFlag ); if( bUnLockView ) - rSh.LockView( FALSE ); + rSh.LockView( sal_False ); if( !bSelObj ) { // move cursor here so that it is not drawn in the // frame at first; ShowCrsr() happens in LeaveSelFrmMode() - bValidCrsrPos = !(CRSR_POSCHG & (rSh.*rSh.fnSetCrsr)(&aDocPos,FALSE)); + bValidCrsrPos = !(CRSR_POSCHG & (rSh.*rSh.fnSetCrsr)(&aDocPos,sal_False)); rSh.LeaveSelFrmMode(); rView.LeaveDrawCreate(); rView.AttrChangedNotify( &rSh ); - bRet = TRUE; + bRet = sal_True; } else { @@ -5200,7 +5210,7 @@ BOOL SwEditWin::SelectMenuPosition(SwWrtShell& rSh, const Point& rMousePos ) rSh.EnterSelFrmMode( &aDocPos ); rSh.SelFlyGrabCrsr(); rSh.MakeSelVisible(); - bFrmDrag = TRUE; + bFrmDrag = sal_True; if( rSh.IsFrmSelected() && rView.GetDrawFuncPtr() ) { @@ -5210,13 +5220,13 @@ BOOL SwEditWin::SelectMenuPosition(SwWrtShell& rSh, const Point& rMousePos ) rView.AttrChangedNotify( &rSh ); } UpdatePointer( aDocPos, 0 ); - bRet = TRUE; + bRet = sal_True; } } else if ( rSh.IsSelFrmMode() && bIsInsideSelectedObj ) { // ## object at the mouse cursor is already selected - do nothing - return FALSE; + return sal_False; } if ( rSh.IsGCAttr() ) @@ -5225,7 +5235,7 @@ BOOL SwEditWin::SelectMenuPosition(SwWrtShell& rSh, const Point& rMousePos ) rSh.ClearGCAttr(); } - BOOL bOverSelect = rSh.ChgCurrPam( aDocPos ), bOverURLGrf = FALSE; + sal_Bool bOverSelect = rSh.ChgCurrPam( aDocPos ), bOverURLGrf = sal_False; if( !bOverSelect ) bOverURLGrf = bOverSelect = 0 != rSh.IsURLGrfAtPos( aDocPos ); @@ -5234,8 +5244,8 @@ BOOL SwEditWin::SelectMenuPosition(SwWrtShell& rSh, const Point& rMousePos ) { // create only temporary move context because otherwise // the query against the content form doesn't work!!! MV_KONTEXT( &rSh ); - (rSh.*rSh.fnSetCrsr)(&aDocPos, FALSE); - bRet = TRUE; + (rSh.*rSh.fnSetCrsr)(&aDocPos, sal_False); + bRet = sal_True; } } if( !bOverURLGrf ) @@ -5248,7 +5258,7 @@ BOOL SwEditWin::SelectMenuPosition(SwWrtShell& rSh, const Point& rMousePos ) if( !rSh.IsFrmSelected() ) rSh.GotoNextFly(); rSh.EnterSelFrmMode(); - bRet = TRUE; + bRet = sal_True; } } return bRet; @@ -5259,7 +5269,7 @@ SfxShell* lcl_GetShellFromDispatcher( SwView& rView, TypeId nType ) // determine Shell SfxShell* pShell; SfxDispatcher* pDispatcher = rView.GetViewFrame()->GetDispatcher(); - for(USHORT i = 0; TRUE; ++i ) + for(sal_uInt16 i = 0; sal_True; ++i ) { pShell = pDispatcher->GetShell( i ); if( !pShell || pShell->IsA( nType ) ) @@ -5280,7 +5290,7 @@ IMPL_LINK( SwEditWin, KeyInputFlushHandler, Timer *, EMPTYARG ) IMPL_LINK( SwEditWin, KeyInputTimerHandler, Timer *, EMPTYARG ) { - bTblInsDelMode = FALSE; + bTblInsDelMode = sal_False; return 0; } @@ -5307,7 +5317,7 @@ IMPL_LINK(SwEditWin, TemplateTimerHdl, Timer*, EMPTYARG) return 0; } -void SwEditWin::SetChainMode( BOOL bOn ) +void SwEditWin::SetChainMode( sal_Bool bOn ) { if ( !bChainMode ) StopInsFrm(); @@ -5322,7 +5332,7 @@ void SwEditWin::SetChainMode( BOOL bOn ) if ( !bChainMode ) rView.GetViewFrame()->HideStatusText(); - static USHORT const aInva[] = + static sal_uInt16 aInva[] = { FN_FRAME_CHAIN, FN_FRAME_UNCHAIN, 0 }; @@ -5348,7 +5358,7 @@ void QuickHelpData::Move( QuickHelpData& rCpy ) { // move pointer aArr.Insert( &rCpy.aArr ); - rCpy.aArr.Remove( (USHORT)0, rCpy.aArr.Count() ); + rCpy.aArr.Remove( (sal_uInt16)0, rCpy.aArr.Count() ); bClear = rCpy.bClear; nLen = rCpy.nLen; nCurArrPos = rCpy.nCurArrPos; @@ -5369,16 +5379,16 @@ void QuickHelpData::Move( QuickHelpData& rCpy ) void QuickHelpData::ClearCntnt() { nLen = nCurArrPos = 0; - bClear = bChkInsBlank = FALSE; + bClear = bChkInsBlank = sal_False; nTipId = 0; aArr.DeleteAndDestroy( 0 , aArr.Count() ); - bIsTip = TRUE; - bIsAutoText = TRUE; + bIsTip = sal_True; + bIsAutoText = sal_True; delete pCETID, pCETID = 0; delete[] pAttrs, pAttrs = 0; } -void QuickHelpData::Start( SwWrtShell& rSh, USHORT nWrdLen ) +void QuickHelpData::Start( SwWrtShell& rSh, sal_uInt16 nWrdLen ) { if( pCETID ) delete pCETID, pCETID = 0; if( pAttrs ) delete[] pAttrs, pAttrs = 0; @@ -5388,7 +5398,7 @@ void QuickHelpData::Start( SwWrtShell& rSh, USHORT nWrdLen ) nLen = nWrdLen; nCurArrPos = 0; } - bClear = TRUE; + bClear = sal_True; Window& rWin = rSh.GetView().GetEditWin(); if( bIsTip ) @@ -5404,13 +5414,13 @@ void QuickHelpData::Start( SwWrtShell& rSh, USHORT nWrdLen ) { String sStr( *aArr[ nCurArrPos ] ); sStr.Erase( 0, nLen ); - USHORT nL = sStr.Len(); - pAttrs = new USHORT[ nL ]; - for( USHORT n = nL; n; ) + sal_uInt16 nL = sStr.Len(); + pAttrs = new sal_uInt16[ nL ]; + for( sal_uInt16 n = nL; n; ) *(pAttrs + --n ) = EXTTEXTINPUT_ATTR_DOTTEDUNDERLINE | EXTTEXTINPUT_ATTR_HIGHLIGHT; pCETID = new CommandExtTextInputData( sStr, pAttrs, nL, - 0, 0, 0, FALSE ); + 0, 0, 0, sal_False ); rSh.CreateExtTextInput(rWin.GetInputLanguage()); rSh.SetExtTextInputData( *pCETID ); } @@ -5419,7 +5429,7 @@ void QuickHelpData::Start( SwWrtShell& rSh, USHORT nWrdLen ) void QuickHelpData::Stop( SwWrtShell& rSh ) { if( !bIsTip ) - rSh.DeleteExtTextInput( 0, FALSE ); + rSh.DeleteExtTextInput( 0, sal_False ); else if( nTipId ) Help::HideTip( nTipId ); ClearCntnt(); @@ -5456,7 +5466,7 @@ void QuickHelpData::FillStrArr( SwWrtShell& rSh, const String& rWord ) // and than add all words from the AutoCompleteWord-List const SwAutoCompleteWord& rACLst = rSh.GetAutoCompleteWords(); - USHORT nStt, nEnd; + sal_uInt16 nStt, nEnd; if( rACLst.GetRange( rWord, nStt, nEnd ) ) { while( nStt < nEnd ) @@ -5510,12 +5520,12 @@ void SwEditWin::ShowAutoTextCorrectQuickHelp( if( pQuickHlpData->aArr.Count() ) { - pQuickHlpData->bIsTip = TRUE; - pQuickHlpData->bIsAutoText = TRUE; + pQuickHlpData->bIsTip = sal_True; + pQuickHlpData->bIsAutoText = sal_True; } else if( pACorr->GetSwFlags().bAutoCompleteWords ) { - pQuickHlpData->bIsAutoText = FALSE; + pQuickHlpData->bIsAutoText = sal_False; pQuickHlpData->bIsTip = bFromIME || !pACorr || pACorr->GetSwFlags().bAutoCmpltShowAsTip; diff --git a/sw/source/ui/docvw/edtwin2.cxx b/sw/source/ui/docvw/edtwin2.cxx index 59f42c0b3bf1..2fc5a877319b 100644 --- a/sw/source/ui/docvw/edtwin2.cxx +++ b/sw/source/ui/docvw/edtwin2.cxx @@ -84,9 +84,9 @@ /*-------------------------------------------------------------------- Description: KeyEvents --------------------------------------------------------------------*/ -static void lcl_GetRedlineHelp( const SwRedline& rRedl, String& rTxt, BOOL bBalloon ) +static void lcl_GetRedlineHelp( const SwRedline& rRedl, String& rTxt, sal_Bool bBalloon ) { - USHORT nResId = 0; + sal_uInt16 nResId = 0; switch( rRedl.GetType() ) { case nsRedlineType_t::REDLINE_INSERT: nResId = STR_REDLINE_INSERT; break; @@ -112,14 +112,14 @@ static void lcl_GetRedlineHelp( const SwRedline& rRedl, String& rTxt, BOOL bBall void SwEditWin::RequestHelp(const HelpEvent &rEvt) { SwWrtShell &rSh = rView.GetWrtShell(); - BOOL bQuickBalloon = 0 != (rEvt.GetMode() & ( HELPMODE_QUICK | HELPMODE_BALLOON )); + sal_Bool bQuickBalloon = 0 != (rEvt.GetMode() & ( HELPMODE_QUICK | HELPMODE_BALLOON )); if(bQuickBalloon && rSh.GetViewOptions()->IsPreventTips()) return; - BOOL bWeiter = TRUE; + sal_Bool bWeiter = sal_True; SET_CURR_SHELL(&rSh); String sTxt; Point aPos( PixelToLogic( ScreenToOutputPixel( rEvt.GetMousePosPixel() ) )); - BOOL bBalloon = static_cast< BOOL >(rEvt.GetMode() & HELPMODE_BALLOON); + sal_Bool bBalloon = static_cast< sal_Bool >(rEvt.GetMode() & HELPMODE_BALLOON); SdrView *pSdrView = rSh.GetDrawView(); @@ -149,9 +149,9 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt) #endif SwContentAtPos::SW_TABLEBOXFML ); - if( rSh.GetContentAtPos( aPos, aCntntAtPos, FALSE, &aFldRect ) ) + if( rSh.GetContentAtPos( aPos, aCntntAtPos, sal_False, &aFldRect ) ) { - USHORT nStyle = 0; // style of quick help + sal_uInt16 nStyle = 0; // style of quick help switch( aCntntAtPos.eCntntAtPos ) { case SwContentAtPos::SW_TABLEBOXFML: @@ -224,7 +224,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt) } } // #i80029# - BOOL bExecHyperlinks = rView.GetDocShell()->IsReadOnly(); + sal_Bool bExecHyperlinks = rView.GetDocShell()->IsReadOnly(); if ( !bExecHyperlinks ) { SvtSecurityOptions aSecOpts; @@ -301,10 +301,9 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt) case RES_TABLEFLD: case RES_GETEXPFLD: { - USHORT nOldSubType = pFld->GetSubType(); + sal_uInt16 nOldSubType = pFld->GetSubType(); ((SwField*)pFld)->SetSubType(nsSwExtendedSubType::SUB_CMD); - sTxt = - pFld->ExpandField(rSh.GetDoc()->IsClipBoard()); + sTxt = pFld->ExpandField(true); ((SwField*)pFld)->SetSubType(nOldSubType); } break; @@ -314,14 +313,14 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt) break; } case RES_INPUTFLD: // BubbleHelp, because the suggestion could be quite long - bBalloon = TRUE; + bBalloon = sal_True; /* no break */ case RES_JUMPEDITFLD: sTxt = pFld->GetPar2(); break; case RES_DBFLD: - sTxt = ((SwDBField*)pFld)->GetCntnt(TRUE); + sTxt = pFld->GetFieldName(); break; case RES_USERFLD: @@ -369,7 +368,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt) if( !sTxt.Len() ) { aCntntAtPos.eCntntAtPos = SwContentAtPos::SW_REDLINE; - if( rSh.GetContentAtPos( aPos, aCntntAtPos, FALSE, &aFldRect ) ) + if( rSh.GetContentAtPos( aPos, aCntntAtPos, sal_False, &aFldRect ) ) lcl_GetRedlineHelp( *aCntntAtPos.aFnd.pRedl, sTxt, bBalloon ); } @@ -393,12 +392,12 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt) } } - bWeiter = FALSE; + bWeiter = sal_False; } if( bWeiter ) { - BYTE nTabCols = rSh.WhichMouseTabCol(aPos); - USHORT nTabRes = 0; + sal_uInt8 nTabCols = rSh.WhichMouseTabCol(aPos); + sal_uInt16 nTabRes = 0; switch(nTabCols) { case SW_TABCOL_HORI: @@ -432,7 +431,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt) Rectangle aRect(rEvt.GetMousePosPixel(), aTxtSize); Help::ShowQuickHelp(this, aRect, sTxt); } - bWeiter = FALSE; + bWeiter = sal_False; } } @@ -451,7 +450,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt) pObj = aVEvt.pObj; sTxt = pField->GetURL(); - bWeiter = FALSE; + bWeiter = sal_False; } } if (bWeiter && eHit == SDRHIT_TEXTEDIT) @@ -476,7 +475,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt) if (pField ) { sTxt = ((const SvxURLField*) pField)->GetURL(); - bWeiter = FALSE; + bWeiter = sal_False; } } } @@ -515,7 +514,7 @@ void SwEditWin::Paint(const Rectangle& rRect) SwWrtShell* pWrtShell = GetView().GetWrtShellPtr(); if(!pWrtShell) return; - BOOL bPaintShadowCrsr = FALSE; + sal_Bool bPaintShadowCrsr = sal_False; if( pShadCrsr ) { Rectangle aRect( pShadCrsr->GetRect()); @@ -528,7 +527,7 @@ void SwEditWin::Paint(const Rectangle& rRect) // resides somewhat above, then everything is clipped outside // and we have to make the "inner part" at the end of the // Paint visible again. Otherwise Paint errors occur! - bPaintShadowCrsr = TRUE; + bPaintShadowCrsr = sal_True; } } diff --git a/sw/source/ui/docvw/edtwin3.cxx b/sw/source/ui/docvw/edtwin3.cxx index 208aacd42e03..34b4103d7537 100644 --- a/sw/source/ui/docvw/edtwin3.cxx +++ b/sw/source/ui/docvw/edtwin3.cxx @@ -57,7 +57,7 @@ void ScrollMDI( ViewShell* pVwSh, const SwRect &rRect, - USHORT nRangeX, USHORT nRangeY) + sal_uInt16 nRangeX, sal_uInt16 nRangeY) { SfxViewShell *pSfxVwSh = pVwSh->GetSfxViewShell(); if (pSfxVwSh && pSfxVwSh->ISA(SwView)) @@ -70,12 +70,12 @@ void ScrollMDI( ViewShell* pVwSh, const SwRect &rRect, -BOOL IsScrollMDI( ViewShell* pVwSh, const SwRect &rRect ) +sal_Bool IsScrollMDI( ViewShell* pVwSh, const SwRect &rRect ) { SfxViewShell *pSfxVwSh = pVwSh->GetSfxViewShell(); if (pSfxVwSh && pSfxVwSh->ISA(SwView)) return (((SwView *)pSfxVwSh)->IsScroll(rRect.SVRect())); - return FALSE; + return sal_False; } /*-------------------------------------------------------------------- @@ -102,7 +102,7 @@ void SizeNotify(ViewShell* pVwSh, const Size &rSize) -void PageNumNotify( ViewShell* pVwSh, USHORT nPhyNum, USHORT nVirtNum, +void PageNumNotify( ViewShell* pVwSh, sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const String& rPgStr) { SfxViewShell *pSfxVwSh = pVwSh->GetSfxViewShell(); @@ -127,7 +127,7 @@ void FrameNotify( ViewShell* pVwSh, FlyMode eMode ) /*-------------------------------------------------------------------- Description: Notify for page number update --------------------------------------------------------------------*/ -BOOL SwEditWin::RulerColumnDrag( const MouseEvent& rMEvt, BOOL bVerticalMode) +sal_Bool SwEditWin::RulerColumnDrag( const MouseEvent& rMEvt, sal_Bool bVerticalMode) { SvxRuler& rRuler = bVerticalMode ? rView.GetVLineal() : rView.GetHLineal(); return (!rRuler.StartDocDrag( rMEvt, RULER_TYPE_BORDER ) && @@ -138,7 +138,7 @@ BOOL SwEditWin::RulerColumnDrag( const MouseEvent& rMEvt, BOOL bVerticalMode) // #i23726# // #i42921# - add 3rd parameter <bVerticalMode> in order // to consider vertical layout -BOOL SwEditWin::RulerMarginDrag( const MouseEvent& rMEvt, +sal_Bool SwEditWin::RulerMarginDrag( const MouseEvent& rMEvt, const bool bVerticalMode ) { SvxRuler& rRuler = bVerticalMode ? rView.GetVLineal() : rView.GetHLineal(); @@ -163,12 +163,12 @@ void RepaintPagePreview( ViewShell* pVwSh, const SwRect& rRect ) ((SwPagePreView *)pSfxVwSh)->RepaintCoreRect( rRect ); } -BOOL JumpToSwMark( ViewShell* pVwSh, const String& rMark ) +sal_Bool JumpToSwMark( ViewShell* pVwSh, const String& rMark ) { SfxViewShell *pSfxVwSh = pVwSh->GetSfxViewShell(); if( pSfxVwSh && pSfxVwSh->ISA( SwView ) ) return ((SwView *)pSfxVwSh)->JumpToSwMark( rMark ); - return FALSE; + return sal_False; } void SwEditWin::DataChanged( const DataChangedEvent& rDCEvt ) @@ -180,8 +180,8 @@ void SwEditWin::DataChanged( const DataChangedEvent& rDCEvt ) // the SwWrtShell if(!pSh) return; - BOOL bViewWasLocked = pSh->IsViewLocked(), bUnlockPaint = FALSE; - pSh->LockView( TRUE ); + sal_Bool bViewWasLocked = pSh->IsViewLocked(), bUnlockPaint = sal_False; + pSh->LockView( sal_True ); switch( rDCEvt.GetType() ) { case DATACHANGED_SETTINGS: @@ -192,7 +192,7 @@ void SwEditWin::DataChanged( const DataChangedEvent& rDCEvt ) if( rDCEvt.GetFlags() & SETTINGS_STYLE ) { pSh->LockPaint(); - bUnlockPaint = TRUE; + bUnlockPaint = sal_True; ViewShell::DeleteReplacementBitmaps(); GetView().InvalidateBorder(); //Scrollbar work } @@ -203,7 +203,7 @@ void SwEditWin::DataChanged( const DataChangedEvent& rDCEvt ) case DATACHANGED_FONTS: case DATACHANGED_FONTSUBSTITUTION: pSh->LockPaint(); - bUnlockPaint = TRUE; + bUnlockPaint = sal_True; GetView().GetDocShell()->UpdateFontList(); //e.g. printer change break; } diff --git a/sw/source/ui/docvw/extedit.cxx b/sw/source/ui/docvw/extedit.cxx index 7f318dbf7a0d..73046addddcb 100644 --- a/sw/source/ui/docvw/extedit.cxx +++ b/sw/source/ui/docvw/extedit.cxx @@ -121,7 +121,7 @@ void EditWithExternalTool(GraphicObject *pGraphicObject, SwWrtShell *rSh) //Write Graphic to the Temp File GraphicFilter& rGF = *GraphicFilter::GetGraphicFilter(); - USHORT nFilter(rGF.GetExportFormatNumber(fExt)); + sal_uInt16 nFilter(rGF.GetExportFormatNumber(fExt)); String aFilter(rGF.GetExportFormatShortName(nFilter)); String sPath(tempFileName.getStr()); diff --git a/sw/source/ui/docvw/makefile.mk b/sw/source/ui/docvw/makefile.mk deleted file mode 100644 index 5e9f739a7720..000000000000 --- a/sw/source/ui/docvw/makefile.mk +++ /dev/null @@ -1,70 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=..$/..$/.. - -PRJNAME=sw -TARGET=docvw -ENABLE_EXCEPTIONS=TRUE - -# --- Settings ----------------------------------------------------- - -.INCLUDE : $(PRJ)$/inc$/swpre.mk -.INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/inc$/sw.mk - -# --- Files -------------------------------------------------------- - -SRS1NAME=$(TARGET) -SRC1FILES = \ - access.src \ - docvw.src \ - annotation.src - -SLOFILES = \ - $(SLO)$/edtdd.obj \ - $(SLO)$/edtwin.obj \ - $(SLO)$/edtwin2.obj \ - $(SLO)$/edtwin3.obj \ - $(SLO)$/romenu.obj \ - $(SLO)$/extedit.obj \ - $(SLO)$/srcedtw.obj \ - $(SLO)$/PostItMgr.obj \ - $(SLO)$/frmsidebarwincontainer.obj \ - $(SLO)$/AnchorOverlayObject.obj \ - $(SLO)$/ShadowOverlayObject.obj \ - $(SLO)$/SidebarWin.obj \ - $(SLO)$/SidebarWinAcc.obj \ - $(SLO)$/AnnotationWin.obj \ - $(SLO)$/AnnotationMenuButton.obj \ - $(SLO)$/SidebarTxtControl.obj \ - $(SLO)$/SidebarTxtControlAcc.obj - -# --- Tagets ------------------------------------------------------- - -.INCLUDE : target.mk - diff --git a/sw/source/ui/docvw/romenu.cxx b/sw/source/ui/docvw/romenu.cxx index c3dd9f1ca82d..569c41be48c0 100644 --- a/sw/source/ui/docvw/romenu.cxx +++ b/sw/source/ui/docvw/romenu.cxx @@ -99,13 +99,13 @@ SwReadOnlyPopup::~SwReadOnlyPopup() delete pTargetURL; } -void SwReadOnlyPopup::Check( USHORT nMID, USHORT nSID, SfxDispatcher &rDis ) +void SwReadOnlyPopup::Check( sal_uInt16 nMID, sal_uInt16 nSID, SfxDispatcher &rDis ) { SfxPoolItem *_pItem = 0; SfxItemState eState = rDis.GetBindings()->QueryState( nSID, _pItem ); if (eState >= SFX_ITEM_AVAILABLE) { - EnableItem( nMID, TRUE ); + EnableItem( nMID, sal_True ); if (_pItem) { CheckItem ( nMID, !_pItem->ISA(SfxVoidItem) && @@ -113,11 +113,11 @@ void SwReadOnlyPopup::Check( USHORT nMID, USHORT nSID, SfxDispatcher &rDis ) ((SfxBoolItem*)_pItem)->GetValue()); //remove full screen entry when not in full screen mode if(SID_WIN_FULLSCREEN == nSID && !IsItemChecked(SID_WIN_FULLSCREEN) ) - EnableItem(nMID, FALSE); + EnableItem(nMID, sal_False); } } else - EnableItem( nMID, FALSE ); + EnableItem( nMID, sal_False ); delete _pItem; } @@ -136,7 +136,7 @@ SwReadOnlyPopup::SwReadOnlyPopup( const Point &rDPos, SwView &rV ) : if ( !sURL.Len() ) { SwContentAtPos aCntntAtPos( SwContentAtPos::SW_INETATTR ); - if( rSh.GetContentAtPos( rDocPos, aCntntAtPos, FALSE)) + if( rSh.GetContentAtPos( rDocPos, aCntntAtPos, sal_False)) { SwFmtINetFmt &rIItem = *(SwFmtINetFmt*)aCntntAtPos.aFnd.pAttr; sURL = rIItem.GetValue(); @@ -145,12 +145,12 @@ SwReadOnlyPopup::SwReadOnlyPopup( const Point &rDPos, SwView &rV ) : } } - BOOL bLink = FALSE; + sal_Bool bLink = sal_False; const Graphic *pGrf; if ( 0 == (pGrf = rSh.GetGrfAtPos( rDocPos, sGrfName, bLink )) ) { - EnableItem( MN_READONLY_SAVEGRAPHIC, FALSE ); - EnableItem( MN_READONLY_COPYGRAPHIC, FALSE ); + EnableItem( MN_READONLY_SAVEGRAPHIC, sal_False ); + EnableItem( MN_READONLY_COPYGRAPHIC, sal_False ); } else { @@ -158,7 +158,7 @@ SwReadOnlyPopup::SwReadOnlyPopup( const Point &rDPos, SwView &rV ) : const SwFrmFmt* pGrfFmt = rSh.GetFmtFromObj( rDocPos ); const SfxPoolItem* pURLItem; if( pGrfFmt && SFX_ITEM_SET == pGrfFmt->GetItemState( - RES_URL, TRUE, &pURLItem )) + RES_URL, sal_True, &pURLItem )) { const SwFmtURL& rURL = *(SwFmtURL*)pURLItem; if( rURL.GetMap() ) @@ -180,7 +180,7 @@ SwReadOnlyPopup::SwReadOnlyPopup( const Point &rDPos, SwView &rV ) : pMenu->CheckItem( MN_READONLY_TOGALLERYLINK, bGrfToGalleryAsLnk ); pMenu->CheckItem( MN_READONLY_TOGALLERYCOPY, !bGrfToGalleryAsLnk ); - for ( USHORT i=0; i < aThemeList.size(); ++i ) + for ( sal_uInt16 i=0; i < aThemeList.size(); ++i ) pMenu->InsertItem( MN_READONLY_GRAPHICTOGALLERY+i + 3, aThemeList[ i ] ); } else @@ -193,12 +193,12 @@ SwReadOnlyPopup::SwReadOnlyPopup( const Point &rDPos, SwView &rV ) : SfxDispatcher &rDis = *pVFrame->GetDispatcher(); const SwPageDesc &rDesc = rSh.GetPageDesc( rSh.GetCurPageDesc() ); pItem = &rDesc.GetMaster().GetBackground(); - BOOL bEnableBackGallery = FALSE, - bEnableBack = FALSE; + sal_Bool bEnableBackGallery = sal_False, + bEnableBack = sal_False; if ( GPOS_NONE != pItem->GetGraphicPos() ) { - bEnableBack = TRUE; + bEnableBack = sal_True; if ( pItem->GetGraphicLink() ) { if ( aThemeList.empty() ) @@ -209,9 +209,9 @@ SwReadOnlyPopup::SwReadOnlyPopup( const Point &rDPos, SwView &rV ) : PopupMenu *pMenu = GetPopupMenu(MN_READONLY_BACKGROUNDTOGALLERY); pMenu->CheckItem( MN_READONLY_TOGALLERYLINK, bGrfToGalleryAsLnk ); pMenu->CheckItem( MN_READONLY_TOGALLERYCOPY, !bGrfToGalleryAsLnk ); - bEnableBackGallery = TRUE; + bEnableBackGallery = sal_True; - for ( USHORT i=0; i < aThemeList.size(); ++i ) + for ( sal_uInt16 i=0; i < aThemeList.size(); ++i ) pMenu->InsertItem( MN_READONLY_GRAPHICTOGALLERY+i + 3, aThemeList[ i ] ); } } @@ -222,9 +222,9 @@ SwReadOnlyPopup::SwReadOnlyPopup( const Point &rDPos, SwView &rV ) : if ( !rSh.GetViewOptions()->IsGraphic() ) CheckItem( MN_READONLY_GRAPHICOFF ); else - EnableItem( MN_READONLY_LOADGRAPHIC, FALSE ); + EnableItem( MN_READONLY_LOADGRAPHIC, sal_False ); - BOOL bReloadFrame = 0 != rSh.GetView().GetViewFrame()->GetFrame().GetParentFrame(); + sal_Bool bReloadFrame = 0 != rSh.GetView().GetViewFrame()->GetFrame().GetParentFrame(); EnableItem( MN_READONLY_RELOAD_FRAME, bReloadFrame ); EnableItem( MN_READONLY_RELOAD, !bReloadFrame); @@ -245,7 +245,7 @@ SwReadOnlyPopup::SwReadOnlyPopup( const Point &rDPos, SwView &rV ) : SfxItemState eState = pVFrame->GetBindings().QueryState( SID_COPY, pState ); Check( MN_READONLY_COPY, SID_COPY, rDis ); if(eState < SFX_ITEM_AVAILABLE) - EnableItem( MN_READONLY_COPY, FALSE ); + EnableItem( MN_READONLY_COPY, sal_False ); eState = pVFrame->GetBindings().QueryState( SID_EDITDOC, pState ); if ( @@ -253,23 +253,23 @@ SwReadOnlyPopup::SwReadOnlyPopup( const Point &rDPos, SwView &rV ) : (rSh.IsGlobalDoc() && rView.GetDocShell()->IsReadOnlyUI()) ) { - EnableItem( MN_READONLY_EDITDOC, FALSE ); + EnableItem( MN_READONLY_EDITDOC, sal_False ); } if ( !sURL.Len() ) { - EnableItem( MN_READONLY_OPENURL, FALSE ); - EnableItem( MN_READONLY_OPENURLNEW, FALSE ); - EnableItem( MN_READONLY_COPYLINK, FALSE ); + EnableItem( MN_READONLY_OPENURL, sal_False ); + EnableItem( MN_READONLY_OPENURLNEW, sal_False ); + EnableItem( MN_READONLY_COPYLINK, sal_False ); } Check( SID_WIN_FULLSCREEN, SID_WIN_FULLSCREEN, rDis ); - RemoveDisabledEntries( TRUE, TRUE ); + RemoveDisabledEntries( sal_True, sal_True ); } void SwReadOnlyPopup::Execute( Window* pWin, const Point &rPixPos ) { - USHORT nId = PopupMenu::Execute( + sal_uInt16 nId = PopupMenu::Execute( pWin, rPixPos ); Execute(pWin, nId); @@ -278,14 +278,14 @@ void SwReadOnlyPopup::Execute( Window* pWin, const Point &rPixPos ) /*-- 17.03.2004 13:06:18--------------------------------------------------- execute the resulting ID only - necessary to support XContextMenuInterception -----------------------------------------------------------------------*/ -void SwReadOnlyPopup::Execute( Window* pWin, USHORT nId ) +void SwReadOnlyPopup::Execute( Window* pWin, sal_uInt16 nId ) { SwWrtShell &rSh = rView.GetWrtShell(); SfxDispatcher &rDis = *rView.GetViewFrame()->GetDispatcher(); if ( nId >= MN_READONLY_GRAPHICTOGALLERY ) { String sTmp; - USHORT nSaveId; + sal_uInt16 nSaveId; if ( nId >= MN_READONLY_BACKGROUNDTOGALLERY ) { nId -= MN_READONLY_BACKGROUNDTOGALLERY+3; @@ -309,8 +309,8 @@ void SwReadOnlyPopup::Execute( Window* pWin, USHORT nId ) TransferDataContainer* pClipCntnr = 0; - USHORT nExecId = USHRT_MAX; - USHORT nFilter = USHRT_MAX; + sal_uInt16 nExecId = USHRT_MAX; + sal_uInt16 nFilter = USHRT_MAX; switch( nId ) { case SID_WIN_FULLSCREEN : nExecId = SID_WIN_FULLSCREEN; break; @@ -351,9 +351,9 @@ void SwReadOnlyPopup::Execute( Window* pWin, USHORT nId ) case MN_READONLY_LOADGRAPHIC: { - BOOL bModified = rSh.IsModified(); + sal_Bool bModified = rSh.IsModified(); SwViewOption aOpt( *rSh.GetViewOptions() ); - aOpt.SetGraphic( TRUE ); + aOpt.SetGraphic( sal_True ); rSh.ApplyViewOptions( aOpt ); if(!bModified) rSh.ResetModified(); @@ -364,10 +364,10 @@ void SwReadOnlyPopup::Execute( Window* pWin, USHORT nId ) case MN_READONLY_PLUGINOFF: nExecId = SID_PLUGINS_ACTIVE; break; #endif case MN_READONLY_TOGALLERYLINK: - SW_MOD()->GetModuleConfig()->SetGrfToGalleryAsLnk( TRUE ); + SW_MOD()->GetModuleConfig()->SetGrfToGalleryAsLnk( sal_True ); break; case MN_READONLY_TOGALLERYCOPY: - SW_MOD()->GetModuleConfig()->SetGrfToGalleryAsLnk( FALSE ); + SW_MOD()->GetModuleConfig()->SetGrfToGalleryAsLnk( sal_False ); break; default: //forward the id to the SfxBindings @@ -386,7 +386,7 @@ void SwReadOnlyPopup::Execute( Window* pWin, USHORT nId ) } } -String SwReadOnlyPopup::SaveGraphic( USHORT nId ) +String SwReadOnlyPopup::SaveGraphic( sal_uInt16 nId ) { // fish out the graphic's name @@ -430,18 +430,18 @@ String ExportGraphic( const Graphic &rGraphic, const String &rGrfName ) aDlgHelper.SetFileName( aURL.GetName() ); GraphicFilter& rGF = *GraphicFilter::GetGraphicFilter(); - const USHORT nCount = rGF.GetExportFormatCount(); + const sal_uInt16 nCount = rGF.GetExportFormatCount(); String aExt( aURL.GetExtension() ); if( !aExt.Len() ) GetPreferedExtension( aExt, rGraphic ); aExt.ToLowerAscii(); - USHORT nDfltFilter = USHRT_MAX; + sal_uInt16 nDfltFilter = USHRT_MAX; Reference<XFilterManager> xFltMgr(xFP, UNO_QUERY); - for ( USHORT i = 0; i < nCount; i++ ) + for ( sal_uInt16 i = 0; i < nCount; i++ ) { xFltMgr->appendFilter( rGF.GetExportFormatName( i ), rGF.GetExportWildcard( i ) ); if ( COMPARE_EQUAL == aExt.CompareIgnoreCaseToAscii(rGF.GetExportFormatShortName( i ).ToLowerAscii() )) @@ -451,7 +451,7 @@ String ExportGraphic( const Graphic &rGraphic, const String &rGrfName ) { // "wrong" extension? GetPreferedExtension( aExt, rGraphic ); - for ( USHORT i = 0; i < nCount; ++i ) + for ( sal_uInt16 i = 0; i < nCount; ++i ) if ( aExt == rGF.GetExportFormatShortName( i ).ToLowerAscii() ) { nDfltFilter = i; @@ -475,11 +475,11 @@ String ExportGraphic( const Graphic &rGraphic, const String &rGrfName ) { // try to save the original graphic SfxMedium aIn( rGrfName, STREAM_READ | STREAM_NOCREATE, - TRUE ); + sal_True ); if( aIn.GetInStream() && !aIn.GetInStream()->GetError() ) { SfxMedium aOut( sPath, STREAM_WRITE | STREAM_SHARE_DENYNONE, - FALSE); + sal_False); if( aOut.GetOutStream() && !aOut.GetOutStream()->GetError()) { *aOut.GetOutStream() << *aIn.GetInStream(); @@ -494,7 +494,7 @@ String ExportGraphic( const Graphic &rGraphic, const String &rGrfName ) } } - USHORT nFilter; + sal_uInt16 nFilter; if ( xFltMgr->getCurrentFilter().getLength() && rGF.GetExportFormatCount() ) nFilter = rGF.GetExportFormatNumber( xFltMgr->getCurrentFilter() ); else diff --git a/sw/source/ui/docvw/romenu.hxx b/sw/source/ui/docvw/romenu.hxx index 95d2ac2bdddd..25440ee8be79 100644 --- a/sw/source/ui/docvw/romenu.hxx +++ b/sw/source/ui/docvw/romenu.hxx @@ -49,12 +49,12 @@ class SwReadOnlyPopup : public PopupMenu sDescription, sGrfName; std::vector<String> aThemeList; - BOOL bGrfToGalleryAsLnk; + sal_Bool bGrfToGalleryAsLnk; ImageMap* pImageMap; INetImage* pTargetURL; - void Check( USHORT nMID, USHORT nSID, SfxDispatcher &rDis ); - String SaveGraphic( USHORT nId ); + void Check( sal_uInt16 nMID, sal_uInt16 nSID, SfxDispatcher &rDis ); + String SaveGraphic( sal_uInt16 nId ); using PopupMenu::Execute; @@ -63,7 +63,7 @@ public: ~SwReadOnlyPopup(); void Execute( Window* pWin, const Point &rPPos ); - void Execute( Window* pWin, USHORT nId ); + void Execute( Window* pWin, sal_uInt16 nId ); }; void GetPreferedExtension( String &rExt, const Graphic &rGrf ); diff --git a/sw/source/ui/docvw/srcedtw.cxx b/sw/source/ui/docvw/srcedtw.cxx index 65e15ba925bd..0bb32d17affa 100644 --- a/sw/source/ui/docvw/srcedtw.cxx +++ b/sw/source/ui/docvw/srcedtw.cxx @@ -51,12 +51,14 @@ #include <docsh.hxx> #include <srcview.hxx> #include <helpid.h> +#include <deque> + struct SwTextPortion { - USHORT nLine; - USHORT nStart, nEnd; + sal_uInt16 nLine; + sal_uInt16 nStart, nEnd; svtools::ColorConfigEntry eType; }; @@ -64,9 +66,7 @@ struct SwTextPortion #define MAX_HIGHLIGHTTIME 200 #define SYNTAX_HIGHLIGHT_TIMEOUT 200 -SV_DECL_VARARR(SwTextPortions, SwTextPortion,16,16) - -SV_IMPL_VARARR(SwTextPortions, SwTextPortion) +typedef std::deque<SwTextPortion> SwTextPortions; static void lcl_Highlight(const String& rSource, SwTextPortions& aPortionList) { @@ -81,12 +81,12 @@ static void lcl_Highlight(const String& rSource, SwTextPortions& aPortionList) const sal_Unicode cCR = 0x0d; - const USHORT nStrLen = rSource.Len(); - USHORT nInsert = 0; // number of inserted portions - USHORT nActPos = 0; // position, where '<' was found - USHORT nOffset = 0; // Offset of nActPos to '<' - USHORT nPortStart = USHRT_MAX; // for the TextPortion - USHORT nPortEnd = 0; // + const sal_uInt16 nStrLen = rSource.Len(); + sal_uInt16 nInsert = 0; // number of inserted portions + sal_uInt16 nActPos = 0; // position, where '<' was found + sal_uInt16 nOffset = 0; // Offset of nActPos to '<' + sal_uInt16 nPortStart = USHRT_MAX; // for the TextPortion + sal_uInt16 nPortEnd = 0; // SwTextPortion aText; while(nActPos < nStrLen) { @@ -103,7 +103,8 @@ static void lcl_Highlight(const String& rSource, SwTextPortions& aPortionList) aText.nStart += 1; aText.nEnd = nActPos - 1; aText.eType = svtools::HTMLUNKNOWN; - aPortionList.Insert(aText, nInsert++); + aPortionList.push_back( aText ); + nInsert++; } sal_Unicode cFollowFirst = rSource.GetChar((xub_StrLen)(nActPos + 1)); sal_Unicode cFollowNext = rSource.GetChar((xub_StrLen)(nActPos + 2)); @@ -130,7 +131,7 @@ static void lcl_Highlight(const String& rSource, SwTextPortions& aPortionList) if(svtools::HTMLUNKNOWN == eFoundType) { // now here a keyword could follow - USHORT nSrchPos = nActPos; + sal_uInt16 nSrchPos = nActPos; while(++nSrchPos < nStrLen - 1) { sal_Unicode cNext = rSource.GetChar(nSrchPos); @@ -171,18 +172,18 @@ static void lcl_Highlight(const String& rSource, SwTextPortions& aPortionList) // now we still have to look for '>' if(svtools::HTMLUNKNOWN != eFoundType) { - BOOL bFound = FALSE; - for(USHORT i = nPortEnd; i < nStrLen; i++) + sal_Bool bFound = sal_False; + for(sal_uInt16 i = nPortEnd; i < nStrLen; i++) if(cCloseBracket == rSource.GetChar(i)) { - bFound = TRUE; + bFound = sal_True; nPortEnd = i; break; } if(!bFound && (eFoundType == svtools::HTMLCOMMENT)) { // comment without ending in this line - bFound = TRUE; + bFound = sal_True; nPortEnd = nStrLen - 1; } @@ -193,7 +194,8 @@ static void lcl_Highlight(const String& rSource, SwTextPortions& aPortionList) aTextPortion.nStart = nPortStart + 1; aTextPortion.nEnd = nPortEnd; aTextPortion.eType = eFoundType; - aPortionList.Insert(aTextPortion, nInsert++); + aPortionList.push_back( aTextPortion ); + nInsert++; eFoundType = svtools::HTMLUNKNOWN; } @@ -207,7 +209,8 @@ static void lcl_Highlight(const String& rSource, SwTextPortions& aPortionList) aText.nStart = nPortEnd + 1; aText.nEnd = nActPos - 1; aText.eType = svtools::HTMLUNKNOWN; - aPortionList.Insert(aText, nInsert++); + aPortionList.push_back( aText ); + nInsert++; } } @@ -226,8 +229,8 @@ SwSrcEditWindow::SwSrcEditWindow( Window* pParent, SwSrcView* pParentView ) : nCurTextWidth(0), nStartLine(USHRT_MAX), eSourceEncoding(gsl_getSystemTextEncoding()), - bDoSyntaxHighlight(TRUE), - bHighlighting(FALSE) + bDoSyntaxHighlight(sal_True), + bHighlighting(sal_False) { SetHelpId(HID_SOURCE_EDITWIN); CreateTextEngine(); @@ -397,9 +400,9 @@ void TextViewOutWin::Command( const CommandEvent& rCEvt ) void TextViewOutWin::KeyInput( const KeyEvent& rKEvt ) { - BOOL bDone = FALSE; + sal_Bool bDone = sal_False; SwSrcEditWindow* pSrcEditWin = (SwSrcEditWindow*)GetParent(); - BOOL bChange = !pSrcEditWin->IsReadonly() || !TextEngine::DoesKeyChangeText( rKEvt ); + sal_Bool bChange = !pSrcEditWin->IsReadonly() || !TextEngine::DoesKeyChangeText( rKEvt ); if(bChange) bDone = pTextView->KeyInput( rKEvt ); @@ -460,14 +463,14 @@ void SwSrcEditWindow::CreateTextEngine() pTextEngine = new ExtTextEngine; pTextView = new ExtTextView( pTextEngine, pOutWin ); - pTextView->SetAutoIndentMode(TRUE); + pTextView->SetAutoIndentMode(sal_True); pOutWin->SetTextView(pTextView); - pTextEngine->SetUpdateMode( FALSE ); + pTextEngine->SetUpdateMode( sal_False ); pTextEngine->InsertView( pTextView ); Font aFont; - aFont.SetTransparent( FALSE ); + aFont.SetTransparent( sal_False ); aFont.SetFillColor( rCol ); SetPointFont( aFont ); aFont = GetFont(); @@ -478,10 +481,10 @@ void SwSrcEditWindow::CreateTextEngine() aSyntaxIdleTimer.SetTimeout( SYNTAX_HIGHLIGHT_TIMEOUT ); aSyntaxIdleTimer.SetTimeoutHdl( LINK( this, SwSrcEditWindow, SyntaxTimerHdl ) ); - pTextEngine->EnableUndo( TRUE ); - pTextEngine->SetUpdateMode( TRUE ); + pTextEngine->EnableUndo( sal_True ); + pTextEngine->SetUpdateMode( sal_True ); - pTextView->ShowCursor( TRUE, TRUE ); + pTextView->ShowCursor( sal_True, sal_True ); InitScrollBars(); StartListening( *pTextEngine ); @@ -519,14 +522,14 @@ IMPL_LINK(SwSrcEditWindow, ScrollHdl, ScrollBar*, pScroll) { long nDiff = pTextView->GetStartDocPos().Y() - pScroll->GetThumbPos(); GetTextView()->Scroll( 0, nDiff ); - pTextView->ShowCursor( FALSE, TRUE ); + pTextView->ShowCursor( sal_False, sal_True ); pScroll->SetThumbPos( pTextView->GetStartDocPos().Y() ); } else { long nDiff = pTextView->GetStartDocPos().X() - pScroll->GetThumbPos(); GetTextView()->Scroll( nDiff, 0 ); - pTextView->ShowCursor( FALSE, TRUE ); + pTextView->ShowCursor( sal_False, sal_True ); pScroll->SetThumbPos( pTextView->GetStartDocPos().X() ); } GetSrcView()->GetViewFrame()->GetBindings().Invalidate( SID_TABLE_CELL ); @@ -538,18 +541,18 @@ IMPL_LINK( SwSrcEditWindow, SyntaxTimerHdl, Timer *, pTimer ) Time aSyntaxCheckStart; OSL_ENSURE( pTextView, "Noch keine View, aber Syntax-Highlight ?!" ); - bHighlighting = TRUE; - USHORT nLine; - USHORT nCount = 0; + bHighlighting = sal_True; + sal_uInt16 nLine; + sal_uInt16 nCount = 0; // at first the region around the cursor is processed TextSelection aSel = pTextView->GetSelection(); - USHORT nCur = (USHORT)aSel.GetStart().GetPara(); + sal_uInt16 nCur = (sal_uInt16)aSel.GetStart().GetPara(); if(nCur > 40) nCur -= 40; else nCur = 0; if(aSyntaxLineTable.Count()) - for(USHORT i = 0; i < 80 && nCount < 40; i++, nCur++) + for(sal_uInt16 i = 0; i < 80 && nCount < 40; i++, nCur++) { void * p = aSyntaxLineTable.Get(nCur); if(p) @@ -571,9 +574,9 @@ IMPL_LINK( SwSrcEditWindow, SyntaxTimerHdl, Timer *, pTimer ) void* p = aSyntaxLineTable.First(); while ( p && nCount < MAX_SYNTAX_HIGHLIGHT) { - nLine = (USHORT)aSyntaxLineTable.GetCurKey(); + nLine = (sal_uInt16)aSyntaxLineTable.GetCurKey(); DoSyntaxHighlight( nLine ); - USHORT nCurKey = (USHORT)aSyntaxLineTable.GetCurKey(); + sal_uInt16 nCurKey = (sal_uInt16)aSyntaxLineTable.GetCurKey(); p = aSyntaxLineTable.Next(); aSyntaxLineTable.Remove(nCurKey); nCount ++; @@ -592,50 +595,50 @@ IMPL_LINK( SwSrcEditWindow, SyntaxTimerHdl, Timer *, pTimer ) nCurTextWidth = pTextEngine->CalcTextWidth() + 25; // kleine Toleranz if ( nCurTextWidth != nPrevTextWidth ) SetScrollBarRanges(); - bHighlighting = FALSE; + bHighlighting = sal_False; return 0; } -void SwSrcEditWindow::DoSyntaxHighlight( USHORT nPara ) +void SwSrcEditWindow::DoSyntaxHighlight( sal_uInt16 nPara ) { // Because of DelayedSyntaxHighlight it could happen, // that the line doesn't exist anymore! if ( nPara < pTextEngine->GetParagraphCount() ) { - BOOL bTempModified = IsModified(); - pTextEngine->RemoveAttribs( nPara, (BOOL)TRUE ); + sal_Bool bTempModified = IsModified(); + pTextEngine->RemoveAttribs( nPara, (sal_Bool)sal_True ); String aSource( pTextEngine->GetText( nPara ) ); - pTextEngine->SetUpdateMode( FALSE ); + pTextEngine->SetUpdateMode( sal_False ); ImpDoHighlight( aSource, nPara ); TextView* pTmp = pTextEngine->GetActiveView(); - pTmp->SetAutoScroll(FALSE); + pTmp->SetAutoScroll(sal_False); pTextEngine->SetActiveView(0); - pTextEngine->SetUpdateMode( TRUE ); + pTextEngine->SetUpdateMode( sal_True ); pTextEngine->SetActiveView(pTmp); - pTmp->SetAutoScroll(TRUE); - pTmp->ShowCursor( FALSE/*pTmp->IsAutoScroll()*/ ); + pTmp->SetAutoScroll(sal_True); + pTmp->ShowCursor( sal_False/*pTmp->IsAutoScroll()*/ ); if(!bTempModified) ClearModifyFlag(); } } -void SwSrcEditWindow::DoDelayedSyntaxHighlight( USHORT nPara ) +void SwSrcEditWindow::DoDelayedSyntaxHighlight( sal_uInt16 nPara ) { if ( !bHighlighting && bDoSyntaxHighlight ) { - aSyntaxLineTable.Insert( nPara, (void*)(USHORT)1 ); + aSyntaxLineTable.Insert( nPara, (void*)(sal_uInt16)1 ); aSyntaxIdleTimer.Start(); } } -void SwSrcEditWindow::ImpDoHighlight( const String& rSource, USHORT nLineOff ) +void SwSrcEditWindow::ImpDoHighlight( const String& rSource, sal_uInt16 nLineOff ) { SwTextPortions aPortionList; lcl_Highlight(rSource, aPortionList); - USHORT nCount = aPortionList.Count(); + size_t nCount = aPortionList.size(); if ( !nCount ) return; @@ -643,7 +646,7 @@ void SwSrcEditWindow::ImpDoHighlight( const String& rSource, USHORT nLineOff ) if ( rLast.nStart > rLast.nEnd ) // Only until Bug from MD is resolved { nCount--; - aPortionList.Remove( nCount); + aPortionList.pop_back(); if ( !nCount ) return; } @@ -651,19 +654,19 @@ void SwSrcEditWindow::ImpDoHighlight( const String& rSource, USHORT nLineOff ) // maybe optimize: // If frequently the same color, blank without color in between, // maybe summarize or at least the blank; for less attributes - BOOL bOptimizeHighlight = TRUE; // war in der BasicIDE static + sal_Bool bOptimizeHighlight = sal_True; // war in der BasicIDE static if ( bOptimizeHighlight ) { // Only blanks and tabs have to be attributed along. // When two identical attributes are placed consecutively, // it optimises the TextEngine. - USHORT nLastEnd = 0; + sal_uInt16 nLastEnd = 0; - for ( USHORT i = 0; i < nCount; i++ ) + for ( size_t i = 0; i < nCount; i++ ) { SwTextPortion& r = aPortionList[i]; #if OSL_DEBUG_LEVEL > 1 - USHORT nLine = aPortionList[0].nLine; + sal_uInt16 nLine = aPortionList[0].nLine; OSL_ENSURE( r.nLine == nLine, "doch mehrere Zeilen ?" ); #endif if ( r.nStart > r.nEnd ) // only until Bug from MD is resolved @@ -681,7 +684,7 @@ void SwSrcEditWindow::ImpDoHighlight( const String& rSource, USHORT nLineOff ) } } - for ( USHORT i = 0; i < aPortionList.Count(); i++ ) + for ( size_t i = 0; i < aPortionList.size(); i++ ) { SwTextPortion& r = aPortionList[i]; if ( r.nStart > r.nEnd ) // only until Bug from MD is resolved @@ -692,8 +695,8 @@ void SwSrcEditWindow::ImpDoHighlight( const String& rSource, USHORT nLineOff ) r.eType != svtools::HTMLUNKNOWN) r.eType = svtools::HTMLUNKNOWN; Color aColor((ColorData)SW_MOD()->GetColorConfig().GetColorValue((svtools::ColorConfigEntry)r.eType).nColor); - USHORT nLine = nLineOff+r.nLine; // - pTextEngine->SetAttrib( TextAttribFontColor( aColor ), nLine, r.nStart, r.nEnd+1, TRUE ); + sal_uInt16 nLine = nLineOff+r.nLine; // + pTextEngine->SetAttrib( TextAttribFontColor( aColor ), nLine, r.nStart, r.nEnd+1, sal_True ); } } @@ -717,7 +720,7 @@ void SwSrcEditWindow::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) else if( ( rTextHint.GetId() == TEXT_HINT_PARAINSERTED ) || ( rTextHint.GetId() == TEXT_HINT_PARACONTENTCHANGED ) ) { - DoDelayedSyntaxHighlight( (USHORT)rTextHint.GetValue() ); + DoDelayedSyntaxHighlight( (sal_uInt16)rTextHint.GetValue() ); } } } @@ -728,7 +731,7 @@ void SwSrcEditWindow::ConfigurationChanged( utl::ConfigurationBroadcaster* pBrdC SetFont(); } -void SwSrcEditWindow::Invalidate(USHORT ) +void SwSrcEditWindow::Invalidate(sal_uInt16 ) { pOutWin->Invalidate(); Window::Invalidate(); @@ -764,7 +767,7 @@ void SwSrcEditWindow::GetFocus() pOutWin->GrabFocus(); } -BOOL lcl_GetLanguagesForEncoding(rtl_TextEncoding eEnc, LanguageType aLanguages[]) +sal_Bool lcl_GetLanguagesForEncoding(rtl_TextEncoding eEnc, LanguageType aLanguages[]) { switch(eEnc) { |