[Libreoffice-commits] core.git: starmath/inc starmath/source

Takeshi Abe tabe at fixedpoint.jp
Tue Jan 24 03:10:05 UTC 2017


 starmath/inc/rect.hxx    |    5 +----
 starmath/source/rect.cxx |   23 +++++------------------
 2 files changed, 6 insertions(+), 22 deletions(-)

New commits:
commit c2850bab4f7e5700151a18d806268f2b86a25d56
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date:   Mon Jan 23 12:09:42 2017 +0900

    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 at libreoffice.org>
    Reviewed-by: Takeshi Abe <tabe at fixedpoint.jp>

diff --git a/starmath/inc/rect.hxx b/starmath/inc/rect.hxx
index 5c58b9d..12cae33 100644
--- a/starmath/inc/rect.hxx
+++ b/starmath/inc/rect.hxx
@@ -107,9 +107,6 @@ class SmRect
             bHasAlignInfo;
 
 protected:
-            void BuildRect (const OutputDevice &rDev, const SmFormat *pFormat,
-                            const OUString &rText, sal_uInt16 nBorderWidth);
-
     inline  void CopyMBL(const SmRect& rRect);
             void CopyAlignInfo(const SmRect& rRect);
 
@@ -118,7 +115,7 @@ protected:
 public:
             SmRect();
             SmRect(const OutputDevice &rDev, const SmFormat *pFormat,
-                   const OUString &rText, long nBorderWidth);
+                   const OUString &rText, sal_uInt16 nBorderWidth);
             SmRect(long nWidth, long nHeight);
 
 
diff --git a/starmath/source/rect.cxx b/starmath/source/rect.cxx
index 4b26bca..66a6c27 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!


More information about the Libreoffice-commits mailing list