editeng/source/outliner/outliner.cxx |   14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

New commits:
commit 80b4e90e055825e3fef6fa11796bf4f40627c478
Author:     Dr. David Alan Gilbert <[email protected]>
AuthorDate: Thu Jul 13 14:52:07 2023 +0100
Commit:     Noel Grandin <[email protected]>
CommitDate: Sun Jul 16 12:55:19 2023 +0200

    editeng/Outliner: Use RotateAround rather than open coding
    
    In PaintBullet, use Tools::Point's RotateAround instead of open coding.
    
    Signed-off-by: Dr. David Alan Gilbert <[email protected]>
    Change-Id: I4f5a50a70d8fcadd2e5af60e365de80f2e9a271e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154393
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/editeng/source/outliner/outliner.cxx 
b/editeng/source/outliner/outliner.cxx
index 04f55eb7dbdb..5af4573bf659 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -945,18 +945,8 @@ void Outliner::PaintBullet(sal_Int32 nPara, const Point& 
rStartPos, const Point&
             {
                 // Both TopLeft and bottom left is not quite correct,
                 // since in EditEngine baseline ...
-                double nRealOrientation = toRadians(nOrientation);
-                double nCos = cos( nRealOrientation );
-                double nSin = sin( nRealOrientation );
-                Point aRotatedPos;
-                // Translation...
-                aTextPos -= rOrigin;
-                // Rotation...
-                aRotatedPos.setX(static_cast<tools::Long>(nCos*aTextPos.X() + 
nSin*aTextPos.Y()) );
-                aRotatedPos.setY(static_cast<tools::Long>(- (nSin*aTextPos.X() 
- nCos*aTextPos.Y())) );
-                aTextPos = aRotatedPos;
-                // Translation...
-                aTextPos += rOrigin;
+                rOrigin.RotateAround(aTextPos, nOrientation);
+
                 vcl::Font aRotatedFont( aBulletFont );
                 aRotatedFont.SetOrientation( nOrientation );
                 rOutDev.SetFont( aRotatedFont );

Reply via email to