summaryrefslogtreecommitdiff
path: root/sw/source/filter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-12-30 10:32:16 +0100
committerAndras Timar <andras.timar@collabora.com>2015-01-05 19:00:32 +0100
commit1cea71c84a07ce84efd44578538faddea0708cfb (patch)
tree98c52676aae9fa9e79be90b38f4de1ef68160ece /sw/source/filter
parentca2174e24369bc63a2475ee471bf76697a859317 (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. (cherry picked from commit 271722d923610d128a358528e64d7233641ea0dc) Conflicts: sw/source/filter/basflt/fltshell.cxx Change-Id: I7cb3564621803fef9a76edaac48773cab7649ee8
Diffstat (limited to 'sw/source/filter')
-rw-r--r--sw/source/filter/basflt/fltshell.cxx14
-rw-r--r--sw/source/filter/inc/fltshell.hxx2
2 files changed, 13 insertions, 3 deletions
diff --git a/sw/source/filter/basflt/fltshell.cxx b/sw/source/filter/basflt/fltshell.cxx
index 5b941025f740..d30a6dbefaf2 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 == ((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 3738c19f2576..8aa6ede620ef 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,