30 rField.
get_range(nMin, nMax, FieldUnit::TWIP);
42 eUnit = FieldUnit::CM;
46 eUnit = FieldUnit::INCH;
55 if (FieldUnit::POINT == eUnit)
83 rField.
set_range(nMin, nMax, FieldUnit::TWIP);
93 rField.
set_value(nVal, FieldUnit::MM_100TH);
98 sal_Int64 nVal = rField.
get_value(FieldUnit::MM_100TH);
100 const sal_Int64 nSizeMask = 0xffffffffff000000LL;
101 bool bRoundBefore =
true;
104 if( (nVal & nSizeMask) == 0 )
105 bRoundBefore =
false;
109 if( ((-nVal) & nSizeMask ) == 0 )
110 bRoundBefore =
false;
125 eUnit == MapUnit::Map100thMM ||
126 eUnit == MapUnit::Map10thMM ||
127 eUnit == MapUnit::MapMM ||
128 eUnit == MapUnit::MapCM,
"this unit is not implemented" );
156 case MapUnit::Map100thMM:
157 case MapUnit::Map10thMM:
159 return FieldUnit::MM;
162 return FieldUnit::CM;
164 case MapUnit::Map1000thInch:
165 case MapUnit::Map100thInch:
166 case MapUnit::Map10thInch:
167 case MapUnit::MapInch:
168 return FieldUnit::INCH;
170 case MapUnit::MapPoint:
171 return FieldUnit::POINT;
173 case MapUnit::MapTwip:
174 return FieldUnit::TWIP;
177 return FieldUnit::NONE;
184 eUnit == MapUnit::Map100thMM ||
185 eUnit == MapUnit::Map10thMM ||
186 eUnit == MapUnit::MapMM ||
187 eUnit == MapUnit::MapCM,
"this unit is not implemented" );
constexpr o3tl::Length FieldToO3tlLength(FieldUnit eU, o3tl::Length ePixelValue=o3tl::Length::px)
constexpr o3tl::Length MapToO3tlLength(MapUnit eU, o3tl::Length ePixelValue=o3tl::Length::px)
SAL_WARN_UNUSED_RESULT Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
#define DBG_ASSERT(sCon, aError)
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
constexpr T & temporary(T &&x)
tools::Long CalcToPoint(tools::Long nIn, MapUnit eUnit, sal_uInt16 nFactor)
void SetFieldUnit(weld::MetricSpinButton &rField, FieldUnit eUnit, bool bAll)
sal_Int64 GetCoreValue(const weld::MetricSpinButton &rField, MapUnit eUnit)
tools::Long ItemToControl(tools::Long nIn, MapUnit eItem, FieldUnit eCtrl)
tools::Long ControlToItem(tools::Long nIn, FieldUnit eCtrl, MapUnit eItem)
tools::Long CalcToUnit(float nIn, MapUnit eUnit)
FieldUnit MapToFieldUnit(const MapUnit eUnit)
tools::Long TransformMetric(tools::Long nVal, FieldUnit aOld, FieldUnit aNew)
void SetMetricValue(weld::MetricSpinButton &rField, sal_Int64 nCoreValue, MapUnit eUnit)