summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2024-04-01 20:12:09 +0900
committerMiklos Vajna <vmiklos@collabora.com>2024-04-15 09:20:18 +0200
commit0b816d1eeb877699018f1bddc22003c6309020e6 (patch)
tree44da35437364fc3b84a0c17aca35a903f789bb16 /include
parentb16637b716479fcbd50acb47673df7e6d2fbdb61 (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> (cherry picked from commit 4bdbf0f898e8642b0a34195537d1516cc8eee819) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165712 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'include')
-rw-r--r--include/editeng/editdata.hxx16
-rw-r--r--include/editeng/editeng.hxx8
-rw-r--r--include/editeng/outliner.hxx9
3 files changed, 26 insertions, 7 deletions
diff --git a/include/editeng/editdata.hxx b/include/editeng/editdata.hxx
index 1762fd86e837..6225ef897b2f 100644
--- a/include/editeng/editdata.hxx
+++ b/include/editeng/editdata.hxx
@@ -268,6 +268,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 57e327444a49..a4ab3dfe8303 100644
--- a/include/editeng/editeng.hxx
+++ b/include/editeng/editeng.hxx
@@ -419,12 +419,10 @@ public:
void QuickDelete( const ESelection& rSel );
void QuickMarkToBeRepainted( sal_Int32 nPara );
- void setGlobalScale(double fFontScaleX, double fFontScaleY, double fSpacingScaleX, double fSpacingScaleY);
- void getGlobalSpacingScale(double& rX, double& rY) const;
- basegfx::B2DTuple getGlobalSpacingScale() const;
- void getGlobalFontScale(double& rX, double& rY) const;
- basegfx::B2DTuple getGlobalFontScale() const;
+ void setScalingParameters(ScalingParameters const& rScalingParameters);
+ void resetScalingParameters();
+ ScalingParameters getScalingParameters() const;
void setRoundFontSizeToPt(bool bRound) const;
diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx
index 35860b762037..ccc7dafe822a 100644
--- a/include/editeng/outliner.hxx
+++ b/include/editeng/outliner.hxx
@@ -936,8 +936,13 @@ public:
bool IsTextPos( const Point& rPaperPos, sal_uInt16 nBorder );
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();