Bug 56851 - Impress autoresize font in slide don't work properly.
Summary: Impress autoresize font in slide don't work properly.
Status: RESOLVED DUPLICATE of bug 42134
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
3.6.2.2 release
Hardware: x86 (IA32) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-07 20:21 UTC by Massimo Medolla
Modified: 2013-05-23 07:07 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Massimo Medolla 2012-11-07 20:21:45 UTC
While typing characters are properly reduced in size to fit the text to the available space on the slide. However when it comes out of typing the text is presented to the minimum size. Attempts to change the font size are failing.
Comment 1 Massimo Medolla 2012-11-07 20:24:48 UTC
There is a video file some show the problems.
Comment 2 Massimo Medolla 2012-11-07 20:25:16 UTC
(In reply to comment #1)
> There is a video file some show the problems.

https://www.box.com/s/h39le9oszaxwwtpyq3ff
Comment 3 sasha.libreoffice 2012-12-05 10:01:26 UTC
See also:
Bug 54434 - EDITING: auto-resizing textbox
Comment 4 sasha.libreoffice 2012-12-05 10:30:26 UTC
See also:
Bug 56849 - EDITING: Auto Reduce font size during typing
Comment 5 Rob Snelders 2013-01-03 23:25:11 UTC
*** Bug 56849 has been marked as a duplicate of this bug. ***
Comment 6 Rob Snelders 2013-01-03 23:25:54 UTC
*** Bug 54434 has been marked as a duplicate of this bug. ***
Comment 7 Flex Liu 2013-01-14 05:54:41 UTC
Still reproduce in upstream 4.0.0 beta.

Some of different between the reproduce video, and more detail.

1. I can change the font size with a suitable font size number for the content object, after the "Autofit Text" made the font too small.
2. If I change the font size with a number which greater than the suitable number, it will be acceptable when you not leave the edit mode for the content object, but the font size will become unacceptable smaller after you leave the edit mode, and it will never back to suitable size if you enter the edit mode again.

Mostly the root cause start in code:
/core/chart2/source/tools/ReferenceSizeProvider.cxx

continue investigate it.
Comment 8 Flex Liu 2013-01-14 07:35:26 UTC
> 
> Mostly the root cause start in code:
> /core/chart2/source/tools/ReferenceSizeProvider.cxx

Sorry, the root cause should be in code:
/core/svx/source/svdraw/svdotext.cxx

   1254 void SdrTextObj::ImpAutoFitText( SdrOutliner& rOutliner ) const
   1255 {
   1256     const Size aShapeSize=GetSnapRect().GetSize();
   1257     ImpAutoFitText( rOutliner,
   1258                     Size(aShapeSize.Width()-GetTextLeftDistance()-GetTextRightDistance(),
   1259                          aShapeSize.Height()-GetTextUpperDistance()-GetTextLowerDistance()),
   1260                     IsVerticalWriting() );
   1261 }
   1262 
   1263 void SdrTextObj::ImpAutoFitText( SdrOutliner& rOutliner, const Size& rTextSize, bool bIsVerticalWriting )
   1264 {
   1265     // EditEngine formatting is unstable enough for
   1266     // line-breaking text that we need some more samples
   1267 
   1268     // loop early-exits if we detect an already attained value
   1269     sal_uInt16 nMinStretchX=0, nMinStretchY=0;
   1270     sal_uInt16 aOldStretchXVals[]={0,0,0,0,0,0,0,0,0,0};
   1271     const size_t aStretchArySize=SAL_N_ELEMENTS(aOldStretchXVals);
   1272     for(unsigned int i=0; i<aStretchArySize; ++i)
   1273     {
   1274         const Size aCurrTextSize = rOutliner.CalcTextSizeNTP();
   1275         double fFactor(1.0);
   1276         if( bIsVerticalWriting )
   1277             fFactor = double(rTextSize.Width())/aCurrTextSize.Width();
   1278         else
   1279             fFactor = double(rTextSize.Height())/aCurrTextSize.Height();
   1280 
   1281         sal_uInt16 nCurrStretchX, nCurrStretchY;
   1282         rOutliner.GetGlobalCharStretching(nCurrStretchX, nCurrStretchY);
   1283 
   1284         if (fFactor >= 1.0 )
   1285         {
   1286             // resulting text area fits into available shape rect -
   1287             // err on the larger stretching, to optimally fill area
   1288             nMinStretchX = std::max(nMinStretchX,nCurrStretchX);
   1289             nMinStretchY = std::max(nMinStretchY,nCurrStretchY);
   1290         }
   1291 
   1292         aOldStretchXVals[i] = nCurrStretchX;
   1293         if( std::find(aOldStretchXVals, aOldStretchXVals+i, nCurrStretchX) != aOldStretchXVals+i )
   1294             break; // same value already attained once; algo is looping, exit
   1295 
   1296         if (fFactor < 1.0 || (fFactor >= 1.0 && nCurrStretchX != 100))
   1297         {
   1298             nCurrStretchX = sal::static_int_cast<sal_uInt16>(nCurrStretchX*fFactor);
   1299             nCurrStretchY = sal::static_int_cast<sal_uInt16>(nCurrStretchY*fFactor);
   1300             rOutliner.SetGlobalCharStretching(std::min(sal_uInt16(100),nCurrStretchX),
   1301                                               std::min(sal_uInt16(100),nCurrStretchY));
   1302             OSL_TRACE("SdrTextObj::onEditOutlinerStatusEvent(): zoom is %d", nCurrStretchX);
   1303         }
   1304     }
   1305 
   1306     OSL_TRACE("---- SdrTextObj::onEditOutlinerStatusEvent(): final zoom is %d ----", nMinStretchX);
   1307     rOutliner.SetGlobalCharStretching(std::min(sal_uInt16(100),nMinStretchX),
   1308                                       std::min(sal_uInt16(100),nMinStretchY));
   1309 }
Comment 9 Vossman 2013-05-23 02:16:48 UTC

*** This bug has been marked as a duplicate of bug 42134 ***