[Libreoffice-commits] core.git: basctl/source include/vcl sd/source starmath/source sw/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Tue Dec 17 12:37:06 UTC 2019


 basctl/source/basicide/baside2.cxx              |    2 +-
 include/vcl/outdev.hxx                          |    2 +-
 sd/source/ui/animations/CustomAnimationPane.cxx |    4 ++--
 starmath/source/view.cxx                        |    4 ++--
 sw/source/ui/index/cnttab.cxx                   |    4 ++--
 5 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 253f4ad388f3687140c2c5a03f895b326593d728
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Dec 17 09:45:11 2019 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Dec 17 13:35:43 2019 +0100

    make approximate_char_width private and use approximate_digit_width
    
    Change-Id: I063cb5b9823d374014fd2c8129eba53384b96870
    Reviewed-on: https://gerrit.libreoffice.org/85273
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx
index 5ac30b14432b..868379bd955c 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -834,7 +834,7 @@ sal_Int32 ModulWindow::FormatAndPrint( Printer* pPrinter, sal_Int32 nPrintPage )
 
     // nLinepPage is not correct if there's a line break
     sal_Int32 nLinespPage = aPaperSz.Height()/nLineHeight;
-    long nXTextWidth = pPrinter->approximate_char_width();
+    long nXTextWidth = pPrinter->approximate_digit_width();
 
     sal_Int32 nCharspLine = aPaperSz.Width() / std::max<long>(nXTextWidth, 1);
     const sal_uInt32 nParas = GetEditEngine()->GetParagraphCount();
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index cd3c84d13305..d0578b39095a 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -1140,7 +1140,6 @@ public:
         See also GetTextBoundRect() for more explanation + code examples.
     */
     long                        GetTextHeight() const;
-    float                       approximate_char_width() const;
     float                       approximate_digit_width() const;
 
     void                        DrawTextArray( const Point& rStartPt, const OUString& rStr,
@@ -1177,6 +1176,7 @@ protected:
     SAL_DLLPRIVATE void         ImplInitAboveTextLineSize();
     static
     SAL_DLLPRIVATE long         ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo, long nWidth, const OUString& rStr, DrawTextFlags nStyle, const vcl::ITextLayout& _rLayout );
+    SAL_DLLPRIVATE float        approximate_char_width() const;
 private:
     SAL_DLLPRIVATE void         ImplInitTextColor();
 
diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx
index 42b5055b0e5a..f4de034d7877 100644
--- a/sd/source/ui/animations/CustomAnimationPane.cxx
+++ b/sd/source/ui/animations/CustomAnimationPane.cxx
@@ -161,10 +161,10 @@ void CustomAnimationPane::initialize()
     mpLBAnimation->SetSelectHdl(LINK(this, CustomAnimationPane, AnimationSelectHdl));
     get(mpCustomAnimationList, "custom_animation_list");
     mpCustomAnimationList->setController( dynamic_cast<ICustomAnimationListController*> ( this ) );
-    mpCustomAnimationList->set_width_request(mpCustomAnimationList->approximate_char_width() * 16);
+    mpCustomAnimationList->set_width_request(mpCustomAnimationList->approximate_digit_width() * 15);
     mpCustomAnimationList->set_height_request(mpCustomAnimationList->GetTextHeight() * 8);
 
-    mpLBAnimation->set_width_request(mpLBAnimation->approximate_char_width() * 16);
+    mpLBAnimation->set_width_request(mpLBAnimation->approximate_digit_width() * 15);
     mpLBAnimation->set_height_request(mpLBAnimation->GetTextHeight() * 8);
 
     get(mpPBMoveUp, "move_up");
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index bb12c5563d70..54e6122c8873 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -923,7 +923,7 @@ void SmViewShell::SetZoomFactor( const Fraction &rX, const Fraction &rY )
 Size SmViewShell::GetTextLineSize(OutputDevice const & rDevice, const OUString& rLine)
 {
     Size   aSize(rDevice.GetTextWidth(rLine), rDevice.GetTextHeight());
-    const long nTabPos = rLine.isEmpty() ? 0 : rDevice.approximate_char_width() * 8;
+    const long nTabPos = rLine.isEmpty() ? 0 : rDevice.approximate_digit_width() * 8;
 
     if (nTabPos)
     {
@@ -1005,7 +1005,7 @@ Size SmViewShell::GetTextSize(OutputDevice const & rDevice, const OUString& rTex
 void SmViewShell::DrawTextLine(OutputDevice& rDevice, const Point& rPosition, const OUString& rLine)
 {
     Point aPoint(rPosition);
-    const long nTabPos = rLine.isEmpty() ? 0 : rDevice.approximate_char_width() * 8;
+    const long nTabPos = rLine.isEmpty() ? 0 : rDevice.approximate_digit_width() * 8;
 
     if (nTabPos)
     {
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index 2aa0afdf547d..40a581b4abbe 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -3650,8 +3650,8 @@ std::vector<long> SwEntryBrowseBox::GetOptimalColWidths() const
 {
     std::vector<long> aWidths;
 
-    long nStandardColMinWidth = approximate_char_width() * 16;
-    long nYesNoWidth = approximate_char_width() * 5;
+    long nStandardColMinWidth = approximate_digit_width() * 15;
+    long nYesNoWidth = approximate_digit_width() * 5;
     nYesNoWidth = std::max(nYesNoWidth, GetTextWidth(m_sYes));
     nYesNoWidth = std::max(nYesNoWidth, GetTextWidth(m_sNo));
     for (sal_uInt16 i = 1; i < 6; i++)


More information about the Libreoffice-commits mailing list