[Libreoffice-commits] core.git: sc/source

Pranav Kant pranavk at collabora.co.uk
Thu Feb 16 08:16:40 UTC 2017


 sc/source/ui/view/cellsh1.cxx |   15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

New commits:
commit 5986bafea98228fc2552a5d71777ae199d223a2a
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Thu Feb 16 00:58:09 2017 +0530

    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 at libreoffice.org>
    Reviewed-by: pranavk <pranavk at collabora.co.uk>

diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index 861effc..bda3d10 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())
                 {


More information about the Libreoffice-commits mailing list