summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@libreoffice.org>2018-02-08 09:13:38 +0100
committerBjoern Michaelsen <bjoern.michaelsen@libreoffice.org>2018-02-08 09:13:38 +0100
commita28bcab9c6225ccfb03366e998a9fa997b5560f8 (patch)
treef8225f14dfcddb653368c15d445e46dd874a2b33
parentc91b4422eb57e3eaab07d1a3a2f3fc29341b4fd3 (diff)
ddefld: proper message passing
Change-Id: Ic6f62879339bd6373c16b57847f57445fd40f493
-rw-r--r--sw/source/core/fields/ddefld.cxx10
-rw-r--r--sw/source/core/fields/ddetbl.cxx12
2 files changed, 10 insertions, 12 deletions
diff --git a/sw/source/core/fields/ddefld.cxx b/sw/source/core/fields/ddefld.cxx
index 61165b6fe1ce..1fdafc06a35a 100644
--- a/sw/source/core/fields/ddefld.cxx
+++ b/sw/source/core/fields/ddefld.cxx
@@ -174,16 +174,6 @@ const SwNode* SwIntrnlRefLink::GetAnchor() const
{
// here, any anchor of the normal NodesArray should be sufficient
const SwNode* pNd = nullptr;
- SwIterator<SwDepend,SwFieldType> aIter(rFieldType);
- for(SwDepend* pLast = aIter.First(); pLast; pLast = aIter.Next())
- {
- // a DDE table or a DDE field attribute in the text
- SwDDETable* pDDETable = static_cast<SwDDETable*>(pLast->GetToTell());
- pNd = pDDETable->GetTabSortBoxes()[0]->GetSttNd();
- if( pNd && &rFieldType.GetDoc()->GetNodes() == &pNd->GetNodes() )
- break;
- pNd = nullptr;
- }
rFieldType.CallSwClientNotify(sw::LinkAnchorSearchHint(rFieldType.GetDoc()->GetNodes(), pNd));
return pNd;
}
diff --git a/sw/source/core/fields/ddetbl.cxx b/sw/source/core/fields/ddetbl.cxx
index 0047f22f8296..99a1843f2669 100644
--- a/sw/source/core/fields/ddetbl.cxx
+++ b/sw/source/core/fields/ddetbl.cxx
@@ -32,6 +32,7 @@
#include <fldupde.hxx>
#include <swtblfmt.hxx>
#include <fieldhint.hxx>
+#include <ddefld.hxx>
/// Ctor moves all lines/boxes from a SwTable into itself.
@@ -93,10 +94,17 @@ void SwDDETable::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
void SwDDETable::SwClientNotify( const SwModify& rModify, const SfxHint& rHint )
{
SwClient::SwClientNotify(rModify, rHint);
- const SwFieldHint* pHint = dynamic_cast<const SwFieldHint*>( &rHint );
- if ( pHint )
+ if(dynamic_cast<const SwFieldHint*>(&rHint))
// replace DDETable by real table
NoDDETable();
+ else if(const auto pLinkAnchorHint = dynamic_cast<const sw::LinkAnchorSearchHint*>(&rHint))
+ {
+ if(pLinkAnchorHint->m_rpFoundNode)
+ return;
+ const auto pNd = GetTabSortBoxes()[0]->GetSttNd();
+ if( pNd && &pLinkAnchorHint->m_rNodes == &pNd->GetNodes() )
+ pLinkAnchorHint->m_rpFoundNode = pNd;
+ }
}
void SwDDETable::ChangeContent()