diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-08-12 14:37:24 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-08-12 14:42:05 +0100 |
commit | b7060e96dfef8e672ae954eb435a9513400c4ea9 (patch) | |
tree | 4b85185a5f91a675339ebffe7be311b76ae12b18 /sw/source/ui | |
parent | b9898f03eb05411c508b1b02588812074d40417a (diff) |
Resolves: tdf#87686 don't refresh index entry from selection on regain focus
Remain populating it from the initial selection on popup, but on
losing focus and regaining it, leave the contents alone. Provide a refresh
button to provide access to optionally updating the contents from the
document selection.
Change-Id: Ifcde5fac341655f1219f4d2a7057e788d3bb0b18
Diffstat (limited to 'sw/source/ui')
-rw-r--r-- | sw/source/ui/index/swuiidxmrk.cxx | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/sw/source/ui/index/swuiidxmrk.cxx b/sw/source/ui/index/swuiidxmrk.cxx index a6a180d67ba9..cc82dbfa5d3c 100644 --- a/sw/source/ui/index/swuiidxmrk.cxx +++ b/sw/source/ui/index/swuiidxmrk.cxx @@ -97,6 +97,8 @@ SwIndexMarkPane::SwIndexMarkPane(Dialog &rDialog, bool bNewDlg, rDialog.get(m_pTypeDCB, "typecb"); rDialog.get(m_pNewBT, "new"); rDialog.get(m_pEntryED, "entryed"); + rDialog.get(m_pSyncED, "sync"); + m_pSyncED->Show(); rDialog.get(m_pPhoneticFT0, "phonetic0ft"); rDialog.get(m_pPhoneticED0, "phonetic0ed"); rDialog.get(m_pKey1FT, "key1ft"); @@ -151,6 +153,7 @@ SwIndexMarkPane::SwIndexMarkPane(Dialog &rDialog, bool bNewDlg, m_pPhoneticED0->SetModifyHdl(LINK(this,SwIndexMarkPane, PhoneticEDModifyHdl)); m_pPhoneticED1->SetModifyHdl(LINK(this,SwIndexMarkPane, PhoneticEDModifyHdl)); m_pPhoneticED2->SetModifyHdl(LINK(this,SwIndexMarkPane, PhoneticEDModifyHdl)); + m_pSyncED->SetClickHdl(LINK(this, SwIndexMarkPane, SyncSelectionHdl)); if(bNewMark) { @@ -359,32 +362,33 @@ OUString SwIndexMarkPane::GetDefaultPhoneticReading( const OUString& rText ) return xExtendedIndexEntrySupplier->getPhoneticCandidate(rText, LanguageTag::convertToLocale( nLangForPhoneticReading )); } -// Change the content of m_pEntryED if text is selected void SwIndexMarkPane::Activate() { // display current selection (first element) ???? - if(bNewMark) + if (bNewMark) { - if (pSh->GetCursorCnt() < 2) - { - bSelected = !pSh->HasSelection(); - aOrgStr = pSh->GetView().GetSelectionTextParam(true, false); - m_pEntryED->SetText(aOrgStr); - - //to include all equal entries may only be allowed in the body and even there - //only when a simple selection exists - const FrameTypeFlags nFrameType = pSh->GetFrameType(nullptr,true); - m_pApplyToAllCB->Show(); - m_pSearchCaseSensitiveCB->Show(); - m_pSearchCaseWordOnlyCB->Show(); - m_pApplyToAllCB->Enable(!aOrgStr.isEmpty() && - !(nFrameType & ( FrameTypeFlags::HEADER | FrameTypeFlags::FOOTER | FrameTypeFlags::FLY_ANY ))); - SearchTypeHdl(m_pApplyToAllCB); - } - ModifyHdl(m_pTypeDCB); + m_pSyncED->Enable(pSh->GetCursorCnt() < 2); } } +IMPL_LINK_NOARG_TYPED(SwIndexMarkPane, SyncSelectionHdl, Button*, void) +{ + bSelected = !pSh->HasSelection(); + aOrgStr = pSh->GetView().GetSelectionTextParam(true, false); + m_pEntryED->SetText(aOrgStr); + + //to include all equal entries may only be allowed in the body and even there + //only when a simple selection exists + const FrameTypeFlags nFrameType = pSh->GetFrameType(nullptr,true); + m_pApplyToAllCB->Show(); + m_pSearchCaseSensitiveCB->Show(); + m_pSearchCaseWordOnlyCB->Show(); + m_pApplyToAllCB->Enable(!aOrgStr.isEmpty() && + !(nFrameType & ( FrameTypeFlags::HEADER | FrameTypeFlags::FOOTER | FrameTypeFlags::FLY_ANY ))); + SearchTypeHdl(m_pApplyToAllCB); + ModifyHdl(m_pTypeDCB); +} + // evaluate Ok-Button void SwIndexMarkPane::Apply() { |