[Libreoffice-commits] core.git: sc/source

Stephan Bergmann sbergman at redhat.com
Mon Jan 5 02:52:14 PST 2015


 sc/source/ui/optdlg/calcoptionsdlg.cxx |   56 ---------------------------------
 1 file changed, 56 deletions(-)

New commits:
commit 8d98f035cf6c410d4b29bd58d86cfe86127db68b
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Jan 5 11:50:51 2015 +0100

    loplugin:unreffun
    
    class OptionString unused since e224c9cb929cd744674b5d4d265cfb4680c82a2b
    "Refactor OpenCL settings dialog"
    
    Change-Id: I14e6adebaa7ea9d4e733b65ef4ca90e6fe6dbce2

diff --git a/sc/source/ui/optdlg/calcoptionsdlg.cxx b/sc/source/ui/optdlg/calcoptionsdlg.cxx
index da171ca..287fccc 100644
--- a/sc/source/ui/optdlg/calcoptionsdlg.cxx
+++ b/sc/source/ui/optdlg/calcoptionsdlg.cxx
@@ -35,62 +35,6 @@
 
 namespace {
 
-class OptionString : public SvLBoxString
-{
-    OUString maDesc;
-    OUString maValue;
-public:
-    OptionString(const OUString& rDesc, const OUString& rValue) :
-        maDesc(rDesc), maValue(rValue) {}
-
-    void SetValue(const OUString &rValue) { maValue = rValue; }
-
-    virtual void Paint(const Point& rPos, SvTreeListBox& rDev, const SvViewDataEntry* pView, const SvTreeListEntry* pEntry) SAL_OVERRIDE;
-
-    virtual void InitViewData(SvTreeListBox* pView, SvTreeListEntry* pEntry, SvViewDataItem* pViewData) SAL_OVERRIDE;
-};
-
-void OptionString::InitViewData(
-    SvTreeListBox* pView, SvTreeListEntry* pEntry, SvViewDataItem* pViewData)
-{
-    if( !pViewData )
-        pViewData = pView->GetViewDataItem( pEntry, this );
-
-    OUString aDesc = maDesc + ": ";
-    Size aDescSize(pView->GetTextWidth(aDesc), pView->GetTextHeight());
-
-    vcl::Font aOldFont = pView->GetFont();
-    vcl::Font aFont = aOldFont;
-    aFont.SetWeight(WEIGHT_BOLD);
-    //To not make the SvTreeListBox try and recalculate all rows, call the
-    //underlying SetFont, we just want to know what size this text will be
-    //and are going to reset the font to the original again afterwards
-    pView->Control::SetFont(aFont);
-    Size aValueSize(pView->GetTextWidth(maValue), pView->GetTextHeight());
-    pView->Control::SetFont(aOldFont);
-
-    pViewData->maSize = Size(aDescSize.Width() + aValueSize.Width(), std::max(aDescSize.Height(), aValueSize.Height()));
-}
-
-void OptionString::Paint(const Point& rPos, SvTreeListBox& rDev, const SvViewDataEntry* /*pView*/, const SvTreeListEntry* /*pEntry*/)
-{
-    Point aPos = rPos;
-    OUString aDesc = maDesc + ": ";
-    rDev.DrawText(aPos, aDesc);
-
-    aPos.X() += rDev.GetTextWidth(aDesc);
-    vcl::Font aOldFont = rDev.GetFont();
-    vcl::Font aFont = aOldFont;
-    aFont.SetWeight(WEIGHT_BOLD);
-
-    //To not make the SvTreeListBox try and recalculate all rows, call the
-    //underlying SetFont, we are going to draw this string and then going to
-    //reset the font to the original again afterwards
-    rDev.Control::SetFont(aFont);
-    rDev.DrawText(aPos, maValue);
-    rDev.Control::SetFont(aOldFont);
-}
-
 formula::FormulaGrammar::AddressConvention toAddressConvention(sal_Int32 nPos)
 {
     switch (nPos)


More information about the Libreoffice-commits mailing list