diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2019-07-03 10:35:48 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2019-07-03 12:58:16 +0200 |
commit | 132803f99818bffbdc260918ad7a304f228f2843 (patch) | |
tree | 2ad2132ea85ce9bd554ec0e7d650fbd33de9e53b /sw/source/filter/basflt | |
parent | 58ef52cf3258030860d34f05bc19e2b42d9503c6 (diff) |
sw comments on frames: fix DOC handling
The export part didn't use HasFlysAt() to decide what to do with empty
annotation marks.
Regarding the import side, the only problem was that the start of the
annotation range wasn't adjusted to cover the comment anchor, similar to
what the UI and the UNO API already does.
Change-Id: Ibcbaafa9f3f70de95a70b424aca31ebdc9df099d
Reviewed-on: https://gerrit.libreoffice.org/75025
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sw/source/filter/basflt')
-rw-r--r-- | sw/source/filter/basflt/fltshell.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sw/source/filter/basflt/fltshell.cxx b/sw/source/filter/basflt/fltshell.cxx index a28cf6732597..62e5920fc2bb 100644 --- a/sw/source/filter/basflt/fltshell.cxx +++ b/sw/source/filter/basflt/fltshell.cxx @@ -662,6 +662,17 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos, if (pPostIt) { assert(pPostIt->GetName().isEmpty()); + + if (!aRegion.HasMark()) + { + // Annotation range was found in the file, but start/end is the same, + // pointing after the postit placeholder (see assert above). + // Adjust the start of the range to actually cover the comment, similar + // to what the UI and the UNO API does. + aRegion.SetMark(); + --aRegion.Start()->nContent; + } + pDoc->getIDocumentMarkAccess()->makeAnnotationMark(aRegion, OUString()); } else |