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/03 01:32:32 @@ -1031,6 +1031,7 @@ UT_sint32 xgrid = _snapPixelToGrid(xrel,tick); m_draggingCenter = xAbsLeft + xgrid; + m_oldX = x; // used to determine if delta is zero on a mouse release // first hit-test against the tab toggle control @@ -1154,8 +1155,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 +1211,15 @@ //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); - + + _xorGuide (UT_TRUE); + + if (x == m_oldX) // 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); } @@ -1270,7 +1277,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); } @@ -1291,7 +1297,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); } @@ -1309,7 +1314,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); } @@ -1325,8 +1329,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 +1347,6 @@ return; } - _xorGuide(UT_TRUE); _setTabStops(tick, iTab, UT_FALSE); } return; @@ -1494,8 +1496,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 +1520,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 +1546,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 +1574,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 +1597,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 +1619,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; Index: src/wp/ap/xp/ap_TopRuler.h =================================================================== RCS file: /cvsroot/abi/src/wp/ap/xp/ap_TopRuler.h,v retrieving revision 1.38 diff -u -r1.38 ap_TopRuler.h --- src/wp/ap/xp/ap_TopRuler.h 2000/01/29 06:20:45 1.38 +++ src/wp/ap/xp/ap_TopRuler.h 2000/03/03 01:32:32 @@ -237,6 +237,8 @@ UT_sint32 m_xGuide; /* valid iff m_bGuide */ UT_sint32 m_xOtherGuide; + UT_sint32 m_oldX; /* Only for dragging; used to see if object has moved */ + /* static const*/ UT_uint32 s_iFixedHeight /* =32 */; /* size we draw stuff w/o regard to window size */ /* static const*/ UT_uint32 s_iFixedWidth /* =32 */; /* minimum width of non-scrolling area on left */