Kaydet (Commit) 80d1ada9 authored tarafından Pranav Kant's avatar Pranav Kant

sd lok: Use IDs in ViewAnnotations output

Change-Id: Ifb1f55ad5a1d21d63f9b37a83e3218c40dfa0b59
üst 46be94e3
...@@ -35,6 +35,8 @@ void createAnnotation( css::uno::Reference< css::office::XAnnotation >& xAnnotat ...@@ -35,6 +35,8 @@ void createAnnotation( css::uno::Reference< css::office::XAnnotation >& xAnnotat
SdrUndoAction* CreateUndoInsertOrRemoveAnnotation( const css::uno::Reference< css::office::XAnnotation >& xAnnotation, bool bInsert ); SdrUndoAction* CreateUndoInsertOrRemoveAnnotation( const css::uno::Reference< css::office::XAnnotation >& xAnnotation, bool bInsert );
sal_uInt32 getAnnotationId(const css::uno::Reference <css::office::XAnnotation>& xAnnotation);
} }
#endif #endif
......
...@@ -370,6 +370,15 @@ SdrUndoAction* CreateUndoInsertOrRemoveAnnotation( const Reference< XAnnotation ...@@ -370,6 +370,15 @@ SdrUndoAction* CreateUndoInsertOrRemoveAnnotation( const Reference< XAnnotation
} }
} }
sal_uInt32 getAnnotationId(const Reference<XAnnotation>& xAnnotation)
{
Annotation* pAnnotation = dynamic_cast<Annotation*>(xAnnotation.get());
sal_uInt32 nId = 0;
if (pAnnotation)
nId = pAnnotation->GetId();
return nId;
}
UndoInsertOrRemoveAnnotation::UndoInsertOrRemoveAnnotation( Annotation& rAnnotation, bool bInsert ) UndoInsertOrRemoveAnnotation::UndoInsertOrRemoveAnnotation( Annotation& rAnnotation, bool bInsert )
: SdrUndoAction( *rAnnotation.GetModel() ) : SdrUndoAction( *rAnnotation.GetModel() )
, mxAnnotation( &rAnnotation ) , mxAnnotation( &rAnnotation )
......
...@@ -78,6 +78,7 @@ ...@@ -78,6 +78,7 @@
#include "ViewShellBase.hxx" #include "ViewShellBase.hxx"
#include <UnoDocumentSettings.hxx> #include <UnoDocumentSettings.hxx>
#include <Annotation.hxx>
#include <drawdoc.hxx> #include <drawdoc.hxx>
#include <glob.hrc> #include <glob.hrc>
#include <sdresid.hxx> #include <sdresid.hxx>
...@@ -2380,7 +2381,7 @@ OUString SdXImpressDocument::getPostIts() ...@@ -2380,7 +2381,7 @@ OUString SdXImpressDocument::getPostIts()
uno::Reference<office::XAnnotation> xAnnotation(aPageAnnotation); uno::Reference<office::XAnnotation> xAnnotation(aPageAnnotation);
boost::property_tree::ptree aAnnotation; boost::property_tree::ptree aAnnotation;
aAnnotation.put("id", sd::getAnnotationId(xAnnotation));
aAnnotation.put("author", xAnnotation->getAuthor()); aAnnotation.put("author", xAnnotation->getAuthor());
aAnnotation.put("dateTime", utl::toISO8601(xAnnotation->getDateTime())); aAnnotation.put("dateTime", utl::toISO8601(xAnnotation->getDateTime()));
uno::Reference<text::XText> xText(xAnnotation->getTextRange()); uno::Reference<text::XText> xText(xAnnotation->getTextRange());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment