diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-01-27 16:51:21 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-01-27 16:51:21 +0000 |
commit | e8d3dfd9c4c2674ac759fda2a5546e89a34d728b (patch) | |
tree | b41c80e7e92222b14bf12e93ab7e5685858bbf28 | |
parent | 78a5c5dcf0bd0a4406ea5d7da7573010863299b8 (diff) |
Revert "merge these two selection changing hunks of code"
This reverts commit bef9cc01c7da9fd75393bfa1818e07f484306829.
-rw-r--r-- | sw/source/ui/fldui/fldedt.cxx | 49 | ||||
-rw-r--r-- | sw/source/uibase/inc/fldedt.hxx | 3 |
2 files changed, 25 insertions, 27 deletions
diff --git a/sw/source/ui/fldui/fldedt.cxx b/sw/source/ui/fldui/fldedt.cxx index 98f959f24708..8a1eb1eb0690 100644 --- a/sw/source/ui/fldui/fldedt.cxx +++ b/sw/source/ui/fldui/fldedt.cxx @@ -49,28 +49,6 @@ #include <boost/scoped_ptr.hpp> #include <swuiexp.hxx> -void SwFldEditDlg::EnsureSelection(SwField *pCurFld) -{ - if (pSh->CrsrInsideInputFld()) - { - // move cursor to start of Input Field - SwInputField* pInputFld = dynamic_cast<SwInputField*>(pCurFld); - if (pInputFld && pInputFld->GetFmtFld()) - { - pSh->GotoField( *(pInputFld->GetFmtFld()) ); - } - } - - /* Only create selection if there is none already. - Normalize PaM instead of swapping. */ - if (!pSh->HasSelection()) - { - //Note that after this, it is possible that rMgr.GetCurFld() != pCurFld - pSh->Right(CRSR_SKIP_CHARS, true, 1, false ); - } - - pSh->NormalizePam(); -} SwFldEditDlg::SwFldEditDlg(SwView& rVw) : SfxSingleTabDialog(&rVw.GetViewFrame()->GetWindow(), 0, @@ -84,12 +62,28 @@ SwFldEditDlg::SwFldEditDlg(SwView& rVw) SwFldMgr aMgr(pSh); SwField *pCurFld = aMgr.GetCurFld(); - if (!pCurFld) + if(!pCurFld) return; SwViewShell::SetCareWin(this); - EnsureSelection(pCurFld); + if ( pSh->CrsrInsideInputFld() ) + { + // move cursor to start of Input Field + SwInputField* pInputFld = dynamic_cast<SwInputField*>(pCurFld); + if ( pInputFld != NULL + && pInputFld->GetFmtFld() != NULL ) + { + pSh->GotoField( *(pInputFld->GetFmtFld()) ); + } + } + + if ( ! pSh->HasSelection() ) + { + pSh->Right(CRSR_SKIP_CHARS, true, 1, false); + } + + pSh->NormalizePam(); sal_uInt16 nGroup = aMgr.GetGroup(false, pCurFld->GetTypeId(), pCurFld->GetSubType()); @@ -260,7 +254,12 @@ IMPL_LINK( SwFldEditDlg, NextPrevHdl, Button *, pButton ) rMgr.GoNextPrev( bNext, pOldTyp ); pCurFld = rMgr.GetCurFld(); - EnsureSelection(pCurFld); + /* #108536# Only create selection if there is none + already. Normalize PaM instead of swapping. */ + if ( ! pSh->HasSelection() ) + pSh->Right(CRSR_SKIP_CHARS, true, 1, false ); + + pSh->NormalizePam(); sal_uInt16 nGroup = rMgr.GetGroup(false, pCurFld->GetTypeId(), pCurFld->GetSubType()); diff --git a/sw/source/uibase/inc/fldedt.hxx b/sw/source/uibase/inc/fldedt.hxx index fc8f27d6eaca..0c859e9fd69d 100644 --- a/sw/source/uibase/inc/fldedt.hxx +++ b/sw/source/uibase/inc/fldedt.hxx @@ -37,10 +37,9 @@ class SwFldEditDlg : public SfxSingleTabDialog void Init(); SfxTabPage* CreatePage(sal_uInt16 nGroup); - void EnsureSelection(SwField *pCurFld); public: - SwFldEditDlg(SwView& rVw); + SwFldEditDlg(SwView& rVw); virtual ~SwFldEditDlg(); DECL_LINK(OKHdl, void *); |