diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2021-02-11 16:37:00 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2021-02-11 18:50:08 +0100 |
commit | b11db88d0174fbad25f7ee04726ae27ceb1488c3 (patch) | |
tree | 42166c5bfa038246b796d478c21f83eea4e4cb4f /sw/inc | |
parent | 8180bdc75c2bf3c1f813469eabd38db0612f1c91 (diff) |
sw tooltip on bibliography fields: add the actual tooltip functionality
- Similar to e.g. SwMacroField::GetMacro(), add a new
SwAuthorityField::GetAuthority() that returns a string which is similar
to the one-liner text node in the bibliography table for a given
bibliography reference.
- Base this on the recently added
SwAuthorityFieldType::CreateTOXInternational() and
SwTOXAuthority::GetText() to share code with
sw::ToxTextGenerator::GenerateText() and SwTOXBaseSection::Update().
- Finally extend SwEditWin::RequestHelp() to actually provide the
tooltip on mouse hover.
Change-Id: I33a58076c6d141566298259e7e4681541fac1055
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110765
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sw/inc')
-rw-r--r-- | sw/inc/authfld.hxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sw/inc/authfld.hxx b/sw/inc/authfld.hxx index 7b7bdd8518be..6436a17bb5f0 100644 --- a/sw/inc/authfld.hxx +++ b/sw/inc/authfld.hxx @@ -30,6 +30,7 @@ #include <vector> class SwTOXInternational; +class SwTextAttr; class SwAuthEntry final : public salhelper::SimpleReferenceObject { @@ -148,7 +149,7 @@ public: one of the instances with the same m_nHandle is actually in the document, they're all cloned via CopyField()... */ -class SAL_DLLPUBLIC_RTTI SwAuthorityField final : public SwField +class SW_DLLPUBLIC SwAuthorityField final : public SwField { rtl::Reference<SwAuthEntry> m_xAuthEntry; mutable sal_IntPtr m_nTempSequencePos; @@ -162,7 +163,7 @@ public: OUString ConditionalExpandAuthIdentifier(SwRootFrame const* pLayout) const; //To handle Citation - SW_DLLPUBLIC OUString ExpandCitation(ToxAuthorityField eField, SwRootFrame const* pLayout) const; + OUString ExpandCitation(ToxAuthorityField eField, SwRootFrame const* pLayout) const; SwAuthorityField(SwAuthorityFieldType* pType, const OUString& rFieldContents); SwAuthorityField(SwAuthorityFieldType* pType, SwAuthEntry* pAuthEntry); @@ -179,6 +180,9 @@ public: SwAuthEntry* GetAuthEntry() const { return m_xAuthEntry.get(); } virtual OUString GetDescription() const override; + + /// Returns the line matching the source's default row in the ToX. + OUString GetAuthority(const SwTextAttr* pTextAttr, const SwRootFrame* pLayout) const; }; inline OUString const & SwAuthEntry::GetAuthorField(ToxAuthorityField ePos) const |