diff options
author | Tomaž Vajngerl <quikee@gmail.com> | 2013-07-23 20:43:29 +0200 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2013-07-23 20:52:46 +0200 |
commit | 98608e57f21820ec1d2c6cd77f433b6963e249a6 (patch) | |
tree | 126b4ab00fc93cddd09e3eb53ba53efb2119ddf5 /include | |
parent | 06c416be33ae727d1b87e5a79cec4a0582aea832 (diff) |
fdo#38144 In ruler snap to markers for tab stops, margins, etc.
Change-Id: Ie7f829b0ec36af79a2a97d9de7b6e37034c22e61
Diffstat (limited to 'include')
-rw-r--r-- | include/svtools/ruler.hxx | 14 | ||||
-rw-r--r-- | include/svx/ruler.hxx | 5 |
2 files changed, 18 insertions, 1 deletions
diff --git a/include/svtools/ruler.hxx b/include/svtools/ruler.hxx index bee6f05d91b5..4c08745d2c21 100644 --- a/include/svtools/ruler.hxx +++ b/include/svtools/ruler.hxx @@ -586,6 +586,18 @@ struct RulerLine sal_uInt16 nStyle; }; +struct RulerUnitData +{ + MapUnit eMapUnit; // MAP_UNIT for calculaion + long nTickUnit; // Unit divider + long nTick1; // Minimal step + long nTick2; // Tick half unit + long nTick3; // Tick whole unit + long n100THMM; // 100mm Unit divider + sal_uInt16 nUnitDigits; // Number of digits + sal_Char aUnitStr[8]; // Unit string +}; + class ImplRulerData; // --------- // - Ruler - @@ -681,6 +693,8 @@ private: protected: long GetRulerVirHeight() const; + MapMode GetMapMode() const { return maMapMode; } + RulerUnitData GetCurrentRulerUnit() const; public: Ruler( Window* pParent, WinBits nWinStyle = WB_STDRULER ); diff --git a/include/svx/ruler.hxx b/include/svx/ruler.hxx index aa18893ec3cc..a6faad748bc8 100644 --- a/include/svx/ruler.hxx +++ b/include/svx/ruler.hxx @@ -22,7 +22,7 @@ #include <vcl/menu.hxx> #include <svtools/ruler.hxx> #include <svl/lstner.hxx> -#include "svx/svxdllapi.h" +#include <svx/svxdllapi.h> class SvxProtectItem; class SvxRulerItem; @@ -124,6 +124,9 @@ class SVX_DLLPUBLIC SvxRuler: public Ruler, public SfxListener void UpdateColumns(); void UpdateObject(); + // Normalize position to the ruler's tick value + void NormalizePosition(long& rValue) const; + long PixelHAdjust(long lPos, long lPos2) const; long PixelVAdjust(long lPos, long lPos2) const; long PixelAdjust(long lPos, long lPos2) const; |