--- Scribus-orig/scribus/canvasmode_normal.cpp	2010-06-07 15:24:19.000000000 -0400
+++ Scribus/scribus/canvasmode_normal.cpp	2010-06-10 14:07:54.000000000 -0400
@@ -212,6 +212,10 @@
 		}
 		else if (currItem->itemType() == PageItem::TextFrame)
 		{
+			// See if double click was on a frame handle
+			FPoint p = m_canvas->globalToCanvas(m->globalPos());
+			Canvas::FrameHandle fh = m_canvas->frameHitTest(QPointF(p.x(),p.y()), currItem);
+
 			//CB old code
 			//emit currItem->isAnnotation() ? AnnotProps() : Amode(modeEdit);
 			//mousePressEvent(m);
@@ -222,6 +226,80 @@
 				m_view->requestMode(submodeAnnotProps);
 				//mousePressEvent(m);
 			}
+
+			//else if on the south or southeast frame handle,
+			//adjust text frame size to fit contents
+			else if (fh == Canvas::SOUTH || fh == Canvas::SOUTHEAST) {
+				currItem->layout();
+				double w = currItem->width();
+				double h = currItem->height();
+				double worig = w;  // Remember original width and height
+				double horig = h;
+				// Bounds of binary search for optimal height:
+				//    hmin = too small (text overflows, or
+				//    	  box would be unreasonably short (< 10pt))
+				//    hmax = big enough (text does not overflow,
+				//        or box is as big as will fit on page)
+				double hmin = 10;
+				double hmax = qMax(10.0, m_doc->Pages->at(currItem->OwnPage)->yOffset() + m_doc->Pages->at(currItem->OwnPage)->height() - currItem->yPos());
+				// Criterion for "text overflows":
+				//   If no linked frame after this one,
+				//     normal meaning of "overflows".
+				//   If linked frame after this one,
+				//     means more characters get shifted
+				//     to that frame than are currently
+				PageItem *next = currItem->nextInChain();
+				int lc = currItem->lastInFrame();
+
+				if (h > hmax) h = hmax;
+				if (h < hmin) h = hmin;
+				while (hmax - hmin > 0.1) {
+				    if (next ? currItem->lastInFrame() < lc : currItem->frameOverflows()) {
+					hmin = h;
+					h = (h+hmax)/2.0;
+				    } else {
+					hmax = h;
+					h = (h+hmin)/2.0;
+				    }
+				    currItem->setWidthHeight(w,h,true);
+				    currItem->invalidateLayout();
+				    currItem->updateClip();
+				    currItem->layout(); 
+				}
+				// hmax is now the height we want.
+				// If on southeast frame point, also
+				// shrink width until text overflows.
+				double wmin = 10;
+				double wmax = w;
+				if (fh == Canvas::SOUTHEAST) {
+				    currItem->setWidthHeight(w,hmax,true);
+				    currItem->invalidateLayout();
+				    currItem->updateClip();
+				    currItem->layout(); 
+				    while (wmax - wmin > 0.1) {
+				        if (next ? currItem->lastInFrame() < lc : currItem->frameOverflows()) {
+					    wmin = w;
+					    w = (w+wmax)/2.0;
+					} else {
+					    wmax = w;
+					    w = (w+wmin)/2.0;
+					}
+					currItem->setWidthHeight(w,hmax,true);
+				        currItem->invalidateLayout();
+				        currItem->updateClip();
+				        currItem->layout(); 
+				    }
+				}
+				// Restore original width, height for undo manager to remember
+				currItem->setWidthHeight(worig,horig,true);
+				// then set new width and height
+				currItem->setWidthHeight(wmax,hmax,false);
+				currItem->invalidateLayout();
+				currItem->updateClip();
+				currItem->layout(); 
+				m_doc->regionsChanged()->update(QRect());
+			} 
+
 			//else if not in mode edit, set mode edit
 			else if (m_doc->appMode != modeEdit)
 			{
