From fcc7ba441ec8e5116bbcc08c88b5ddb7c892c988 Mon Sep 17 00:00:00 2001 From: Joren De Cuyper Date: Fri, 15 May 2015 20:11:52 +0200 Subject: tdf#85911 docx: export comment initials Change-Id: I1437c197312911a15a50715235d840b24117bfba Reviewed-on: https://gerrit.libreoffice.org/15742 Tested-by: Jenkins Reviewed-by: Joren De Cuyper --- sw/qa/extras/ooxmlexport/data/comment_initials.odt | Bin 0 -> 9335 bytes sw/qa/extras/ooxmlexport/ooxmlexport7.cxx | 9 +++++++++ sw/source/uibase/fldui/fldmgr.cxx | 4 +++- 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 sw/qa/extras/ooxmlexport/data/comment_initials.odt diff --git a/sw/qa/extras/ooxmlexport/data/comment_initials.odt b/sw/qa/extras/ooxmlexport/data/comment_initials.odt new file mode 100644 index 000000000000..9b84ed859215 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/comment_initials.odt differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx index 03acd850db0b..6dec1e137b11 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx @@ -851,6 +851,15 @@ DECLARE_OOXMLEXPORT_TEST(testDashedLine_CustDashPercentage, "dashed_line_custdas assertXPath(pXmlDoc,"/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]/a:graphic[1]/a:graphicData[1]/wps:wsp[1]/wps:spPr[1]/a:ln[1]/a:custDash[1]/a:ds[3]", "sp", "300000"); } +DECLARE_OOXMLEXPORT_TEST(testCommentInitials, "comment_initials.odt") +{ + xmlDocPtr pXmlDoc = parseExport("word/comments.xml"); + if (!pXmlDoc) + return; + + assertXPath(pXmlDoc,"/w:comments/w:comment[1]", "initials", "initials"); +} + DECLARE_OOXMLEXPORT_TEST(testTextboxRoundedCorners, "textbox-rounded-corners.docx") { uno::Reference xShape = getShape(1); diff --git a/sw/source/uibase/fldui/fldmgr.cxx b/sw/source/uibase/fldui/fldmgr.cxx index 5a1d5e49a27b..80308ff785b5 100644 --- a/sw/source/uibase/fldui/fldmgr.cxx +++ b/sw/source/uibase/fldui/fldmgr.cxx @@ -78,6 +78,7 @@ #include #include #include +#include using namespace com::sun::star::uno; using namespace com::sun::star::container; @@ -773,13 +774,14 @@ bool SwFldMgr::InsertFld( { // ATTENTION this field is inserted by a separate dialog case TYP_POSTITFLD: { + SvtUserOptions aUserOpt; SwPostItFieldType* pType = static_cast(pCurShell->GetFldType(0, RES_POSTITFLD)); SwPostItField* pPostItField = new SwPostItField( pType, rData.m_sPar1, // author rData.m_sPar2, // content - OUString(), // author's initials + aUserOpt.GetID(), // author's initials OUString(), // name DateTime(DateTime::SYSTEM) ); pFld = pPostItField; -- cgit