sw/source/uibase/shells/textfld.cxx | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-)
New commits: commit f4309a2c56bfbfe536d95e6692fe9da99774453f Author: Maxim Monastirsky <momonas...@gmail.com> Date: Fri Nov 21 00:50:18 2014 +0200 fdo#78980 i#98931 Accept args for .uno:InsertAnnotation Change-Id: I27b1b966135767d204a11a9d9f38ad6cc943ee61 (cherry picked from commit 917c52f3219149741199015fce1740c5b13d814e) diff --git a/sw/source/uibase/shells/textfld.cxx b/sw/source/uibase/shells/textfld.cxx index 10575a7..e4ba7d8 100644 --- a/sw/source/uibase/shells/textfld.cxx +++ b/sw/source/uibase/shells/textfld.cxx @@ -376,11 +376,22 @@ void SwTextShell::ExecField(SfxRequest &rReq) bool bNew = !(pPostIt && pPostIt->GetTyp()->Which() == RES_POSTITFLD); if (bNew || GetView().GetPostItMgr()->IsAnswer()) { - SvtUserOptions aUserOpt; + SFX_REQUEST_ARG( rReq, pAuthorItem, SvxPostItAuthorItem, SID_ATTR_POSTIT_AUTHOR, false ); OUString sAuthor; - if( (sAuthor = aUserOpt.GetFullName()).isEmpty()) - if( (sAuthor = aUserOpt.GetID()).isEmpty() ) - sAuthor = SW_RES( STR_REDLINE_UNKNOWN_AUTHOR ); + if ( pAuthorItem ) + sAuthor = pAuthorItem->GetValue(); + else + { + SvtUserOptions aUserOpt; + if( (sAuthor = aUserOpt.GetFullName()).isEmpty()) + if( (sAuthor = aUserOpt.GetID()).isEmpty() ) + sAuthor = SW_RES( STR_REDLINE_UNKNOWN_AUTHOR ); + } + + SFX_REQUEST_ARG( rReq, pTextItem, SvxPostItTextItem, SID_ATTR_POSTIT_TEXT, false ); + OUString sText; + if ( pTextItem ) + sText = pTextItem->GetValue(); if ( rSh.HasSelection() && !rSh.IsTableMode() ) { @@ -391,14 +402,14 @@ void SwTextShell::ExecField(SfxRequest &rReq) // --> suggestion has to be removed before GetView().GetEditWin().StopQuickHelp(); - SwInsertFld_Data aData(TYP_POSTITFLD, 0, sAuthor, OUString(), 0); + SwInsertFld_Data aData(TYP_POSTITFLD, 0, sAuthor, sText, 0); aFldMgr.InsertFld( aData ); rSh.Push(); rSh.SwCrsrShell::Left(1, CRSR_SKIP_CHARS, false); pPostIt = (SwPostItField*)aFldMgr.GetCurFld(); rSh.Pop(false); // Restore cursor position - } + } if (pPostIt) { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits