Index: src/wp/ap/xp/ap_TopRuler.cpp =================================================================== RCS file: /cvsroot/abi/src/wp/ap/xp/ap_TopRuler.cpp,v retrieving revision 1.61 diff -u -r1.61 ap_TopRuler.cpp --- src/wp/ap/xp/ap_TopRuler.cpp 2000/02/29 15:09:07 1.61 +++ src/wp/ap/xp/ap_TopRuler.cpp 2000/03/02 08:38:43 @@ -1154,8 +1154,7 @@ // this is a new widget, so it needs more work to get started m_dragStart = xgrid; - double dgrid = _scalePixelDistanceToUnits(xrel,tick); - UT_DEBUGMSG(("SettingTabStop: %s\n",m_pG->invertDimension(tick.dimType,dgrid))); + UT_DEBUGMSG(("SettingTabStop: %s\n",m_pG->invertDimension(tick.dimType, _scalePixelDistanceToUnits(xrel,tick)))); UT_sint32 oldDraggingCenter = m_draggingCenter; UT_Rect oldDraggingRect = m_draggingRect; m_draggingCenter = xAbsLeft + xgrid; @@ -1211,7 +1210,16 @@ //UT_DEBUGMSG(("mouseRelease: [ems 0x%08lx][emb 0x%08lx][x %ld][y %ld]\n",ems,emb,x,y)); ap_RulerTicks tick(m_pG,m_dim); - + + UT_sint32 xAbsLeft = _getFirstPixelInColumn(&m_infoCache,m_infoCache.m_iCurrentColumn); + UT_sint32 xdelta = (m_draggingCenter-xAbsLeft) - m_infoCache.m_xrLeftIndent; + _xorGuide (UT_TRUE); + if (xdelta == 0) // Not moved, clicked and released + { + m_draggingWhat = DW_NOTHING; + return; + } + switch (m_draggingWhat) { case DW_NOTHING: @@ -1234,7 +1242,6 @@ properties[2] = 0; UT_DEBUGMSG(("TopRuler: ColumnGap [%s]\n",properties[1])); - _xorGuide(UT_TRUE); m_draggingWhat = DW_NOTHING; (static_cast(m_pView))->setSectionFormat(properties); } @@ -1247,10 +1254,7 @@ // so that the absolute position of the first-line has not changed. // first-line is stored in relative terms, so we need to update it. - UT_sint32 xAbsLeft = _getFirstPixelInColumn(&m_infoCache,m_infoCache.m_iCurrentColumn); double dxrel = _scalePixelDistanceToUnits(m_draggingCenter - xAbsLeft,tick); - - UT_sint32 xdelta = (m_draggingCenter-xAbsLeft) - m_infoCache.m_xrLeftIndent; double dxrel2 = _scalePixelDistanceToUnits(m_infoCache.m_xrFirstLineIndent - xdelta,tick); // invertDimension() returns pointer to static buffer, so @@ -1270,7 +1274,6 @@ UT_DEBUGMSG(("TopRuler: LeftIndent [%s] TextIndent [%s]\n", properties[1],properties[3])); - _xorGuide(UT_TRUE); m_draggingWhat = DW_NOTHING; (static_cast(m_pView))->setBlockFormat(properties); } @@ -1282,7 +1285,6 @@ // so that we do not change the first-line-indent relative to // the paragraph. since first-line-indent is stored in the // document in relative coordinates, we don't need to do anything. - UT_sint32 xAbsLeft = _getFirstPixelInColumn(&m_infoCache,m_infoCache.m_iCurrentColumn); double dxrel = _scalePixelDistanceToUnits(m_draggingCenter - xAbsLeft,tick); const XML_Char * properties[3]; @@ -1291,7 +1293,6 @@ properties[2] = 0; UT_DEBUGMSG(("TopRuler: LeftIndent [%s]\n",properties[1])); - _xorGuide(UT_TRUE); m_draggingWhat = DW_NOTHING; (static_cast(m_pView))->setBlockFormat(properties); } @@ -1299,7 +1300,6 @@ case DW_RIGHTINDENT: { - UT_sint32 xAbsLeft = _getFirstPixelInColumn(&m_infoCache,m_infoCache.m_iCurrentColumn); UT_sint32 xAbsRight = xAbsLeft + m_infoCache.u.c.m_xColumnWidth; double dxrel = _scalePixelDistanceToUnits(xAbsRight - m_draggingCenter,tick); @@ -1309,7 +1309,6 @@ properties[2] = 0; UT_DEBUGMSG(("TopRuler: RightIndent [%s]\n",properties[1])); - _xorGuide(UT_TRUE); m_draggingWhat = DW_NOTHING; (static_cast(m_pView))->setBlockFormat(properties); } @@ -1317,7 +1316,6 @@ case DW_FIRSTLINEINDENT: { - UT_sint32 xAbsLeft = _getFirstPixelInColumn(&m_infoCache,m_infoCache.m_iCurrentColumn); double dxrel = _scalePixelDistanceToUnits(m_draggingCenter-xAbsLeft-m_infoCache.m_xrLeftIndent,tick); const XML_Char * properties[3]; @@ -1325,8 +1323,7 @@ properties[1] = m_pG->invertDimension(tick.dimType,dxrel); properties[2] = 0; UT_DEBUGMSG(("TopRuler: FirstLineIndent [%s]\n",properties[1])); - - _xorGuide(UT_TRUE); + m_draggingWhat = DW_NOTHING; (static_cast(m_pView))->setBlockFormat(properties); } @@ -1344,7 +1341,6 @@ return; } - _xorGuide(UT_TRUE); _setTabStops(tick, iTab, UT_FALSE); } return; @@ -1494,8 +1490,7 @@ UT_DEBUGMSG(("Gap: [x %ld][xAbsRight %ld][xrel %ld][xgrid %ld][width %ld]\n",x,xAbsRight,xrel,xgrid,m_draggingRect.width)); - double dgrid = _scalePixelDistanceToUnits(m_draggingRect.width,tick); - UT_DEBUGMSG(("SettingColumnGap: %s\n",m_pG->invertDimension(tick.dimType,dgrid))); + UT_DEBUGMSG(("SettingColumnGap: %s\n",m_pG->invertDimension(tick.dimType, _scalePixelDistanceToUnits(m_draggingRect.width,tick)))); if (!m_bBeforeFirstMotion && (m_draggingCenter != oldDraggingCenter)) draw(((oldDraggingRect.width > m_draggingRect.width ) ? &oldDraggingRect : &m_draggingRect), &m_infoCache); @@ -1519,8 +1514,7 @@ UT_sint32 xAbsLeft = _getFirstPixelInColumn(&m_infoCache,m_infoCache.m_iCurrentColumn); UT_sint32 xrel = ((UT_sint32)x) - xAbsLeft; UT_sint32 xgrid = _snapPixelToGrid(xrel,tick); - double dgrid = _scalePixelDistanceToUnits(xrel,tick); - UT_DEBUGMSG(("SettingLeftIndent: %s\n",m_pG->invertDimension(tick.dimType,dgrid))); + UT_DEBUGMSG(("SettingLeftIndent: %s\n",m_pG->invertDimension(tick.dimType, _scalePixelDistanceToUnits(xrel,tick)))); UT_sint32 oldDraggingCenter = m_draggingCenter; UT_Rect oldDraggingRect = m_draggingRect; m_draggingCenter = xAbsLeft + xgrid; @@ -1546,8 +1540,7 @@ UT_sint32 xrel = ((UT_sint32)x) - xAbsLeft; UT_sint32 xgrid = _snapPixelToGrid(xrel,tick); UT_sint32 xgridTagAlong = xgrid + m_infoCache.m_xrFirstLineIndent; - double dgrid = _scalePixelDistanceToUnits(xrel,tick); - UT_DEBUGMSG(("SettingLeftIndent: %s\n",m_pG->invertDimension(tick.dimType,dgrid))); + UT_DEBUGMSG(("SettingLeftIndent: %s\n",m_pG->invertDimension(tick.dimType,_scalePixelDistanceToUnits(xrel,tick)))); UT_sint32 oldDraggingCenter = m_draggingCenter; UT_Rect oldDraggingRect = m_draggingRect; UT_Rect oldDragging2Rect = m_dragging2Rect; @@ -1575,8 +1568,7 @@ UT_sint32 xAbsRight = xAbsLeft + m_infoCache.u.c.m_xColumnWidth; UT_sint32 xrel = xAbsRight - ((UT_sint32)x); UT_sint32 xgrid = _snapPixelToGrid(xrel,tick); - double dgrid = _scalePixelDistanceToUnits(xrel,tick); - UT_DEBUGMSG(("SettingRightIndent: %s\n",m_pG->invertDimension(tick.dimType,dgrid))); + UT_DEBUGMSG(("SettingRightIndent: %s\n",m_pG->invertDimension(tick.dimType,_scalePixelDistanceToUnits(xrel,tick)))); UT_sint32 oldDraggingCenter = m_draggingCenter; UT_Rect oldDraggingRect = m_draggingRect; m_draggingCenter = xAbsRight - xgrid; @@ -1599,8 +1591,7 @@ // not the left edge of the column. UT_sint32 xrel2 = xrel - m_infoCache.m_xrLeftIndent; UT_sint32 xgrid = _snapPixelToGrid(xrel2,tick); - double dgrid = _scalePixelDistanceToUnits(xrel2,tick); - UT_DEBUGMSG(("SettingFirstLineIndent: %s\n",m_pG->invertDimension(tick.dimType,dgrid))); + UT_DEBUGMSG(("SettingFirstLineIndent: %s\n",m_pG->invertDimension(tick.dimType, _scalePixelDistanceToUnits(xrel2,tick)))); UT_sint32 oldDraggingCenter = m_draggingCenter; UT_Rect oldDraggingRect = m_draggingRect; m_draggingCenter = xAbsLeft + m_infoCache.m_xrLeftIndent + xgrid; @@ -1622,8 +1613,7 @@ UT_sint32 xAbsLeft = _getFirstPixelInColumn(&m_infoCache,m_infoCache.m_iCurrentColumn); UT_sint32 xrel = ((UT_sint32)x) - xAbsLeft; UT_sint32 xgrid = _snapPixelToGrid(xrel,tick); - double dgrid = _scalePixelDistanceToUnits(xrel,tick); - UT_DEBUGMSG(("SettingTabStop: %s\n",m_pG->invertDimension(tick.dimType,dgrid))); + UT_DEBUGMSG(("SettingTabStop: %s\n",m_pG->invertDimension(tick.dimType, _scalePixelDistanceToUnits(xrel,tick)))); UT_sint32 oldDraggingCenter = m_draggingCenter; UT_Rect oldDraggingRect = m_draggingRect; m_draggingCenter = xAbsLeft + xgrid;