summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorPranav Kant <pranavk@collabora.co.uk>2017-02-16 00:58:09 +0530
committerpranavk <pranavk@collabora.co.uk>2017-02-16 08:16:19 +0000
commit5986bafea98228fc2552a5d71777ae199d223a2a (patch)
tree52d1a957185d1e1be8fe6917170ca53f5b5cd035 /sc
parent544bd60be20d1abe195f51fc9906cdef2c8489dd (diff)
sc: author, date not mandatory now for .uno:InsertAnnotation
These can be autostamped always when missing Change-Id: I9cf8d03d7294cb70c17ccb2635f81936abcad1c0 Reviewed-on: https://gerrit.libreoffice.org/34328 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: pranavk <pranavk@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/view/cellsh1.cxx15
1 files changed, 6 insertions, 9 deletions
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index 861effcb1a93..bda3d10f7506 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -2199,20 +2199,17 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
case SID_INSERT_POSTIT:
case SID_EDIT_POSTIT:
{
- const SfxPoolItem* pAuthor;
- const SfxPoolItem* pDate;
const SfxPoolItem* pText;
-
- if ( pReqArgs && pReqArgs->HasItem( SID_ATTR_POSTIT_AUTHOR, &pAuthor ) &&
- pReqArgs->HasItem( SID_ATTR_POSTIT_DATE, &pDate) &&
- pReqArgs->HasItem( SID_ATTR_POSTIT_TEXT, &pText) )
+ if ( pReqArgs && pReqArgs->HasItem( SID_ATTR_POSTIT_TEXT, &pText) )
{
- const SvxPostItAuthorItem* pAuthorItem = static_cast<const SvxPostItAuthorItem*>( pAuthor );
- const SvxPostItDateItem* pDateItem = static_cast<const SvxPostItDateItem*>( pDate );
const SvxPostItTextItem* pTextItem = static_cast<const SvxPostItTextItem*>( pText );
+ const SvxPostItAuthorItem* pAuthorItem = static_cast<const SvxPostItAuthorItem*>( pReqArgs->GetItem( SID_ATTR_POSTIT_AUTHOR) );
+ const SvxPostItDateItem* pDateItem = static_cast<const SvxPostItDateItem*>( pReqArgs->GetItem( SID_ATTR_POSTIT_DATE ) );
ScAddress aPos( GetViewData()->GetCurX(), GetViewData()->GetCurY(), GetViewData()->GetTabNo() );
- pTabViewShell->ReplaceNote( aPos, pTextItem->GetValue(), &pAuthorItem->GetValue(), &pDateItem->GetValue() );
+ pTabViewShell->ReplaceNote( aPos, pTextItem->GetValue(),
+ pAuthorItem ? &pAuthorItem->GetValue() : nullptr,
+ pDateItem ? &pDateItem->GetValue() : nullptr );
}
else if (!comphelper::LibreOfficeKit::isActive() || comphelper::LibreOfficeKit::isTiledAnnotations())
{