summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2024-04-01 20:12:09 +0900
committerTomaž Vajngerl <quikee@gmail.com>2024-04-02 05:48:41 +0200
commit4bdbf0f898e8642b0a34195537d1516cc8eee819 (patch)
treec3227c1785873f4579f73c89f0e9f74e7b7a0292 /include
parent6027c219444ade7274841a5ba45e62bdc1ea3238 (diff)
editeng: combine scaling parameters into ScalingParameters struct
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 <quikee@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/editeng/editdata.hxx16
-rw-r--r--include/editeng/editeng.hxx9
-rw-r--r--include/editeng/outliner.hxx9
3 files changed, 26 insertions, 8 deletions
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();