summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/doc/docbm.cxx2
-rw-r--r--sw/source/core/doc/docedt.cxx20
2 files changed, 9 insertions, 13 deletions
diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index cfc8629fc280..f3befe4f1ecd 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -593,7 +593,7 @@ namespace sw { namespace mark
isPosInRange = true, isOtherPosInRange = true;
}
- if(isPosInRange && (isOtherPosInRange || !pMark->IsExpanded() || IDocumentMarkAccess::GetType(*pMark) == TEXT_FIELDMARK))
+ if(isPosInRange && (isOtherPosInRange || !pMark->IsExpanded()))
{
// completely in range
diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index 365529457e12..5ae2ab6f5d16 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -76,6 +76,7 @@
#include "editsh.hxx"
#include <fldbas.hxx>
#include <fmtfld.hxx>
+#include <docufld.hxx>
#include <unoflatpara.hxx>
#include <SwGrammarMarkUp.hxx>
@@ -1646,21 +1647,16 @@ bool SwDoc::DeleteRangeImplImpl(SwPaM & rPam)
{
SwTxtNode* pTxtNd = rPam.Start()->nNode.GetNode().GetTxtNode();
xub_StrLen nIndex = rPam.Start()->nContent.GetIndex();
- // If there are at least two chars before the postit, we may have a fieldmark there.
- if (pTxtNd->GetTxt().GetChar(nIndex) == CH_TXTATR_INWORD && nIndex > 1)
+ // We may have a postit here.
+ if (pTxtNd->GetTxt().GetChar(nIndex) == CH_TXTATR_INWORD)
{
SwTxtAttr* pTxtAttr = pTxtNd->GetTxtAttrForCharAt(nIndex, RES_TXTATR_FIELD);
- if (pTxtAttr && pTxtAttr->GetFld().GetFld()->Which() == RES_POSTITFLD && pTxtNd->GetTxt().GetChar(nIndex - 1) == CH_TXT_ATR_FIELDEND)
+ if (pTxtAttr && pTxtAttr->GetFld().GetFld()->Which() == RES_POSTITFLD)
{
- xub_StrLen nStart = pTxtNd->GetTxt().SearchBackward(CH_TXT_ATR_FIELDSTART, nIndex - 2);
- if (nStart != STRING_NOTFOUND)
- {
- SwIndex aStart(pStt->nContent);
- aStart = nStart;
- SwIndex aEnd(pEnd->nContent);
- aEnd = nIndex - 1;
- _DelBookmarks(pStt->nNode, pEnd->nNode, NULL, &aStart, &aEnd);
- }
+ const SwPostItField* pField = dynamic_cast<const SwPostItField*>(pTxtAttr->GetFld().GetFld());
+ IDocumentMarkAccess::const_iterator_t ppMark = getIDocumentMarkAccess()->findMark(pField->GetName());
+ if (ppMark != getIDocumentMarkAccess()->getMarksEnd())
+ getIDocumentMarkAccess()->deleteMark(ppMark);
}
}
}