Fraction->double in ImpSetCharStretching

Change-Id: I8f191c9491ba475e58b00abdcde388005b937b96
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201737
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2026-03-18 07:59:46 +01:00
committed by Noel Grandin
parent 5c66e050a5
commit 4ce81e4302
3 changed files with 8 additions and 8 deletions
+2 -2
View File
@@ -270,7 +270,7 @@ private:
tools::Rectangle& rTextRect,
tools::Rectangle& rAnchorRect,
tools::Rectangle& rPaintRect,
Fraction& aFitXCorrection ) const;
double& aFitXCorrection ) const;
void setupAutoFitText( SdrOutliner& rOutliner ) const;
void setupAutoFitText(SdrOutliner& rOutliner, const Size& rShapeSize) const;
@@ -291,7 +291,7 @@ protected:
rtl::Reference<SdrPathObj> ImpConvertMakeObj(const basegfx::B2DPolyPolygon& rPolyPolygon, bool bClosed, bool bBezier) const;
rtl::Reference<SdrObject> ImpConvertAddText(const rtl::Reference<SdrObject> & pObj, bool bBezier) const;
void ImpSetTextStyleSheetListeners();
static void ImpSetCharStretching(SdrOutliner& rOutliner, const Size& rTextSize, const Size& rShapeSize, Fraction& rFitXCorrection);
static void ImpSetCharStretching(SdrOutliner& rOutliner, const Size& rTextSize, const Size& rShapeSize, double& rFitXCorrection);
static void ImpJustifyRect(tools::Rectangle& rRect);
void ImpCheckShear();
tools::Rectangle ImpDragCalcRect(const SdrDragStat& rDrag) const;
+5 -5
View File
@@ -832,7 +832,7 @@ std::optional<OutlinerParaObject> SdrTextObj::CreateEditOutlinerParaObject() con
return pPara;
}
void SdrTextObj::ImpSetCharStretching(SdrOutliner& rOutliner, const Size& rTextSize, const Size& rShapeSize, Fraction& rFitXCorrection)
void SdrTextObj::ImpSetCharStretching(SdrOutliner& rOutliner, const Size& rTextSize, const Size& rShapeSize, double& rFitXCorrection)
{
OutputDevice* pOut = rOutliner.GetRefDevice();
bool bNoStretching(false);
@@ -955,7 +955,7 @@ void SdrTextObj::ImpSetCharStretching(SdrOutliner& rOutliner, const Size& rTextS
nLoopCount++;
Size aSiz(rOutliner.CalcTextSize());
tools::Long nXDiff = aSiz.Width() - nWantWdt;
rFitXCorrection=Fraction(nWantWdt,aSiz.Width());
rFitXCorrection = double(nWantWdt) / aSiz.Width();
if (((nXDiff>=nXTolMi || !bChkX) && nXDiff<=nXTolPl) || nXDiff==nXDiff0) {
bNoMoreLoop = true;
} else {
@@ -1169,7 +1169,7 @@ void SdrTextObj::ImpSetupDrawOutlinerForPaint( bool bContourFrame,
tools::Rectangle& rTextRect,
tools::Rectangle& rAnchorRect,
tools::Rectangle& rPaintRect,
Fraction& rFitXCorrection ) const
double& rFitXCorrection ) const
{
if (!bContourFrame)
{
@@ -1259,7 +1259,7 @@ void SdrTextObj::UpdateOutlinerFormatting( SdrOutliner& rOutl, tools::Rectangle&
{
tools::Rectangle aTextRect;
tools::Rectangle aAnchorRect;
Fraction aFitXCorrection(1,1);
double aFitXCorrection(1.0);
const bool bContourFrame(IsContourTextFrame());
const MapMode aMapMode(getSdrModelFromSdrObject().GetScaleUnit());
@@ -1754,7 +1754,7 @@ GDIMetaFile* SdrTextObj::GetTextScrollMetaFileAndRectangle(
tools::Rectangle aTextRect;
tools::Rectangle aAnchorRect;
tools::Rectangle aPaintRect;
Fraction aFitXCorrection(1,1);
double aFitXCorrection(1.0);
bool bContourFrame(IsContourTextFrame());
// get outliner set up. To avoid getting a somehow rotated MetaFile,
+1 -1
View File
@@ -105,7 +105,7 @@ bool SdrTextObj::BegTextEdit(SdrOutliner& rOutl)
tools::Rectangle aTextRect;
TakeTextRect(rOutl, aTextRect, false,
&aAnchorRect);
Fraction aFitXCorrection(1,1);
double aFitXCorrection(1.0);
ImpSetCharStretching(rOutl,aTextRect.GetSize(),aAnchorRect.GetSize(),aFitXCorrection);
}
else if (IsAutoFit())