summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-09-09 15:49:16 +0200
committerMiklos Vajna <vmiklos@collabora.com>2020-09-15 14:38:47 +0200
commit618b12b768eaffd40fcd98eb0ed55d0e7850b64c (patch)
tree4d94f5d4ccf973e556fe142d0194c04b45b9035a /include
parentsvx UNO API for shapes: expose what scaling factor is used for autofit scaling (diff)
downloadcore-618b12b768eaffd40fcd98eb0ed55d0e7850b64c.tar.gz
core-618b12b768eaffd40fcd98eb0ed55d0e7850b64c.zip
svx UNO API for shapes: allow setting a max factor for autofit text scale
This allows getting the scale factor from multiple shapes (that have text), seeing what factors they use and then setting the factor to the minimum of the values. Towards allowing both "autofit" and "same font size for these shapes" at the same time for SmartArt purposes. (cherry picked from commit 81345de4858d6e72ecb8fc6621396570f4a4ee93) Conflicts: include/svx/unoshprp.hxx Change-Id: I31a5e097c62e6e65b32956a4a32137bc3339c64c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102710 Tested-by: Jenkins Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
Diffstat (limited to 'include')
-rw-r--r--include/svx/sdtfsitm.hxx10
-rw-r--r--include/svx/svdotext.hxx2
-rw-r--r--include/svx/unoshprp.hxx2
3 files changed, 12 insertions, 2 deletions
diff --git a/include/svx/sdtfsitm.hxx b/include/svx/sdtfsitm.hxx
index 597da1ad591c..c446bc1fbca6 100644
--- a/include/svx/sdtfsitm.hxx
+++ b/include/svx/sdtfsitm.hxx
@@ -38,7 +38,13 @@ public:
SdrTextFitToSizeTypeItem(
css::drawing::TextFitToSizeType const eFit = css::drawing::TextFitToSizeType_NONE)
: SfxEnumItem(SDRATTR_TEXT_FITTOSIZE, eFit) {}
+ SdrTextFitToSizeTypeItem(const SdrTextFitToSizeTypeItem& rItem)
+ : SfxEnumItem(rItem),
+ m_nMaxScale(rItem.GetMaxScale())
+ {
+ }
virtual SdrTextFitToSizeTypeItem* Clone(SfxItemPool* pPool=nullptr) const override;
+ bool operator==(const SfxPoolItem& rItem) const override;
virtual sal_uInt16 GetValueCount() const override;
virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
@@ -49,6 +55,10 @@ public:
virtual bool HasBoolValue() const override;
virtual bool GetBoolValue() const override;
virtual void SetBoolValue(bool bVal) override;
+ void SetMaxScale(sal_Int16 nMaxScale) { m_nMaxScale = nMaxScale; }
+ sal_Int16 GetMaxScale() const { return m_nMaxScale; }
+private:
+ sal_Int16 m_nMaxScale = 0;
};
#endif
diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx
index 6f1804bb1757..5ee175520251 100644
--- a/include/svx/svdotext.hxx
+++ b/include/svx/svdotext.hxx
@@ -263,7 +263,7 @@ private:
tools::Rectangle& rPaintRect,
Fraction& aFitXCorrection ) const;
void ImpAutoFitText( SdrOutliner& rOutliner ) const;
- static void ImpAutoFitText( SdrOutliner& rOutliner, const Size& rShapeSize, bool bIsVerticalWriting );
+ void ImpAutoFitText( SdrOutliner& rOutliner, const Size& rShapeSize, bool bIsVerticalWriting ) const;
SVX_DLLPRIVATE SdrObjectUniquePtr ImpConvertContainedTextToSdrPathObjs(bool bToPoly) const;
SVX_DLLPRIVATE void ImpRegisterLink();
SVX_DLLPRIVATE void ImpDeregisterLink();
diff --git a/include/svx/unoshprp.hxx b/include/svx/unoshprp.hxx
index 8051634c3e42..cf7452e8303a 100644
--- a/include/svx/unoshprp.hxx
+++ b/include/svx/unoshprp.hxx
@@ -349,7 +349,7 @@
{ OUString(UNO_NAME_MISC_OBJ_SIZEPROTECT), SDRATTR_OBJSIZEPROTECT , cppu::UnoType<bool>::get(), 0, 0},\
{ OUString("UINameSingular"), OWN_ATTR_UINAME_SINGULAR , ::cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY, 0}, \
{ OUString("UINamePlural"), OWN_ATTR_UINAME_PLURAL , ::cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY, 0}, \
- { OUString("TextFitToSizeScale"), OWN_ATTR_TEXTFITTOSIZESCALE, ::cppu::UnoType<sal_Int16>::get(), css::beans::PropertyAttribute::READONLY, 0}, \
+ { OUString("TextFitToSizeScale"), OWN_ATTR_TEXTFITTOSIZESCALE, ::cppu::UnoType<sal_Int16>::get(), 0, 0}, \
/* #i68101# */ \
{ OUString(UNO_NAME_MISC_OBJ_TITLE), OWN_ATTR_MISC_OBJ_TITLE , ::cppu::UnoType<OUString>::get(), 0, 0}, \
{ OUString(UNO_NAME_MISC_OBJ_DESCRIPTION), OWN_ATTR_MISC_OBJ_DESCRIPTION , ::cppu::UnoType<OUString>::get(), 0, 0},