incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r1395635 - in /incubator/ooo/trunk/main: editeng/source/editeng/impedit.cxx svx/source/svdraw/svdedxv.cxx svx/source/svdraw/svdotext.cxx svx/source/svdraw/svdotxed.cxx
Date Mon, 08 Oct 2012 16:13:37 GMT
Author: alg
Date: Mon Oct  8 16:13:37 2012
New Revision: 1395635

URL: http://svn.apache.org/viewvc?rev=1395635&view=rev
Log:
#119885# Made EditMode work with text boxes where text is reaching over the TextBox's bounds

Modified:
    incubator/ooo/trunk/main/editeng/source/editeng/impedit.cxx
    incubator/ooo/trunk/main/svx/source/svdraw/svdedxv.cxx
    incubator/ooo/trunk/main/svx/source/svdraw/svdotext.cxx
    incubator/ooo/trunk/main/svx/source/svdraw/svdotxed.cxx

Modified: incubator/ooo/trunk/main/editeng/source/editeng/impedit.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/editeng/source/editeng/impedit.cxx?rev=1395635&r1=1395634&r2=1395635&view=diff
==============================================================================
--- incubator/ooo/trunk/main/editeng/source/editeng/impedit.cxx (original)
+++ incubator/ooo/trunk/main/editeng/source/editeng/impedit.cxx Mon Oct  8 16:13:37 2012
@@ -49,7 +49,6 @@
 #include <sot/exchange.hxx>
 #include <sot/formats.hxx>
 
-
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::linguistic2;
@@ -449,67 +448,54 @@ void ImpEditView::SetOutputArea( const R
 
 void ImpEditView::ResetOutputArea( const Rectangle& rRec )
 {
-	Rectangle aCurArea( aOutArea );
-	SetOutputArea( rRec );
-	// Umliegende Bereiche invalidieren, wenn UpdateMode der Engine auf sal_True
-	if ( !aCurArea.IsEmpty() && pEditEngine->pImpEditEngine->GetUpdateMode() )
-	{
-		long nMore = 0;
-		if ( DoInvalidateMore() )
-			nMore = GetWindow()->PixelToLogic( Size( nInvMore, 0 ) ).Width();
-		if ( aCurArea.Left() < aOutArea.Left() )
-		{
-			Rectangle aRect( aCurArea.TopLeft(),
-				Size( aOutArea.Left()-aCurArea.Left(), aCurArea.GetHeight() ) );
-			if ( nMore )
-			{
-				aRect.Left() -= nMore;
-				aRect.Top() -= nMore;
-				aRect.Bottom() += nMore;
-			}
-			GetWindow()->Invalidate( aRect );
-		}
-		if ( aCurArea.Right() > aOutArea.Right() )
-		{
-			long nW = aCurArea.Right() - aOutArea.Right();
-			Point aPos( aCurArea.TopRight() );
-			aPos.X() -= nW;
-			Rectangle aRect( aPos, Size( nW, aCurArea.GetHeight() ) );
-			if ( nMore )
-			{
-				aRect.Right() += nMore;
-				aRect.Top() -= nMore;
-				aRect.Bottom() += nMore;
-			}
-			GetWindow()->Invalidate( aRect );
-		}
-		if ( aCurArea.Top() < aOutArea.Top() )
-		{
-			Rectangle aRect( aCurArea.TopLeft(), Size( aCurArea.GetWidth(), aOutArea.Top() - aCurArea.Top()
) );
-			if ( nMore )
-			{
-				aRect.Top() -= nMore;
-				aRect.Left() -= nMore;
-				aRect.Right() += nMore;
-			}
-			GetWindow()->Invalidate( aRect );
-		}
-		if ( aCurArea.Bottom() > aOutArea.Bottom() )
-		{
-			long nH = aCurArea.Bottom() - aOutArea.Bottom();
-			Point aPos( aCurArea.BottomLeft() );
-			aPos.Y() -= nH;
-			Rectangle aRect( aPos, Size( aCurArea.GetWidth(), nH ) );
-			if ( nMore )
-			{
-				aRect.Bottom() += nMore;
-				aRect.Left() -= nMore;
-				aRect.Right() += nMore;
-			}
+    // remember old out area
+    const Rectangle aOldArea(aOutArea);
 
-			GetWindow()->Invalidate( aRect );
-		}
-	}
+    // apply new one
+    SetOutputArea(rRec);
+
+    // invalidate surrounding areas if update is true
+    if(!aOldArea.IsEmpty() && pEditEngine->pImpEditEngine->GetUpdateMode())
+    {
+        // #119885# use grown area if needed; do when getting bigger OR smaller
+        const sal_Int32 nMore(DoInvalidateMore() ? GetWindow()->PixelToLogic(Size(nInvMore,
0)).Width() : 0);
+
+        if(aOldArea.Left() > aOutArea.Left())
+        {
+            GetWindow()->Invalidate(Rectangle(aOutArea.Left() - nMore, aOldArea.Top()
- nMore, aOldArea.Left(), aOldArea.Bottom() + nMore));
+        }
+        else if(aOldArea.Left() < aOutArea.Left())
+        {
+            GetWindow()->Invalidate(Rectangle(aOldArea.Left() - nMore, aOldArea.Top()
- nMore, aOutArea.Left(), aOldArea.Bottom() + nMore));
+        }
+
+        if(aOldArea.Right() > aOutArea.Right())
+        {
+            GetWindow()->Invalidate(Rectangle(aOutArea.Right(), aOldArea.Top() - nMore,
aOldArea.Right() + nMore, aOldArea.Bottom() + nMore));
+        }
+        else if(aOldArea.Right() < aOutArea.Right())
+        {
+            GetWindow()->Invalidate(Rectangle(aOldArea.Right(), aOldArea.Top() - nMore,
aOutArea.Right() + nMore, aOldArea.Bottom() + nMore));
+        }
+
+        if(aOldArea.Top() > aOutArea.Top())
+        {
+            GetWindow()->Invalidate(Rectangle(aOldArea.Left() - nMore, aOutArea.Top()
- nMore, aOldArea.Right() + nMore, aOldArea.Top()));
+        }
+        else if(aOldArea.Top() < aOutArea.Top())
+        {
+            GetWindow()->Invalidate(Rectangle(aOldArea.Left() - nMore, aOldArea.Top()
- nMore, aOldArea.Right() + nMore, aOutArea.Top()));
+        }
+
+        if(aOldArea.Bottom() > aOutArea.Bottom())
+        {
+            GetWindow()->Invalidate(Rectangle(aOldArea.Left() - nMore, aOutArea.Bottom(),
aOldArea.Right() + nMore, aOldArea.Bottom() + nMore));
+        }
+        else if(aOldArea.Bottom() < aOutArea.Bottom())
+        {
+            GetWindow()->Invalidate(Rectangle(aOldArea.Left() - nMore, aOldArea.Bottom(),
aOldArea.Right() + nMore, aOutArea.Bottom() + nMore));
+        }
+    }
 }
 
 void ImpEditView::RecalcOutputArea()

Modified: incubator/ooo/trunk/main/svx/source/svdraw/svdedxv.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svx/source/svdraw/svdedxv.cxx?rev=1395635&r1=1395634&r2=1395635&view=diff
==============================================================================
--- incubator/ooo/trunk/main/svx/source/svdraw/svdedxv.cxx (original)
+++ incubator/ooo/trunk/main/svx/source/svdraw/svdedxv.cxx Mon Oct  8 16:13:37 2012
@@ -211,6 +211,7 @@ void SdrObjEditView::ModelHasChanged()
                 aMinArea1.Move(aPvOfs.X(),aPvOfs.Y());
                 Rectangle aNewArea(aMinArea1);
                 aNewArea.Union(aEditArea1);
+
                 if (aNewArea!=aOldArea || aEditArea1!=aTextEditArea || aMinArea1!=aMinTextEditArea
||
                     pTextEditOutliner->GetMinAutoPaperSize()!=aPaperMin1 || pTextEditOutliner->GetMaxAutoPaperSize()!=aPaperMax1)
{
                     aTextEditArea=aEditArea1;

Modified: incubator/ooo/trunk/main/svx/source/svdraw/svdotext.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svx/source/svdraw/svdotext.cxx?rev=1395635&r1=1395634&r2=1395635&view=diff
==============================================================================
--- incubator/ooo/trunk/main/svx/source/svdraw/svdotext.cxx (original)
+++ incubator/ooo/trunk/main/svx/source/svdraw/svdotext.cxx Mon Oct  8 16:13:37 2012
@@ -862,6 +862,17 @@ void SdrTextObj::TakeTextRect( SdrOutlin
 				if (eAniDirection==SDRTEXTANI_LEFT || eAniDirection==SDRTEXTANI_RIGHT) nWdt=1000000;
 				if (eAniDirection==SDRTEXTANI_UP || eAniDirection==SDRTEXTANI_DOWN) nHgt=1000000;
 			}
+
+            // #119885# Do not limit/force height to geometrical frame (vice versa for vertical
writing)
+            if(IsVerticalWriting())
+            {
+                nWdt = 1000000;
+            }
+            else
+            {
+                nHgt = 1000000;
+            }
+
 			rOutliner.SetMaxAutoPaperSize(Size(nWdt,nHgt));
 		}
 

Modified: incubator/ooo/trunk/main/svx/source/svdraw/svdotxed.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svx/source/svdraw/svdotxed.cxx?rev=1395635&r1=1395634&r2=1395635&view=diff
==============================================================================
--- incubator/ooo/trunk/main/svx/source/svdraw/svdotxed.cxx (original)
+++ incubator/ooo/trunk/main/svx/source/svdraw/svdotxed.cxx Mon Oct  8 16:13:37 2012
@@ -180,9 +180,20 @@ void SdrTextObj::TakeTextEditArea(Size* 
 		if (!bFitToSize) {
 			if (nMaxWdt==0 || nMaxWdt>aMaxSiz.Width())  nMaxWdt=aMaxSiz.Width();
 			if (nMaxHgt==0 || nMaxHgt>aMaxSiz.Height()) nMaxHgt=aMaxSiz.Height();
-			if (!IsAutoGrowWidth() ) { nMaxWdt=aAnkSiz.Width();  nMinWdt=nMaxWdt; }
-			if (!IsAutoGrowHeight()) { nMaxHgt=aAnkSiz.Height(); nMinHgt=nMaxHgt; }
-			SdrTextAniKind      eAniKind=GetTextAniKind();
+			
+            if (!IsAutoGrowWidth() ) 
+            { 
+                nMinWdt = aAnkSiz.Width();  
+                nMaxWdt = nMinWdt; 
+            }
+			
+            if (!IsAutoGrowHeight()) 
+            { 
+                nMinHgt = aAnkSiz.Height(); 
+                nMaxHgt = nMinHgt; 
+            }
+			
+            SdrTextAniKind      eAniKind=GetTextAniKind();
 			SdrTextAniDirection eAniDirection=GetTextAniDirection();
 
 			// #101684#
@@ -194,9 +205,22 @@ void SdrTextObj::TakeTextEditArea(Size* 
 				if (eAniDirection==SDRTEXTANI_LEFT || eAniDirection==SDRTEXTANI_RIGHT) nMaxWdt=1000000;
 				if (eAniDirection==SDRTEXTANI_UP || eAniDirection==SDRTEXTANI_DOWN) nMaxHgt=1000000;
 			}
-			aPaperMax.Width()=nMaxWdt;
+            
+            // #119885# Do not limit/force height to geometrical frame (vice versa for vertical
writing)
+            if(IsVerticalWriting())
+            {
+                nMaxWdt = 1000000;
+            }
+            else
+            {
+                nMaxHgt = 1000000;
+            }
+
+            aPaperMax.Width()=nMaxWdt;
 			aPaperMax.Height()=nMaxHgt;
-		} else {
+		} 
+        else 
+        {
 			aPaperMax=aMaxSiz;
 		}
 		aPaperMin.Width()=nMinWdt;



Mime
View raw message