summaryrefslogtreecommitdiff
path: root/sw/source/uibase/docvw
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2024-11-15 13:04:58 +0500
committerMike Kaganski <mike.kaganski@collabora.com>2024-11-23 16:05:36 +0100
commitfa706421c9a981df11814cd845fe901181c49974 (patch)
tree0e7882a332313e187f10c84cb503fc260f454b81 /sw/source/uibase/docvw
parentee331d51c84b0d6fcbd65810843ab6c836d9dea9 (diff)
Avoid new string allocations, when only checking if empty
Change-Id: I35a44dedd27b5c3470ed035e64ec0461d8d0cbdf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177074 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'sw/source/uibase/docvw')
-rw-r--r--sw/source/uibase/docvw/AnnotationWin2.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx b/sw/source/uibase/docvw/AnnotationWin2.cxx
index b3634148e7fe..4979045c48dd 100644
--- a/sw/source/uibase/docvw/AnnotationWin2.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin2.cxx
@@ -1026,7 +1026,7 @@ void SwAnnotationWin::DeactivatePostIt()
if ( !Application::GetSettings().GetStyleSettings().GetHighContrastMode() )
GetOutlinerView()->SetBackgroundColor(COL_TRANSPARENT);
- if (!mnDeleteEventId && !IsReadOnlyOrProtected() && mpOutliner->GetEditEngine().GetText().isEmpty())
+ if (!mnDeleteEventId && !IsReadOnlyOrProtected() && !mpOutliner->GetEditEngine().HasText())
{
mnDeleteEventId = Application::PostUserEvent( LINK( this, SwAnnotationWin, DeleteHdl), nullptr, true );
}
@@ -1059,7 +1059,7 @@ void SwAnnotationWin::ExecuteCommand(sal_uInt16 nSlot)
const bool bReply = nSlot == FN_REPLY;
// if this note is empty, it will be deleted once losing the focus, so no reply, but only a new note
// will be created
- if (!mrMgr.IsAnswer() && !mpOutliner->GetEditEngine().GetText().isEmpty())
+ if (!mrMgr.IsAnswer() && mpOutliner->GetEditEngine().HasText())
{
OutlinerParaObject aPara(GetOutlinerView()->GetEditView().CreateTextObject());
mrMgr.RegisterAnswer(aPara);