From 4bdbf0f898e8642b0a34195537d1516cc8eee819 Mon Sep 17 00:00:00 2001 From: Tomaž Vajngerl Date: Mon, 1 Apr 2024 20:12:09 +0900 Subject: editeng: combine scaling parameters into ScalingParameters struct MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This makes dealing with scaling parameters much clearer and it improves readability. Change-Id: I327b6530ef5587972cc0075390704754a33563a9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165632 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl --- include/editeng/editdata.hxx | 16 ++++++++++++++++ include/editeng/editeng.hxx | 9 +++------ include/editeng/outliner.hxx | 9 +++++++-- 3 files changed, 26 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/editeng/editdata.hxx b/include/editeng/editdata.hxx index da789675d1b6..6c8e5abe2db7 100644 --- a/include/editeng/editdata.hxx +++ b/include/editeng/editdata.hxx @@ -156,6 +156,22 @@ struct ParagraphInfos bool bValid; // A query during formatting is not valid! }; +struct ScalingParameters +{ + double fFontX = 100.0; + double fFontY = 100.0; + double fSpacingX = 100.0; + double fSpacingY = 100.0; + + bool operator==(const ScalingParameters& rOther) const + { + return fFontX == rOther.fFontX + && fFontY == rOther.fFontY + && fSpacingX == rOther.fSpacingX + && fSpacingY == rOther.fSpacingY; + } +}; + struct EECharAttrib { const SfxPoolItem* pAttr; diff --git a/include/editeng/editeng.hxx b/include/editeng/editeng.hxx index 03c8b281c1fa..263a0931dff8 100644 --- a/include/editeng/editeng.hxx +++ b/include/editeng/editeng.hxx @@ -416,12 +416,9 @@ public: void QuickDelete( const ESelection& rSel ); SAL_DLLPRIVATE void QuickMarkToBeRepainted( sal_Int32 nPara ); - SAL_DLLPRIVATE void setGlobalScale(double fFontScaleX, double fFontScaleY, double fSpacingScaleX, double fSpacingScaleY); - - SAL_DLLPRIVATE void getGlobalSpacingScale(double& rX, double& rY) const; - basegfx::B2DTuple getGlobalSpacingScale() const; - SAL_DLLPRIVATE void getGlobalFontScale(double& rX, double& rY) const; - basegfx::B2DTuple getGlobalFontScale() const; + void setScalingParameters(ScalingParameters const& rScalingParameters); + void resetScalingParameters(); + ScalingParameters getScalingParameters() const; SAL_DLLPRIVATE void setRoundFontSizeToPt(bool bRound); diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx index 3e4dac1082ad..e0d14487ea13 100644 --- a/include/editeng/outliner.hxx +++ b/include/editeng/outliner.hxx @@ -938,8 +938,13 @@ public: bool IsTextPos( const Point& rPaperPos, sal_uInt16 nBorder ); SAL_DLLPRIVATE bool IsTextPos( const Point& rPaperPos, sal_uInt16 nBorder, bool* pbBulletPos ); - void setGlobalScale(double rFontX = 100.0, double rFontY = 100.0, double rSpacingX = 100.0, double rSpacingY = 100.0); - void getGlobalScale(double& rFontX, double& rFontY, double& rSpacingX, double& rSpacingY) const; + ScalingParameters getScalingParameters() const; + void setScalingParameters(ScalingParameters const& rScalingParameters); + void resetScalingParameters() + { + setScalingParameters(ScalingParameters()); + } + void setRoundFontSizeToPt(bool bRound) const; void EraseVirtualDevice(); -- cgit