diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-03-27 20:42:57 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-03-28 08:57:49 +0000 |
commit | 38e4ef50d43bdab45e7b43244b3fc6dde6f0e697 (patch) | |
tree | c97527081663c6d743371cece82587427141f228 /sw | |
parent | 4e0118aba0d41008c1a31b1cdc7ce7596b894ae2 (diff) |
Related: fdo#73936 for spelling restrict formelements-as-fields..
to dropdowns to be on the safe side for now anyway.
Change-Id: I88a73fe37b39306c6b24226e3b02c702d992ecb0
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/IDocumentMarkAccess.hxx | 1 | ||||
-rw-r--r-- | sw/source/core/doc/docbm.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/edit/edlingu.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/inc/MarkManager.hxx | 1 |
4 files changed, 11 insertions, 1 deletions
diff --git a/sw/inc/IDocumentMarkAccess.hxx b/sw/inc/IDocumentMarkAccess.hxx index 3fd37b890129..7ae711cc5eb3 100644 --- a/sw/inc/IDocumentMarkAccess.hxx +++ b/sw/inc/IDocumentMarkAccess.hxx @@ -249,6 +249,7 @@ class IDocumentMarkAccess virtual ::sw::mark::IFieldmark* getFieldmarkBefore(const SwPosition& pos) const =0; virtual ::sw::mark::IFieldmark* getFieldmarkAfter(const SwPosition& pos) const =0; + virtual ::sw::mark::IFieldmark* getDropDownFor(const SwPosition& pos) const=0; virtual std::vector< ::sw::mark::IFieldmark* > getDropDownsFor(const SwPaM &rPaM) const=0; // Marks exclusive annotation marks diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx index e3f3583002e8..481490bb5086 100644 --- a/sw/source/core/doc/docbm.cxx +++ b/sw/source/core/doc/docbm.cxx @@ -1013,6 +1013,14 @@ namespace sw { namespace mark return dynamic_cast<IFieldmark*>(pFieldmark->get()); } + IFieldmark* MarkManager::getDropDownFor(const SwPosition& rPos) const + { + IFieldmark *pMark = getFieldmarkFor(rPos); + if (!pMark || pMark->GetFieldname() != ODF_FORMDROPDOWN) + return NULL; + return pMark; + } + std::vector<IFieldmark*> MarkManager::getDropDownsFor(const SwPaM &rPaM) const { std::vector<IFieldmark*> aRet; diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx index ed7b06729244..bc3a0fa6e09f 100644 --- a/sw/source/core/edit/edlingu.cxx +++ b/sw/source/core/edit/edlingu.cxx @@ -1661,7 +1661,7 @@ void SwSpellIter::AddPortion(uno::Reference< XSpellAlternatives > xAlt, else if (cChar == CH_TXT_ATR_FORMELEMENT) { SwPosition aPos(*pCrsr->GetMark()); - bField = pMySh->GetDoc()->getIDocumentMarkAccess()->getFieldmarkFor(aPos); + bField = pMySh->GetDoc()->getIDocumentMarkAccess()->getDropDownFor(aPos); } LanguageType eCurLanguage = lcl_GetLanguage(*GetSh()); diff --git a/sw/source/core/inc/MarkManager.hxx b/sw/source/core/inc/MarkManager.hxx index 890fe7d591fc..a5a6b6db83ce 100644 --- a/sw/source/core/inc/MarkManager.hxx +++ b/sw/source/core/inc/MarkManager.hxx @@ -82,6 +82,7 @@ namespace sw { virtual ::sw::mark::IFieldmark* getFieldmarkBefore(const SwPosition& rPos) const SAL_OVERRIDE; virtual ::sw::mark::IFieldmark* getFieldmarkAfter(const SwPosition& rPos) const SAL_OVERRIDE; + virtual ::sw::mark::IFieldmark* getDropDownFor(const SwPosition &rPos) const; virtual std::vector< ::sw::mark::IFieldmark* > getDropDownsFor(const SwPaM &rPaM) const; void dumpAsXml(xmlTextWriterPtr w); |