summaryrefslogtreecommitdiff
path: root/starmath/source/rect.cxx
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2017-01-23 12:09:42 +0900
committerTakeshi Abe <tabe@fixedpoint.jp>2017-01-24 03:09:37 +0000
commitc2850bab4f7e5700151a18d806268f2b86a25d56 (patch)
tree01101b1157f547e4f11b464b72d443311def0039 /starmath/source/rect.cxx
parent4ef8740c98e6db96832191985e5cd49ca94be0bf (diff)
starmath: Inline and remove SmRect::BuildRect()
because a ctor was its only client. Change-Id: I31cce925231210930576bf93396f9d7aa44a5a71 Reviewed-on: https://gerrit.libreoffice.org/33414 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Takeshi Abe <tabe@fixedpoint.jp>
Diffstat (limited to 'starmath/source/rect.cxx')
-rw-r--r--starmath/source/rect.cxx23
1 files changed, 5 insertions, 18 deletions
diff --git a/starmath/source/rect.cxx b/starmath/source/rect.cxx
index 4b26bcae42b8..66a6c27f1fdf 100644
--- a/starmath/source/rect.cxx
+++ b/starmath/source/rect.cxx
@@ -107,13 +107,12 @@ void SmRect::CopyAlignInfo(const SmRect &rRect)
}
-void SmRect::BuildRect(const OutputDevice &rDev, const SmFormat *pFormat,
- const OUString &rText, sal_uInt16 nBorder)
+SmRect::SmRect(const OutputDevice &rDev, const SmFormat *pFormat,
+ const OUString &rText, sal_uInt16 nBorder)
+ // get rectangle fitting for drawing 'rText' on OutputDevice 'rDev'
+ : aTopLeft(0, 0)
+ , aSize(rDev.GetTextWidth(rText), rDev.GetTextHeight())
{
- OSL_ENSURE(aTopLeft == Point(0, 0), "Sm: Ooops...");
-
- aSize = Size(rDev.GetTextWidth(rText), rDev.GetTextHeight());
-
const FontMetric aFM (rDev.GetFontMetric());
bool bIsMath = aFM.GetFamilyName().equalsIgnoreAsciiCase( FONTNAME_MATH );
bool bAllowSmaller = bIsMath && !SmIsMathAlpha(rText);
@@ -195,18 +194,6 @@ void SmRect::BuildRect(const OutputDevice &rDev, const SmFormat *pFormat,
}
-
-SmRect::SmRect(const OutputDevice &rDev, const SmFormat *pFormat,
- const OUString &rText, long nEBorderWidth)
-{
- OSL_ENSURE( nEBorderWidth >= 0, "BorderWidth is negative" );
- if (nEBorderWidth < 0)
- nEBorderWidth = 0;
- // get rectangle fitting for drawing 'rText' on OutputDevice 'rDev'
- BuildRect(rDev, pFormat, rText, sal::static_int_cast<sal_uInt16>(nEBorderWidth));
-}
-
-
SmRect::SmRect(long nWidth, long nHeight)
// this constructor should never be used for anything textlike because
// it will not provide useful values for baseline, AlignT and AlignB!