summaryrefslogtreecommitdiff
path: root/sfx2/source/control/emojiviewitem.cxx
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2021-08-13 16:44:15 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2021-08-16 15:53:02 +0200
commit581b2cf7960c48e6199bd35be839424113abe533 (patch)
tree5f5d0f4cf0be4d134804cea9738460e92a61e11c /sfx2/source/control/emojiviewitem.cxx
parent76f89b0097c02fa68c36cfc9a31de3b2e9166abc (diff)
Drop tools::Rectangle::getX/getY, which are just duplicates of Left/Top
The change allowed to simplify many places where previously this API was used, to avoid inefficient calculations (e.g., moving rectangle keeping its size, and then immediately changing the size). Change-Id: Ica2dc594d91cae83e2c2740c1f4fb23f44998916 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120461 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sfx2/source/control/emojiviewitem.cxx')
-rw-r--r--sfx2/source/control/emojiviewitem.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/sfx2/source/control/emojiviewitem.cxx b/sfx2/source/control/emojiviewitem.cxx
index f9394ea9435c..ff90325dd4bc 100644
--- a/sfx2/source/control/emojiviewitem.cxx
+++ b/sfx2/source/control/emojiviewitem.cxx
@@ -42,11 +42,11 @@ void EmojiViewItem::calculateItemsPosition (const tools::Long /*nThumbnailHeight
css::lang::Locale() );
Size aRectSize = maDrawArea.GetSize();
- Point aPos = maDrawArea.TopLeft();
+ Point aPos = maDrawArea.TopCenter();
// Calculate text position
- aPos.setY( maDrawArea.getY() + (aRectSize.Height() - aTextDev.getTextHeight())/3 );
- aPos.setX( maDrawArea.Left() + (aRectSize.Width() - aTextDev.getTextWidth(maTitle,0,nMaxTextLength))/2 );
+ aPos.Move(-aTextDev.getTextWidth(maTitle, 0, nMaxTextLength) / 2,
+ (aRectSize.Height() - aTextDev.getTextHeight()) / 3);
maTextPos = aPos;
}