summaryrefslogtreecommitdiff
path: root/oox/source/drawingml/diagram
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2024-04-01 20:32:15 +0900
committerTomaž Vajngerl <quikee@gmail.com>2024-04-03 04:06:39 +0200
commitdb64748f1ee771da9da857f95601b9e08b577166 (patch)
tree2be5e8a13d75e287da95aa5d1b6891c34812875e /oox/source/drawingml/diagram
parent6fd33d50603c2d12c0a1d88edb04c0890b6a1ef1 (diff)
svx: read font and spacing scaling from oox, add bot as UNO prop.
- Read spacing in oox. - Add spacing scaling as a property. - Rename property "TextFitToSizeScale" to "TextFitToSizeFontScale" - Add property "TextFitToSizeSpacingScale" Change-Id: Icde575e55a3146169d86bb538a57adcf1fa228a7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165633 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'oox/source/drawingml/diagram')
-rw-r--r--oox/source/drawingml/diagram/diagram.cxx21
1 files changed, 14 insertions, 7 deletions
diff --git a/oox/source/drawingml/diagram/diagram.cxx b/oox/source/drawingml/diagram/diagram.cxx
index 029c2c56e962..f63185549c23 100644
--- a/oox/source/drawingml/diagram/diagram.cxx
+++ b/oox/source/drawingml/diagram/diagram.cxx
@@ -185,30 +185,37 @@ void Diagram::syncDiagramFontHeights()
{
// Find out the minimum scale within this group.
const ShapePairs& rShapePairs = rNameAndPairs.second;
- double nMinScale = 100.0;
+ double fMinFontScale = 100.0;
+ double fMinSpacingScale = 100.0;
for (const auto& rShapePair : rShapePairs)
{
uno::Reference<beans::XPropertySet> xPropertySet(rShapePair.second, uno::UNO_QUERY);
if (xPropertySet.is())
{
- double nTextFitToSizeScale = 0.0;
- xPropertySet->getPropertyValue("TextFitToSizeScale") >>= nTextFitToSizeScale;
- if (nTextFitToSizeScale > 0 && nTextFitToSizeScale < nMinScale)
+ double fFontScale = 0.0;
+ double fSpacingScale = 0.0;
+ xPropertySet->getPropertyValue("TextFitToSizeFontScale") >>= fFontScale;
+ xPropertySet->getPropertyValue("TextFitToSizeSpacingScale") >>= fSpacingScale;
+
+ if (fFontScale > 0 && fSpacingScale > 0
+ && (fFontScale < fMinFontScale || (fFontScale == fMinFontScale && fSpacingScale < fMinSpacingScale)))
{
- nMinScale = nTextFitToSizeScale;
+ fMinFontScale = fFontScale;
+ fMinSpacingScale = fSpacingScale;
}
}
}
// Set that minimum scale for all members of the group.
- if (nMinScale < 100.0)
+ if (fMinFontScale < 100.0 || fMinSpacingScale < 100.0)
{
for (const auto& rShapePair : rShapePairs)
{
uno::Reference<beans::XPropertySet> xPropertySet(rShapePair.second, uno::UNO_QUERY);
if (xPropertySet.is())
{
- xPropertySet->setPropertyValue("TextFitToSizeScale", uno::Any(nMinScale));
+ xPropertySet->setPropertyValue("TextFitToSizeFontScale", uno::Any(fMinFontScale));
+ xPropertySet->setPropertyValue("TextFitToSizeSpacingScale", uno::Any(fMinSpacingScale));
}
}
}