incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r1345289 [3/3] - in /incubator/ooo/branches/alg/aw080/main: basegfx/source/numeric/ basegfx/source/polygon/ filter/inc/filter/msfilter/ filter/source/msfilter/ oox/inc/oox/export/ sc/source/filter/excel/ sc/source/filter/inc/ sc/source/filt...
Date Fri, 01 Jun 2012 17:57:51 GMT
Modified: incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdocirc.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdocirc.cxx?rev=1345289&r1=1345288&r2=1345289&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdocirc.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdocirc.cxx Fri Jun  1 17:57:48
2012
@@ -68,6 +68,15 @@ namespace
 			const double fSnapAngle(((rView.GetSnapAngle() % 36000) * F_PI) / 18000.0);
 			
 			fAngle = basegfx::snapToNearestMultiple(fAngle, fSnapAngle);
+
+            if(basegfx::fTools::equalZero(fAngle))
+            {
+                fAngle = 0.0;
+            }
+            else if(basegfx::fTools::equal(fAngle, F_2PI))
+            {
+                fAngle = F_2PI;
+            }
 		}
 
 		return fAngle;
@@ -473,7 +482,7 @@ bool SdrCircObj::applySpecialDrag(SdrDra
 		fNewAngle = impSnapAngle(fNewAngle, rDrag.GetSdrViewFromSdrDragStat());
 
 		if(1 == rDrag.GetActiveHdl()->GetPointNum())
-            {
+        {
 			SetStartAngle(fNewAngle);
 		}
 		else // (2 == rDrag.GetActiveHdl()->GetPointNum()) 

Modified: incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdotxat.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdotxat.cxx?rev=1345289&r1=1345288&r2=1345289&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdotxat.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdotxat.cxx Fri Jun  1 17:57:48
2012
@@ -30,8 +30,8 @@
 #include <svx/svdmodel.hxx>
 #include <svx/svditext.hxx>
 #include <svx/svdoutl.hxx>
-#include <svx/svdorect.hxx> // fuer SetDirty bei AdjustTextFrameWidthAndHeight
-#include <svx/svdocapt.hxx> // fuer SetDirty bei AdjustTextFrameWidthAndHeight
+#include <svx/svdorect.hxx>
+#include <svx/svdocapt.hxx>
 #include <svx/svdetc.hxx>
 #include <editeng/writingmodeitem.hxx>
 #include <editeng/editeng.hxx>
@@ -59,221 +59,286 @@
 
 ////////////////////////////////////////////////////////////////////////////////////////////////////
 
-bool SdrTextObj::AdjustTextFrameWidthAndHeight(Rectangle& rR, bool bHgt, bool bWdt) const
+bool SdrTextObj::AdjustTextFrameWidthAndHeight(basegfx::B2DRange& o_rRange, bool bHgt,
bool bWdt) const
 {
-	if(bTextFrame)
-	{
-		if(!rR.IsEmpty())
-    	{
-	    	SdrFitToSizeType eFit=GetFitToSize();
-			bool bFitToSize=(eFit==SDRTEXTFIT_PROPORTIONAL || eFit==SDRTEXTFIT_ALLLINES);
-			bool bWdtGrow=bWdt && IsAutoGrowWidth();
-			bool bHgtGrow=bHgt && IsAutoGrowHeight();
-		    SdrTextAniKind eAniKind=GetTextAniKind();
-		    SdrTextAniDirection eAniDir=GetTextAniDirection();
-			bool bScroll=eAniKind==SDRTEXTANI_SCROLL || eAniKind==SDRTEXTANI_ALTERNATE || eAniKind==SDRTEXTANI_SLIDE;
-			bool bHScroll=bScroll && (eAniDir==SDRTEXTANI_LEFT || eAniDir==SDRTEXTANI_RIGHT);
-			bool bVScroll=bScroll && (eAniDir==SDRTEXTANI_UP || eAniDir==SDRTEXTANI_DOWN);
+	if(IsTextFrame() && !o_rRange.isEmpty())
+    {
+	    const SdrFitToSizeType eFit(GetFitToSize());
+	    const bool bFitToSize(SDRTEXTFIT_PROPORTIONAL == eFit || SDRTEXTFIT_ALLLINES == eFit);
+
+        if(!bFitToSize)
+	    {
+            return ImpAdjustTextFrameWidthAndHeight(o_rRange, bHgt, bWdt, true);
+        }
+    }
+
+    return false;
+}
+
+bool SdrTextObj::ImpAdjustTextFrameWidthAndHeight(basegfx::B2DRange& o_rRange, bool bHgt,
bool bWdt, bool bCheckAnimation) const
+{
+	bool bWdtGrow(bWdt && IsAutoGrowWidth());
+	bool bHgtGrow(bHgt && IsAutoGrowHeight());
 		    
-            if (!bFitToSize && (bWdtGrow || bHgtGrow))
-		    {
-    			Rectangle aR0(rR);
-				sal_Int32 nHgt=0,nMinHgt=0,nMaxHgt=0;
-				sal_Int32 nWdt=0,nMinWdt=0,nMaxWdt=0;
-	    		Size aSiz(rR.GetSize()); aSiz.Width()--; aSiz.Height()--;
-		    	Size aMaxSiz(100000,100000);
-			
-				if(!basegfx::fTools::equalZero(getSdrModelFromSdrObject().GetMaxObjectScale().getX()))

-				{
-					aMaxSiz.Width() = basegfx::fround(getSdrModelFromSdrObject().GetMaxObjectScale().getX());
-				}
+    if(bWdtGrow || bHgtGrow)
+	{
+        basegfx::B2DVector aSize(o_rRange.getRange());
+        basegfx::B2DVector aMaxSize(100000.0, 100000.0);
+        double fHeight(0.0), fMinHeight(0.0), fMaxHeight(0.0);
+        double fWidth(0.0), fMinWidth(0.0), fMaxWidth(0.0);
+        const basegfx::B2DPoint aOriginalMinimum(o_rRange.getMinimum());
 
-				if(!basegfx::fTools::equalZero(getSdrModelFromSdrObject().GetMaxObjectScale().getY()))

-				{
-					aMaxSiz.Height() = basegfx::fround(getSdrModelFromSdrObject().GetMaxObjectScale().getY());
-				}
+		if(!basegfx::fTools::equalZero(getSdrModelFromSdrObject().GetMaxObjectScale().getX()))

+		{
+			aMaxSize.setX(fabs(getSdrModelFromSdrObject().GetMaxObjectScale().getX()));
+		}
+
+		if(!basegfx::fTools::equalZero(getSdrModelFromSdrObject().GetMaxObjectScale().getY()))

+		{
+			aMaxSize.setY(fabs(getSdrModelFromSdrObject().GetMaxObjectScale().getY()));
+		}
 			
-			    if (bWdtGrow)
-			    {
-				    nMinWdt=GetMinTextFrameWidth();
-				    nMaxWdt=GetMaxTextFrameWidth();
-				    if (nMaxWdt==0 || nMaxWdt>aMaxSiz.Width()) nMaxWdt=aMaxSiz.Width();
-				    if (nMinWdt<=0) nMinWdt=1;
-				    aSiz.Width()=nMaxWdt;
-			    }
-			    if (bHgtGrow)
-			    {
-				    nMinHgt=GetMinTextFrameHeight();
-				    nMaxHgt=GetMaxTextFrameHeight();
-				    if (nMaxHgt==0 || nMaxHgt>aMaxSiz.Height()) nMaxHgt=aMaxSiz.Height();
-				    if (nMinHgt<=0) nMinHgt=1;
-				    aSiz.Height()=nMaxHgt;
-			    }
-
-                sal_Int32 nHDist=GetTextLeftDistance()+GetTextRightDistance();
-				sal_Int32 nVDist=GetTextUpperDistance()+GetTextLowerDistance();
-			    aSiz.Width()-=nHDist;
-			    aSiz.Height()-=nVDist;
-			    if (aSiz.Width()<2) aSiz.Width()=2;   // Mindestgroesse 2
-			    if (aSiz.Height()<2) aSiz.Height()=2; // Mindestgroesse 2
-
-			    // #101684#
-				bool bInEditMode = IsInEditMode();
-
-			    if(!bInEditMode)
-			    {
-				    if (bHScroll) aSiz.Width()=0x0FFFFFFF; // Laufschrift nicht umbrechen
-				    if (bVScroll) aSiz.Height()=0x0FFFFFFF;
-			    }
-
-			    if(pEdtOutl)
-			    {
-				    pEdtOutl->SetMaxAutoPaperSize(aSiz);
+		if(bWdtGrow)
+		{
+			fMinWidth = GetMinTextFrameWidth();
+			fMaxWidth = GetMaxTextFrameWidth();
+				
+            if(basegfx::fTools::equalZero(fMaxWidth) || basegfx::fTools::more(fMaxWidth,
aMaxSize.getX()))
+            {
+                fMaxWidth = aMaxSize.getX();
+            }
+				
+            if(basegfx::fTools::less(fMinWidth, 1.0))
+            {
+                fMinWidth = 1.0;
+            }
 				
-                    if (bWdtGrow) 
-                    {
-					    Size aSiz2(pEdtOutl->CalcTextSize());
-					    nWdt=aSiz2.Width()+1; // lieber etwas Tolleranz
-					    if (bHgtGrow) nHgt=aSiz2.Height()+1; // lieber etwas Tolleranz
-				    } 
-                    else 
-                    {
-					    nHgt=pEdtOutl->GetTextHeight()+1; // lieber etwas Tolleranz
-				    }
-			    } 
-                else 
+            aSize.setX(fMaxWidth);
+		}
+
+		if(bHgtGrow)
+		{
+			fMinHeight = GetMinTextFrameHeight();
+			fMaxHeight = GetMaxTextFrameHeight();
+
+            if(basegfx::fTools::equalZero(fMaxHeight) || basegfx::fTools::more(fMaxHeight,
aMaxSize.getY()))
+            {
+                fMaxHeight = aMaxSize.getY();
+            }
+
+			if(basegfx::fTools::less(fMinHeight, 1.0)) 
+            {
+                fMinHeight = 1.0;
+            }
+				
+            aSize.setY(fMaxHeight);
+		}
+
+        const basegfx::B2DVector aBorders(
+            GetTextLeftDistance() + GetTextRightDistance(),
+			GetTextUpperDistance() + GetTextLowerDistance());
+
+        // substract orders
+        aSize -= aBorders;
+
+        // minimum size is 2.0
+        aSize = basegfx::maximum(basegfx::B2DTuple(2.0, 2.0), aSize);
+
+		if(bCheckAnimation && !IsInEditMode())
+		{
+            // do not wrap animated text
+		    const SdrTextAniKind eAniKind(GetTextAniKind());
+		    const SdrTextAniDirection eAniDir(GetTextAniDirection());
+		    const bool bScroll(SDRTEXTANI_SCROLL == eAniKind || SDRTEXTANI_ALTERNATE == eAniKind
|| SDRTEXTANI_SLIDE == eAniKind);
+		    const bool bHScroll(bScroll && (SDRTEXTANI_LEFT == eAniDir || SDRTEXTANI_RIGHT
== eAniDir));
+		    const bool bVScroll(bScroll && (SDRTEXTANI_UP == eAniDir || SDRTEXTANI_DOWN
== eAniDir));
+				
+            if(bHScroll) 
+            {
+                aSize.setX(268435455.0);
+            }
+				
+            if(bVScroll) 
+            {
+                aSize.setY(268435455.0);
+            }
+		}
+
+		if(IsTextEditActive())
+		{
+			GetTextEditOutliner()->SetMaxAutoPaperSize(Size(basegfx::fround(aSize.getX()), basegfx::fround(aSize.getY())));
+				
+            if(bWdtGrow) 
+            {
+				const Size aSiz2(GetTextEditOutliner()->CalcTextSize());
+
+                fWidth = aSiz2.Width() + 1; // lieber etwas Tolleranz
+					
+                if(bHgtGrow) 
                 {
-				    Outliner& rOutliner=ImpGetDrawOutliner();
-				    rOutliner.SetPaperSize(aSiz);
-					rOutliner.SetUpdateMode(true);
-				    // !!! hier sollte ich wohl auch noch mal die Optimierung mit
-				    // bPortionInfoChecked usw einbauen
-				    OutlinerParaObject* pOutlinerParaObject = GetOutlinerParaObject();
+                    fHeight = aSiz2.Height() + 1; // lieber etwas Tolleranz
+                }
+			} 
+            else 
+            {
+				fHeight = GetTextEditOutliner()->GetTextHeight() + 1; // lieber etwas Tolleranz
+			}
+		} 
+        else 
+        {
+			Outliner& rOutliner = ImpGetDrawOutliner();
+
+            rOutliner.SetPaperSize(Size(basegfx::fround(aSize.getX()), basegfx::fround(aSize.getY())));
+			rOutliner.SetUpdateMode(true);
+			OutlinerParaObject* pOutlinerParaObject = GetOutlinerParaObject();
 					
-                    if ( pOutlinerParaObject != 0 )
-				    {
-					    rOutliner.SetText(*pOutlinerParaObject);
-					    rOutliner.SetFixedCellHeight(((const SdrTextFixedCellHeightItem&)GetMergedItem(SDRATTR_TEXT_USEFIXEDCELLHEIGHT)).GetValue());
-				    }
-				    if (bWdtGrow)
-				    {
-					    Size aSiz2(rOutliner.CalcTextSize());
-					    nWdt=aSiz2.Width()+1; // lieber etwas Tolleranz
-					    if (bHgtGrow) nHgt=aSiz2.Height()+1; // lieber etwas Tolleranz
-				    } 
-                    else 
-                    {
-					    nHgt=rOutliner.GetTextHeight()+1; // lieber etwas Tolleranz
-				    }
-				    
-                    rOutliner.Clear();
-			    }
+            if(pOutlinerParaObject)
+			{
+				rOutliner.SetText(*pOutlinerParaObject);
+				rOutliner.SetFixedCellHeight(((const SdrTextFixedCellHeightItem&)GetMergedItem(SDRATTR_TEXT_USEFIXEDCELLHEIGHT)).GetValue());
+			}
+
+            if(bWdtGrow)
+			{
+				const Size aSiz2(rOutliner.CalcTextSize());
 
-                if (nWdt<nMinWdt) 
-                    nWdt=nMinWdt;
+                fWidth = aSiz2.Width() + 1; // lieber etwas Tolleranz
 
-			    if (nWdt>nMaxWdt) 
-                    nWdt=nMaxWdt;
+				if(bHgtGrow) 
+                {
+                    fHeight = aSiz2.Height() + 1; // lieber etwas Tolleranz
+                }
+			} 
+            else 
+            {
+				fHeight = rOutliner.GetTextHeight() + 1; // lieber etwas Tolleranz
+			}
+				    
+            rOutliner.Clear();
+		}
 
-			    nWdt+=nHDist;
-			    
-                // nHDist kann auch negativ sein
-                if (nWdt<1) 
-                    nWdt=1;
-
-                if (nHgt<nMinHgt) 
-                    nHgt=nMinHgt;
-
-			    if (nHgt>nMaxHgt) 
-                    nHgt=nMaxHgt;
-
-			    nHgt+=nVDist;
-			    
-                // nVDist kann auch negativ sein
-                if (nHgt<1) 
-                    nHgt=1;
+        // fMinWidth < fWidth < fMaxWidth
+        fWidth = std::min(fMaxWidth, std::max(fWidth, fMinWidth));
+		fWidth = std::min(1.0, fWidth += aBorders.getX()); // aBorders.getX() may be negative
+
+        // fMinHeight < fHeight < fMaxHeight
+        fHeight = std::min(fMaxHeight, std::max(fHeight, fMinHeight));
+		fHeight = std::min(1.0, fHeight += aBorders.getY()); // aBorders.getY() may be negative
+
+        // get grow sizes
+        const double fWidthGrow(fWidth - o_rRange.getWidth());
+        const double fHeightGrow(fHeight - o_rRange.getHeight());
 
-                sal_Int32 nWdtGrow=nWdt-(rR.Right()-rR.Left());
-				sal_Int32 nHgtGrow=nHgt-(rR.Bottom()-rR.Top());
-				
-                if (nWdtGrow==0) 
-                    bWdtGrow=false;
+        if(basegfx::fTools::equalZero(fWidthGrow))
+        {
+            bWdtGrow = false;
+        }
 
-				if (nHgtGrow==0) 
-                    bHgtGrow=false;
+        if(basegfx::fTools::equalZero(fHeightGrow))
+        {
+            bHgtGrow = false;
+        }
     			
-                if (bWdtGrow || bHgtGrow) 
+        if(bWdtGrow || bHgtGrow) 
+        {
+			if(bWdtGrow) 
+            {
+				const SdrTextHorzAdjust eHAdj(GetTextHorizontalAdjust());
+
+                if(SDRTEXTHORZADJUST_LEFT == eHAdj) 
                 {
-				    if (bWdtGrow) 
-                    {
-					    SdrTextHorzAdjust eHAdj=GetTextHorizontalAdjust();
-					    if (eHAdj==SDRTEXTHORZADJUST_LEFT) 
-                            rR.Right()+=nWdtGrow;
-					    else if (eHAdj==SDRTEXTHORZADJUST_RIGHT) 
-                            rR.Left()-=nWdtGrow;
-					    else 
-                        {
-							    sal_Int32 nWdtGrow2=nWdtGrow/2;
-						    rR.Left()-=nWdtGrow2;
-						    rR.Right()=rR.Left()+nWdt;
-					    }
-				    }
-    				if (bHgtGrow) 
-                    {
-					    SdrTextVertAdjust eVAdj=GetTextVerticalAdjust();
-					    if (eVAdj==SDRTEXTVERTADJUST_TOP) 
-                            rR.Bottom()+=nHgtGrow;
-					    else if (eVAdj==SDRTEXTVERTADJUST_BOTTOM) 
-                            rR.Top()-=nHgtGrow;
-    					else 
-                        {
-							sal_Int32 nHgtGrow2=nHgtGrow/2;
-						    rR.Top()-=nHgtGrow2;
-						    rR.Bottom()=rR.Top()+nHgt;
-					    }
-    				}
-	
-                    const sal_Int32 aOldRotation(sdr::legacy::GetRotateAngle(*this));
-					
-                    if (aOldRotation) 
-                    {
-					    Point aD1(rR.TopLeft());
-					    aD1-=aR0.TopLeft();
-					    Point aD2(aD1);
-						RotatePoint(aD2,Point(),sin(aOldRotation*nPi180), cos(aOldRotation*nPi180));
-    					aD2-=aD1;
-	    				rR.Move(aD2.X(),aD2.Y());
-		    		}
-					
-                    return true;
-			    }
+                    o_rRange.expand(basegfx::B2DTuple(o_rRange.getMaxX() + fWidthGrow, o_rRange.getMinY()));
+                }
+				else if(SDRTEXTHORZADJUST_RIGHT == eHAdj) 
+                {
+                    o_rRange.expand(basegfx::B2DTuple(o_rRange.getMinX() - fWidthGrow, o_rRange.getMinY()));
+                }
+				else 
+                {
+                    o_rRange.expand(basegfx::B2DTuple(o_rRange.getMinX() - (fWidthGrow *
0.5), o_rRange.getMinY()));
+                    o_rRange.expand(basegfx::B2DTuple(o_rRange.getMaxX() + (fWidthGrow *
0.5), o_rRange.getMinY()));
+				}
+			}
+
+    		if(bHgtGrow) 
+            {
+				const SdrTextVertAdjust eVAdj(GetTextVerticalAdjust());
+
+				if(SDRTEXTVERTADJUST_TOP == eVAdj) 
+                {
+                    o_rRange.expand(basegfx::B2DTuple(o_rRange.getMinX(), o_rRange.getMaxY()
+ fHeightGrow));
+                }
+				else if(SDRTEXTVERTADJUST_BOTTOM == eVAdj) 
+                {
+                    o_rRange.expand(basegfx::B2DTuple(o_rRange.getMinX(), o_rRange.getMinY()
- fHeightGrow));
+                }
+    			else 
+                {
+                    o_rRange.expand(basegfx::B2DTuple(o_rRange.getMinX(), o_rRange.getMinY()
- (fHeightGrow * 0.5)));
+                    o_rRange.expand(basegfx::B2DTuple(o_rRange.getMinX(), o_rRange.getMaxY()
+ (fHeightGrow * 0.5)));
+				}
+    		}
+
+            if(!aOriginalMinimum.equal(o_rRange.getMinimum()) && isRotatedOrSheared())
+            {
+                basegfx::B2DHomMatrix aCorrector(
+                    basegfx::tools::createScaleTranslateB2DHomMatrix(
+                        getSdrObjectScale(),
+                        getSdrObjectTranslate()));
+
+                aCorrector.invert();
+                aCorrector = getSdrObjectTransformation() * aCorrector;
+
+                const basegfx::B2DPoint aCorrectedTopLeft(aCorrector * o_rRange.getMinimum());
+
+                aCorrector.identity();
+                aCorrector.translate(aCorrectedTopLeft - o_rRange.getMinimum());
+
+                o_rRange.transform(aCorrector);
+
+                // TTTT: Check if the above solution works
+                //
+                //const sal_Int32 aOldRotation(sdr::legacy::GetRotateAngle(*this));
+				//
+                //if (aOldRotation) 
+                //{
+				//    Point aD1(rR.TopLeft());
+				//    aD1-=aOriginalMinimum;
+				//    Point aD2(aD1);
+				//    RotatePoint(aD2,Point(),sin(aOldRotation*nPi180), cos(aOldRotation*nPi180));
+    			//    aD2-=aD1;
+	    		//    rR.Move(aD2.X(),aD2.Y());
+                //}
 		    }
-	    }
-    }
+					
+            return true;
+		}
+	}
 
 	return false;
 }
 
 bool SdrTextObj::AdjustTextFrameWidthAndHeight(bool bHgt, bool bWdt)
 {
-	Rectangle aNeuRect(sdr::legacy::GetLogicRect(*this));
-	bool bRet=AdjustTextFrameWidthAndHeight(aNeuRect,bHgt,bWdt);
+    basegfx::B2DRange aNewRange(getSdrObjectTranslate(), getSdrObjectTranslate() + getSdrObjectScale());
 	
-	if (bRet) 
+	if(AdjustTextFrameWidthAndHeight(aNewRange, bHgt, bWdt)) 
     {
         const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*this);
-		sdr::legacy::SetLogicRect(*this, aNeuRect);
+		sdr::legacy::SetLogicRange(*this, aNewRange);
 		
-		if (dynamic_cast< SdrCaptionObj* >(this)) 
+		if(dynamic_cast< SdrCaptionObj* >(this)) 
 		{ 
 			// mal wieder 'nen Hack
 			((SdrCaptionObj*)this)->ImpRecalcTail();
 		}
 		
 		SetChanged();
+        
+        return true;
 	}
 
-	return bRet;
+	return false;
 }
 
 void SdrTextObj::ImpSetTextStyleSheetListeners()
@@ -490,8 +555,8 @@ void SdrTextObj::RemoveOutlinerCharacter
 		{
 			Outliner* pOutliner = 0;
 			
-			if( pEdtOutl || (pText == getActiveText()) )
-				pOutliner = pEdtOutl;
+			if( IsTextEditActive() || (pText == getActiveText()) )
+				pOutliner = GetTextEditOutliner();
 
 			if(!pOutliner)
 			{
@@ -506,7 +571,7 @@ void SdrTextObj::RemoveOutlinerCharacter
 				pOutliner->RemoveAttribs( aSelAll, false, (*aIter++) );
 			}
 
-			if(!pEdtOutl || (pText != getActiveText()) )
+			if(!IsTextEditActive() || (pText != getActiveText()) )
 			{
 				const sal_uInt32 nParaCount = pOutliner->GetParagraphCount();
 				OutlinerParaObject* pTemp = pOutliner->CreateParaObject(0, (sal_uInt16)nParaCount);
@@ -519,7 +584,7 @@ void SdrTextObj::RemoveOutlinerCharacter
 
 bool SdrTextObj::HasText() const
 {
-	if( pEdtOutl )
+	if( IsTextEditActive() )
 		return HasEditText();
 	
 	OutlinerParaObject* pOPO = GetOutlinerParaObject();

Modified: incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdotxtr.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdotxtr.cxx?rev=1345289&r1=1345288&r2=1345289&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdotxtr.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdotxtr.cxx Fri Jun  1 17:57:48
2012
@@ -49,24 +49,66 @@
 
 void SdrTextObj::setSdrObjectTransformation(const basegfx::B2DHomMatrix& rTransformation)
 {
-	// call parent
+    const bool bTextAdaption(bTextFrame && !IsPasteResize());
+	basegfx::B2DVector aOldSize;
+
+    if(bTextAdaption)
+    {
+        aOldSize = basegfx::absolute(getSdrObjectScale());
+    }
+
+    // call parent
 	SdrAttrObj::setSdrObjectTransformation(rTransformation);
 
-	// TTTT: check if needed and how to emulate; maybe exclusive to resize...?
+	// TTTT: check if the rebuild works
+    //
 	//sal_Int32 nHDist=GetTextLeftDistance()+GetTextRightDistance();
 	//sal_Int32 nVDist=GetTextUpperDistance()+GetTextLowerDistance();
 	//sal_Int32 nTWdt0=aRect.GetWidth ()-1-nHDist; if (nTWdt0<0) nTWdt0=0;
 	//sal_Int32 nTHgt0=aRect.GetHeight()-1-nVDist; if (nTHgt0<0) nTHgt0=0;
-	//sal_Int32 nTWdt1=aRect.GetWidth ()-1-nHDist; if (nTWdt1<0) nTWdt1=0;
-	//sal_Int32 nTHgt1=aRect.GetHeight()-1-nVDist; if (nTHgt1<0) nTHgt1=0;
-	//if (bTextFram4e && !IsPasteResize()) { // #51139#
+	//sal_Int32 nTWdt1=rRect.GetWidth ()-1-nHDist; if (nTWdt1<0) nTWdt1=0;
+	//sal_Int32 nTHgt1=rRect.GetHeight()-1-nVDist; if (nTHgt1<0) nTHgt1=0;
 	//	if (nTWdt0!=nTWdt1 && IsAutoGrowWidth() ) SetMinTextFrameWidth(nTWdt1);
 	//	if (nTHgt0!=nTHgt1 && IsAutoGrowHeight()) SetMinTextFrameHeight(nTHgt1);
 	//	if (GetFitToSize()==SDRTEXTFIT_RESIZEATTR) {
 	//		ResizeTextAttributes(Fraction(nTWdt1,nTWdt0),Fraction(nTHgt1,nTHgt0));
 	//	}
 	//	AdjustTextFrameWidthAndHeight();
-	//}
+	
+    if(bTextAdaption) 
+    {
+    	basegfx::B2DVector aNewSize(basegfx::absolute(getSdrObjectScale()));
+
+        if(!aNewSize.equal(aOldSize))
+        {
+            const basegfx::B2DVector aBorders(
+                GetTextLeftDistance() + GetTextRightDistance(),
+                GetTextUpperDistance() + GetTextLowerDistance());
+
+            aNewSize -= aBorders;
+            aOldSize -= aBorders;
+
+            if(IsAutoGrowWidth() && !basegfx::fTools::equal(aOldSize.getX(), aNewSize.getX()))
+            {
+                SetMinTextFrameWidth(aNewSize.getX());
+            }
+
+            if(IsAutoGrowHeight() && !basegfx::fTools::equal(aOldSize.getY(), aNewSize.getY()))
+            {
+                SetMinTextFrameHeight(aNewSize.getY());
+            }
+
+            if(SDRTEXTFIT_RESIZEATTR == GetFitToSize()) 
+            {
+                const double fFactorX(aNewSize.getX() / (basegfx::fTools::equalZero(aOldSize.getX())
? 1.0 : aOldSize.getX()));
+                const double fFactorY(aNewSize.getY() / (basegfx::fTools::equalZero(aOldSize.getY())
? 1.0 : aOldSize.getY()));
+
+                ResizeTextAttributes(fFactorX, fFactorY);
+            }
+
+            AdjustTextFrameWidthAndHeight();
+        }
+	}
 }
 
 //////////////////////////////////////////////////////////////////////////////

Modified: incubator/ooo/branches/alg/aw080/main/svx/source/table/celleditsource.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/table/celleditsource.cxx?rev=1345289&r1=1345288&r2=1345289&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/table/celleditsource.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/table/celleditsource.cxx Fri Jun  1 17:57:48
2012
@@ -156,8 +156,6 @@ public:
     Point 					PixelToLogic( const Point&, const MapMode& rMapMode );
 
     DECL_LINK( NotifyHdl, EENotify* );
-
-//CMCX	void ChangeModel( SdrModel* pNewModel );
 };
 
 //------------------------------------------------------------------------
@@ -256,44 +254,6 @@ void SAL_CALL CellEditSourceImpl::releas
 		delete this;
 }	
 
-//CMCXvoid CellEditSourceImpl::ChangeModel( SdrModel* pNewModel )
-//CMCX{
-//CMCX	if( mpModel != pNewModel )
-//CMCX	{
-//CMCX		if( mpOutliner )
-//CMCX		{
-//CMCX			if( mpModel )
-//CMCX				mpModel->disposeOutliner( mpOutliner );
-//CMCX			else
-//CMCX				delete mpOutliner;
-//CMCX			mpOutliner = 0;
-//CMCX		}
-//CMCX
-//CMCX		if( mpView )
-//CMCX		{
-//CMCX			EndListening( *mpView );
-//CMCX			mpView = 0;
-//CMCX		}
-//CMCX
-//CMCX		mpWindow = 0;
-//CMCX		mxLinguServiceManager.clear();
-//CMCX
-//CMCX		mpModel = pNewModel;
-//CMCX
-//CMCX		if( mpTextForwarder )
-//CMCX		{
-//CMCX	        delete mpTextForwarder;
-//CMCX		    mpTextForwarder = 0;
-//CMCX		}
-//CMCX
-//CMCX		if( mpViewForwarder )
-//CMCX		{
-//CMCX			delete mpViewForwarder;
-//CMCX			mpViewForwarder = 0;
-//CMCX		}
-//CMCX	}
-//CMCX}
-
 //------------------------------------------------------------------------
 
 void CellEditSourceImpl::Notify( SfxBroadcaster&, const SfxHint& rHint )
@@ -1044,11 +1004,4 @@ const SvxUnoTextRangeBaseList& CellEditS
 
 //------------------------------------------------------------------------
 
-//CMCXvoid CellEditSource::ChangeModel( SdrModel* pNewModel )
-//CMCX{
-//CMCX	mpImpl->ChangeModel( pNewModel );
-//CMCX}
-
-//------------------------------------------------------------------------
-
 } }

Modified: incubator/ooo/branches/alg/aw080/main/svx/source/table/celleditsource.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/table/celleditsource.hxx?rev=1345289&r1=1345288&r2=1345289&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/table/celleditsource.hxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/table/celleditsource.hxx Fri Jun  1 17:57:48
2012
@@ -72,8 +72,6 @@ public:
     virtual Point		LogicToPixel( const Point&, const MapMode& ) const;
     virtual Point		PixelToLogic( const Point&, const MapMode& ) const;
 
-//CMCX	void ChangeModel( SdrModel* pNewModel );
-
 private:
 	CellEditSource( CellEditSourceImpl* pImpl );
 

Modified: incubator/ooo/branches/alg/aw080/main/svx/source/table/svdotable.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/table/svdotable.cxx?rev=1345289&r1=1345288&r2=1345289&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/table/svdotable.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/table/svdotable.cxx Fri Jun  1 17:57:48
2012
@@ -217,7 +217,7 @@ public:
 	bool mbModifyPending;
 
 	CellRef getCell( const CellPos& rPos ) const;
-	void LayoutTable( Rectangle& rArea, bool bFitWidth, bool bFitHeight );
+	void LayoutTable( basegfx::B2DRange& o_aArea, bool bFitWidth, bool bFitHeight );
 
 	bool ApplyCellStyles();
 	void UpdateCells( Rectangle& rArea );
@@ -277,8 +277,12 @@ void SdrTableObjImpl::init( SdrTableObj*
 	Reference< XModifyListener > xListener( static_cast< ::com::sun::star::util::XModifyListener*
>(this) );
 	mxTable->addModifyListener( xListener );
 	UpdateWritingMode();
-	Rectangle aRectangle(sdr::legacy::GetLogicRect(*mpTableObj));
-	LayoutTable( aRectangle, true, true );
+    
+    basegfx::B2DRange aObjectRange(
+        mpTableObj->getSdrObjectTranslate(), 
+        mpTableObj->getSdrObjectTranslate() + mpTableObj->getSdrObjectScale());
+
+    LayoutTable( aObjectRange, true, true );
 }
 
 // -----------------------------------------------------------------------------
@@ -308,8 +312,12 @@ void SdrTableObjImpl::operator=( const S
 	mxTableStyle = rSource.mxTableStyle;
 	UpdateWritingMode();
 	ApplyCellStyles();
-	Rectangle aRectangle(sdr::legacy::GetLogicRect(*mpTableObj));
-	LayoutTable( aRectangle, false, false );
+	
+    basegfx::B2DRange aObjectRange(
+        mpTableObj->getSdrObjectTranslate(), 
+        mpTableObj->getSdrObjectTranslate() + mpTableObj->getSdrObjectScale());
+	
+    LayoutTable( aObjectRange, false, false );
 }
 
 // -----------------------------------------------------------------------------
@@ -504,8 +512,12 @@ void SdrTableObjImpl::update()
 		}
 
 		ApplyCellStyles();
-		Rectangle aRectangle(sdr::legacy::GetLogicRect(*mpTableObj));
-		LayoutTable( aRectangle, false, false );
+		
+        basegfx::B2DRange aObjectRange(
+            mpTableObj->getSdrObjectTranslate(), 
+            mpTableObj->getSdrObjectTranslate() + mpTableObj->getSdrObjectScale());
+
+        LayoutTable( aObjectRange, false, false );
 	}
 }
 
@@ -594,12 +606,13 @@ sal_Int32 SdrTableObjImpl::getRowCount()
 
 // -----------------------------------------------------------------------------
 
-void SdrTableObjImpl::LayoutTable( Rectangle& rArea, bool bFitWidth, bool bFitHeight
)
+void SdrTableObjImpl::LayoutTable( basegfx::B2DRange& o_aArea, bool bFitWidth, bool bFitHeight
)
 {
 	if( mpTableObj && mpLayouter )
 	{
 		TableModelNotifyGuard aGuard( mxTable.get() );
-		mpLayouter->LayoutTable( rArea, bFitWidth, bFitHeight );
+		
+        mpLayouter->LayoutTable( o_aArea, bFitWidth, bFitHeight );
 	}
 }
 
@@ -1368,8 +1381,11 @@ void SdrTableObj::onEditOutlinerStatusEv
 	if( (pEditStatus->GetStatusWord() & EE_STAT_TEXTHEIGHTCHANGED) && mpImpl
&& mpImpl->mpLayouter )
 	{
         const SdrObjectChangeBroadcaster aSdrObjectChangeBroadcaster(*this);
-		Rectangle aRectangle(sdr::legacy::GetLogicRect(*this));
-		mpImpl->LayoutTable( aRectangle, false, false );
+        basegfx::B2DRange aObjectRange(
+            getSdrObjectTranslate(), 
+            getSdrObjectTranslate() + getSdrObjectScale());
+		
+        mpImpl->LayoutTable( aObjectRange, false, false );
 	}
 }
 
@@ -1583,16 +1599,20 @@ basegfx::B2DRange SdrTableObj::getUnifie
 	if(mpImpl)
 	{
 		basegfx::B2DRange aRange;
-		
+
+        // get the absolute range
 		TakeTextAnchorRangeFromCell(mpImpl->maEditPos, aRange);
 
+        // scale back to unit range, could also be done by using an inverse of object
+        // transformation's simplified scale and translate
 		const double fAbsInvScaleX(basegfx::fTools::equalZero(getSdrObjectScale().getX()) ? 1.0
: 1.0 / fabs(getSdrObjectScale().getX()));
 		const double fAbsInvScaleY(basegfx::fTools::equalZero(getSdrObjectScale().getY()) ? 1.0
: 1.0 / fabs(getSdrObjectScale().getY()));
 		const basegfx::B2DPoint aTopLeft(aRange.getMinimum() - getSdrObjectTranslate());
+        const basegfx::B2DPoint aUnitTopLeft(aTopLeft.getX() * fAbsInvScaleX, aTopLeft.getY()
* fAbsInvScaleY);
 
 		aRetval = basegfx::B2DRange(
-			aTopLeft,
-			aTopLeft + basegfx::B2DVector(
+			aUnitTopLeft,
+			aUnitTopLeft + basegfx::B2DVector(
 				aRange.getWidth() * fAbsInvScaleX, 
 				aRange.getHeight() * fAbsInvScaleY));
 	}
@@ -2112,29 +2132,36 @@ void SdrTableObj::setSdrObjectTransforma
 
 bool SdrTableObj::AdjustTextFrameWidthAndHeight(bool bHgt, bool bWdt)
 {
-	Rectangle aNeuRect(sdr::legacy::GetLogicRect(*this));
-	bool bRet=AdjustTextFrameWidthAndHeight(aNeuRect,bHgt,bWdt);
-	if (bRet)
+    basegfx::B2DRange aNewRange(getSdrObjectTranslate(), getSdrObjectTranslate() + getSdrObjectScale());
+
+	if(AdjustTextFrameWidthAndHeight(aNewRange, bHgt, bWdt))
 	{
-		sdr::legacy::SetLogicRect(*this, aNeuRect);
+		sdr::legacy::SetLogicRange(*this, aNewRange);
+
+        return true;
 	}
-	return bRet;
+
+    return false;
 }
 
 // --------------------------------------------------------------------
 
-bool SdrTableObj::AdjustTextFrameWidthAndHeight(Rectangle& rR, bool bHeight, bool bWidth)
const
+bool SdrTableObj::AdjustTextFrameWidthAndHeight(basegfx::B2DRange& o_rRange, bool bHeight,
bool bWidth) const
 {
-	if(rR.IsEmpty() || !mpImpl || !mpImpl->mxTable.is() )
+	if(o_rRange.isEmpty() || !mpImpl || !mpImpl->mxTable.is())
+    {
 		return false;
+    }
+
+    basegfx::B2DRange aNewRange(o_rRange);
 
-	Rectangle aRectangle( rR );
-	mpImpl->LayoutTable( aRectangle, !bWidth, !bHeight );
+    mpImpl->LayoutTable(o_rRange, !bWidth, !bHeight);
 
-	if( aRectangle != rR )
+	if(!o_rRange.equal(aNewRange))
 	{
-		rR = aRectangle;
-		return true;
+		o_rRange = aNewRange;
+
+        return true;
 	}
 	else
 	{
@@ -2504,8 +2531,11 @@ void SdrTableObj::DistributeColumns( sal
 	if( mpImpl && mpImpl->mpLayouter )
 	{
 		TableModelNotifyGuard aGuard( mpImpl->mxTable.get() );
-		Rectangle aRectangle(sdr::legacy::GetLogicRect(*this));
-		mpImpl->mpLayouter->DistributeColumns( aRectangle, nFirstColumn, nLastColumn );
+        basegfx::B2DRange aObjectRange(
+            getSdrObjectTranslate(), 
+            getSdrObjectTranslate() + getSdrObjectScale());
+		
+        mpImpl->mpLayouter->DistributeColumns( aObjectRange, nFirstColumn, nLastColumn
);
 	}
 }
 
@@ -2516,8 +2546,11 @@ void SdrTableObj::DistributeRows( sal_In
 	if( mpImpl && mpImpl->mpLayouter )
 	{
 		TableModelNotifyGuard aGuard( mpImpl->mxTable.get() );
-		Rectangle aRectangle(sdr::legacy::GetLogicRect(*this));
-		mpImpl->mpLayouter->DistributeRows( aRectangle, nFirstRow, nLastRow );
+        basegfx::B2DRange aObjectRange(
+            getSdrObjectTranslate(), 
+            getSdrObjectTranslate() + getSdrObjectScale());
+
+        mpImpl->mpLayouter->DistributeRows( aObjectRange, nFirstRow, nLastRow );
 	}
 }
 
@@ -2529,8 +2562,11 @@ void SdrTableObj::SetChanged()
 	{
 		if( mpImpl->UpdateWritingMode() )
 		{
-			Rectangle aRectangle(sdr::legacy::GetLogicRect(*this));
-			mpImpl->LayoutTable( aRectangle, false, false );
+            basegfx::B2DRange aObjectRange(
+                getSdrObjectTranslate(), 
+                getSdrObjectTranslate() + getSdrObjectScale());
+			
+            mpImpl->LayoutTable( aObjectRange, false, false );
 		}
 	}
 

Modified: incubator/ooo/branches/alg/aw080/main/svx/source/table/tablelayouter.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/table/tablelayouter.cxx?rev=1345289&r1=1345288&r2=1345289&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/table/tablelayouter.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/table/tablelayouter.cxx Fri Jun  1 17:57:48
2012
@@ -839,7 +839,7 @@ void TableLayouter::LayoutTableHeight( R
 
 /** try to fit the table into the given rectangle.
 	If the rectangle is to small, it will be grown to fit the table. */
-void TableLayouter::LayoutTable( Rectangle& rRectangle, bool bFitWidth, bool bFitHeight
)
+void TableLayouter::LayoutTable( basegfx::B2DRange& o_aArea, bool bFitWidth, bool bFitHeight
)
 {
 	if( !mxTable.is() )
 		return;
@@ -863,9 +863,20 @@ void TableLayouter::LayoutTable( Rectang
 			maColumns[nCol].clear();
 	}
 
-	LayoutTableWidth( rRectangle, bFitWidth );
-	LayoutTableHeight( rRectangle, bFitHeight );
-	UpdateBorderLayout();
+    // here TableLayout could be changed to double precision,
+    // but for now this will not be needed
+    Rectangle aTableArea(
+        basegfx::fround(o_aArea.getMinX()), basegfx::fround(o_aArea.getMinY()), 
+        basegfx::fround(o_aArea.getMaxX()), basegfx::fround(o_aArea.getMaxY()));
+
+    // layout with integer
+	LayoutTableWidth( aTableArea, bFitWidth );
+	LayoutTableHeight( aTableArea, bFitHeight );
+
+    // copy back evtl. changed area
+    o_aArea = basegfx::B2DRange(aTableArea.Left(), aTableArea.Top(), aTableArea.Right(),
aTableArea.Bottom());
+
+    UpdateBorderLayout();
 }
 
 // -----------------------------------------------------------------------------
@@ -1109,7 +1120,7 @@ void TableLayouter::SetLayoutToModel()
 */
 // -----------------------------------------------------------------------------
 
-void TableLayouter::DistributeColumns( ::Rectangle& rArea, sal_Int32 nFirstCol, sal_Int32
nLastCol )
+void TableLayouter::DistributeColumns( basegfx::B2DRange& o_aArea, sal_Int32 nFirstCol,
sal_Int32 nLastCol )
 {
 	if( mxTable.is() ) try
 	{
@@ -1137,7 +1148,7 @@ void TableLayouter::DistributeColumns( :
 			nAllWidth -= nWidth;
 		}
 
-		LayoutTable( rArea, true, false );
+		LayoutTable( o_aArea, true, false );
 	}
 	catch( Exception& e )
 	{
@@ -1148,7 +1159,7 @@ void TableLayouter::DistributeColumns( :
 
 // -----------------------------------------------------------------------------
 
-void TableLayouter::DistributeRows( ::Rectangle& rArea, sal_Int32 nFirstRow, sal_Int32
nLastRow )
+void TableLayouter::DistributeRows( basegfx::B2DRange& o_aArea, sal_Int32 nFirstRow,
sal_Int32 nLastRow )
 {
 	if( mxTable.is() ) try
 	{
@@ -1172,8 +1183,14 @@ void TableLayouter::DistributeRows( ::Re
 		if( nHeight < nMinHeight )
 		{
 			sal_Int32 nNeededHeight = nRows * nMinHeight;
-			rArea.nBottom += nNeededHeight - nAllHeight;
-			nHeight = nMinHeight;
+
+            o_aArea = basegfx::B2DRange(
+                o_aArea.getMinX(),
+                o_aArea.getMinY(),
+                o_aArea.getMaxX(),
+                o_aArea.getMinY() + (nNeededHeight - nAllHeight));
+			
+            nHeight = nMinHeight;
 			nAllHeight = nRows * nMinHeight;
 		}
 
@@ -1189,7 +1206,7 @@ void TableLayouter::DistributeRows( ::Re
 			nAllHeight -= nHeight;
 		}
 
-		LayoutTable( rArea, false, true );
+		LayoutTable( o_aArea, false, true );
 	}
 	catch( Exception& e )
 	{

Modified: incubator/ooo/branches/alg/aw080/main/svx/source/table/tablelayouter.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/table/tablelayouter.hxx?rev=1345289&r1=1345288&r2=1345289&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/table/tablelayouter.hxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/table/tablelayouter.hxx Fri Jun  1 17:57:48
2012
@@ -76,7 +76,7 @@ public:
 
 		if bFitWidth or bFitHeight is set, the model is changed.
 	*/
-	void LayoutTable( ::Rectangle& rRectangle, bool bFitWidth, bool bFitHeight );
+	void LayoutTable( basegfx::B2DRange& o_aArea, bool bFitWidth, bool bFitHeight );
 
 	/** after a call to LayoutTable, this method can be used to set the new
 		column and row sizes back to the model. */
@@ -119,8 +119,8 @@ public:
 	sal_Int32 getHorizontalEdge( int nEdgeY, sal_Int32* pnMin = 0, sal_Int32* pnMax = 0 );
 	sal_Int32 getVerticalEdge( int nEdgeX , sal_Int32* pnMin = 0, sal_Int32* pnMax = 0);
 
-	void DistributeColumns( ::Rectangle& rArea, sal_Int32 nFirstCol, sal_Int32 nLastCol
);
-	void DistributeRows( ::Rectangle& rArea, sal_Int32 nFirstRow, sal_Int32 nLastRow );
+	void DistributeColumns( basegfx::B2DRange& o_aArea, sal_Int32 nFirstCol, sal_Int32 nLastCol
);
+	void DistributeRows( basegfx::B2DRange& o_aArea, sal_Int32 nFirstRow, sal_Int32 nLastRow
);
 
 	com::sun::star::text::WritingMode GetWritingMode() const { return meWritingMode; }
 	void SetWritingMode( com::sun::star::text::WritingMode eWritingMode );

Modified: incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/unopage.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/unopage.cxx?rev=1345289&r1=1345288&r2=1345289&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/unopage.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/unopage.cxx Fri Jun  1 17:57:48
2012
@@ -925,31 +925,6 @@ SvxShape* CreateSvxShapeByTypeAndInvento
 	return SvxDrawPage::CreateShapeByTypeAndInventor( nType, nInventor );
 }
 
-//CMCXvoid SvxDrawPage::ChangeModel( SdrModel* pNewModel )
-//CMCX{
-//CMCX	if( pNewModel != mpModel )
-//CMCX	{
-//CMCX		if( mpModel )
-//CMCX			EndListening( *mpModel );
-//CMCX
-//CMCX		if( pNewModel )
-//CMCX			StartListening( *pNewModel );
-//CMCX
-//CMCX		mpModel = pNewModel;
-//CMCX
-//CMCX        if( mpView )
-//CMCX        {
-//CMCX            delete mpView;
-//CMCX	
-//CMCX			if(mpModel)
-//CMCX		        mpView = new SdrView( *mpModel );
-//CMCX	        
-//CMCX	        if( mpView )
-//CMCX		        mpView->SetDesignMode(true);
-//CMCX        }
-//CMCX	}
-//CMCX}
-
 /** returns a StarOffice API wrapper for the given SdrPage */
 uno::Reference< drawing::XDrawPage > GetXDrawPageForSdrPage( SdrPage* pPage ) throw
()
 {

Modified: incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/unoshape.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/unoshape.cxx?rev=1345289&r1=1345288&r2=1345289&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/unoshape.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/unoshape.cxx Fri Jun  1 17:57:48
2012
@@ -528,41 +528,6 @@ void SvxShape::Create( SdrObject* pNewOb
 
 //----------------------------------------------------------------------
 
-//CMCXvoid SvxShape::ChangeModel( SdrModel* pNewModel ) // TTTT: Needed anymore?
-//CMCX{
-//CMCX    DBG_TESTSOLARMUTEX();
-//CMCX	if( mpObj.is() )
-//CMCX	{
-//CMCX		if( &mpObj->getSdrModelFromSdrObject() != pNewModel )
-//CMCX		{
-//CMCX			EndListening( mpObj->getSdrModelFromSdrObject() );
-//CMCX		}
-//CMCX	}
-//CMCX
-//CMCX    // --> CL, OD 2005-07-19 #i52126# - always listen to new model
-//CMCX    if( pNewModel )
-//CMCX    {
-//CMCX        StartListening( *pNewModel );
-//CMCX    }
-//CMCX    // <--
-//CMCX
-//CMCX	// HACK #i53696# ChangeModel should be virtual, but it isn't. can't change that for
2.0.1
-//CMCX	SvxShapeText* pShapeText = dynamic_cast< SvxShapeText* >( this );
-//CMCX	if( pShapeText )
-//CMCX	{
-//CMCX		SvxTextEditSource* pTextEditSource = dynamic_cast< SvxTextEditSource* >( pShapeText->GetEditSource()
);
-//CMCX		if( pTextEditSource )
-//CMCX			pTextEditSource->ChangeModel( pNewModel );
-//CMCX	}
-//CMCX
-//CMCX	mpModel = pNewModel;
-//CMCX
-//CMCX	if( mpImpl->mpMaster )
-//CMCX		mpImpl->mpMaster->modelChanged( pNewModel );
-//CMCX}
-
-//----------------------------------------------------------------------
-
 void SvxShape::ForceMetricToItemPoolMetric(basegfx::B2DPoint& rPoint) const throw()
 {
     DBG_TESTSOLARMUTEX();

Modified: incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/unoshtxt.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/unoshtxt.cxx?rev=1345289&r1=1345288&r2=1345289&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/unoshtxt.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/unoshtxt.cxx Fri Jun  1 17:57:48
2012
@@ -162,8 +162,6 @@ public:
 
     DECL_LINK( NotifyHdl, EENotify* );
 
-//CMCX	void ChangeModel( SdrModel* pNewModel );
-
     void                    UpdateOutliner();
 };
 
@@ -310,51 +308,6 @@ void SAL_CALL SvxTextEditSourceImpl::rel
 		delete this;
 }	
 
-//CMCXvoid SvxTextEditSourceImpl::ChangeModel( SdrModel* pNewModel )
-//CMCX{
-//CMCX	if( mpModel != pNewModel )
-//CMCX	{
-//CMCX		if( mpModel )
-//CMCX			EndListening( *mpModel );
-//CMCX
-//CMCX		if( mpOutliner )
-//CMCX		{
-//CMCX			if( mpModel )
-//CMCX				mpModel->disposeOutliner( mpOutliner );
-//CMCX			else
-//CMCX				delete mpOutliner;
-//CMCX			mpOutliner = 0;
-//CMCX		}
-//CMCX
-//CMCX		if( mpView )
-//CMCX		{
-//CMCX			EndListening( *mpView );
-//CMCX			mpView = 0;
-//CMCX		}
-//CMCX
-//CMCX		mpWindow = 0;
-//CMCX		m_xLinguServiceManager.clear();
-//CMCX		mpOwner = 0;
-//CMCX
-//CMCX		mpModel = pNewModel;
-//CMCX
-//CMCX		if( mpTextForwarder )
-//CMCX		{
-//CMCX	        delete mpTextForwarder;
-//CMCX		    mpTextForwarder = 0;
-//CMCX		}
-//CMCX
-//CMCX		if( mpViewForwarder )
-//CMCX		{
-//CMCX			delete mpViewForwarder;
-//CMCX			mpViewForwarder = 0;
-//CMCX		}
-//CMCX
-//CMCX		if( mpModel )
-//CMCX			StartListening( *mpModel );
-//CMCX	}
-//CMCX}
-
 //------------------------------------------------------------------------
 
 void SvxTextEditSourceImpl::Notify( SfxBroadcaster&, const SfxHint& rHint )
@@ -1163,11 +1116,6 @@ const SvxUnoTextRangeBaseList& SvxTextEd
 	return mpImpl->getRanges();
 }
 
-//CMCXvoid SvxTextEditSource::ChangeModel( SdrModel* pNewModel )
-//CMCX{
-//CMCX	mpImpl->ChangeModel( pNewModel );
-//CMCX}
-
 void SvxTextEditSource::UpdateOutliner()
 {
     mpImpl->UpdateOutliner();

Modified: incubator/ooo/branches/alg/aw080/main/sw/source/filter/ww8/escher.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sw/source/filter/ww8/escher.hxx?rev=1345289&r1=1345288&r2=1345289&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sw/source/filter/ww8/escher.hxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sw/source/filter/ww8/escher.hxx Fri Jun  1 17:57:48
2012
@@ -173,8 +173,10 @@ public:
 
     virtual void WriteFrmExtraData(const SwFrmFmt& rFmt);
 
-    virtual EscherExHostAppData* StartShape(const com::sun::star::uno::Reference<
-        com::sun::star::drawing::XShape > &, const basegfx::B2DRange*);
+    virtual EscherExHostAppData* StartShape(
+        const com::sun::star::uno::Reference< com::sun::star::drawing::XShape > &,

+        const basegfx::B2DPoint* pObjectPosition,
+        const basegfx::B2DVector* pObjectScale);
 private:
     //No copying
     SwEscherEx(const SwEscherEx&);

Modified: incubator/ooo/branches/alg/aw080/main/sw/source/filter/ww8/wrtw8esh.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sw/source/filter/ww8/wrtw8esh.cxx?rev=1345289&r1=1345288&r2=1345289&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sw/source/filter/ww8/wrtw8esh.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sw/source/filter/ww8/wrtw8esh.cxx Fri Jun  1 17:57:48
2012
@@ -1258,7 +1258,10 @@ void WW8Export::WriteEscher()
     }
 }
 
-EscherExHostAppData* SwEscherEx::StartShape(const com::sun::star::uno::Reference< com::sun::star::drawing::XShape
> &, const basegfx::B2DRange*) 
+EscherExHostAppData* SwEscherEx::StartShape(
+    const com::sun::star::uno::Reference< com::sun::star::drawing::XShape > &,

+    const basegfx::B2DPoint* /*pObjectPosition*/,
+    const basegfx::B2DVector* /*pObjectScale*/) 
 {
 	return &aHostData;
 }
@@ -1405,10 +1408,16 @@ sal_Int32 SwBasicEscherEx::WriteGrfFlyFr
 				aScale *= OutputDevice::GetFactorLogicToLogic(aGraphic.GetPrefMapMode().GetMapUnit(),
MAP_100TH_MM);
             }
 
-			const basegfx::B2DRange aRange(basegfx::B2DPoint(0.0, 0.0), aScale);
+            const basegfx::B2DPoint aPoint(0.0, 0.0);
 
-            sal_uInt32 nBlibId = mxGlobal->GetBlibID( *QueryPictureStream(),
-                aUniqueId, aRange, NULL, 0 );
+            sal_uInt32 nBlibId = mxGlobal->GetBlibID( 
+                *QueryPictureStream(),
+                aUniqueId, 
+                aPoint, 
+                aScale, 
+                NULL, 
+                0 );
+            
             if (nBlibId)
                 aPropOpt.AddOpt(ESCHER_Prop_pib, nBlibId, sal_True);
         }
@@ -1611,10 +1620,16 @@ void SwBasicEscherEx::WriteBrushAttr(con
 				aScale *= OutputDevice::GetFactorLogicToLogic(rGraphic.GetPrefMapMode().GetMapUnit(),
MAP_100TH_MM);
             }
 
-			const basegfx::B2DRange aRange(basegfx::B2DPoint(0.0, 0.0), aScale);
+            const basegfx::B2DPoint aPoint(0.0, 0.0);
+
+            sal_uInt32 nBlibId = mxGlobal->GetBlibID( 
+                *QueryPictureStream(),
+                aUniqueId, 
+                aPoint, 
+                aScale, 
+                NULL, 
+                0);
 
-            sal_uInt32 nBlibId = mxGlobal->GetBlibID( *QueryPictureStream(),
-                aUniqueId, aRange, NULL, 0);
             if (nBlibId)
                 rPropOpt.AddOpt(ESCHER_Prop_fillBlip,nBlibId,sal_True);
         }
@@ -2648,11 +2663,16 @@ void SwBasicEscherEx::WriteOLEPicture(Es
     if (aId.Len())
     {
 		const basegfx::B2DRange aObjectRange(sdr::legacy::GetLogicRange(rObj));
-		const basegfx::B2DRange aRange(0.0, 0.0,
-			DrawModelToEmu(aObjectRange.getWidth()),
-			DrawModelToEmu(aObjectRange.getHeight()));
-        sal_uInt32 nBlibId = mxGlobal->GetBlibID( *QueryPictureStream(),
-            aId, aRange, pVisArea, 0);    // SJ: the fourth parameter (VisArea) should be
set..
+        const basegfx::B2DPoint aPoint(0.0, 0.0);
+        const basegfx::B2DVector aScale(DrawModelToEmu(aObjectRange.getWidth()), DrawModelToEmu(aObjectRange.getHeight()));
+        sal_uInt32 nBlibId = mxGlobal->GetBlibID( 
+            *QueryPictureStream(),
+            aId, 
+            aPoint, 
+            aScale, 
+            pVisArea, 
+            0);    // SJ: the fifth parameter (VisArea) should be set..
+        
         if (nBlibId)
             rPropOpt.AddOpt(ESCHER_Prop_pib, nBlibId, sal_True);
     }



Mime
View raw message