[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - svx/source

Tomaž Vajngerl (via logerrit) logerrit at kemper.freedesktop.org
Mon Jun 8 11:43:57 UTC 2020


 svx/source/svdraw/svdpdf.cxx |   28 +++++++++++++++-------------
 1 file changed, 15 insertions(+), 13 deletions(-)

New commits:
commit ae512835805da05cfa873eebf189fa7a2f927a20
Author:     Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Thu Apr 30 13:18:21 2020 +0200
Commit:     Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Mon Jun 8 13:43:26 2020 +0200

    SdrPdfImport: rename some variables to non-abbreviated names
    
    Change-Id: I1cb004a8e426f8ea26bb930d4897db3763433b31
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93329
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
    (cherry picked from commit 9e3da9e3bc7133972fae76c27f911fc19ca854b1)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95781
    Tested-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/svx/source/svdraw/svdpdf.cxx b/svx/source/svdraw/svdpdf.cxx
index a41caaeaba14..106718a34aa9 100644
--- a/svx/source/svdraw/svdpdf.cxx
+++ b/svx/source/svdraw/svdpdf.cxx
@@ -99,6 +99,7 @@ namespace
 /// Here we effectively render at 96 DPI (to match
 /// the image rendered in vcl::ImportPDF in pdfread.cxx).
 double lcl_PointToPixel(double fPoint) { return fPoint * 96. / 72.; }
+
 /// Convert from pixels to logic (twips).
 long lcl_ToLogic(double value)
 {
@@ -894,21 +895,22 @@ void ImpSdrPdfImport::ImportText(const Point& rPos, const Size& rSize, const OUS
     // calc text box size, add 5% to make it fit safely
 
     FontMetric aFontMetric(mpVD->GetFontMetric());
-    vcl::Font aFnt(mpVD->GetFont());
-    FontAlign eAlg(aFnt.GetAlignment());
+    vcl::Font aFont(mpVD->GetFont());
+    FontAlign eAlignment(aFont.GetAlignment());
 
     // sal_Int32 nTextWidth = static_cast<sal_Int32>(mpVD->GetTextWidth(rStr) * mfScaleX);
     sal_Int32 nTextHeight = static_cast<sal_Int32>(mpVD->GetTextHeight() * mfScaleY);
 
-    Point aPos(FRound(rPos.X() * mfScaleX + maOfs.X()), FRound(rPos.Y() * mfScaleY + maOfs.Y()));
+    Point aPosition(FRound(rPos.X() * mfScaleX + maOfs.X()),
+                    FRound(rPos.Y() * mfScaleY + maOfs.Y()));
     Size aSize(FRound(rSize.Width() * mfScaleX), FRound(rSize.Height() * mfScaleY));
 
-    if (eAlg == ALIGN_BASELINE)
-        aPos.AdjustY(-FRound(aFontMetric.GetAscent() * mfScaleY));
-    else if (eAlg == ALIGN_BOTTOM)
-        aPos.AdjustY(-nTextHeight);
+    if (eAlignment == ALIGN_BASELINE)
+        aPosition.AdjustY(-FRound(aFontMetric.GetAscent() * mfScaleY));
+    else if (eAlignment == ALIGN_BOTTOM)
+        aPosition.AdjustY(-nTextHeight);
 
-    tools::Rectangle aTextRect(aPos, aSize);
+    tools::Rectangle aTextRect(aPosition, aSize);
     SdrRectObj* pText = new SdrRectObj(*mpModel, OBJ_TEXT, aTextRect);
 
     pText->SetMergedItem(makeSdrTextUpperDistItem(0));
@@ -916,7 +918,7 @@ void ImpSdrPdfImport::ImportText(const Point& rPos, const Size& rSize, const OUS
     pText->SetMergedItem(makeSdrTextRightDistItem(0));
     pText->SetMergedItem(makeSdrTextLeftDistItem(0));
 
-    if (aFnt.GetAverageFontWidth())
+    if (aFont.GetAverageFontWidth())
     {
         pText->ClearMergedItem(SDRATTR_TEXT_AUTOGROWWIDTH);
         pText->SetMergedItem(makeSdrTextAutoGrowHeightItem(false));
@@ -933,21 +935,21 @@ void ImpSdrPdfImport::ImportText(const Point& rPos, const Size& rSize, const OUS
     SetAttributes(pText, true);
     pText->SetSnapRect(aTextRect);
 
-    if (!aFnt.IsTransparent())
+    if (!aFont.IsTransparent())
     {
         SfxItemSet aAttr(*mpFillAttr->GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{});
         aAttr.Put(XFillStyleItem(drawing::FillStyle_SOLID));
-        aAttr.Put(XFillColorItem(OUString(), aFnt.GetFillColor()));
+        aAttr.Put(XFillColorItem(OUString(), aFont.GetFillColor()));
         pText->SetMergedItemSet(aAttr);
     }
-    sal_uInt32 nAngle = aFnt.GetOrientation();
+    sal_uInt32 nAngle = aFont.GetOrientation();
     if (nAngle)
     {
         nAngle *= 10;
         double a = nAngle * F_PI18000;
         double nSin = sin(a);
         double nCos = cos(a);
-        pText->NbcRotate(aPos, nAngle, nSin, nCos);
+        pText->NbcRotate(aPosition, nAngle, nSin, nCos);
     }
     InsertObj(pText, false);
 }


More information about the Libreoffice-commits mailing list