summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2014-11-21 00:50:18 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-11-25 11:07:48 +0000
commitdaa567e1c5e4015236640b1d97b32710df4e96a7 (patch)
tree9c095158b855ecdb1d7b244d25dcec9aa8dfc25b /sw
parent008c0fe0f9b489a10ecc81e0205f2ac9e25b60ff (diff)
fdo#78980 i#98931 Accept args for .uno:InsertAnnotation
(adapted from commit 917c52f3219149741199015fce1740c5b13d814e) Change-Id: I27b1b966135767d204a11a9d9f38ad6cc943ee61 Reviewed-on: https://gerrit.libreoffice.org/13067 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/uibase/shells/textfld.cxx23
1 files changed, 17 insertions, 6 deletions
diff --git a/sw/source/core/uibase/shells/textfld.cxx b/sw/source/core/uibase/shells/textfld.cxx
index cace5c546f11..cd24a481e172 100644
--- a/sw/source/core/uibase/shells/textfld.cxx
+++ b/sw/source/core/uibase/shells/textfld.cxx
@@ -363,11 +363,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() )
{
@@ -378,14 +389,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)
{