summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Heinisch <andreas.heinisch@yahoo.de>2022-10-01 11:31:41 +0200
committerAndreas Heinisch <andreas.heinisch@yahoo.de>2022-10-01 21:58:17 +0200
commit2a7fcaf582df3ada57ca519b50e29011973a1b6f (patch)
tree248fcfde1fc7aec7f1c61ea6fa2c1479574af250
parentUnused constants (diff)
downloadcore-2a7fcaf582df3ada57ca519b50e29011973a1b6f.tar.gz
core-2a7fcaf582df3ada57ca519b50e29011973a1b6f.zip
tdf#143158 - Handle double clicks on alphabetical indices
Open the edit index dialog when double-clicking an alphabetical index field. Change-Id: Iaba398e485d2e7e848503189ad1f3b12975a5a71 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140836 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
-rw-r--r--sw/source/uibase/docvw/edtwin.cxx19
-rw-r--r--sw/source/uibase/shells/textidx.cxx2
2 files changed, 20 insertions, 1 deletions
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index 1ceb7d70f827..d7fed1052210 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -3514,6 +3514,25 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
}
}
+ // tdf#143158 - handle alphabetical index entries
+ SwContentAtPos aToxContentAtPos(IsAttrAtPos::ToxMark);
+ if (rSh.GetContentAtPos(aDocPos, aToxContentAtPos))
+ {
+ const OUString sToxText = aToxContentAtPos.sStr;
+ if (!sToxText.isEmpty() && aToxContentAtPos.pFndTextAttr)
+ {
+ const SwTOXType* pTType
+ = aToxContentAtPos.pFndTextAttr->GetTOXMark().GetTOXType();
+ if (pTType && pTType->GetType() == TOXTypes::TOX_INDEX)
+ {
+ RstMBDownFlags();
+ GetView().GetViewFrame()->GetBindings().Execute(
+ FN_EDIT_IDX_ENTRY_DLG);
+ return;
+ }
+ }
+ }
+
g_bHoldSelection = true;
return;
}
diff --git a/sw/source/uibase/shells/textidx.cxx b/sw/source/uibase/shells/textidx.cxx
index 590b9fa82f0b..299de33d1490 100644
--- a/sw/source/uibase/shells/textidx.cxx
+++ b/sw/source/uibase/shells/textidx.cxx
@@ -196,7 +196,7 @@ void SwTextShell::GetIdxState(SfxItemSet &rSet)
bool bEnableEdit = true;
bool bInReadonly = rSh.HasReadonlySel();
- if( rSh.HasSelection() || bInReadonly)
+ if(bInReadonly)
bEnableEdit = false;
else
{