diff options
author | Paul Trojahn <paul.trojahn@gmail.com> | 2018-11-04 23:07:45 +0100 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-12-07 08:26:17 +0100 |
commit | 2c8ef031af56f5e787e7984e746ffb8b65bf0a5b (patch) | |
tree | 67611df1cccb62e87f76096712b0ceddd63f7c7f /sd | |
parent | a10dd637dc842e0b0221b8ec10965c8f130b4059 (diff) |
tdf#63029 Copy and paste comments with slide
Change-Id: Iceb0e744f8e994ece91cd8f50fefaed631aa8396
Reviewed-on: https://gerrit.libreoffice.org/64126
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/core/sdpage2.cxx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/sd/source/core/sdpage2.cxx b/sd/source/core/sdpage2.cxx index 0744eca27585..996f9760f121 100644 --- a/sd/source/core/sdpage2.cxx +++ b/sd/source/core/sdpage2.cxx @@ -30,6 +30,7 @@ #include <svl/urihelper.hxx> #include <editeng/xmlcnitm.hxx> #include <svx/svditer.hxx> +#include <com/sun/star/text/XTextCopy.hpp> #include <Annotation.hxx> #include <notifydocumentevent.hxx> @@ -391,6 +392,22 @@ void SdPage::lateInit(const SdPage& rSrcPage) // animations rSrcPage.cloneAnimations(*this); + // annotations + for(const Reference< XAnnotation >& srcAnnotation : rSrcPage.maAnnotations) + { + Reference< XAnnotation > ref; + createAnnotation(ref); + ref->setPosition(srcAnnotation->getPosition()); + ref->setSize(srcAnnotation->getSize()); + ref->setAuthor(srcAnnotation->getAuthor()); + ref->setInitials(srcAnnotation->getInitials()); + ref->setDateTime(srcAnnotation->getDateTime()); + Reference< ::css::text::XTextCopy > srcRange ( srcAnnotation->getTextRange(), uno::UNO_QUERY); + Reference< ::css::text::XTextCopy > range ( ref->getTextRange(), uno::UNO_QUERY); + if(srcRange.is() && range.is()) + range->copyText( srcRange ); + } + // fix user calls for duplicated slide SdrObjListIter aSourceIter( &rSrcPage, SdrIterMode::DeepWithGroups ); SdrObjListIter aTargetIter( this, SdrIterMode::DeepWithGroups ); |