diff options
author | Justin Luth <justin_luth@sil.org> | 2016-11-15 14:50:03 +0300 |
---|---|---|
committer | Justin Luth <justin_luth@sil.org> | 2016-11-29 06:12:09 +0000 |
commit | 8a0575819ae3526831699767177b333270d6c718 (patch) | |
tree | 94842d38c4614fcca1dd3bd3251cd20d6c8e498f | |
parent | e2121e396c07111df985cff7b7a47586179cafe5 (diff) |
tdf#34467 - FitToFrame: stretch text to fill drawing obj
Help for Fit To Frame says "Resizes the text to fit the entire area
of the drawing or text object".
reverts commit b7628798ec1a966c97a64d7cf0aa9f3859b78bef
and partially addresses the problem of "Shrink font automatically
when text overflows" by treating text as "Autofit" while it is being
edited.
It's not WYSIWYG, but good enough, and maybe better.
Since that part of the change prevents any way of setting ::Autofit,
I also changed clearing of Fit To Frame to Autofit instead of NONE, since there
is no good reason why text should be allowed to spill outside of a textbox.
For those who REALLY want that odd behaviour, they can use
.uno:TextFitToSize (Ctrl-Shift-F8) to toggle between "stretch" and "none".
NONE is still the original default if "Fit to Frame" is never touched. So it
can look a little inconsistent.
1. Turn off "frame height expands with text" and Fit2Frame defaults to
NONE - text can spill out of the textbox.
2. Turn on "Fit to Frame" and Fit2Frame is PROPORTIONAL - the text stretches
to fill the frame.
3. Turn off "Fit to Frame" and Fit2Frame is AUTOFIT - the text will shrink to
fit nicely inside of the frame.
Change-Id: I8313a82cbea82f11fad0f50d966fc77874977da9
Reviewed-on: https://gerrit.libreoffice.org/30727
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Justin Luth <justin_luth@sil.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Reviewed-on: https://gerrit.libreoffice.org/30869
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
-rw-r--r-- | cui/source/tabpages/textattr.cxx | 10 | ||||
-rw-r--r-- | svx/source/svdraw/svdotext.cxx | 2 |
2 files changed, 8 insertions, 4 deletions
diff --git a/cui/source/tabpages/textattr.cxx b/cui/source/tabpages/textattr.cxx index 1e92b6c4cdb6..6305b762002a 100644 --- a/cui/source/tabpages/textattr.cxx +++ b/cui/source/tabpages/textattr.cxx @@ -310,7 +310,11 @@ void SvxTextAttrPage::Reset( const SfxItemSet* rAttrs ) { SdrFitToSizeType eFTS = (SdrFitToSizeType) static_cast<const SdrTextFitToSizeTypeItem&>( rAttrs->Get( SDRATTR_TEXT_FITTOSIZE ) ).GetValue(); - m_pTsbFitToSize->SetState( eFTS == SDRTEXTFIT_NONE ? TRISTATE_FALSE : TRISTATE_TRUE ); + if( eFTS == SDRTEXTFIT_AUTOFIT || eFTS == SDRTEXTFIT_NONE ) + m_pTsbFitToSize->SetState( TRISTATE_FALSE ); + else + m_pTsbFitToSize->SetState( TRISTATE_TRUE ); + m_pTsbFitToSize->EnableTriState( false ); } else @@ -408,8 +412,8 @@ bool SvxTextAttrPage::FillItemSet( SfxItemSet* rAttrs) default: ; //prevent warning OSL_FAIL( "svx::SvxTextAttrPage::FillItemSet(), unhandled state!" ); SAL_FALLTHROUGH; - case TRISTATE_FALSE: eFTS = SDRTEXTFIT_NONE; break; - case TRISTATE_TRUE: eFTS = SDRTEXTFIT_AUTOFIT; break; + case TRISTATE_FALSE: eFTS = SDRTEXTFIT_AUTOFIT; break; + case TRISTATE_TRUE: eFTS = SDRTEXTFIT_PROPORTIONAL; break; } rAttrs->Put( SdrTextFitToSizeTypeItem( eFTS ) ); } diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index b7ef71a53cb8..e877b8341f1c 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -1968,7 +1968,7 @@ void SdrTextObj::onEditOutlinerStatusEvent( EditStatus* pEditStatus ) { AdjustTextFrameWidthAndHeight(); } - else if (IsAutoFit() && !mbInDownScale) + else if ( (IsAutoFit() || IsFitToSize()) && !mbInDownScale) { assert(pEdtOutl); mbInDownScale = true; |