xref: /trunk/main/svx/source/svdraw/svdotxed.cxx (revision cf6516809c57e1bb0a940545cca99cdad54d4ce2)
1f6e50924SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3f6e50924SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4f6e50924SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5f6e50924SAndrew Rist  * distributed with this work for additional information
6f6e50924SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7f6e50924SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8f6e50924SAndrew Rist  * "License"); you may not use this file except in compliance
9f6e50924SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11f6e50924SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13f6e50924SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14f6e50924SAndrew Rist  * software distributed under the License is distributed on an
15f6e50924SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16f6e50924SAndrew Rist  * KIND, either express or implied.  See the License for the
17f6e50924SAndrew Rist  * specific language governing permissions and limitations
18f6e50924SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20f6e50924SAndrew Rist  *************************************************************/
21f6e50924SAndrew Rist 
22f6e50924SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_svx.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <svx/svdotext.hxx>
28cdf0e10cSrcweir #include "svx/svditext.hxx"
29cdf0e10cSrcweir #include <svx/svdmodel.hxx> // fuer GetMaxObjSize
30cdf0e10cSrcweir #include <svx/svdoutl.hxx>
31cdf0e10cSrcweir #include <editeng/outliner.hxx>
32cdf0e10cSrcweir #include <editeng/editstat.hxx>
33cdf0e10cSrcweir #include <svl/itemset.hxx>
34cdf0e10cSrcweir #include <editeng/eeitem.hxx>
35cdf0e10cSrcweir #include <svx/sdtfchim.hxx>
36cdf0e10cSrcweir 
37cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////////////////////////////
38cdf0e10cSrcweir //
39cdf0e10cSrcweir //  @@@@@@ @@@@@ @@   @@ @@@@@@  @@@@  @@@@@  @@@@@@
40cdf0e10cSrcweir //    @@   @@    @@@ @@@   @@   @@  @@ @@  @@     @@
41cdf0e10cSrcweir //    @@   @@     @@@@@    @@   @@  @@ @@  @@     @@
42cdf0e10cSrcweir //    @@   @@@@    @@@     @@   @@  @@ @@@@@      @@
43cdf0e10cSrcweir //    @@   @@     @@@@@    @@   @@  @@ @@  @@     @@
44cdf0e10cSrcweir //    @@   @@    @@@ @@@   @@   @@  @@ @@  @@ @@  @@
45cdf0e10cSrcweir //    @@   @@@@@ @@   @@   @@    @@@@  @@@@@   @@@@
46cdf0e10cSrcweir //
47cdf0e10cSrcweir //  TextEdit
48cdf0e10cSrcweir //
49cdf0e10cSrcweir ////////////////////////////////////////////////////////////////////////////////////////////////////
50cdf0e10cSrcweir 
HasTextEdit() const51cdf0e10cSrcweir FASTBOOL SdrTextObj::HasTextEdit() const
52cdf0e10cSrcweir {
53cdf0e10cSrcweir     // lt. Anweisung von MB duerfen gelinkte Textobjekte nun doch
54cdf0e10cSrcweir     // geaendert werden (kein automatisches Reload)
55cdf0e10cSrcweir     return sal_True;
56cdf0e10cSrcweir }
57cdf0e10cSrcweir 
BegTextEdit(SdrOutliner & rOutl)58cdf0e10cSrcweir sal_Bool SdrTextObj::BegTextEdit(SdrOutliner& rOutl)
59cdf0e10cSrcweir {
60cdf0e10cSrcweir     if (pEdtOutl!=NULL) return sal_False; // Textedit laeuft evtl. schon an einer anderen View!
61cdf0e10cSrcweir     pEdtOutl=&rOutl;
62cdf0e10cSrcweir 
63cdf0e10cSrcweir     // #101684#
64cdf0e10cSrcweir     mbInEditMode = sal_True;
65cdf0e10cSrcweir 
66cdf0e10cSrcweir     sal_uInt16 nOutlinerMode = OUTLINERMODE_OUTLINEOBJECT;
67cdf0e10cSrcweir     if ( !IsOutlText() )
68cdf0e10cSrcweir         nOutlinerMode = OUTLINERMODE_TEXTOBJECT;
69cdf0e10cSrcweir     rOutl.Init( nOutlinerMode );
70cdf0e10cSrcweir     rOutl.SetRefDevice( pModel->GetRefDevice() );
71cdf0e10cSrcweir 
7226734c99SArmin Le Grand     SdrFitToSizeType eFit=GetFitToSize();
7326734c99SArmin Le Grand     FASTBOOL bFitToSize=(eFit==SDRTEXTFIT_PROPORTIONAL || eFit==SDRTEXTFIT_ALLLINES);
74cdf0e10cSrcweir     FASTBOOL bContourFrame=IsContourTextFrame();
75cdf0e10cSrcweir     ImpSetTextEditParams();
76cdf0e10cSrcweir 
77cdf0e10cSrcweir     if (!bContourFrame) {
78cdf0e10cSrcweir         sal_uIntPtr nStat=rOutl.GetControlWord();
79cdf0e10cSrcweir         nStat|=EE_CNTRL_AUTOPAGESIZE;
80cdf0e10cSrcweir         if (bFitToSize) nStat|=EE_CNTRL_STRETCHING; else nStat&=~EE_CNTRL_STRETCHING;
81cdf0e10cSrcweir         rOutl.SetControlWord(nStat);
82cdf0e10cSrcweir     }
83cdf0e10cSrcweir 
84cdf0e10cSrcweir     OutlinerParaObject* pOutlinerParaObject = GetOutlinerParaObject();
85cdf0e10cSrcweir     if(pOutlinerParaObject!=NULL)
86cdf0e10cSrcweir     {
87cdf0e10cSrcweir         rOutl.SetText(*GetOutlinerParaObject());
88cdf0e10cSrcweir         rOutl.SetFixedCellHeight(((const SdrTextFixedCellHeightItem&)GetMergedItem(SDRATTR_TEXT_USEFIXEDCELLHEIGHT)).GetValue());
89cdf0e10cSrcweir     }
90cdf0e10cSrcweir 
91cdf0e10cSrcweir     // ggf. Rahmenattribute am 1. (neuen) Absatz des Outliners setzen
92cdf0e10cSrcweir     if( !HasTextImpl( &rOutl ) )
93cdf0e10cSrcweir     {
94cdf0e10cSrcweir         // Outliner has no text so we must set some
95cdf0e10cSrcweir         // empty text so the outliner initialise itself
96cdf0e10cSrcweir         rOutl.SetText( String(), rOutl.GetParagraph( 0 ) );
97cdf0e10cSrcweir 
98cdf0e10cSrcweir         if(GetStyleSheet())
99cdf0e10cSrcweir             rOutl.SetStyleSheet( 0, GetStyleSheet());
100cdf0e10cSrcweir 
101cdf0e10cSrcweir         // Beim setzen der harten Attribute an den ersten Absatz muss
102cdf0e10cSrcweir         // der Parent pOutlAttr (=die Vorlage) temporaer entfernt
103cdf0e10cSrcweir         // werden, da sonst bei SetParaAttribs() auch alle in diesem
104cdf0e10cSrcweir         // Parent enthaltenen Items hart am Absatz attributiert werden.
105cdf0e10cSrcweir         // -> BugID 22467
106cdf0e10cSrcweir         const SfxItemSet& rSet = GetObjectItemSet();
107cdf0e10cSrcweir         SfxItemSet aFilteredSet(*rSet.GetPool(), EE_ITEMS_START, EE_ITEMS_END);
108cdf0e10cSrcweir         aFilteredSet.Put(rSet);
109cdf0e10cSrcweir         rOutl.SetParaAttribs(0, aFilteredSet);
110cdf0e10cSrcweir     }
111cdf0e10cSrcweir     if (bFitToSize)
112cdf0e10cSrcweir     {
113cdf0e10cSrcweir         Rectangle aAnchorRect;
114cdf0e10cSrcweir         Rectangle aTextRect;
115cdf0e10cSrcweir         TakeTextRect(rOutl, aTextRect, sal_False,
116cdf0e10cSrcweir             &aAnchorRect/* #97097# give sal_True here, not sal_False */);
117cdf0e10cSrcweir         Fraction aFitXKorreg(1,1);
118cdf0e10cSrcweir         ImpSetCharStretching(rOutl,aTextRect,aAnchorRect,aFitXKorreg);
119cdf0e10cSrcweir     }
120cdf0e10cSrcweir 
121cdf0e10cSrcweir     if(pOutlinerParaObject)
122cdf0e10cSrcweir     {
123cdf0e10cSrcweir         // #78476# also repaint when animated text is put to edit mode
124cdf0e10cSrcweir         // to not make appear the text double
125cdf0e10cSrcweir         // #111096# should now repaint automatically.
126cdf0e10cSrcweir         // sal_Bool bIsAnimated(pPlusData && pPlusData->pAnimator);
127cdf0e10cSrcweir 
128cdf0e10cSrcweir         if(aGeo.nDrehWink || IsFontwork() /*|| bIsAnimated*/)
129cdf0e10cSrcweir         {
130cdf0e10cSrcweir             // only repaint here, no real objectchange
131cdf0e10cSrcweir 
132cdf0e10cSrcweir //          ActionChanged();
133cdf0e10cSrcweir             BroadcastObjectChange();
134cdf0e10cSrcweir         }
135cdf0e10cSrcweir     }
136cdf0e10cSrcweir 
137cdf0e10cSrcweir     rOutl.UpdateFields();
138cdf0e10cSrcweir     rOutl.ClearModifyFlag();
139cdf0e10cSrcweir 
140cdf0e10cSrcweir     return sal_True;
141cdf0e10cSrcweir }
142cdf0e10cSrcweir 
TakeTextEditArea(Size * pPaperMin,Size * pPaperMax,Rectangle * pViewInit,Rectangle * pViewMin) const143cdf0e10cSrcweir void SdrTextObj::TakeTextEditArea(Size* pPaperMin, Size* pPaperMax, Rectangle* pViewInit, Rectangle* pViewMin) const
144cdf0e10cSrcweir {
14526734c99SArmin Le Grand     SdrFitToSizeType eFit=GetFitToSize();
14626734c99SArmin Le Grand     FASTBOOL bFitToSize=(eFit==SDRTEXTFIT_PROPORTIONAL || eFit==SDRTEXTFIT_ALLLINES);
147cdf0e10cSrcweir     Size aPaperMin,aPaperMax;
148cdf0e10cSrcweir     Rectangle aViewInit;
149cdf0e10cSrcweir     TakeTextAnchorRect(aViewInit);
150cdf0e10cSrcweir     if (aGeo.nDrehWink!=0) {
151cdf0e10cSrcweir         Point aCenter(aViewInit.Center());
152cdf0e10cSrcweir         aCenter-=aViewInit.TopLeft();
153cdf0e10cSrcweir         Point aCenter0(aCenter);
154cdf0e10cSrcweir         RotatePoint(aCenter,Point(),aGeo.nSin,aGeo.nCos);
155cdf0e10cSrcweir         aCenter-=aCenter0;
156cdf0e10cSrcweir         aViewInit.Move(aCenter.X(),aCenter.Y());
157cdf0e10cSrcweir     }
158cdf0e10cSrcweir     Size aAnkSiz(aViewInit.GetSize());
159cdf0e10cSrcweir     aAnkSiz.Width()--; aAnkSiz.Height()--; // weil GetSize() ein draufaddiert
160cdf0e10cSrcweir     Size aMaxSiz(1000000,1000000);
161cdf0e10cSrcweir     if (pModel!=NULL) {
162cdf0e10cSrcweir         Size aTmpSiz(pModel->GetMaxObjSize());
163cdf0e10cSrcweir         if (aTmpSiz.Width()!=0) aMaxSiz.Width()=aTmpSiz.Width();
164cdf0e10cSrcweir         if (aTmpSiz.Height()!=0) aMaxSiz.Height()=aTmpSiz.Height();
165cdf0e10cSrcweir     }
166cdf0e10cSrcweir 
167cdf0e10cSrcweir     // #106879#
168cdf0e10cSrcweir     // Done earlier since used in else tree below
169cdf0e10cSrcweir     SdrTextHorzAdjust eHAdj(GetTextHorizontalAdjust());
170cdf0e10cSrcweir     SdrTextVertAdjust eVAdj(GetTextVerticalAdjust());
171cdf0e10cSrcweir 
172cdf0e10cSrcweir     if(IsTextFrame())
173cdf0e10cSrcweir     {
174cdf0e10cSrcweir         long nMinWdt=GetMinTextFrameWidth();
175cdf0e10cSrcweir         long nMinHgt=GetMinTextFrameHeight();
176cdf0e10cSrcweir         long nMaxWdt=GetMaxTextFrameWidth();
177cdf0e10cSrcweir         long nMaxHgt=GetMaxTextFrameHeight();
178cdf0e10cSrcweir         if (nMinWdt<1) nMinWdt=1;
179cdf0e10cSrcweir         if (nMinHgt<1) nMinHgt=1;
180cdf0e10cSrcweir         if (!bFitToSize) {
181cdf0e10cSrcweir             if (nMaxWdt==0 || nMaxWdt>aMaxSiz.Width())  nMaxWdt=aMaxSiz.Width();
182cdf0e10cSrcweir             if (nMaxHgt==0 || nMaxHgt>aMaxSiz.Height()) nMaxHgt=aMaxSiz.Height();
1835df46f50SArmin Le Grand 
1845df46f50SArmin Le Grand             if (!IsAutoGrowWidth() )
1855df46f50SArmin Le Grand             {
1865df46f50SArmin Le Grand                 nMinWdt = aAnkSiz.Width();
1875df46f50SArmin Le Grand                 nMaxWdt = nMinWdt;
1885df46f50SArmin Le Grand             }
1895df46f50SArmin Le Grand 
1905df46f50SArmin Le Grand             if (!IsAutoGrowHeight())
1915df46f50SArmin Le Grand             {
1925df46f50SArmin Le Grand                 nMinHgt = aAnkSiz.Height();
1935df46f50SArmin Le Grand                 nMaxHgt = nMinHgt;
1945df46f50SArmin Le Grand             }
1955df46f50SArmin Le Grand 
196cdf0e10cSrcweir             SdrTextAniKind      eAniKind=GetTextAniKind();
197cdf0e10cSrcweir             SdrTextAniDirection eAniDirection=GetTextAniDirection();
198cdf0e10cSrcweir 
199cdf0e10cSrcweir             // #101684#
200cdf0e10cSrcweir             sal_Bool bInEditMode = IsInEditMode();
201cdf0e10cSrcweir 
202cdf0e10cSrcweir             if (!bInEditMode && (eAniKind==SDRTEXTANI_SCROLL || eAniKind==SDRTEXTANI_ALTERNATE || eAniKind==SDRTEXTANI_SLIDE))
203cdf0e10cSrcweir             {
204cdf0e10cSrcweir                 // Grenzenlose Papiergroesse fuer Laufschrift
205cdf0e10cSrcweir                 if (eAniDirection==SDRTEXTANI_LEFT || eAniDirection==SDRTEXTANI_RIGHT) nMaxWdt=1000000;
206cdf0e10cSrcweir                 if (eAniDirection==SDRTEXTANI_UP || eAniDirection==SDRTEXTANI_DOWN) nMaxHgt=1000000;
207cdf0e10cSrcweir             }
2085df46f50SArmin Le Grand 
2095df46f50SArmin Le Grand             // #119885# Do not limit/force height to geometrical frame (vice versa for vertical writing)
2105df46f50SArmin Le Grand             if(IsVerticalWriting())
2115df46f50SArmin Le Grand             {
2125df46f50SArmin Le Grand                 nMaxWdt = 1000000;
2135df46f50SArmin Le Grand             }
2145df46f50SArmin Le Grand             else
2155df46f50SArmin Le Grand             {
2165df46f50SArmin Le Grand                 nMaxHgt = 1000000;
2175df46f50SArmin Le Grand             }
2185df46f50SArmin Le Grand 
219cdf0e10cSrcweir             aPaperMax.Width()=nMaxWdt;
220cdf0e10cSrcweir             aPaperMax.Height()=nMaxHgt;
2215df46f50SArmin Le Grand         }
2225df46f50SArmin Le Grand         else
2235df46f50SArmin Le Grand         {
224cdf0e10cSrcweir             aPaperMax=aMaxSiz;
225cdf0e10cSrcweir         }
226cdf0e10cSrcweir         aPaperMin.Width()=nMinWdt;
227cdf0e10cSrcweir         aPaperMin.Height()=nMinHgt;
228cdf0e10cSrcweir     }
229cdf0e10cSrcweir     else
230cdf0e10cSrcweir     {
231cdf0e10cSrcweir         // #106879#
232cdf0e10cSrcweir         // aPaperMin needs to be set to object's size if full width is activated
233cdf0e10cSrcweir         // for hor or ver writing respectively
234cdf0e10cSrcweir         if((SDRTEXTHORZADJUST_BLOCK == eHAdj && !IsVerticalWriting())
235cdf0e10cSrcweir             || (SDRTEXTVERTADJUST_BLOCK == eVAdj && IsVerticalWriting()))
236cdf0e10cSrcweir         {
237cdf0e10cSrcweir             aPaperMin = aAnkSiz;
238cdf0e10cSrcweir         }
239cdf0e10cSrcweir 
240cdf0e10cSrcweir         aPaperMax=aMaxSiz;
241cdf0e10cSrcweir     }
242cdf0e10cSrcweir 
243cdf0e10cSrcweir     if (pViewMin!=NULL) {
244cdf0e10cSrcweir         *pViewMin=aViewInit;
245cdf0e10cSrcweir 
246cdf0e10cSrcweir         long nXFree=aAnkSiz.Width()-aPaperMin.Width();
247cdf0e10cSrcweir         if (eHAdj==SDRTEXTHORZADJUST_LEFT) pViewMin->Right()-=nXFree;
248cdf0e10cSrcweir         else if (eHAdj==SDRTEXTHORZADJUST_RIGHT) pViewMin->Left()+=nXFree;
249cdf0e10cSrcweir         else { pViewMin->Left()+=nXFree/2; pViewMin->Right()=pViewMin->Left()+aPaperMin.Width(); }
250cdf0e10cSrcweir 
251cdf0e10cSrcweir         long nYFree=aAnkSiz.Height()-aPaperMin.Height();
252cdf0e10cSrcweir         if (eVAdj==SDRTEXTVERTADJUST_TOP) pViewMin->Bottom()-=nYFree;
253cdf0e10cSrcweir         else if (eVAdj==SDRTEXTVERTADJUST_BOTTOM) pViewMin->Top()+=nYFree;
254cdf0e10cSrcweir         else { pViewMin->Top()+=nYFree/2; pViewMin->Bottom()=pViewMin->Top()+aPaperMin.Height(); }
255cdf0e10cSrcweir     }
256cdf0e10cSrcweir 
257cdf0e10cSrcweir     // Die PaperSize soll in den meisten Faellen von selbst wachsen
258cdf0e10cSrcweir     // #89459#
259cdf0e10cSrcweir     if(IsVerticalWriting())
260cdf0e10cSrcweir         aPaperMin.Width() = 0;
261cdf0e10cSrcweir     else
262cdf0e10cSrcweir         aPaperMin.Height() = 0; // #33102#
263cdf0e10cSrcweir 
264cdf0e10cSrcweir     if(eHAdj!=SDRTEXTHORZADJUST_BLOCK || bFitToSize) {
265cdf0e10cSrcweir         aPaperMin.Width()=0;
266cdf0e10cSrcweir     }
267cdf0e10cSrcweir 
268cdf0e10cSrcweir     // #103516# For complete ver adjust support, set paper min height to 0, here.
269cdf0e10cSrcweir     if(SDRTEXTVERTADJUST_BLOCK != eVAdj || bFitToSize)
270cdf0e10cSrcweir     {
271cdf0e10cSrcweir         aPaperMin.Height() = 0;
272cdf0e10cSrcweir     }
273cdf0e10cSrcweir 
274cdf0e10cSrcweir     if (pPaperMin!=NULL) *pPaperMin=aPaperMin;
275cdf0e10cSrcweir     if (pPaperMax!=NULL) *pPaperMax=aPaperMax;
276cdf0e10cSrcweir     if (pViewInit!=NULL) *pViewInit=aViewInit;
277cdf0e10cSrcweir }
278cdf0e10cSrcweir 
EndTextEdit(SdrOutliner & rOutl)279cdf0e10cSrcweir void SdrTextObj::EndTextEdit(SdrOutliner& rOutl)
280cdf0e10cSrcweir {
281cdf0e10cSrcweir     if(rOutl.IsModified())
282cdf0e10cSrcweir     {
283cdf0e10cSrcweir         OutlinerParaObject* pNewText = NULL;
284cdf0e10cSrcweir 
285cdf0e10cSrcweir         if(HasTextImpl( &rOutl ) )
286cdf0e10cSrcweir         {
287cdf0e10cSrcweir             // Damit der grauen Feldhintergrund wieder verschwindet
288cdf0e10cSrcweir             rOutl.UpdateFields();
289cdf0e10cSrcweir 
290*c2eaa082SDamjan Jovanovic             sal_uInt32 nParaAnz = rOutl.GetParagraphCount();
291cdf0e10cSrcweir             pNewText = rOutl.CreateParaObject( 0, nParaAnz );
292cdf0e10cSrcweir         }
293cdf0e10cSrcweir 
294cdf0e10cSrcweir         // need to end edit mode early since SetOutlinerParaObject already
295cdf0e10cSrcweir         // uses GetCurrentBoundRect() which needs to take the text into account
296cdf0e10cSrcweir         // to work correct
297cdf0e10cSrcweir         mbInEditMode = sal_False;
298cdf0e10cSrcweir         SetOutlinerParaObject(pNewText);
299cdf0e10cSrcweir     }
300cdf0e10cSrcweir 
301cdf0e10cSrcweir     pEdtOutl = NULL;
302cdf0e10cSrcweir     rOutl.Clear();
303cdf0e10cSrcweir     sal_uInt32 nStat = rOutl.GetControlWord();
304cdf0e10cSrcweir     nStat &= ~EE_CNTRL_AUTOPAGESIZE;
305cdf0e10cSrcweir     rOutl.SetControlWord(nStat);
306cdf0e10cSrcweir 
307cdf0e10cSrcweir     // #101684#
308cdf0e10cSrcweir     mbInEditMode = sal_False;
309cdf0e10cSrcweir }
310cdf0e10cSrcweir 
GetOutlinerViewAnchorMode() const311cdf0e10cSrcweir sal_uInt16 SdrTextObj::GetOutlinerViewAnchorMode() const
312cdf0e10cSrcweir {
313cdf0e10cSrcweir     SdrTextHorzAdjust eH=GetTextHorizontalAdjust();
314cdf0e10cSrcweir     SdrTextVertAdjust eV=GetTextVerticalAdjust();
315cdf0e10cSrcweir     EVAnchorMode eRet=ANCHOR_TOP_LEFT;
316cdf0e10cSrcweir     if (IsContourTextFrame()) return (sal_uInt16)eRet;
317cdf0e10cSrcweir     if (eH==SDRTEXTHORZADJUST_LEFT) {
318cdf0e10cSrcweir         if (eV==SDRTEXTVERTADJUST_TOP) {
319cdf0e10cSrcweir             eRet=ANCHOR_TOP_LEFT;
320cdf0e10cSrcweir         } else if (eV==SDRTEXTVERTADJUST_BOTTOM) {
321cdf0e10cSrcweir             eRet=ANCHOR_BOTTOM_LEFT;
322cdf0e10cSrcweir         } else {
323cdf0e10cSrcweir             eRet=ANCHOR_VCENTER_LEFT;
324cdf0e10cSrcweir         }
325cdf0e10cSrcweir     } else if (eH==SDRTEXTHORZADJUST_RIGHT) {
326cdf0e10cSrcweir         if (eV==SDRTEXTVERTADJUST_TOP) {
327cdf0e10cSrcweir             eRet=ANCHOR_TOP_RIGHT;
328cdf0e10cSrcweir         } else if (eV==SDRTEXTVERTADJUST_BOTTOM) {
329cdf0e10cSrcweir             eRet=ANCHOR_BOTTOM_RIGHT;
330cdf0e10cSrcweir         } else {
331cdf0e10cSrcweir             eRet=ANCHOR_VCENTER_RIGHT;
332cdf0e10cSrcweir         }
333cdf0e10cSrcweir     } else {
334cdf0e10cSrcweir         if (eV==SDRTEXTVERTADJUST_TOP) {
335cdf0e10cSrcweir             eRet=ANCHOR_TOP_HCENTER;
336cdf0e10cSrcweir         } else if (eV==SDRTEXTVERTADJUST_BOTTOM) {
337cdf0e10cSrcweir             eRet=ANCHOR_BOTTOM_HCENTER;
338cdf0e10cSrcweir         } else {
339cdf0e10cSrcweir             eRet=ANCHOR_VCENTER_HCENTER;
340cdf0e10cSrcweir         }
341cdf0e10cSrcweir     }
342cdf0e10cSrcweir     return (sal_uInt16)eRet;
343cdf0e10cSrcweir }
344cdf0e10cSrcweir 
ImpSetTextEditParams() const345cdf0e10cSrcweir void SdrTextObj::ImpSetTextEditParams() const
346cdf0e10cSrcweir {
347cdf0e10cSrcweir     if (pEdtOutl!=NULL) {
348cdf0e10cSrcweir         FASTBOOL bUpdMerk=pEdtOutl->GetUpdateMode();
349cdf0e10cSrcweir         if (bUpdMerk) pEdtOutl->SetUpdateMode(sal_False);
350cdf0e10cSrcweir         Size aPaperMin;
351cdf0e10cSrcweir         Size aPaperMax;
352cdf0e10cSrcweir         Rectangle aEditArea;
353cdf0e10cSrcweir         TakeTextEditArea(&aPaperMin,&aPaperMax,&aEditArea,NULL);
35426734c99SArmin Le Grand         //SdrFitToSizeType eFit=GetFitToSize();
35526734c99SArmin Le Grand         //FASTBOOL bFitToSize=(eFit==SDRTEXTFIT_PROPORTIONAL || eFit==SDRTEXTFIT_ALLLINES);
356cdf0e10cSrcweir         FASTBOOL bContourFrame=IsContourTextFrame();
35726734c99SArmin Le Grand         //EVAnchorMode eAM=(EVAnchorMode)GetOutlinerViewAnchorMode();
35826734c99SArmin Le Grand         //sal_uIntPtr nViewAnz=pEdtOutl->GetViewCount();
359cdf0e10cSrcweir         pEdtOutl->SetMinAutoPaperSize(aPaperMin);
360cdf0e10cSrcweir         pEdtOutl->SetMaxAutoPaperSize(aPaperMax);
361cdf0e10cSrcweir         pEdtOutl->SetPaperSize(Size());
362cdf0e10cSrcweir         if (bContourFrame) {
363cdf0e10cSrcweir             Rectangle aAnchorRect;
364cdf0e10cSrcweir             TakeTextAnchorRect(aAnchorRect);
365cdf0e10cSrcweir             ImpSetContourPolygon(*pEdtOutl,aAnchorRect, sal_True);
366cdf0e10cSrcweir         }
367cdf0e10cSrcweir         if (bUpdMerk) pEdtOutl->SetUpdateMode(sal_True);
368cdf0e10cSrcweir     }
369cdf0e10cSrcweir }
370