[Libreoffice-commits] core.git: sw/source

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Wed Feb 10 15:36:17 UTC 2021


 sw/source/core/inc/txmsrt.hxx |    1 +
 sw/source/core/tox/txmsrt.cxx |   12 ++++++++----
 2 files changed, 9 insertions(+), 4 deletions(-)

New commits:
commit 0cc3c55fe696156dec116cde823258c20ca70a8e
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Wed Feb 10 15:33:58 2021 +0100
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Wed Feb 10 16:35:28 2021 +0100

    sw tooltip on bibliography fields: add a text factory that gives us a string
    
    Normally an SwTextNode is created, then we insert the result directly to
    that at a specified position. This way the text for a ToxAuthorityField
    can be created without a temporary SwTextNode.
    
    Towards providing a tooltip on mouseover for bibliography reference fields.
    
    Change-Id: I66e9ca12129b988b7301c33fb80c133d4f7fadfd
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110712
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
    Tested-by: Jenkins

diff --git a/sw/source/core/inc/txmsrt.hxx b/sw/source/core/inc/txmsrt.hxx
index c4c91b734a00..4c06c03c1d3f 100644
--- a/sw/source/core/inc/txmsrt.hxx
+++ b/sw/source/core/inc/txmsrt.hxx
@@ -295,6 +295,7 @@ public:
     virtual bool    equivalent( const SwTOXSortTabBase& ) override;
     virtual bool    sort_lt( const SwTOXSortTabBase& ) override;
     virtual sal_uInt16  GetLevel() const override;
+    OUString GetText(sal_uInt16 nAuthField, const SwRootFrame* pLayout) const;
 };
 
 #endif // INCLUDED_SW_SOURCE_CORE_INC_TXMSRT_HXX
diff --git a/sw/source/core/tox/txmsrt.cxx b/sw/source/core/tox/txmsrt.cxx
index 3bdd2871c23c..25456a292169 100644
--- a/sw/source/core/tox/txmsrt.cxx
+++ b/sw/source/core/tox/txmsrt.cxx
@@ -815,9 +815,7 @@ TextAndReading SwTOXAuthority::GetText_Impl(SwRootFrame const*const pLayout) con
     return TextAndReading(lcl_GetText(m_rField, pLayout), OUString());
 }
 
-void    SwTOXAuthority::FillText( SwTextNode& rNd,
-                        const SwIndex& rInsPos, sal_uInt16 nAuthField,
-        SwRootFrame const*const pLayout) const
+OUString SwTOXAuthority::GetText(sal_uInt16 nAuthField, const SwRootFrame* pLayout) const
 {
     SwAuthorityField* pField = static_cast<SwAuthorityField*>(m_rField.GetField());
     OUString sText;
@@ -840,7 +838,13 @@ void    SwTOXAuthority::FillText( SwTextNode& rNd,
     }
     else
         sText = pField->GetFieldText(static_cast<ToxAuthorityField>(nAuthField));
-    rNd.InsertText( sText, rInsPos );
+    return sText;
+}
+
+void SwTOXAuthority::FillText(SwTextNode& rNd, const SwIndex& rInsPos, sal_uInt16 nAuthField,
+                              SwRootFrame const* const pLayout) const
+{
+    rNd.InsertText(GetText(nAuthField, pLayout), rInsPos);
 }
 
 bool SwTOXAuthority::equivalent(const SwTOXSortTabBase& rCmp)


More information about the Libreoffice-commits mailing list