summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-12-30 10:32:16 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-12-30 19:04:25 +0100
commit271722d923610d128a358528e64d7233641ea0dc (patch)
treedbbcf6977aec534ebb8ca14b6de146f5d3bf3e49
parentdc5383e2fa487a7599f2e317bba409dc3cde8339 (diff)
i#93570 sw: add RES_FLTR_ANNOTATIONMARK
As commit b1cd83c625a2afeb9da43cc9745d79c01963c797 (fix crash loading ooo#93570-3.doc, 2014-07-04) notes, the way how we map WW8 CP indexes to sw character positions is working only in the very simple cases. However, to do that properly, we need a way to store the start position of an annotation mark before we create it, so add a RES_FLTR_ANNOTATIONMARK that can do so. Change-Id: I7cb3564621803fef9a76edaac48773cab7649ee8
-rw-r--r--sw/inc/hintids.hxx1
-rw-r--r--sw/source/filter/basflt/fltshell.cxx14
-rw-r--r--sw/source/filter/inc/fltshell.hxx2
3 files changed, 14 insertions, 3 deletions
diff --git a/sw/inc/hintids.hxx b/sw/inc/hintids.hxx
index 4bcde231110a..ecfd937bb92e 100644
--- a/sw/inc/hintids.hxx
+++ b/sw/inc/hintids.hxx
@@ -350,6 +350,7 @@ enum RES_FLTRATTR
RES_FLTR_NUMRULE,
RES_FLTR_TOX,
RES_FLTR_REDLINE,
+ RES_FLTR_ANNOTATIONMARK,
RES_FLTRATTR_END
};
diff --git a/sw/source/filter/basflt/fltshell.cxx b/sw/source/filter/basflt/fltshell.cxx
index 758e1347dfb1..5692dcdba7fd 100644
--- a/sw/source/filter/basflt/fltshell.cxx
+++ b/sw/source/filter/basflt/fltshell.cxx
@@ -347,12 +347,16 @@ SwFltStackEntry* SwFltControlStack::SetAttr(const SwPosition& rPos,
}
else if (nAttrId == rEntry.pAttr->Which())
{
- if( nAttrId != RES_FLTR_BOOKMARK )
+ if( nAttrId != RES_FLTR_BOOKMARK && nAttrId != RES_FLTR_ANNOTATIONMARK )
{
// query handle
bF = true;
}
- else if (nHand == static_cast<SwFltBookmark*>(rEntry.pAttr)->GetHandle())
+ else if (nAttrId == RES_FLTR_BOOKMARK && nHand == static_cast<SwFltBookmark*>(rEntry.pAttr)->GetHandle())
+ {
+ bF = true;
+ }
+ else if (nAttrId == RES_FLTR_ANNOTATIONMARK && nHand == static_cast<CntUInt16Item*>(rEntry.pAttr)->GetValue())
{
bF = true;
}
@@ -583,6 +587,12 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos,
}
}
break;
+ case RES_FLTR_ANNOTATIONMARK:
+ {
+ MakeBookRegionOrPoint(rEntry, pDoc, aRegion, true);
+ pDoc->getIDocumentMarkAccess()->makeAnnotationMark(aRegion, OUString());
+ }
+ break;
case RES_FLTR_TOX:
{
MakePoint(rEntry, pDoc, aRegion);
diff --git a/sw/source/filter/inc/fltshell.hxx b/sw/source/filter/inc/fltshell.hxx
index f1f35f893654..c4c6021dacc9 100644
--- a/sw/source/filter/inc/fltshell.hxx
+++ b/sw/source/filter/inc/fltshell.hxx
@@ -148,7 +148,6 @@ protected:
SwDoc* pDoc;
bool bIsEndStack;
- void MoveAttrs( const SwPosition& rPos );
virtual void SetAttrInDoc(const SwPosition& rTmpPos, SwFltStackEntry& rEntry);
virtual sal_Int32 GetCurrAttrCP() const {return -1;}
virtual bool IsParaEndInCPs(sal_Int32 nStart,sal_Int32 nEnd,bool bSdOD=true) const;
@@ -159,6 +158,7 @@ protected:
bool HasSdOD();
public:
+ void MoveAttrs( const SwPosition& rPos );
enum Flags
{
HYPO,