22#include <osl/diagnose.h>
24#include <editeng/editrids.hrc>
29#include <rtl/ustrbuf.hxx>
35 bool bShowAtLeastOneDecimalDigit =
true;
46 case MapUnit::Map100thMM:
47 case MapUnit::Map10thMM:
55 case MapUnit::Map100thMM: nRet *= 1000;
break;
56 case MapUnit::Map10thMM: nRet *= 100;
break;
57 case MapUnit::MapMM: nRet *= 10;
break;
63 case MapUnit::Map1000thInch:
64 case MapUnit::Map100thInch:
65 case MapUnit::Map10thInch:
66 case MapUnit::MapInch:
72 case MapUnit::Map1000thInch: nRet *= 1000;
break;
73 case MapUnit::Map100thInch: nRet *= 100;
break;
74 case MapUnit::Map10thInch: nRet *= 10;
break;
80 case MapUnit::MapPoint:
83 bShowAtLeastOneDecimalDigit =
false;
86 case MapUnit::MapTwip:
87 case MapUnit::MapPixel:
89 nVal, eSrcUnit, eDestUnit ));
92 OSL_FAIL(
"not supported mapunit" );
96 if ( MapUnit::MapCM == eDestUnit || MapUnit::MapInch == eDestUnit )
98 sal_Int32 nMod = nRet % 10;
112 for(
int nDigits = 4; nDigits; --nDigits, nDiff /= 10 )
117 sRet.append(nRet / nDiff);
119 if( 4 == nDigits && (bShowAtLeastOneDecimalDigit || nRet) )
134 return sRet.makeStringAndClear();
142 static const Color aColAry[] = {
148 sal_uInt16 nColor = 0;
157 RID_SVXITEMS_COLOR_BLACK,
158 RID_SVXITEMS_COLOR_BLUE,
159 RID_SVXITEMS_COLOR_GREEN,
160 RID_SVXITEMS_COLOR_CYAN,
161 RID_SVXITEMS_COLOR_RED,
162 RID_SVXITEMS_COLOR_MAGENTA,
163 RID_SVXITEMS_COLOR_BROWN,
164 RID_SVXITEMS_COLOR_GRAY,
165 RID_SVXITEMS_COLOR_LIGHTGRAY,
166 RID_SVXITEMS_COLOR_LIGHTBLUE,
167 RID_SVXITEMS_COLOR_LIGHTGREEN,
168 RID_SVXITEMS_COLOR_LIGHTCYAN,
169 RID_SVXITEMS_COLOR_LIGHTRED,
170 RID_SVXITEMS_COLOR_LIGHTMAGENTA,
171 RID_SVXITEMS_COLOR_YELLOW,
172 RID_SVXITEMS_COLOR_WHITE
179 sStr =
EditResId(RID_SVXITEMS_COLORS[nColor]);
181 if ( sStr.isEmpty() )
186 OUString::number( rCol.
GetBlue() ) +
")";
197 case MapUnit::Map100thMM:
198 case MapUnit::Map10thMM:
200 pId = RID_SVXITEMS_METRIC_MM;
204 pId = RID_SVXITEMS_METRIC_CM;
207 case MapUnit::Map1000thInch:
208 case MapUnit::Map100thInch:
209 case MapUnit::Map10thInch:
210 case MapUnit::MapInch:
211 pId = RID_SVXITEMS_METRIC_INCH;
214 case MapUnit::MapPoint:
215 pId = RID_SVXITEMS_METRIC_POINT;
218 case MapUnit::MapTwip:
219 pId = RID_SVXITEMS_METRIC_TWIP;
222 case MapUnit::MapPixel:
223 pId = RID_SVXITEMS_METRIC_PIXEL;
227 OSL_FAIL(
"not supported mapunit" );
Color GetRGBColor() const
sal_uInt8 GetBlue() const
sal_uInt8 GetGreen() const
const LocaleDataWrapper * getLocaleData() const
const OUString & getNumDecimalSep() const
SAL_WARN_UNUSED_RESULT Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
constexpr ::Color COL_LIGHTRED(0xFF, 0x00, 0x00)
constexpr ::Color COL_GRAY(0x80, 0x80, 0x80)
constexpr ::Color COL_GREEN(0x00, 0x80, 0x00)
constexpr ::Color COL_WHITE(0xFF, 0xFF, 0xFF)
constexpr ::Color COL_LIGHTCYAN(0x00, 0xFF, 0xFF)
constexpr ::Color COL_MAGENTA(0x80, 0x00, 0x80)
constexpr ::Color COL_LIGHTMAGENTA(0xFF, 0x00, 0xFF)
constexpr ::Color COL_BROWN(0x80, 0x80, 0x00)
constexpr ::Color COL_YELLOW(0xFF, 0xFF, 0x00)
constexpr ::Color COL_RED(0x80, 0x00, 0x00)
constexpr ::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
constexpr ::Color COL_LIGHTGRAY(0xC0, 0xC0, 0xC0)
constexpr ::Color COL_LIGHTBLUE(0x00, 0x00, 0xFF)
constexpr ::Color COL_CYAN(0x00, 0x80, 0x80)
constexpr ::Color COL_LIGHTGREEN(0x00, 0xFF, 0x00)
constexpr ::Color COL_BLUE(0x00, 0x00, 0x80)
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
OUString EditResId(TranslateId aId)
OUString GetColorString(const Color &rCol)
OUString GetMetricText(tools::Long nVal, MapUnit eSrcUnit, MapUnit eDestUnit, const IntlWrapper *pIntl)
TranslateId GetMetricId(MapUnit eUnit)
constexpr OUStringLiteral cpDelim
#define SAL_N_ELEMENTS(arr)