diff options
author | Gülşah Köse <gulsah.kose@collabora.com> | 2022-12-12 14:22:53 +0300 |
---|---|---|
committer | Gökay ŞATIR <gokaysatir@collabora.com> | 2022-12-21 10:53:27 +0000 |
commit | 5b8b90d4bdc70dc697adf5014c394e5d2f1adffe (patch) | |
tree | b81a0bf286923667f0bafaaa648e590282960e24 | |
parent | 7b279ffa22a5c2080e31e6cac534ccc048229e6e (diff) |
tdf#152483 Fix the insert hyperlink behaviour on Calc
Cursor invalidation message shouldn't carry a hyperlink info to online
side if there is no hyperlink under the cursor
Change-Id: Ibdb6e32d029e101212d03bc117a5a14a712822ef
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143986
Tested-by: Jenkins
Reviewed-by: Dennis Francis <dennis.francis@collabora.com>
(cherry picked from commit e9356f9ced3167cd927e98617bab54048cc63073)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144184
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
Reviewed-by: Gökay ŞATIR <gokaysatir@collabora.com>
-rw-r--r-- | editeng/source/editeng/impedit.cxx | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx index 344f9a24ba03..a6387ba1d776 100644 --- a/editeng/source/editeng/impedit.cxx +++ b/editeng/source/editeng/impedit.cxx @@ -22,6 +22,7 @@ #include <editeng/editeng.hxx> #include <editeng/editview.hxx> #include <editeng/outliner.hxx> +#include <editeng/urlfieldhelper.hxx> #include <tools/poly.hxx> #include <editeng/unolingu.hxx> #include <com/sun/star/linguistic2/XDictionary.hpp> @@ -1415,19 +1416,17 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool bForceVisCursor ) // is cursor at a misspelled word ? Reference< linguistic2::XSpellChecker1 > xSpeller( pEditEngine->pImpEditEngine->GetSpeller() ); bool bIsWrong = xSpeller.is() && IsWrongSpelledWord(aPaM, /*bMarkIfWrong*/ false); + EditView* pActiveView = GetEditViewPtr(); boost::property_tree::ptree aHyperlinkTree; - if (const SvxFieldItem* pFld = GetField(aPos, nullptr, nullptr)) + if (URLFieldHelper::IsCursorAtURLField(*pActiveView)) { - if (auto pUrlField = dynamic_cast<const SvxURLField*>(pFld->GetField())) - { - aHyperlinkTree = getHyperlinkPropTree(pUrlField->GetRepresentation(), pUrlField->GetURL()); - } + if (const SvxFieldItem* pFld = GetField(aPos, nullptr, nullptr)) + if (auto pUrlField = dynamic_cast<const SvxURLField*>(pFld->GetField())) + aHyperlinkTree = getHyperlinkPropTree(pUrlField->GetRepresentation(), pUrlField->GetURL()); } else if (GetEditSelection().HasRange()) { - EditView* pActiveView = GetEditViewPtr(); - if (pActiveView) { const SvxFieldItem* pFieldItem = pActiveView->GetFieldAtSelection(); |