diff options
author | Tomaž Vajngerl <quikee@gmail.com> | 2013-07-25 23:55:05 +0200 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2013-07-26 00:05:03 +0200 |
commit | bfa3f8584b2f2492f5c0573f22e4ebd96d9a8af5 (patch) | |
tree | 97e2e3fdfb283f1e17d6166c08e17e0f1ddc662d /svtools | |
parent | 81219456462e831cf931d7594657281b5c4c09a1 (diff) |
fdo#38144 Enhance snapping to markers, also snap to frame margins
Change-Id: I5de4f8bafecabf84224a0518d9515295d23d7321
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/control/ruler.cxx | 38 |
1 files changed, 32 insertions, 6 deletions
diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx index d1289756cf36..e25452a19132 100644 --- a/svtools/source/control/ruler.cxx +++ b/svtools/source/control/ruler.cxx @@ -90,6 +90,8 @@ private: long nNullOff; long nMargin1; long nMargin2; + long nLeftFrameMargin; + long nRightFrameMargin; sal_uInt16 nLines; sal_uInt16 nBorders; sal_uInt16 nIndents; @@ -1032,11 +1034,12 @@ void Ruler::ImplFormat() if ( mbCalc ) ImplCalc(); mpData->nNullVirOff = mnWinOff+mpData->nPageOff+mpData->nNullOff-mnVirOff; + nNullVirOff = mpData->nNullVirOff; nVirLeft = mpData->nRulVirOff; - nVirRight = nVirLeft+mpData->nRulWidth-1; + nVirRight = nVirLeft + mpData->nRulWidth - 1; nVirTop = 0; - nVirBottom = mnVirHeight-1; + nVirBottom = mnVirHeight - 1; if ( !IsReallyVisible() ) return; @@ -1138,10 +1141,15 @@ void Ruler::ImplFormat() } // Lineal-Beschriftung (nur wenn keine Bemassungspfeile) - long nMin = nVirLeft; - long nMax = nP2; - long nStart = mpData->bTextRTL ? mpData->nMargin2 + nNullVirOff : nNullVirOff; - long nCenter = nVirTop+((nVirBottom-nVirTop)/2); + long nMin = nVirLeft; + long nMax = nP2; + long nCenter = nVirTop + ((nVirBottom - nVirTop) / 2); + long nStart = 0; + + if (mpData->bTextRTL) + nStart = mpData->nRightFrameMargin + nNullVirOff; + else + nStart = mpData->nLeftFrameMargin + nNullVirOff; // Nicht Schatten uebermalen if ( nP1 > nVirLeft ) @@ -2497,6 +2505,24 @@ void Ruler::SetNullOffset( long nPos ) } } +void Ruler::SetLeftFrameMargin( long nPos ) +{ + if ( (mpData->nLeftFrameMargin != nPos) ) + { + mpData->nLeftFrameMargin = nPos; + ImplUpdate(); + } +} + +void Ruler::SetRightFrameMargin( long nPos ) +{ + if ( (mpData->nRightFrameMargin != nPos) ) + { + mpData->nRightFrameMargin = nPos; + ImplUpdate(); + } +} + // ----------------------------------------------------------------------- void Ruler::SetMargin1( long nPos, sal_uInt16 nMarginStyle ) |