summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2024-03-28 12:30:34 +0900
committerMiklos Vajna <vmiklos@collabora.com>2024-04-15 14:56:31 +0200
commit774c1ddfecc6389234f8d0e68d6e17c1fe218cb1 (patch)
treee3761a8d1d48b330a9202c0494e1ed1188d707d9 /include
parent134bbf9ad54ad351b859e31bd4f7aecae17e595c (diff)
editeng: use text scaling that better mimics MSO text scaling
Implement text scaling algorithm that is similar to MSO text scaling for text boxes for the compatibility purpuse, so that the Impress slides better match how the PP slides are layed out. This also moves the implementation into EditEng, where it is possible to better control how searching for the best scaling factor is performed without doing additional irrelevant work or trigger invalidations that should not be triggered. An additional change is that the paragraph with no content at the end are ignored, and are not taken into account when determining the height of the content. This is done for compatibility reasons. Fix horizontal spacing of tabs - the spacing shouldn't be scaled and the tab shouldn't include the space at the beginning of the line. Change-Id: Ie37fa67f1cf300e915a4ebaef2a7f968bf6c5744 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165441 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit f61ea135430d7b4a1fac7de1e57a1314fbb1b49e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166087 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'include')
-rw-r--r--include/editeng/editdata.hxx4
-rw-r--r--include/editeng/outliner.hxx2
-rw-r--r--include/svx/svdotext.hxx6
3 files changed, 8 insertions, 4 deletions
diff --git a/include/editeng/editdata.hxx b/include/editeng/editdata.hxx
index 6225ef897b2f..a4a160cc171f 100644
--- a/include/editeng/editdata.hxx
+++ b/include/editeng/editdata.hxx
@@ -282,6 +282,10 @@ struct ScalingParameters
&& fSpacingX == rOther.fSpacingX
&& fSpacingY == rOther.fSpacingY;
}
+ bool areValuesDefault()
+ {
+ return fFontX == 100.0 && fFontY == 100.0 && fSpacingX == 100.0 && fSpacingY == 100.0;
+ }
};
struct EECharAttrib
diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx
index ccc7dafe822a..8733e4c4d429 100644
--- a/include/editeng/outliner.hxx
+++ b/include/editeng/outliner.hxx
@@ -897,7 +897,7 @@ public:
/// Set attributes from rSet an all characters of nPara.
void SetCharAttribs(sal_Int32 nPara, const SfxItemSet& rSet);
void RemoveCharAttribs( sal_Int32 nPara, sal_uInt16 nWhich = 0 );
- void QuickFormatDoc();
+ void QuickFormatDoc();
bool UpdateFields();
void RemoveFields( const std::function<bool ( const SvxFieldData* )>& isFieldData = [] (const SvxFieldData* ){return true;} );
diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx
index d9c0908e505b..f3c3a300eed7 100644
--- a/include/svx/svdotext.hxx
+++ b/include/svx/svdotext.hxx
@@ -273,9 +273,9 @@ private:
tools::Rectangle& rAnchorRect,
tools::Rectangle& rPaintRect,
Fraction& aFitXCorrection ) const;
- void ImpAutoFitText( SdrOutliner& rOutliner ) const;
- void ImpAutoFitText( SdrOutliner& rOutliner, const Size& rShapeSize, bool bIsVerticalWriting ) const;
- void autoFitTextForCompatibility(SdrOutliner& rOutliner, const Size& rShapeSize, bool bIsVerticalWriting) const;
+
+ void setupAutoFitText( SdrOutliner& rOutliner ) const;
+ void setupAutoFitText(SdrOutliner& rOutliner, const Size& rShapeSize) const;
SVX_DLLPRIVATE rtl::Reference<SdrObject> ImpConvertContainedTextToSdrPathObjs(bool bToPoly) const;
SVX_DLLPRIVATE void ImpRegisterLink();