diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-01-31 22:42:22 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-01-31 22:42:22 +0000 |
commit | 970ccf4f69080e827008b5da8d8640c202b42306 (patch) | |
tree | 2378056c77896e99c496c6c42dbb0db81d6066b4 /starmath | |
parent | 2762c6dcc1e4839b6e384238adb000024a4f0222 (diff) |
drop unnecessary includes
Diffstat (limited to 'starmath')
-rw-r--r-- | starmath/inc/rect.hxx | 11 | ||||
-rw-r--r-- | starmath/source/rect.cxx | 27 |
2 files changed, 18 insertions, 20 deletions
diff --git a/starmath/inc/rect.hxx b/starmath/inc/rect.hxx index 57cceba3b784..80542dfa0837 100644 --- a/starmath/inc/rect.hxx +++ b/starmath/inc/rect.hxx @@ -31,6 +31,7 @@ #include <new> +#include <rtl/ustring.hxx> #include <tools/gen.hxx> #include <vcl/outdev.hxx> #include <vcl/metric.hxx> @@ -39,9 +40,9 @@ bool SmGetGlyphBoundRect(const OutputDevice &rDev, - const XubString &rText, Rectangle &rRect); + const rtl::OUString &rText, Rectangle &rRect); -bool SmIsMathAlpha(const XubString &rText); +bool SmIsMathAlpha(const rtl::OUString &rText); inline long SmFromTo(long nFrom, long nTo, double fRelDist) @@ -109,9 +110,9 @@ class SmRect protected: void BuildRect (const OutputDevice &rDev, const SmFormat *pFormat, - const XubString &rText, sal_uInt16 nBorderWidth); + const rtl::OUString &rText, sal_uInt16 nBorderWidth); void Init(const OutputDevice &rDev, const SmFormat *pFormat, - const XubString &rText, sal_uInt16 nBorderWidth); + const rtl::OUString &rText, sal_uInt16 nBorderWidth); void ClearBaseline() { bHasBaseline = false; }; inline void CopyMBL(const SmRect& rRect); @@ -122,7 +123,7 @@ protected: public: SmRect(); SmRect(const OutputDevice &rDev, const SmFormat *pFormat, - const XubString &rText, long nBorderWidth); + const rtl::OUString &rText, long nBorderWidth); SmRect(long nWidth, long nHeight); SmRect(const SmRect &rRect); diff --git a/starmath/source/rect.cxx b/starmath/source/rect.cxx index 52f367f4c3f4..879988c769b0 100644 --- a/starmath/source/rect.cxx +++ b/starmath/source/rect.cxx @@ -26,9 +26,6 @@ * ************************************************************************/ - - -#include <tools/string.hxx> #include <osl/diagnose.h> #include <vcl/svapp.hxx> #include <vcl/wrkwin.hxx> @@ -60,14 +57,14 @@ static xub_Unicode const aMathAlpha[] = xub_Unicode('\0') }; -bool SmIsMathAlpha(const XubString &rText) +bool SmIsMathAlpha(const rtl::OUString &rText) // true iff symbol (from StarMath Font) should be treated as letter { - if (rText.Len() == 0) + if (rText.isEmpty()) return false; - OSL_ENSURE(rText.Len() == 1, "Sm : string must be exactly one character long"); - xub_Unicode cChar = rText.GetChar(0); + OSL_ENSURE(rText.getLength() == 1, "Sm : string must be exactly one character long"); + xub_Unicode cChar = rText[0]; // is it a greek symbol? if (xub_Unicode(0xE0AC) <= cChar && cChar <= xub_Unicode(0xE0D4)) @@ -138,7 +135,7 @@ void SmRect::CopyAlignInfo(const SmRect &rRect) void SmRect::BuildRect(const OutputDevice &rDev, const SmFormat *pFormat, - const XubString &rText, sal_uInt16 nBorder) + const rtl::OUString &rText, sal_uInt16 nBorder) { OSL_ENSURE(aTopLeft == Point(0, 0), "Sm: Ooops..."); @@ -227,13 +224,13 @@ void SmRect::BuildRect(const OutputDevice &rDev, const SmFormat *pFormat, if (nLoAttrFence > GetBottom()) nLoAttrFence = GetBottom(); - OSL_ENSURE(rText.Len() == 0 || !IsEmpty(), + OSL_ENSURE(rText.isEmpty() || !IsEmpty(), "Sm: empty rectangle created"); } void SmRect::Init(const OutputDevice &rDev, const SmFormat *pFormat, - const XubString &rText, sal_uInt16 nEBorderWidth) + const rtl::OUString &rText, sal_uInt16 nEBorderWidth) // get rectangle fitting for drawing 'rText' on OutputDevice 'rDev' { BuildRect(rDev, pFormat, rText, nEBorderWidth); @@ -241,7 +238,7 @@ void SmRect::Init(const OutputDevice &rDev, const SmFormat *pFormat, SmRect::SmRect(const OutputDevice &rDev, const SmFormat *pFormat, - const XubString &rText, long nEBorderWidth) + const rtl::OUString &rText, long nEBorderWidth) { OSL_ENSURE( nEBorderWidth >= 0, "BorderWidth is negative" ); if (nEBorderWidth < 0) @@ -613,14 +610,14 @@ SmRect SmRect::AsGlyphRect() const } bool SmGetGlyphBoundRect(const OutputDevice &rDev, - const XubString &rText, Rectangle &rRect) + const rtl::OUString &rText, Rectangle &rRect) // basically the same as 'GetTextBoundRect' (in class 'OutputDevice') // but with a string as argument. { // handle special case first - xub_StrLen nLen = rText.Len(); - if (nLen == 0) - { rRect.SetEmpty(); + if (rText.isEmpty()) + { + rRect.SetEmpty(); return true; } |