summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
Diffstat (limited to 'sd')
-rw-r--r--sd/source/core/annotations/Annotation.cxx6
-rw-r--r--sd/source/ui/unoidl/unomodel.cxx14
2 files changed, 17 insertions, 3 deletions
diff --git a/sd/source/core/annotations/Annotation.cxx b/sd/source/core/annotations/Annotation.cxx
index 554dc4318786..17dcb12eb638 100644
--- a/sd/source/core/annotations/Annotation.cxx
+++ b/sd/source/core/annotations/Annotation.cxx
@@ -429,6 +429,12 @@ std::string lcl_LOKGetCommentPayload(CommentNotificationType nType, Reference<XA
aAnnotation.put("text", xText->getString());
const SdPage* pPage = sd::getAnnotationPage(rxAnnotation);
aAnnotation.put("parthash", pPage ? OString::number(pPage->GetHashCode()) : OString());
+ geometry::RealPoint2D const & rPoint = rxAnnotation->getPosition();
+ geometry::RealSize2D const & rSize = rxAnnotation->getSize();
+ ::tools::Rectangle aRectangle(Point(rPoint.X * 100.0, rPoint.Y * 100.0), Size(rSize.Width * 100.0, rSize.Height * 100.0));
+ aRectangle = OutputDevice::LogicToLogic(aRectangle, MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip));
+ OString sRectangle = aRectangle.toString();
+ aAnnotation.put("rectangle", sRectangle.getStr());
}
boost::property_tree::ptree aTree;
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index 5b8386022652..cea0b9f4c420 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -118,6 +118,7 @@
#include <drawinglayer/primitive2d/structuretagprimitive2d.hxx>
#include <sfx2/lokcharthelper.hxx>
+#include <tools/gen.hxx>
#include <tools/debug.hxx>
#include <tools/diagnose_ex.h>
@@ -2399,14 +2400,21 @@ OUString SdXImpressDocument::getPostIts()
for (const uno::Reference<office::XAnnotation>& xAnnotation : aPageAnnotations)
{
boost::property_tree::ptree aAnnotation;
- aAnnotation.put("id", sd::getAnnotationId(xAnnotation));
+ sal_uInt32 nID = sd::getAnnotationId(xAnnotation);
+ OString nodeName = "comment" + OString::number(nID);
+ aAnnotation.put("id", nID);
aAnnotation.put("author", xAnnotation->getAuthor());
aAnnotation.put("dateTime", utl::toISO8601(xAnnotation->getDateTime()));
uno::Reference<text::XText> xText(xAnnotation->getTextRange());
aAnnotation.put("text", xText->getString());
aAnnotation.put("parthash", OUString(OUString::number(pPage->GetHashCode())));
-
- aAnnotations.push_back(std::make_pair("", aAnnotation));
+ geometry::RealPoint2D const & rPoint = xAnnotation->getPosition();
+ geometry::RealSize2D const & rSize = xAnnotation->getSize();
+ ::tools::Rectangle aRectangle(Point(rPoint.X * 100.0, rPoint.Y * 100.0), Size(rSize.Width * 100.0, rSize.Height * 100.0));
+ aRectangle = OutputDevice::LogicToLogic(aRectangle, MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip));
+ OString sRectangle = aRectangle.toString();
+ aAnnotation.put("rectangle", sRectangle.getStr());
+ aAnnotations.push_back(std::make_pair(nodeName.getStr(), aAnnotation));
}
}