merge the formfield patch from ooo-build
[ooovba.git] / applied_patches / 0520-fit-list-to-size.diff
blob9a04f56c0ee7f7482d74527117683d8d968ed55a
1 --- offapi/com/sun/star/drawing/TextFitToSizeType.idl.old 2009-04-02 10:51:28.000000000 +0000
2 +++ offapi/com/sun/star/drawing/TextFitToSizeType.idl 2009-04-06 16:42:18.000000000 +0000
3 @@ -63,9 +63,10 @@ published enum TextFitToSizeType
5 //-------------------------------------------------------------------------
7 - /** if the shape is scaled, the font attributes are scaled and hard set
8 - on the text */
9 - RESIZEATTR
10 + /** if the shape is scaled, the font is scaled isotrophically to
11 + fit the avaiable space. Auto line-breaks will keep working
12 + */
13 + AUTOFIT
15 };
17 --- qadevOOo/runner/util/ValueChanger.java.old 2009-04-02 10:57:39.000000000 +0000
18 +++ qadevOOo/runner/util/ValueChanger.java 2009-04-06 16:42:18.000000000 +0000
19 @@ -389,7 +389,7 @@ public class ValueChanger {
20 com.sun.star.drawing.TextFitToSizeType TF1 = com.sun.star.drawing.TextFitToSizeType.ALLLINES;
21 com.sun.star.drawing.TextFitToSizeType TF2 = com.sun.star.drawing.TextFitToSizeType.NONE;
22 com.sun.star.drawing.TextFitToSizeType TF3 = com.sun.star.drawing.TextFitToSizeType.PROPORTIONAL;
23 - com.sun.star.drawing.TextFitToSizeType TF4 = com.sun.star.drawing.TextFitToSizeType.RESIZEATTR;
24 + com.sun.star.drawing.TextFitToSizeType TF4 = com.sun.star.drawing.TextFitToSizeType.AUTOFIT;
25 if (oldValue.equals(TF1)) newValue = TF2;
26 if (oldValue.equals(TF2)) newValue = TF3;
27 if (oldValue.equals(TF3)) newValue = TF4;
28 --- sd/sdi/_drvwsh.sdi.old 2009-04-02 10:45:43.000000000 +0000
29 +++ sd/sdi/_drvwsh.sdi 2009-04-06 16:42:18.000000000 +0000
30 @@ -28,18 +28,6 @@
32 ************************************************************************/
34 -enum SdrFitToSizeType
36 - SDRTEXTFIT_NONE ,
37 - SDRTEXTFIT_PROPORTIONAL ,
38 - SDRTEXTFIT_ALLLINES ,
39 - SDRTEXTFIT_RESIZEATTR
41 -item UINT32 SvxObjectItem ;
42 -item BOOL SdrShadowItem ;
43 -item SdrFitToSizeType SdrTextFitToSizeTypeItem ;
46 interface DrawView
48 SID_JUMPTOMARK // ole : no, status : ?
49 --- svx/inc/svx/sdr/attribute/sdrtextattribute.hxx
50 +++ svx/inc/svx/sdr/attribute/sdrtextattribute.hxx
51 @@ -65,6 +65,7 @@ namespace drawinglayer
52 // bitfield
53 unsigned mbContour : 1;
54 unsigned mbFitToSize : 1;
55 + unsigned mbAutoFit : 1;
56 unsigned mbHideContour : 1;
57 unsigned mbBlink : 1;
58 unsigned mbScroll : 1;
59 @@ -81,6 +82,7 @@ namespace drawinglayer
60 sal_Int32 aTextLowerDistance,
61 bool bContour,
62 bool bFitToSize,
63 + bool bAutoFit,
64 bool bHideContour,
65 bool bBlink,
66 bool bScroll,
67 @@ -93,6 +95,7 @@ namespace drawinglayer
68 const OutlinerParaObject& getOutlinerParaObject() const { return maOutlinerParaObject; }
69 bool isContour() const { return mbContour; }
70 bool isFitToSize() const { return mbFitToSize; }
71 + bool isAutoFit() const { return mbAutoFit; }
72 bool isHideContour() const { return mbHideContour; }
73 bool isBlink() const { return mbBlink; }
74 bool isScroll() const { return mbScroll; }
75 --- svx/inc/svx/sdr/primitive2d/sdrtextprimitive2d.hxx.old 2009-04-02 11:03:37.000000000 +0000
76 +++ svx/inc/svx/sdr/primitive2d/sdrtextprimitive2d.hxx 2009-04-06 16:42:18.000000000 +0000
77 @@ -265,6 +265,47 @@ namespace drawinglayer
79 //////////////////////////////////////////////////////////////////////////////
81 +namespace drawinglayer
83 + namespace primitive2d
84 + {
85 + class SdrAutoFitTextPrimitive2D : public SdrTextPrimitive2D
86 + {
87 + private:
88 + ::basegfx::B2DHomMatrix maTextRangeTransform; // text range transformation from unit range ([0.0 .. 1.0]) to text range
90 + // bitfield
91 + unsigned mbWordWrap : 1; // for CustomShapes text layout
93 + protected:
94 + // local decomposition.
95 + virtual Primitive2DSequence createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const;
97 + public:
98 + SdrAutoFitTextPrimitive2D(
99 + const SdrText* pSdrText,
100 + const OutlinerParaObject& rOutlinerParaObjectPtr,
101 + const ::basegfx::B2DHomMatrix& rTextRangeTransform,
102 + bool bWordWrap);
104 + // get data
105 + const basegfx::B2DHomMatrix& getTextRangeTransform() const { return maTextRangeTransform; }
106 + bool getWordWrap() const { return mbWordWrap; }
108 + // compare operator
109 + virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
111 + // transformed clone operator
112 + virtual SdrTextPrimitive2D* createTransformedClone(const ::basegfx::B2DHomMatrix& rTransform) const;
114 + // provide unique ID
115 + DeclPrimitrive2DIDBlock()
116 + };
117 + } // end of namespace primitive2d
118 +} // end of namespace drawinglayer
120 +//////////////////////////////////////////////////////////////////////////////
122 #endif //INCLUDED_SDR_PRIMITIVE2D_SDRTEXTPRIMITIVE2D_HXX
124 // eof
125 --- svx/inc/svx/sdr/primitive2d/svx_primitivetypes2d.hxx
126 +++ svx/inc/svx/sdr/primitive2d/svx_primitivetypes2d.hxx
127 @@ -52,6 +52,7 @@
128 #define PRIMITIVE2D_ID_OVERLAYROLLINGRECTANGLEPRIMITIVE (PRIMITIVE2D_ID_RANGE_SVX| 20)
129 #define PRIMITIVE2D_ID_SDRCONTROLPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 21)
130 #define PRIMITIVE2D_ID_SDROLECONTENTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 22)
131 +#define PRIMITIVE2D_ID_SDRAUTOFITTEXTPRIMITIVE2D (PRIMITIVE2D_ID_RANGE_SVX| 23)
133 //////////////////////////////////////////////////////////////////////////////
135 --- svx/inc/svx/sdtfsitm.hxx.old 2009-04-02 11:03:40.000000000 +0000
136 +++ svx/inc/svx/sdtfsitm.hxx 2009-04-06 16:42:18.000000000 +0000
137 @@ -34,19 +34,21 @@
138 #include <svx/svddef.hxx>
139 #include "svx/svxdllapi.h"
141 -enum SdrFitToSizeType {SDRTEXTFIT_NONE, // - kein FitToSize
142 - SDRTEXTFIT_PROPORTIONAL, // - Alle Buchstaben proportional umgroessern
143 - SDRTEXTFIT_ALLLINES, // - Zus. jede Zeile separat in der Breite stretchen
144 - SDRTEXTFIT_RESIZEATTR}; // - Bei Rahmenumgroesserung (ausser Autogrow) wird
145 - // die Schriftgroesse umattributiert (hart)
146 +enum SdrFitToSizeType {
147 + SDRTEXTFIT_NONE, // - no fit-to-size
148 + SDRTEXTFIT_PROPORTIONAL, // - resize all glyhs proportionally
149 + // (might scale anisotrophically)
150 + SDRTEXTFIT_ALLLINES, // - like SDRTEXTFIT_PROPORTIONAL, but
151 + // scales each line separately
152 + SDRTEXTFIT_AUTOFIT}; // - mimics PPT's automatic adaption of
153 + // font size to text rect - comparable
154 + // to SDRTEXTFIT_PROPORTIONAL, but
155 + // scales isotrophically
157 -// Bei SDRTEXTFIT_PROPORTIONAL und SDRTEXTFIT_ALLLINES gibt es kein AutoGrow und
158 -// keine automatischen Umbrueche.
159 -// Ist SDRTEXTFIT_RESIZEATTR gesetzt, so wird beim umgroessern des Textrahmens
160 -// (ausser bei AutoGrow) die Schrift durch harte Attributierung ebenfalls
161 -// umgegroessert.
162 -// Bei AutoGrowingWidth gibt es ebenfalls keine automatischen Umbrueche (erst bei
163 -// TextMaxFrameWidth).
164 +// No AutoGrow and no automatic line breaks for
165 +// SDRTEXTFIT_PROPORTIONAL and SDRTEXTFIT_ALLLINES.
166 +// No automatic line breaks for AutoGrowingWidth as well (only if
167 +// TextMaxFrameWidth is reached).
169 //--------------------------------
170 // class SdrTextFitToSizeTypeItem
171 --- svx/inc/svx/svdotext.hxx
172 +++ svx/inc/svx/svdotext.hxx
173 @@ -62,6 +62,7 @@ namespace drawinglayer { namespace primi
174 class SdrContourTextPrimitive2D;
175 class SdrPathTextPrimitive2D;
176 class SdrBlockTextPrimitive2D;
177 + class SdrAutoFitTextPrimitive2D;
178 class SdrStretchTextPrimitive2D;
181 @@ -259,6 +260,9 @@ protected:
182 // Flag for allowing text animation. Default is sal_true.
183 BOOL mbTextAnimationAllowed : 1;
185 + // flag for preventing recursive onEditOutlinerStatusEvent calls
186 + BOOL mbInDownScale : 1;
188 SdrOutliner& ImpGetDrawOutliner() const;
190 private:
191 @@ -272,6 +276,8 @@ private:
192 Rectangle& rAnchorRect,
193 Rectangle& rPaintRect,
194 Fraction& aFitXKorreg ) const;
195 + void ImpAutoFitText( SdrOutliner& rOutliner ) const;
196 + static void ImpAutoFitText( SdrOutliner& rOutliner, const Size& rShapeSize, bool bIsVerticalWriting );
197 SVX_DLLPRIVATE SdrObject* ImpConvertContainedTextToSdrPathObjs(bool bToPoly) const;
198 SVX_DLLPRIVATE void ImpLinkAnmeldung();
199 SVX_DLLPRIVATE void ImpLinkAbmeldung();
200 @@ -283,7 +289,7 @@ protected:
201 SdrObject* ImpConvertMakeObj(const basegfx::B2DPolyPolygon& rPolyPolygon, sal_Bool bClosed, sal_Bool bBezier, sal_Bool bNoSetAttr = sal_False) const;
202 SdrObject* ImpConvertAddText(SdrObject* pObj, FASTBOOL bBezier) const;
203 void ImpSetTextStyleSheetListeners();
204 - void ImpSetCharStretching(SdrOutliner& rOutliner, const Rectangle& rTextRect, const Rectangle& rAnchorRect, Fraction& rFitXKorreg) const;
205 + void ImpSetCharStretching(SdrOutliner& rOutliner, const Size& rTextSize, const Size& rShapeSize, Fraction& rFitXKorreg) const;
206 void ImpJustifyRect(Rectangle& rRect) const;
207 void ImpCheckShear();
208 Rectangle ImpDragCalcRect(const SdrDragStat& rDrag) const;
209 @@ -345,6 +351,10 @@ public:
210 void NbcResizeTextAttributes(const Fraction& xFact, const Fraction& yFact);
211 FASTBOOL IsTextFrame() const { return bTextFrame; }
212 FASTBOOL IsOutlText() const { return bTextFrame && (eTextKind==OBJ_OUTLINETEXT || eTextKind==OBJ_TITLETEXT); }
213 + /// returns true if the PPT autofit of text into shape bounds is enabled. implies IsFitToSize()==false!
214 + FASTBOOL IsAutoFit() const;
215 + /// returns true if the old feature for fitting shape content should into shape is enabled. implies IsAutoFit()==false!
216 + FASTBOOL IsFitToSize() const;
217 SdrObjKind GetTextKind() const { return eTextKind; }
219 virtual bool HasText() const;
220 @@ -590,6 +600,10 @@ public:
221 drawinglayer::primitive2d::Primitive2DSequence& rTarget,
222 const drawinglayer::primitive2d::SdrBlockTextPrimitive2D& rSdrBlockTextPrimitive,
223 const drawinglayer::geometry::ViewInformation2D& aViewInformation) const;
224 + void impDecomposeAutoFitTextPrimitive(
225 + drawinglayer::primitive2d::Primitive2DSequence& rTarget,
226 + const drawinglayer::primitive2d::SdrAutoFitTextPrimitive2D& rSdrAutofitTextPrimitive,
227 + const drawinglayer::geometry::ViewInformation2D& aViewInformation) const;
228 void impDecomposeStretchTextPrimitive(
229 drawinglayer::primitive2d::Primitive2DSequence& rTarget,
230 const drawinglayer::primitive2d::SdrStretchTextPrimitive2D& rSdrStretchTextPrimitive,
231 --- svx/source/cui/dbregisterednamesconfig.cxx
232 +++ svx/source/cui/dbregisterednamesconfig.cxx
233 @@ -163,7 +163,7 @@ namespace svx
235 catch( const Exception& )
237 - DBG_UNHANDLED_EXCEPTION();
238 + //DBG_UNHANDLED_EXCEPTION();
242 @@ -184,7 +184,7 @@ namespace svx
244 catch( const Exception& )
246 - DBG_UNHANDLED_EXCEPTION();
247 + //DBG_UNHANDLED_EXCEPTION();
251 --- svx/source/cui/textattr.cxx
252 +++ svx/source/cui/textattr.cxx
253 @@ -460,7 +460,6 @@ BOOL SvxTextAttrPage::FillItemSet( SfxIt
254 default: ; //prevent warning
255 DBG_ERROR( "svx::SvxTextAttrPage::FillItemSet(), unhandled state!" );
256 case STATE_NOCHECK: eFTS = SDRTEXTFIT_NONE; break;
257 - //case STATE_CHECK: eFTS = SDRTEXTFIT_RESIZEATTR; break;
258 case STATE_CHECK: eFTS = SDRTEXTFIT_PROPORTIONAL; break;
260 rAttrs.Put( SdrTextFitToSizeTypeItem( eFTS ) );
261 --- svx/source/editeng/editobj2.hxx.old 2009-04-02 11:03:02.000000000 +0000
262 +++ svx/source/editeng/editobj2.hxx 2009-04-06 16:42:18.000000000 +0000
263 @@ -115,12 +115,16 @@ class XParaPortionList : public XBasePa
264 ULONG nRefDevPtr;
265 OutDevType eRefDevType;
266 MapMode aRefMapMode;
267 + sal_uInt16 nStretchX;
268 + sal_uInt16 nStretchY;
269 ULONG nPaperWidth;
272 public:
273 - XParaPortionList( OutputDevice* pRefDev, ULONG nPW ) :
274 - aRefMapMode( pRefDev->GetMapMode() )
275 + XParaPortionList( OutputDevice* pRefDev, ULONG nPW, sal_uInt16 _nStretchX, sal_uInt16 _nStretchY ) :
276 + aRefMapMode( pRefDev->GetMapMode() ),
277 + nStretchX(_nStretchX),
278 + nStretchY(_nStretchY)
280 nRefDevPtr = (ULONG)pRefDev; nPaperWidth = nPW;
281 eRefDevType = pRefDev->GetOutDevType();
282 @@ -130,6 +134,8 @@ public:
283 ULONG GetPaperWidth() const { return nPaperWidth; }
284 OutDevType GetRefDevType() const { return eRefDevType; }
285 const MapMode& GetRefMapMode() const { return aRefMapMode; }
286 + sal_uInt16 GetStretchX() const { return nStretchX; }
287 + sal_uInt16 GetStretchY() const { return nStretchY; }
290 /* cl removed because not needed anymore since binfilter
291 --- svx/source/editeng/impedit3.cxx.old 2009-04-06 16:42:16.000000000 +0000
292 +++ svx/source/editeng/impedit3.cxx 2009-04-06 16:42:18.000000000 +0000
293 @@ -2665,38 +2665,46 @@ void ImpEditEngine::SeekCursor( ContentNode* pNode, sal_uInt16 nPos, SvxFont& rF
294 aRealSz.Height() /= 100;
296 if ( nStretchX != 100 )
298 - aRealSz.Width() *= nStretchX;
299 - aRealSz.Width() /= 100;
301 + if ( nStretchX == nStretchY &&
302 + nRelWidth == 100 )
304 + aRealSz.Width() = 0;
306 + else
308 + aRealSz.Width() *= nStretchX;
309 + aRealSz.Width() /= 100;
311 - // Auch das Kerning: (long wegen Zwischenergebnis)
312 - long nKerning = rFont.GetFixKerning();
313 + // Auch das Kerning: (long wegen Zwischenergebnis)
314 + long nKerning = rFont.GetFixKerning();
316 - Die Ueberlegung war: Wenn neg. Kerning, aber StretchX = 200
317 - => Nicht das Kerning verdoppelt, also die Buchstaben weiter
318 - zusammenziehen
319 - ---------------------------
320 - Kern StretchX =>Kern
321 - ---------------------------
322 - >0 <100 < (Proportional)
323 - <0 <100 < (Proportional)
324 - >0 >100 > (Proportional)
325 - <0 >100 < (Der Betrag, also Antiprop)
326 + Die Ueberlegung war: Wenn neg. Kerning, aber StretchX = 200
327 + => Nicht das Kerning verdoppelt, also die Buchstaben weiter
328 + zusammenziehen
329 + ---------------------------
330 + Kern StretchX =>Kern
331 + ---------------------------
332 + >0 <100 < (Proportional)
333 + <0 <100 < (Proportional)
334 + >0 >100 > (Proportional)
335 + <0 >100 < (Der Betrag, also Antiprop)
337 - if ( ( nKerning < 0 ) && ( nStretchX > 100 ) )
339 - // Antiproportional
340 - nKerning *= 100;
341 - nKerning /= nStretchX;
343 - else if ( nKerning )
345 - // Proportional
346 - nKerning *= nStretchX;
347 - nKerning /= 100;
349 - rFont.SetFixKerning( (short)nKerning );
351 + if ( ( nKerning < 0 ) && ( nStretchX > 100 ) )
353 + // Antiproportional
354 + nKerning *= 100;
355 + nKerning /= nStretchX;
357 + else if ( nKerning )
359 + // Proportional
360 + nKerning *= nStretchX;
361 + nKerning /= 100;
363 + rFont.SetFixKerning( (short)nKerning );
367 if ( nRelWidth != 100 )
369 @@ -4085,20 +4085,25 @@ void ImpEditEngine::SetFlatMode( sal_Boo
371 void ImpEditEngine::SetCharStretching( sal_uInt16 nX, sal_uInt16 nY )
373 + bool bChanged(false);
374 if ( !IsVertical() )
376 + bChanged = nStretchX!=nX || nStretchY!=nY;
377 nStretchX = nX;
378 nStretchY = nY;
380 else
382 + bChanged = nStretchX!=nY || nStretchY!=nX;
383 nStretchX = nY;
384 nStretchY = nX;
387 - if ( aStatus.DoStretch() )
388 + if (bChanged && aStatus.DoStretch())
390 FormatFullDoc();
391 + // (potentially) need everything redrawn
392 + aInvalidRec=Rectangle(0,0,1000000,1000000);
393 UpdateViews( GetActiveView() );
396 --- svx/source/editeng/impedit4.cxx.old 2009-04-02 11:03:02.000000000 +0000
397 +++ svx/source/editeng/impedit4.cxx 2009-04-06 16:42:18.000000000 +0000
398 @@ -1169,7 +1169,7 @@ EditTextObject* ImpEditEngine::CreateBin
399 // Schwelle rauf setzen, wenn Olli die Absaetze nicht mehr zerhackt!
400 if ( bAllowBigObjects && bOnlyFullParagraphs && IsFormatted() && GetUpdateMode() && ( nTextPortions >= nBigObjectStart ) )
402 - XParaPortionList* pXList = new XParaPortionList( GetRefDevice(), aPaperSize.Width() );
403 + XParaPortionList* pXList = new XParaPortionList( GetRefDevice(), aPaperSize.Width(), nStretchX, nStretchY );
404 pTxtObj->SetPortionInfo( pXList );
405 for ( nNode = nStartNode; nNode <= nEndNode; nNode++ )
407 @@ -1260,7 +1260,9 @@ EditSelection ImpEditEngine::InsertBinTe
408 XParaPortionList* pPortionInfo = rTextObject.GetPortionInfo();
410 if ( pPortionInfo && ( (long)pPortionInfo->GetPaperWidth() == aPaperSize.Width() )
411 - && ( pPortionInfo->GetRefMapMode() == GetRefDevice()->GetMapMode() ) )
412 + && ( pPortionInfo->GetRefMapMode() == GetRefDevice()->GetMapMode() )
413 + && ( pPortionInfo->GetStretchX() == nStretchX )
414 + && ( pPortionInfo->GetStretchY() == nStretchY ) )
416 if ( ( pPortionInfo->GetRefDevPtr() == (sal_uIntPtr)GetRefDevice() ) ||
417 ( ( pPortionInfo->GetRefDevType() == OUTDEV_VIRDEV ) &&
418 --- svx/source/outliner/outliner.cxx.old 2009-04-02 11:02:55.000000000 +0000
419 +++ svx/source/outliner/outliner.cxx 2009-04-06 16:42:18.000000000 +0000
420 @@ -922,7 +922,10 @@ Font Outliner::ImpCalcBulletFont( USHORT
423 // #107508# Use original scale...
424 - USHORT nScale = /* pEditEngine->IsFlatMode() ? DEFAULT_SCALE : */ pFmt->GetBulletRelSize();
425 + USHORT nStretchX, nStretchY;
426 + const_cast<Outliner*>(this)->GetGlobalCharStretching(nStretchX, nStretchY);
428 + USHORT nScale = pFmt->GetBulletRelSize() * nStretchY / 100;
429 ULONG nScaledLineHeight = aStdFont.GetSize().Height();
430 nScaledLineHeight *= nScale*10;
431 nScaledLineHeight /= 1000;
432 @@ -965,6 +968,12 @@ void Outliner::PaintBullet( USHORT nPara
433 BOOL bRightToLeftPara = pEditEngine->IsRightToLeft( nPara );
435 Rectangle aBulletArea( ImpCalcBulletArea( nPara, TRUE, FALSE ) );
436 + USHORT nStretchX, nStretchY;
437 + GetGlobalCharStretching(nStretchX, nStretchY);
438 + aBulletArea = Rectangle( Point(aBulletArea.Left()*nStretchX/100,
439 + aBulletArea.Top()),
440 + Size(aBulletArea.GetWidth()*nStretchX/100,
441 + aBulletArea.GetHeight()) );
443 Paragraph* pPara = pParaList->GetParagraph( nPara );
444 const SvxNumberFormat* pFmt = GetNumberFormat( nPara );
445 --- svx/source/sdr/attribute/sdrtextattribute.cxx.old 2009-04-02 11:02:53.000000000 +0000
446 +++ svx/source/sdr/attribute/sdrtextattribute.cxx 2009-04-06 16:42:18.000000000 +0000
447 @@ -52,6 +52,7 @@ namespace drawinglayer
448 sal_Int32 aTextLowerDistance,
449 bool bContour,
450 bool bFitToSize,
451 + bool bAutoFit,
452 bool bHideContour,
453 bool bBlink,
454 bool bScroll,
455 @@ -65,6 +66,7 @@ namespace drawinglayer
456 maTextLowerDistance(aTextLowerDistance),
457 mbContour(bContour),
458 mbFitToSize(bFitToSize),
459 + mbAutoFit(bAutoFit),
460 mbHideContour(bHideContour),
461 mbBlink(bBlink),
462 mbScroll(bScroll),
463 @@ -82,6 +84,7 @@ namespace drawinglayer
464 && getTextLowerDistance() == rCandidate.getTextLowerDistance()
465 && isContour() == rCandidate.isContour()
466 && isFitToSize() == rCandidate.isFitToSize()
467 + && isAutoFit() == rCandidate.isAutoFit()
468 && isHideContour() == rCandidate.isHideContour()
469 && isBlink() == rCandidate.isBlink()
470 && isScroll() == rCandidate.isScroll()
471 --- svx/source/sdr/primitive2d/sdrattributecreator.cxx.old 2009-04-02 11:02:54.000000000 +0000
472 +++ svx/source/sdr/primitive2d/sdrattributecreator.cxx 2009-04-06 16:42:18.000000000 +0000
473 @@ -521,7 +521,8 @@ namespace drawinglayer
474 rTextObj.GetTextRightDistance(),
475 rTextObj.GetTextLowerDistance(),
476 ((const SdrTextContourFrameItem&)rSet.Get(SDRATTR_TEXT_CONTOURFRAME)).GetValue(),
477 - (SDRTEXTFIT_PROPORTIONAL == eFit || SDRTEXTFIT_ALLLINES == eFit),
478 + rTextObj.IsFitToSize(),
479 + rTextObj.IsAutoFit(),
480 ((const XFormTextHideFormItem&)rSet.Get(XATTR_FORMTXTHIDEFORM)).GetValue(),
481 SDRTEXTANI_BLINK == eAniKind,
482 SDRTEXTANI_SCROLL == eAniKind || SDRTEXTANI_ALTERNATE == eAniKind || SDRTEXTANI_SLIDE == eAniKind,
483 @@ -542,7 +543,7 @@ namespace drawinglayer
484 const XGradient& rGradient = ((XFillFloatTransparenceItem*)pGradientItem)->GetGradientValue();
485 const sal_uInt8 nStartLuminance(rGradient.GetStartColor().GetLuminance());
486 const sal_uInt8 nEndLuminance(rGradient.GetEndColor().GetLuminance());
487 - const bool bCompletelyTransparent(0xff == nStartLuminance == nEndLuminance);
488 + const bool bCompletelyTransparent(0xff == nStartLuminance && 0xff == nEndLuminance);
490 if(!bCompletelyTransparent)
492 --- svx/source/sdr/primitive2d/sdrdecompositiontools.cxx.old 2009-04-02 11:02:54.000000000 +0000
493 +++ svx/source/sdr/primitive2d/sdrdecompositiontools.cxx 2009-04-06 16:42:18.000000000 +0000
494 @@ -269,6 +269,11 @@ namespace drawinglayer
495 // streched text in range
496 pNew = new SdrStretchTextPrimitive2D(rText.getSdrText(), rText.getOutlinerParaObject(), aAnchorTransform);
498 + else if(rText.isAutoFit())
500 + // isotrophically scaled text in range
501 + pNew = new SdrAutoFitTextPrimitive2D(&rText.getSdrText(), rText.getOutlinerParaObject(), aAnchorTransform, bWordWrap);
503 else // text in range
505 // build new primitive
506 --- svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx.old 2009-04-02 11:02:54.000000000 +0000
507 +++ svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx 2009-04-06 16:42:18.000000000 +0000
508 @@ -305,6 +305,55 @@ namespace drawinglayer
510 namespace primitive2d
512 + Primitive2DSequence SdrAutoFitTextPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const
514 + Primitive2DSequence aRetval;
515 + getSdrText()->GetObject().impDecomposeAutoFitTextPrimitive(aRetval, *this, aViewInformation);
517 + return encapsulateWithTextHierarchyBlockPrimitive2D(aRetval);
520 + SdrAutoFitTextPrimitive2D::SdrAutoFitTextPrimitive2D(
521 + const SdrText* pSdrText,
522 + const OutlinerParaObject& rParaObj,
523 + const ::basegfx::B2DHomMatrix& rTextRangeTransform,
524 + bool bWordWrap)
525 + : SdrTextPrimitive2D(pSdrText, rParaObj),
526 + maTextRangeTransform(rTextRangeTransform),
527 + mbWordWrap(bWordWrap)
531 + bool SdrAutoFitTextPrimitive2D::operator==(const BasePrimitive2D& rPrimitive) const
533 + if(SdrTextPrimitive2D::operator==(rPrimitive))
535 + const SdrBlockTextPrimitive2D& rCompare = (SdrBlockTextPrimitive2D&)rPrimitive;
537 + return (getTextRangeTransform() == rCompare.getTextRangeTransform()
538 + && getWordWrap() == rCompare.getWordWrap());
541 + return false;
544 + SdrTextPrimitive2D* SdrAutoFitTextPrimitive2D::createTransformedClone(const ::basegfx::B2DHomMatrix& rTransform) const
546 + return new SdrAutoFitTextPrimitive2D(getSdrText(), getOutlinerParaObject(), rTransform * getTextRangeTransform(), getWordWrap());
549 + // provide unique ID
550 + ImplPrimitrive2DIDBlock(SdrAutoFitTextPrimitive2D, PRIMITIVE2D_ID_SDRAUTOFITTEXTPRIMITIVE2D)
552 + } // end of namespace primitive2d
553 +} // end of namespace drawinglayer
555 +//////////////////////////////////////////////////////////////////////////////
557 +namespace drawinglayer
559 + namespace primitive2d
561 Primitive2DSequence SdrStretchTextPrimitive2D::createLocalDecomposition(const geometry::ViewInformation2D& aViewInformation) const
563 Primitive2DSequence aRetval;
564 --- svx/source/svdraw/svdedxv.cxx.old 2009-04-06 16:42:16.000000000 +0000
565 +++ svx/source/svdraw/svdedxv.cxx 2009-04-06 16:42:18.000000000 +0000
566 @@ -315,7 +315,7 @@ void SdrObjEditView::ImpPaintOutlinerVie
568 const SdrTextObj* pText = PTR_CAST(SdrTextObj,GetTextEditObject());
569 bool bTextFrame(pText && pText->IsTextFrame());
570 - bool bFitToSize(0 != (pTextEditOutliner->GetControlWord() & EE_CNTRL_STRETCHING));
571 + bool bFitToSize(pText && pText->IsFitToSize());
572 bool bModifyMerk(pTextEditOutliner->IsModified()); // #43095#
573 Rectangle aBlankRect(rOutlView.GetOutputArea());
574 aBlankRect.Union(aMinTextEditArea);
575 @@ -384,7 +384,7 @@ void SdrObjEditView::ImpInvalidateOutlin
577 const SdrTextObj* pText = PTR_CAST(SdrTextObj,GetTextEditObject());
578 bool bTextFrame(pText && pText->IsTextFrame());
579 - bool bFitToSize(0 != (pTextEditOutliner->GetControlWord() & EE_CNTRL_STRETCHING));
580 + bool bFitToSize(pText && pText->IsFitToSize());
582 if(bTextFrame && !bFitToSize)
584 @@ -692,8 +692,7 @@ sal_Bool SdrObjEditView::SdrBeginTextEdi
585 if ( !pTextObj->IsContourTextFrame() )
587 // FitToSize erstmal nicht mit ContourFrame
588 - SdrFitToSizeType eFit = pTextObj->GetFitToSize();
589 - if (eFit==SDRTEXTFIT_PROPORTIONAL || eFit==SDRTEXTFIT_ALLLINES)
590 + if (pTextObj->IsFitToSize())
591 aTextRect = aAnchorRect;
594 @@ -761,8 +760,7 @@ sal_Bool SdrObjEditView::SdrBeginTextEdi
595 // #71519#
596 if(!bExtraInvalidate)
598 - SdrFitToSizeType eFit = pTextObj->GetFitToSize();
599 - if(eFit == SDRTEXTFIT_PROPORTIONAL || eFit == SDRTEXTFIT_ALLLINES)
600 + if(pTextObj->IsFitToSize())
601 bExtraInvalidate = sal_True;
604 --- svx/source/svdraw/svdfppt.cxx
605 +++ svx/source/svdraw/svdfppt.cxx
606 @@ -1113,6 +1113,7 @@ SdrObject* SdrEscherImport::ProcessObj(
608 aTextObj.SetDestinationInstance( (sal_uInt16)nDestinationInstance );
610 + bool bAutoFit = false; // auto-scale text into shape box
611 switch ( aTextObj.GetInstance() )
613 case TSS_TYPE_PAGETITLE :
614 @@ -1120,7 +1121,7 @@ SdrObject* SdrEscherImport::ProcessObj(
615 case TSS_TYPE_SUBTITLE : eTextKind = OBJ_TEXT; break;
616 case TSS_TYPE_BODY :
617 case TSS_TYPE_HALFBODY :
618 - case TSS_TYPE_QUARTERBODY : eTextKind = OBJ_OUTLINETEXT; break;
619 + case TSS_TYPE_QUARTERBODY : eTextKind = OBJ_OUTLINETEXT; bAutoFit = true; break;
621 if ( aTextObj.GetDestinationInstance() != TSS_TYPE_TEXT_IN_SHAPE )
623 @@ -1175,6 +1176,15 @@ SdrObject* SdrEscherImport::ProcessObj(
625 pTObj->SetMergedItem( SvxFrameDirectionItem( bVerticalText ? FRMDIR_VERT_TOP_RIGHT : FRMDIR_HORI_LEFT_TOP, EE_PARA_WRITINGDIR ) );
627 + if (bAutoFit)
629 + // disable both, defeats purpose of autofit
630 + // otherwise
631 + bAutoGrowHeight = sal_False;
632 + bAutoGrowWidth = sal_False;
633 + pTObj->SetMergedItem( SdrTextFitToSizeTypeItem(SDRTEXTFIT_AUTOFIT) );
636 if ( !pTObj->ISA( SdrObjCustomShape ) )
638 pTObj->SetMergedItem( SdrTextAutoGrowWidthItem( bAutoGrowWidth ) );
639 --- svx/source/svdraw/svdotext.cxx.old 2009-04-02 11:03:00.000000000 +0000
640 +++ svx/source/svdraw/svdotext.cxx 2009-04-06 16:42:18.000000000 +0000
641 @@ -145,6 +145,7 @@ SdrTextObj::SdrTextObj()
643 // #i25616#
644 mbSupportTextIndentingOnLineWidthChange = sal_True;
645 + mbInDownScale = sal_False;
648 SdrTextObj::SdrTextObj(const Rectangle& rNewRect)
649 @@ -170,6 +171,7 @@ SdrTextObj::SdrTextObj(const Rectangle&
651 // #111096#
652 mbTextAnimationAllowed = sal_True;
653 + mbInDownScale = sal_False;
655 // #108784#
656 maTextEditOffset = Point(0, 0);
657 @@ -200,6 +202,7 @@ SdrTextObj::SdrTextObj(SdrObjKind eNewTe
659 // #111096#
660 mbTextAnimationAllowed = sal_True;
661 + mbInDownScale = sal_False;
663 // #108784#
664 maTextEditOffset = Point(0, 0);
665 @@ -232,6 +235,7 @@ SdrTextObj::SdrTextObj(SdrObjKind eNewTe
667 // #111096#
668 mbTextAnimationAllowed = sal_True;
669 + mbInDownScale = sal_False;
671 // #108784#
672 maTextEditOffset = Point(0, 0);
673 @@ -266,6 +270,7 @@ SdrTextObj::SdrTextObj(SdrObjKind eNewTe
675 // #111096#
676 mbTextAnimationAllowed = sal_True;
677 + mbInDownScale = sal_False;
679 // #108784#
680 maTextEditOffset = Point(0, 0);
681 @@ -842,8 +847,7 @@ void SdrTextObj::TakeTextRect( SdrOutlin
682 SdrTextAniKind eAniKind=GetTextAniKind();
683 SdrTextAniDirection eAniDirection=GetTextAniDirection();
685 - SdrFitToSizeType eFit=GetFitToSize();
686 - FASTBOOL bFitToSize=(eFit==SDRTEXTFIT_PROPORTIONAL || eFit==SDRTEXTFIT_ALLLINES);
687 + FASTBOOL bFitToSize(IsFitToSize());
688 FASTBOOL bContourFrame=IsContourTextFrame();
690 FASTBOOL bFrame=IsTextFrame();
691 @@ -1004,7 +1008,7 @@ OutlinerParaObject* SdrTextObj::GetEditO
692 return pPara;
695 -void SdrTextObj::ImpSetCharStretching(SdrOutliner& rOutliner, const Rectangle& rTextRect, const Rectangle& rAnchorRect, Fraction& rFitXKorreg) const
696 +void SdrTextObj::ImpSetCharStretching(SdrOutliner& rOutliner, const Size& rTextSize, const Size& rShapeSize, Fraction& rFitXKorreg) const
698 OutputDevice* pOut = rOutliner.GetRefDevice();
699 BOOL bNoStretching(FALSE);
700 @@ -1049,12 +1053,12 @@ void SdrTextObj::ImpSetCharStretching(Sd
701 unsigned nLoopCount=0;
702 FASTBOOL bNoMoreLoop=FALSE;
703 long nXDiff0=0x7FFFFFFF;
704 - long nWantWdt=rAnchorRect.Right()-rAnchorRect.Left();
705 - long nIsWdt=rTextRect.Right()-rTextRect.Left();
706 + long nWantWdt=rShapeSize.Width();
707 + long nIsWdt=rTextSize.Width();
708 if (nIsWdt==0) nIsWdt=1;
710 - long nWantHgt=rAnchorRect.Bottom()-rAnchorRect.Top();
711 - long nIsHgt=rTextRect.Bottom()-rTextRect.Top();
712 + long nWantHgt=rShapeSize.Height();
713 + long nIsHgt=rTextSize.Height();
714 if (nIsHgt==0) nIsHgt=1;
716 long nXTolPl=nWantWdt/100; // Toleranz +1%
717 # FIXME: 2009-08-14: No CheckHit() method any longer --tml
719 # @@ -1143,8 +1147,7 @@ SdrObject* SdrTextObj::CheckHit(const Po
721 # INT32 nMyTol=nTol;
722 # FASTBOOL bFontwork=IsFontwork();
723 # - SdrFitToSizeType eFit=GetFitToSize();
724 # - FASTBOOL bFitToSize=(eFit==SDRTEXTFIT_PROPORTIONAL || eFit==SDRTEXTFIT_ALLLINES);
725 # + FASTBOOL bFitToSize(IsFitToSize());
726 # Rectangle aR(aRect);
727 # Rectangle aAnchor2(aR);
728 # Rectangle aTextRect(aR);
729 @@ -1377,8 +1380,7 @@ basegfx::B2DPolyPolygon SdrTextObj::Take
730 Rectangle aR;
731 TakeTextRect(rOutliner,aR,FALSE,&aAnchor2);
732 rOutliner.Clear();
733 - SdrFitToSizeType eFit=GetFitToSize();
734 - FASTBOOL bFitToSize=(eFit==SDRTEXTFIT_PROPORTIONAL || eFit==SDRTEXTFIT_ALLLINES);
735 + FASTBOOL bFitToSize(IsFitToSize());
736 if (bFitToSize) aR=aAnchor2;
737 Polygon aPol(aR);
738 if (aGeo.nDrehWink!=0) RotatePoly(aPol,aR.TopLeft(),aGeo.nSin,aGeo.nCos);
739 @@ -1495,8 +1497,7 @@ void SdrTextObj::ImpSetupDrawOutlinerFor
740 if (!bContourFrame)
742 // FitToSize erstmal nicht mit ContourFrame
743 - SdrFitToSizeType eFit=GetFitToSize();
744 - if (eFit==SDRTEXTFIT_PROPORTIONAL || eFit==SDRTEXTFIT_ALLLINES)
745 + if (IsFitToSize() || IsAutoFit())
747 ULONG nStat=rOutliner.GetControlWord();
748 nStat|=EE_CNTRL_STRETCHING|EE_CNTRL_AUTOPAGESIZE;
749 @@ -1510,13 +1511,73 @@ void SdrTextObj::ImpSetupDrawOutlinerFor
750 if (!bContourFrame)
752 // FitToSize erstmal nicht mit ContourFrame
753 - SdrFitToSizeType eFit=GetFitToSize();
754 - if (eFit==SDRTEXTFIT_PROPORTIONAL || eFit==SDRTEXTFIT_ALLLINES)
755 + if (IsFitToSize())
757 - ImpSetCharStretching(rOutliner,rTextRect,rAnchorRect,rFitXKorreg);
758 + ImpSetCharStretching(rOutliner,rTextRect.GetSize(),rAnchorRect.GetSize(),rFitXKorreg);
759 rPaintRect=rAnchorRect;
761 + else if (IsAutoFit())
763 + ImpAutoFitText(rOutliner);
768 +void SdrTextObj::ImpAutoFitText( SdrOutliner& rOutliner ) const
770 + const Size aShapeSize=GetSnapRect().GetSize();
771 + ImpAutoFitText( rOutliner,
772 + Size(aShapeSize.Width()-GetTextLeftDistance()-GetTextRightDistance(),
773 + aShapeSize.Height()-GetTextUpperDistance()-GetTextLowerDistance()),
774 + IsVerticalWriting() );
777 +void SdrTextObj::ImpAutoFitText( SdrOutliner& rOutliner, const Size& rTextSize, bool bIsVerticalWriting )
779 + // EditEngine formatting is unstable enough for
780 + // line-breaking text that we need some more samples
782 + // loop early-exits if we detect an already attained value
783 + USHORT nMinStretchX=0, nMinStretchY=0;
784 + USHORT aOldStretchXVals[]={0,0,0,0,0,0,0,0,0,0};
785 + const size_t aStretchArySize=sizeof(aOldStretchXVals)/sizeof(*aOldStretchXVals);
786 + for(int i=0; i<aStretchArySize; ++i)
788 + const Size aCurrTextSize = rOutliner.CalcTextSize();
789 + double fFactor(1.0);
790 + if( bIsVerticalWriting )
791 + fFactor = double(rTextSize.Width())/aCurrTextSize.Width();
792 + else
793 + fFactor = double(rTextSize.Height())/aCurrTextSize.Height();
795 + USHORT nCurrStretchX, nCurrStretchY;
796 + rOutliner.GetGlobalCharStretching(nCurrStretchX, nCurrStretchY);
798 + if (fFactor >= 1.0 )
800 + // resulting text area fits into available shape rect -
801 + // err on the larger streching, to optimally fill area
802 + nMinStretchX = std::max(nMinStretchX,nCurrStretchX);
803 + nMinStretchY = std::max(nMinStretchY,nCurrStretchY);
806 + aOldStretchXVals[i] = nCurrStretchX;
807 + if( std::find(aOldStretchXVals, aOldStretchXVals+i, nCurrStretchX) != aOldStretchXVals+i )
808 + break; // same value already attained once; algo is looping, exit
810 + if (fFactor < 1.0 || (fFactor >= 1.0 && nCurrStretchX != 100))
812 + nCurrStretchX = sal::static_int_cast<USHORT>(nCurrStretchX*fFactor);
813 + nCurrStretchY = sal::static_int_cast<USHORT>(nCurrStretchY*fFactor);
814 + rOutliner.SetGlobalCharStretching(std::min(USHORT(100),nCurrStretchX),
815 + std::min(USHORT(100),nCurrStretchY));
816 + OSL_TRACE("SdrTextObj::onEditOutlinerStatusEvent(): zoom is %d", nCurrStretchX);
820 + OSL_TRACE("---- SdrTextObj::onEditOutlinerStatusEvent(): final zoom is %d ----", nMinStretchX);
821 + rOutliner.SetGlobalCharStretching(std::min(USHORT(100),nMinStretchX),
822 + std::min(USHORT(100),nMinStretchY));
825 void SdrTextObj::SetupOutlinerFormatting( SdrOutliner& rOutl, Rectangle& rPaintRect ) const
826 @@ -2114,6 +2175,17 @@ bool SdrTextObj::IsTextAnimationAllowed(
827 return mbTextAnimationAllowed;
830 +FASTBOOL SdrTextObj::IsAutoFit() const
832 + return GetFitToSize()==SDRTEXTFIT_AUTOFIT;
835 +FASTBOOL SdrTextObj::IsFitToSize() const
837 + const SdrFitToSizeType eFit=GetFitToSize();
838 + return (eFit==SDRTEXTFIT_PROPORTIONAL || eFit==SDRTEXTFIT_ALLLINES);
841 void SdrTextObj::SetTextAnimationAllowed(sal_Bool bNew)
843 if(mbTextAnimationAllowed != bNew)
844 @@ -2131,13 +2203,21 @@ void SdrTextObj::onEditOutlinerStatusEve
845 const bool bGrowY=(nStat & EE_STAT_TEXTHEIGHTCHANGED) !=0;
846 if(bTextFrame && (bGrowX || bGrowY))
848 - const bool bAutoGrowHgt= bTextFrame && IsAutoGrowHeight();
849 - const bool bAutoGrowWdt= bTextFrame && IsAutoGrowWidth();
851 - if ((bGrowX && bAutoGrowWdt) || (bGrowY && bAutoGrowHgt))
852 + if ((bGrowX && IsAutoGrowWidth()) || (bGrowY && IsAutoGrowHeight()))
854 AdjustTextFrameWidthAndHeight();
856 + else if (IsAutoFit() && !mbInDownScale)
858 + OSL_ASSERT(pEdtOutl);
859 + mbInDownScale = sal_True;
861 + // sucks that we cannot disable paints via
862 + // pEdtOutl->SetUpdateMode(FALSE) - but EditEngine skips
863 + // formatting as well, then.
864 + ImpAutoFitText(*pEdtOutl);
865 + mbInDownScale = sal_False;
870 --- svx/source/svdraw/svdotextdecomposition.cxx
871 +++ svx/source/svdraw/svdotextdecomposition.cxx
872 @@ -956,6 +956,137 @@ bool SdrTextObj::impDecomposeStretchText
873 rOutliner.setVisualizedPage(0);
875 rTarget = aConverter.getPrimitive2DSequence();
878 +void SdrTextObj::impDecomposeAutoFitTextPrimitive(
879 + drawinglayer::primitive2d::Primitive2DSequence& rTarget,
880 + const drawinglayer::primitive2d::SdrAutoFitTextPrimitive2D& rSdrAutofitTextPrimitive,
881 + const drawinglayer::geometry::ViewInformation2D& aViewInformation) const
883 + // decompose matrix to have position and size of text
884 + basegfx::B2DVector aScale, aTranslate;
885 + double fRotate, fShearX;
886 + rSdrAutofitTextPrimitive.getTextRangeTransform().decompose(aScale, aTranslate, fRotate, fShearX);
888 + // use B2DRange aAnchorTextRange for calculations
889 + basegfx::B2DRange aAnchorTextRange(aTranslate);
890 + aAnchorTextRange.expand(aTranslate + aScale);
892 + // prepare outliner
893 + const SfxItemSet& rTextItemSet = rSdrAutofitTextPrimitive.getSdrText()->GetItemSet();
894 + SdrOutliner& rOutliner = ImpGetDrawOutliner();
895 + SdrTextVertAdjust eVAdj = GetTextVerticalAdjust(rTextItemSet);
896 + SdrTextHorzAdjust eHAdj = GetTextHorizontalAdjust(rTextItemSet);
897 + const sal_uInt32 nOriginalControlWord(rOutliner.GetControlWord());
898 + const Size aNullSize;
900 + // set visualizing page at Outliner; needed e.g. for PageNumberField decomposition
901 + rOutliner.setVisualizedPage(GetSdrPageFromXDrawPage(aViewInformation.getVisualizedPage()));
903 + rOutliner.SetControlWord(nOriginalControlWord|EE_CNTRL_AUTOPAGESIZE|EE_CNTRL_STRETCHING);
904 + rOutliner.SetMinAutoPaperSize(aNullSize);
905 + rOutliner.SetMaxAutoPaperSize(Size(1000000,1000000));
907 + // add one to rage sizes to get back to the old Rectangle and outliner measurements
908 + const sal_uInt32 nAnchorTextWidth(FRound(aAnchorTextRange.getWidth() + 1L));
909 + const sal_uInt32 nAnchorTextHeight(FRound(aAnchorTextRange.getHeight() + 1L));
910 + const OutlinerParaObject* pOutlinerParaObject = rSdrAutofitTextPrimitive.getSdrText()->GetOutlinerParaObject();
911 + OSL_ENSURE(pOutlinerParaObject, "impDecomposeBlockTextPrimitive used with no OutlinerParaObject (!)");
912 + const bool bVerticalWritintg(pOutlinerParaObject->IsVertical());
913 + const Size aAnchorTextSize(Size(nAnchorTextWidth, nAnchorTextHeight));
915 + if((rSdrAutofitTextPrimitive.getWordWrap() || IsTextFrame()))
917 + rOutliner.SetMaxAutoPaperSize(aAnchorTextSize);
920 + if(SDRTEXTHORZADJUST_BLOCK == eHAdj && !bVerticalWritintg)
922 + rOutliner.SetMinAutoPaperSize(Size(nAnchorTextWidth, 0));
925 + if(SDRTEXTVERTADJUST_BLOCK == eVAdj && bVerticalWritintg)
927 + rOutliner.SetMinAutoPaperSize(Size(0, nAnchorTextHeight));
930 + rOutliner.SetPaperSize(aNullSize);
931 + rOutliner.SetUpdateMode(true);
932 + rOutliner.SetText(*pOutlinerParaObject);
933 + ImpAutoFitText(rOutliner,aAnchorTextSize,bVerticalWritintg);
935 + // now get back the layouted text size from outliner
936 + const Size aOutlinerTextSiz(rOutliner.GetPaperSize());
937 + const basegfx::B2DVector aOutlinerScale(aOutlinerTextSiz.Width(), aOutlinerTextSiz.Height());
938 + basegfx::B2DVector aAdjustTranslate(0.0, 0.0);
940 + // correct horizontal translation using the now known text size
941 + if(SDRTEXTHORZADJUST_CENTER == eHAdj || SDRTEXTHORZADJUST_RIGHT == eHAdj)
943 + const double fFree(aAnchorTextRange.getWidth() - aOutlinerScale.getX());
945 + if(SDRTEXTHORZADJUST_CENTER == eHAdj)
947 + aAdjustTranslate.setX(fFree / 2.0);
950 + if(SDRTEXTHORZADJUST_RIGHT == eHAdj)
952 + aAdjustTranslate.setX(fFree);
956 + // correct vertical translation using the now known text size
957 + if(SDRTEXTVERTADJUST_CENTER == eVAdj || SDRTEXTVERTADJUST_BOTTOM == eVAdj)
959 + const double fFree(aAnchorTextRange.getHeight() - aOutlinerScale.getY());
961 + if(SDRTEXTVERTADJUST_CENTER == eVAdj)
963 + aAdjustTranslate.setY(fFree / 2.0);
966 + if(SDRTEXTVERTADJUST_BOTTOM == eVAdj)
968 + aAdjustTranslate.setY(fFree);
972 + // prepare matrices to apply to newly created primitives. aNewTransformA
973 + // will get coordinates in aOutlinerScale size and positive in X, Y.
974 + basegfx::B2DHomMatrix aNewTransformA;
975 + basegfx::B2DHomMatrix aNewTransformB;
977 + // translate relative to given primitive to get same rotation and shear
978 + // as the master shape we are working on. For vertical, use the top-right
979 + // corner
980 + const double fStartInX(bVerticalWritintg ? aAdjustTranslate.getX() + aOutlinerScale.getX() : aAdjustTranslate.getX());
981 + aNewTransformA.translate(fStartInX, aAdjustTranslate.getY());
983 + // mirroring. We are now in aAnchorTextRange sizes. When mirroring in X and Y,
984 + // move the null point which was top left to bottom right.
985 + const bool bMirrorX(basegfx::fTools::less(aScale.getX(), 0.0));
986 + const bool bMirrorY(basegfx::fTools::less(aScale.getY(), 0.0));
987 + aNewTransformB.scale(bMirrorX ? -1.0 : 1.0, bMirrorY ? -1.0 : 1.0);
989 + // in-between the translations of the single primitives will take place. Afterwards,
990 + // the object's transformations need to be applied
991 + aNewTransformB.shearX(fShearX);
992 + aNewTransformB.rotate(fRotate);
993 + aNewTransformB.translate(aTranslate.getX(), aTranslate.getY());
995 + basegfx::B2DRange aClipRange;
997 + // now break up text primitives.
998 + impTextBreakupHandler aConverter(rOutliner);
999 + aConverter.decomposeBlockTextPrimitive(aNewTransformA, aNewTransformB, aClipRange);
1001 + // cleanup outliner
1002 + rOutliner.Clear();
1003 + rOutliner.setVisualizedPage(0);
1004 + rOutliner.SetControlWord(nOriginalControlWord);
1006 + rTarget = aConverter.getPrimitive2DSequence();
1009 void SdrTextObj::impDecomposeBlockTextPrimitive(
1010 --- svx/source/svdraw/svdotxat.cxx.old 2009-04-02 11:03:00.000000000 +0000
1011 +++ svx/source/svdraw/svdotxat.cxx 2009-04-06 16:42:18.000000000 +0000
1012 @@ -82,8 +82,7 @@ FASTBOOL SdrTextObj::AdjustTextFrameWidt
1014 if (bTextFrame && pModel!=NULL && !rR.IsEmpty())
1016 - SdrFitToSizeType eFit=GetFitToSize();
1017 - FASTBOOL bFitToSize=(eFit==SDRTEXTFIT_PROPORTIONAL || eFit==SDRTEXTFIT_ALLLINES);
1018 + FASTBOOL bFitToSize(IsFitToSize());
1019 FASTBOOL bWdtGrow=bWdt && IsAutoGrowWidth();
1020 FASTBOOL bHgtGrow=bHgt && IsAutoGrowHeight();
1021 SdrTextAniKind eAniKind=GetTextAniKind();
1022 --- svx/source/svdraw/svdotxed.cxx.old 2009-04-02 11:03:00.000000000 +0000
1023 +++ svx/source/svdraw/svdotxed.cxx 2009-04-06 16:42:18.000000000 +0000
1024 @@ -76,15 +76,17 @@ sal_Bool SdrTextObj::BegTextEdit(SdrOutl
1025 rOutl.Init( nOutlinerMode );
1026 rOutl.SetRefDevice( pModel->GetRefDevice() );
1028 - SdrFitToSizeType eFit=GetFitToSize();
1029 - FASTBOOL bFitToSize=(eFit==SDRTEXTFIT_PROPORTIONAL || eFit==SDRTEXTFIT_ALLLINES);
1030 + FASTBOOL bFitToSize(IsFitToSize());
1031 FASTBOOL bContourFrame=IsContourTextFrame();
1032 ImpSetTextEditParams();
1034 if (!bContourFrame) {
1035 ULONG nStat=rOutl.GetControlWord();
1036 nStat|=EE_CNTRL_AUTOPAGESIZE;
1037 - if (bFitToSize) nStat|=EE_CNTRL_STRETCHING; else nStat&=~EE_CNTRL_STRETCHING;
1038 + if (bFitToSize || IsAutoFit())
1039 + nStat|=EE_CNTRL_STRETCHING;
1040 + else
1041 + nStat&=~EE_CNTRL_STRETCHING;
1042 rOutl.SetControlWord(nStat);
1045 @@ -122,8 +124,12 @@ sal_Bool SdrTextObj::BegTextEdit(SdrOutl
1046 TakeTextRect(rOutl, aTextRect, FALSE,
1047 &aAnchorRect/* #97097# give TRUE here, not FALSE */);
1048 Fraction aFitXKorreg(1,1);
1049 - ImpSetCharStretching(rOutl,aTextRect,aAnchorRect,aFitXKorreg);
1050 + ImpSetCharStretching(rOutl,aTextRect.GetSize(),aAnchorRect.GetSize(),aFitXKorreg);
1052 + else if (IsAutoFit())
1054 + ImpAutoFitText(rOutl);
1057 if(pOutlinerParaObject)
1059 @@ -149,8 +155,7 @@ sal_Bool SdrTextObj::BegTextEdit(SdrOutl
1061 void SdrTextObj::TakeTextEditArea(Size* pPaperMin, Size* pPaperMax, Rectangle* pViewInit, Rectangle* pViewMin) const
1063 - SdrFitToSizeType eFit=GetFitToSize();
1064 - FASTBOOL bFitToSize=(eFit==SDRTEXTFIT_PROPORTIONAL || eFit==SDRTEXTFIT_ALLLINES);
1065 + FASTBOOL bFitToSize(IsFitToSize());
1066 Size aPaperMin,aPaperMax;
1067 Rectangle aViewInit;
1068 TakeTextAnchorRect(aViewInit);
1069 --- svx/source/svdraw/svdotxtr.cxx.old 2009-04-02 11:03:00.000000000 +0000
1070 +++ svx/source/svdraw/svdotxtr.cxx 2009-04-06 16:42:18.000000000 +0000
1071 @@ -83,9 +83,6 @@ void SdrTextObj::NbcSetSnapRect(const Re
1072 if (bTextFrame && (pModel==NULL || !pModel->IsPasteResize())) { // #51139#
1073 if (nTWdt0!=nTWdt1 && IsAutoGrowWidth() ) NbcSetMinTextFrameWidth(nTWdt1);
1074 if (nTHgt0!=nTHgt1 && IsAutoGrowHeight()) NbcSetMinTextFrameHeight(nTHgt1);
1075 - if (GetFitToSize()==SDRTEXTFIT_RESIZEATTR) {
1076 - NbcResizeTextAttributes(Fraction(nTWdt1,nTWdt0),Fraction(nTHgt1,nTHgt0));
1078 NbcAdjustTextFrameWidthAndHeight();
1080 ImpCheckShear();
1081 @@ -111,9 +108,6 @@ void SdrTextObj::NbcSetLogicRect(const R
1082 if (bTextFrame) {
1083 if (nTWdt0!=nTWdt1 && IsAutoGrowWidth() ) NbcSetMinTextFrameWidth(nTWdt1);
1084 if (nTHgt0!=nTHgt1 && IsAutoGrowHeight()) NbcSetMinTextFrameHeight(nTHgt1);
1085 - if (GetFitToSize()==SDRTEXTFIT_RESIZEATTR) {
1086 - NbcResizeTextAttributes(Fraction(nTWdt1,nTWdt0),Fraction(nTHgt1,nTHgt0));
1088 NbcAdjustTextFrameWidthAndHeight();
1090 SetRectsDirty();
1091 @@ -227,9 +221,6 @@ void SdrTextObj::NbcResize(const Point&
1092 if (bTextFrame && (pModel==NULL || !pModel->IsPasteResize())) { // #51139#
1093 if (nTWdt0!=nTWdt1 && IsAutoGrowWidth() ) NbcSetMinTextFrameWidth(nTWdt1);
1094 if (nTHgt0!=nTHgt1 && IsAutoGrowHeight()) NbcSetMinTextFrameHeight(nTHgt1);
1095 - if (GetFitToSize()==SDRTEXTFIT_RESIZEATTR) {
1096 - NbcResizeTextAttributes(Fraction(nTWdt1,nTWdt0),Fraction(nTHgt1,nTHgt0));
1098 NbcAdjustTextFrameWidthAndHeight();
1100 ImpCheckShear();
1101 # FIXME: 2009-08-14: No such file any longer, in fact no
1102 # ImpTextPortionHandler class any longer. --tml
1104 # --- svx/source/svdraw/svdtxhdl.cxx.old 2009-04-02 11:03:00.000000000 +0000
1105 # +++ svx/source/svdraw/svdtxhdl.cxx 2009-04-06 16:42:18.000000000 +0000
1106 # @@ -85,8 +85,7 @@ void ImpTextPortionHandler::ConvertToPat
1108 # Rectangle aAnchorRect;
1109 # Rectangle aTextRect;
1110 # - SdrFitToSizeType eFit=rTextObj.GetFitToSize();
1111 # - FASTBOOL bFitToSize=(eFit==SDRTEXTFIT_PROPORTIONAL || eFit==SDRTEXTFIT_ALLLINES);
1112 # + FASTBOOL bFitToSize(rTextObj.IsFitToSize());
1113 # // Bei TakeTextRect wird u.a. auch der Text in
1114 # // den Outliner gesteckt
1115 # rTextObj.TakeTextRect(rOutliner,aTextRect,FALSE,&aAnchorRect);
1116 --- svx/source/svdraw/svdview.cxx.old 2009-04-02 11:03:00.000000000 +0000
1117 +++ svx/source/svdraw/svdview.cxx 2009-04-06 16:42:18.000000000 +0000
1118 @@ -504,8 +504,7 @@ SdrHitKind SdrView::PickAnything(const P
1119 Point aTemporaryTextRelativePosition(aLocalLogicPosition - aTextRect.TopLeft());
1121 // FitToSize berueksichtigen
1122 - SdrFitToSizeType eFit=pTextObj->GetFitToSize();
1123 - BOOL bFitToSize=(eFit==SDRTEXTFIT_PROPORTIONAL || eFit==SDRTEXTFIT_ALLLINES);
1124 + BOOL bFitToSize(pTextObj->IsFitToSize());
1125 if (bFitToSize) {
1126 Fraction aX(aTextRect.GetWidth()-1,aAnchor.GetWidth()-1);
1127 Fraction aY(aTextRect.GetHeight()-1,aAnchor.GetHeight()-1);
1128 --- xmloff/source/draw/sdpropls.cxx.old 2009-04-02 10:36:08.000000000 +0000
1129 +++ xmloff/source/draw/sdpropls.cxx 2009-04-06 16:42:18.000000000 +0000
1130 @@ -627,8 +627,8 @@ SvXMLEnumMapEntry __READONLY_DATA pXML_F
1132 { XML_FALSE, drawing::TextFitToSizeType_NONE },
1133 { XML_TRUE, drawing::TextFitToSizeType_PROPORTIONAL },
1134 - { XML_TRUE, drawing::TextFitToSizeType_ALLLINES },
1135 - { XML_TRUE, drawing::TextFitToSizeType_RESIZEATTR },
1136 + { XML_ALL, drawing::TextFitToSizeType_ALLLINES },
1137 + { XML_SHRINK_TO_FIT,drawing::TextFitToSizeType_AUTOFIT },
1138 { XML_TOKEN_INVALID, 0 }