[Libreoffice-commits] core.git: 2 commits - sw/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Thu Oct 3 07:53:23 UTC 2019


 sw/source/ui/dbui/dbinsdlg.cxx      |    2 
 sw/source/ui/fldui/flddb.cxx        |    2 
 sw/source/ui/fldui/flddb.hxx        |    2 
 sw/source/uibase/inc/dbinsdlg.hxx   |    2 
 sw/source/uibase/inc/numfmtlb.hxx   |   46 ----
 sw/source/uibase/utlui/numfmtlb.cxx |  357 +-----------------------------------
 6 files changed, 17 insertions(+), 394 deletions(-)

New commits:
commit f0b4b42c39b314019438770c45778da2c6645d6c
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Oct 2 17:34:37 2019 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Oct 3 09:51:58 2019 +0200

    rename SwNumFormatListBox back to NumFormatListBox
    
    Change-Id: Ie5d5a3d4bfad52d1f758a6b4e017a7f685630e97
    Reviewed-on: https://gerrit.libreoffice.org/80066
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx
index dc595d295667..a78e7acd2601 100644
--- a/sw/source/ui/dbui/dbinsdlg.cxx
+++ b/sw/source/ui/dbui/dbinsdlg.cxx
@@ -200,7 +200,7 @@ SwInsertDBColAutoPilot::SwInsertDBColAutoPilot( SwView& rView,
     , m_xFormatFrame(m_xBuilder->weld_frame("formatframe"))
     , m_xRbDbFormatFromDb(m_xBuilder->weld_radio_button("fromdatabase"))
     , m_xRbDbFormatFromUsr(m_xBuilder->weld_radio_button("userdefined"))
-    , m_xLbDbFormatFromUsr(new SwNumFormatListBox(m_xBuilder->weld_combo_box("numformat")))
+    , m_xLbDbFormatFromUsr(new NumFormatListBox(m_xBuilder->weld_combo_box("numformat")))
     , m_xIbDbcolToEdit(m_xBuilder->weld_button("toedit"))
     , m_xEdDbText(m_xBuilder->weld_text_view("textview"))
     , m_xFtDbParaColl(m_xBuilder->weld_label("parastylelabel"))
diff --git a/sw/source/ui/fldui/flddb.cxx b/sw/source/ui/fldui/flddb.cxx
index 1dc625e19298..fc4dbde5f978 100644
--- a/sw/source/ui/fldui/flddb.cxx
+++ b/sw/source/ui/fldui/flddb.cxx
@@ -46,7 +46,7 @@ SwFieldDBPage::SwFieldDBPage(weld::Container* pPage, weld::DialogController* pCo
     , m_xValueED(m_xBuilder->weld_entry("recnumber"))
     , m_xDBFormatRB(m_xBuilder->weld_radio_button("fromdatabasecb"))
     , m_xNewFormatRB(m_xBuilder->weld_radio_button("userdefinedcb"))
-    , m_xNumFormatLB(new SwNumFormatListBox(m_xBuilder->weld_combo_box("numformat")))
+    , m_xNumFormatLB(new NumFormatListBox(m_xBuilder->weld_combo_box("numformat")))
     , m_xFormatLB(m_xBuilder->weld_combo_box("format"))
     , m_xFormat(m_xBuilder->weld_widget("formatframe"))
 {
diff --git a/sw/source/ui/fldui/flddb.hxx b/sw/source/ui/fldui/flddb.hxx
index ad16a62863bf..ed499cbe9755 100644
--- a/sw/source/ui/fldui/flddb.hxx
+++ b/sw/source/ui/fldui/flddb.hxx
@@ -42,7 +42,7 @@ class SwFieldDBPage : public SwFieldPage
     std::unique_ptr<weld::Entry> m_xValueED;
     std::unique_ptr<weld::RadioButton> m_xDBFormatRB;
     std::unique_ptr<weld::RadioButton> m_xNewFormatRB;
-    std::unique_ptr<SwNumFormatListBox> m_xNumFormatLB;
+    std::unique_ptr<NumFormatListBox> m_xNumFormatLB;
     std::unique_ptr<weld::ComboBox> m_xFormatLB;
     std::unique_ptr<weld::Widget> m_xFormat;
 
diff --git a/sw/source/uibase/inc/dbinsdlg.hxx b/sw/source/uibase/inc/dbinsdlg.hxx
index 37053e036596..df31a2135ec7 100644
--- a/sw/source/uibase/inc/dbinsdlg.hxx
+++ b/sw/source/uibase/inc/dbinsdlg.hxx
@@ -102,7 +102,7 @@ class SwInsertDBColAutoPilot : public SfxDialogController, public utl::ConfigIte
     std::unique_ptr<weld::Frame> m_xFormatFrame;
     std::unique_ptr<weld::RadioButton> m_xRbDbFormatFromDb;
     std::unique_ptr<weld::RadioButton> m_xRbDbFormatFromUsr;
-    std::unique_ptr<SwNumFormatListBox> m_xLbDbFormatFromUsr;
+    std::unique_ptr<NumFormatListBox> m_xLbDbFormatFromUsr;
 
     // Page Text/Field
     std::unique_ptr<weld::Button> m_xIbDbcolToEdit;
diff --git a/sw/source/uibase/inc/numfmtlb.hxx b/sw/source/uibase/inc/numfmtlb.hxx
index cdcba993256c..13d9c0cc2c46 100644
--- a/sw/source/uibase/inc/numfmtlb.hxx
+++ b/sw/source/uibase/inc/numfmtlb.hxx
@@ -71,7 +71,7 @@ public:
     virtual ~SwNumFormatBase() {}
 };
 
-class SW_DLLPUBLIC SwNumFormatListBox : public SwNumFormatBase
+class SW_DLLPUBLIC NumFormatListBox : public SwNumFormatBase
 {
     std::unique_ptr<weld::ComboBox> mxControl;
 
@@ -80,7 +80,7 @@ class SW_DLLPUBLIC SwNumFormatListBox : public SwNumFormatBase
     virtual void Init() override;
 
 public:
-    SwNumFormatListBox(std::unique_ptr<weld::ComboBox> xControl);
+    NumFormatListBox(std::unique_ptr<weld::ComboBox> xControl);
 
     virtual sal_uInt32 GetFormat() const override;
 
diff --git a/sw/source/uibase/utlui/numfmtlb.cxx b/sw/source/uibase/utlui/numfmtlb.cxx
index bd70d7b8ae97..3fe4c0ef8fa2 100644
--- a/sw/source/uibase/utlui/numfmtlb.cxx
+++ b/sw/source/uibase/utlui/numfmtlb.cxx
@@ -129,7 +129,7 @@ SwNumFormatBase::SwNumFormatBase()
 {
 }
 
-SwNumFormatListBox::SwNumFormatListBox(std::unique_ptr<weld::ComboBox> xControl)
+NumFormatListBox::NumFormatListBox(std::unique_ptr<weld::ComboBox> xControl)
     : mxControl(std::move(xControl))
 {
     Init();
@@ -154,11 +154,11 @@ void SwNumFormatBase::Init()
     SetDefFormat(nDefFormat);
 }
 
-void SwNumFormatListBox::Init()
+void NumFormatListBox::Init()
 {
     SwNumFormatBase::Init();
 
-    mxControl->connect_changed(LINK(this, SwNumFormatListBox, SelectHdl));
+    mxControl->connect_changed(LINK(this, NumFormatListBox, SelectHdl));
 }
 
 void SwNumFormatTreeView::Init()
@@ -361,7 +361,7 @@ void SwNumFormatBase::SetDefFormat(const sal_uInt32 nDefaultFormat)
     nDefFormat = GetFormat();
 }
 
-sal_uInt32 SwNumFormatListBox::GetFormat() const
+sal_uInt32 NumFormatListBox::GetFormat() const
 {
     return mxControl->get_active_id().toUInt32();
 }
@@ -447,7 +447,7 @@ void SwNumFormatBase::CallSelectHdl()
 
 }
 
-IMPL_LINK_NOARG(SwNumFormatListBox, SelectHdl, weld::ComboBox&, void)
+IMPL_LINK_NOARG(NumFormatListBox, SelectHdl, weld::ComboBox&, void)
 {
     CallSelectHdl();
 }
@@ -463,7 +463,7 @@ void SwNumFormatBase::clear()
     nCurrFormatType = SvNumFormatType::ALL;
 }
 
-void SwNumFormatListBox::clear()
+void NumFormatListBox::clear()
 {
     mxControl->clear();
     SwNumFormatBase::clear();
commit fedf42c0a0d1ebe0c16516467a0730d350fa37dc
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Oct 2 17:28:58 2019 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Oct 3 09:51:20 2019 +0200

    NumFormatListBox is unused
    
    Change-Id: I19292f1b1a2eb5abf250a222d0bdb254ae7350f2
    Reviewed-on: https://gerrit.libreoffice.org/80065
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/uibase/inc/numfmtlb.hxx b/sw/source/uibase/inc/numfmtlb.hxx
index 5349665ce317..cdcba993256c 100644
--- a/sw/source/uibase/inc/numfmtlb.hxx
+++ b/sw/source/uibase/inc/numfmtlb.hxx
@@ -26,47 +26,6 @@
 
 class SwView;
 
-class SW_DLLPUBLIC NumFormatListBox : public ListBox
-{
-    SvNumFormatType     nCurrFormatType;
-    bool                mbCurrFormatTypeNeedsInit;
-    sal_Int32           nStdEntry;
-    bool                bOneArea;
-    sal_uInt32          nDefFormat;
-    LanguageType        eCurLanguage;
-    bool                bShowLanguageControl; //determine whether the language control has
-                                              //to be shown in the number format dialog
-    bool                bUseAutomaticLanguage;//determine whether language is automatically assigned
-
-    DECL_DLLPRIVATE_LINK( SelectHdl, ListBox&, void );
-
-    SAL_DLLPRIVATE void            Init();
-
-public:
-    NumFormatListBox(vcl::Window* pWin, WinBits nStyle);
-
-    virtual ~NumFormatListBox() override;
-
-    void            Clear();
-
-    void     SetOneArea(bool bOnlyOne) { bOneArea = bOnlyOne; }
-
-    void            SetFormatType(const SvNumFormatType nFormatType);
-    SvNumFormatType GetFormatType() const { return nCurrFormatType; }
-    void            SetDefFormat(const sal_uInt32 nDefFormat);
-    sal_uInt32      GetFormat() const;
-
-    LanguageType GetCurLanguage() const { return eCurLanguage;}
-    void                SetLanguage(LanguageType eSet)  { eCurLanguage = eSet;}
-
-    void            SetAutomaticLanguage(bool bSet){bUseAutomaticLanguage = bSet;}
-    bool            IsAutomaticLanguage()const {return bUseAutomaticLanguage;}
-
-    void            SetShowLanguageControl(bool bSet){bShowLanguageControl = bSet;}
-
-    SAL_DLLPRIVATE static double   GetDefValue(const SvNumFormatType nFormatType);
-};
-
 class SW_DLLPUBLIC SwNumFormatBase
 {
 protected:
@@ -88,6 +47,7 @@ public:
     LanguageType GetCurLanguage() const { return eCurLanguage;}
     void SetLanguage(LanguageType eSet)  { eCurLanguage = eSet; }
     void SetShowLanguageControl(bool bSet) { bShowLanguageControl = bSet; }
+    SAL_DLLPRIVATE static double GetDefValue(const SvNumFormatType nFormatType);
     void SetOneArea(bool bOnlyOne) { bOneArea = bOnlyOne; }
 
     void SetFormatType(const SvNumFormatType nFormatType);
diff --git a/sw/source/uibase/utlui/numfmtlb.cxx b/sw/source/uibase/utlui/numfmtlb.cxx
index 078a85278181..bd70d7b8ae97 100644
--- a/sw/source/uibase/utlui/numfmtlb.cxx
+++ b/sw/source/uibase/utlui/numfmtlb.cxx
@@ -48,195 +48,6 @@ using namespace ::com::sun::star::lang;
  *     nDefaultFormat: Select this format and possibly insert it
  */
 
-NumFormatListBox::NumFormatListBox(vcl::Window* pWin, WinBits nStyle) :
-    ListBox             ( pWin, nStyle ),
-    nCurrFormatType     (SvNumFormatType::ALL),
-    mbCurrFormatTypeNeedsInit(true),
-    nStdEntry           (0),
-    bOneArea            (false),
-    nDefFormat          (0),
-    bShowLanguageControl(false),
-    bUseAutomaticLanguage(true)
-{
-    Init();
-}
-
-extern "C" SAL_DLLPUBLIC_EXPORT void makeNumFormatListBox(VclPtr<vcl::Window> & rRet, const VclPtr<vcl::Window> & pParent, VclBuilder::stringmap & rMap)
-{
-    static_assert(std::is_same_v<std::remove_pointer_t<VclBuilder::customMakeWidget>,
-                                 decltype(makeNumFormatListBox)>);
-    WinBits nBits = WB_LEFT|WB_VCENTER|WB_3DLOOK;
-
-    bool bDropdown = BuilderUtils::extractDropdown(rMap);
-
-    if (bDropdown)
-        nBits |= WB_DROPDOWN;
-    else
-        nBits |= WB_BORDER;
-
-    VclPtrInstance<NumFormatListBox> pListBox(pParent, nBits|WB_SIMPLEMODE);
-
-    if (bDropdown)
-        pListBox->EnableAutoSize(true);
-
-    rRet = pListBox;
-}
-
-void NumFormatListBox::Init()
-{
-    SwView *pView = GetActiveView();
-
-    if (pView)
-        eCurLanguage = pView->GetWrtShell().GetCurLang();
-    else
-        eCurLanguage = SvtSysLocale().GetLanguageTag().getLanguageType();
-
-    SetFormatType(SvNumFormatType::NUMBER);
-    SetDefFormat(nDefFormat);
-
-    SetSelectHdl(LINK(this, NumFormatListBox, SelectHdl));
-}
-
-NumFormatListBox::~NumFormatListBox()
-{
-    disposeOnce();
-}
-
-void NumFormatListBox::SetFormatType(const SvNumFormatType nFormatType)
-{
-    if (!mbCurrFormatTypeNeedsInit &&
-        (nCurrFormatType & nFormatType))   // there are mixed formats, like for example DateTime
-        return;
-
-    SwView *pView = GetActiveView();
-    OSL_ENSURE(pView, "no view found");
-    if(!pView)
-        return;
-    SwWrtShell &rSh = pView->GetWrtShell();
-    SvNumberFormatter* pFormatter = rSh.GetNumberFormatter();
-
-    Clear();    // Remove all entries from the Listbox
-
-    NfIndexTableOffset eOffsetStart = NF_NUMBER_START;
-    NfIndexTableOffset eOffsetEnd = NF_NUMBER_START;
-
-    switch( nFormatType )
-    {
-    case SvNumFormatType::NUMBER:
-        eOffsetStart=NF_NUMBER_START;
-        eOffsetEnd=NF_NUMBER_END;
-        break;
-
-    case SvNumFormatType::PERCENT:
-        eOffsetStart=NF_PERCENT_START;
-        eOffsetEnd=NF_PERCENT_END;
-        break;
-
-    case SvNumFormatType::CURRENCY:
-        eOffsetStart=NF_CURRENCY_START;
-        eOffsetEnd=NF_CURRENCY_END;
-        break;
-
-    case SvNumFormatType::DATETIME:
-        eOffsetStart=NF_DATE_START;
-        eOffsetEnd=NF_TIME_END;
-        break;
-
-    case SvNumFormatType::DATE:
-        eOffsetStart=NF_DATE_START;
-        eOffsetEnd=NF_DATE_END;
-        break;
-
-    case SvNumFormatType::TIME:
-        eOffsetStart=NF_TIME_START;
-        eOffsetEnd=NF_TIME_END;
-        break;
-
-    case SvNumFormatType::SCIENTIFIC:
-        eOffsetStart=NF_SCIENTIFIC_START;
-        eOffsetEnd=NF_SCIENTIFIC_END;
-        break;
-
-    case SvNumFormatType::FRACTION:
-        eOffsetStart=NF_FRACTION_START;
-        eOffsetEnd=NF_FRACTION_END;
-        break;
-
-    case SvNumFormatType::LOGICAL:
-        eOffsetStart=NF_BOOLEAN;
-        eOffsetEnd=NF_BOOLEAN;
-        break;
-
-    case SvNumFormatType::TEXT:
-        eOffsetStart=NF_TEXT;
-        eOffsetEnd=NF_TEXT;
-        break;
-
-    case SvNumFormatType::ALL:
-        eOffsetStart=NF_NUMERIC_START;
-        eOffsetEnd = NfIndexTableOffset( NF_INDEX_TABLE_ENTRIES - 1 );
-        break;
-
-    default:
-        OSL_FAIL("what a format?");
-        break;
-    }
-
-    const SvNumberformat* pFormat;
-    sal_Int32 i = 0;
-    Color* pCol;
-    double fVal = GetDefValue( nFormatType );
-    OUString sValue;
-
-    const sal_uInt32 nSysNumFormat = pFormatter->GetFormatIndex(
-                                    NF_NUMBER_SYSTEM, eCurLanguage );
-    const sal_uInt32 nSysShortDateFormat = pFormatter->GetFormatIndex(
-                                    NF_DATE_SYSTEM_SHORT, eCurLanguage );
-    const sal_uInt32 nSysLongDateFormat = pFormatter->GetFormatIndex(
-                                    NF_DATE_SYSTEM_LONG, eCurLanguage );
-
-    for( long nIndex = eOffsetStart; nIndex <= eOffsetEnd; ++nIndex )
-    {
-        const sal_uInt32 nFormat = pFormatter->GetFormatIndex(
-                        static_cast<NfIndexTableOffset>(nIndex), eCurLanguage );
-        pFormat = pFormatter->GetEntry( nFormat );
-
-        if( nFormat == pFormatter->GetFormatIndex( NF_NUMBER_STANDARD,
-                                                    eCurLanguage )
-            || const_cast<SvNumberformat*>(pFormat)->GetOutputString( fVal, sValue, &pCol )
-            || nFormatType == SvNumFormatType::UNDEFINED )
-        {
-            sValue = pFormat->GetFormatstring();
-        }
-        else if( nFormatType == SvNumFormatType::TEXT )
-        {
-            pFormatter->GetOutputString( "\"ABC\"", nFormat, sValue, &pCol);
-        }
-
-        if (nFormat != nSysNumFormat       &&
-            nFormat != nSysShortDateFormat &&
-            nFormat != nSysLongDateFormat)
-        {
-            const sal_Int32 nPos = InsertEntry( sValue );
-            SetEntryData( nPos, reinterpret_cast<void*>(nFormat) );
-
-            if( nFormat == pFormatter->GetStandardFormat(
-                                    nFormatType, eCurLanguage ) )
-                nStdEntry = i;
-            ++i;
-        }
-    }
-
-    const sal_Int32 nPos = InsertEntry(SwResId( STR_DEFINE_NUMBERFORMAT ));
-    SetEntryData( nPos, nullptr );
-
-    SelectEntryPos( nStdEntry );
-
-    nCurrFormatType = nFormatType;
-    mbCurrFormatTypeNeedsInit = false;
-
-}
-
 namespace
 {
 
@@ -267,148 +78,7 @@ bool lcl_isSystemFormat(sal_uInt32 nDefaultFormat, SvNumberFormatter* pFormatter
 
 }
 
-void NumFormatListBox::SetDefFormat(const sal_uInt32 nDefaultFormat)
-{
-    if (nDefaultFormat == NUMBERFORMAT_ENTRY_NOT_FOUND)
-    {
-        nDefFormat = nDefaultFormat;
-        return;
-    }
-
-    SwView *pView = GetActiveView();
-    OSL_ENSURE(pView, "no view found");
-    if(!pView)
-        return;
-    SwWrtShell &rSh = pView->GetWrtShell();
-    SvNumberFormatter* pFormatter = rSh.GetNumberFormatter();
-
-    SvNumFormatType nType = pFormatter->GetType(nDefaultFormat);
-
-    SetFormatType(nType);
-
-    sal_uInt32 nFormat = pFormatter->GetFormatForLanguageIfBuiltIn(nDefaultFormat, eCurLanguage);
-
-    for (sal_Int32 i = 0; i < GetEntryCount(); i++)
-    {
-        if (nFormat == static_cast<sal_uInt32>(reinterpret_cast<sal_uIntPtr>(GetEntryData(i))))
-        {
-            SelectEntryPos(i);
-            nStdEntry = i;
-            nDefFormat = GetFormat();
-            return;
-        }
-    }
-
-    // No entry found:
-    OUString sValue;
-    Color* pCol = nullptr;
-
-    if (nType == SvNumFormatType::TEXT)
-    {
-        pFormatter->GetOutputString("\"ABC\"", nDefaultFormat, sValue, &pCol);
-    }
-    else
-    {
-        pFormatter->GetOutputString(GetDefValue(nType), nDefaultFormat, sValue, &pCol);
-    }
-
-    sal_Int32 nPos = 0;
-    while (static_cast<sal_uInt32>(reinterpret_cast<sal_uIntPtr>(GetEntryData(nPos))) == NUMBERFORMAT_ENTRY_NOT_FOUND)
-        nPos++;
-
-    if ( lcl_isSystemFormat(nDefaultFormat, pFormatter, eCurLanguage) )
-    {
-        sValue += SwResId(RID_STR_SYSTEM);
-    }
-
-    nPos = InsertEntry(sValue, nPos);   // Insert as first numeric entry
-    SetEntryData(nPos, reinterpret_cast<void*>(nDefaultFormat));
-    SelectEntryPos(nPos);
-    nDefFormat = GetFormat();
-}
-
-sal_uInt32 NumFormatListBox::GetFormat() const
-{
-    sal_Int32 nPos = GetSelectedEntryPos();
-
-    return static_cast<sal_uInt32>(reinterpret_cast<sal_uIntPtr>(GetEntryData(nPos)));
-}
-
-IMPL_LINK( NumFormatListBox, SelectHdl, ListBox&, rBox, void )
-{
-    const sal_Int32 nPos = rBox.GetSelectedEntryPos();
-    OUString sDefine(SwResId( STR_DEFINE_NUMBERFORMAT ));
-    SwView *pView = GetActiveView();
-
-    if( !pView || nPos != rBox.GetEntryCount() - 1 ||
-        rBox.GetEntry( nPos ) != sDefine )
-        return;
-
-    SwWrtShell &rSh = pView->GetWrtShell();
-    SvNumberFormatter* pFormatter = rSh.GetNumberFormatter();
-
-    SfxItemSet aCoreSet(
-        rSh.GetAttrPool(),
-        svl::Items<
-            SID_ATTR_NUMBERFORMAT_VALUE, SID_ATTR_NUMBERFORMAT_INFO,
-            SID_ATTR_NUMBERFORMAT_ONE_AREA, SID_ATTR_NUMBERFORMAT_ONE_AREA,
-            SID_ATTR_NUMBERFORMAT_NOLANGUAGE,
-                SID_ATTR_NUMBERFORMAT_NOLANGUAGE,
-            SID_ATTR_NUMBERFORMAT_ADD_AUTO,
-                SID_ATTR_NUMBERFORMAT_ADD_AUTO>{});
-
-    double fValue = GetDefValue( nCurrFormatType);
-
-    sal_uInt32 nFormat = pFormatter->GetStandardFormat( nCurrFormatType, eCurLanguage);
-    aCoreSet.Put( SfxUInt32Item( SID_ATTR_NUMBERFORMAT_VALUE, nFormat ));
-
-    aCoreSet.Put( SvxNumberInfoItem( pFormatter, fValue,
-                                        SID_ATTR_NUMBERFORMAT_INFO ) );
-
-    if( (SvNumFormatType::DATE | SvNumFormatType::TIME) & nCurrFormatType )
-        aCoreSet.Put(SfxBoolItem(SID_ATTR_NUMBERFORMAT_ONE_AREA, bOneArea));
-
-    aCoreSet.Put(SfxBoolItem(SID_ATTR_NUMBERFORMAT_NOLANGUAGE, !bShowLanguageControl));
-    aCoreSet.Put(SfxBoolItem(SID_ATTR_NUMBERFORMAT_ADD_AUTO, bUseAutomaticLanguage));
-
-    SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-    ScopedVclPtr<SfxAbstractDialog> pDlg(pFact->CreateNumFormatDialog(GetFrameWeld(), aCoreSet));
-
-    if (RET_OK == pDlg->Execute())
-    {
-        const SfxPoolItem* pItem = pView->GetDocShell()->
-                        GetItem( SID_ATTR_NUMBERFORMAT_INFO );
-
-        if( pItem )
-        {
-            for ( sal_uInt32 key : static_cast<const SvxNumberInfoItem*>(pItem)->GetDelFormats() )
-                pFormatter->DeleteEntry( key );
-        }
-
-        const SfxItemSet* pOutSet = pDlg->GetOutputItemSet();
-        if( SfxItemState::SET == pOutSet->GetItemState(
-            SID_ATTR_NUMBERFORMAT_VALUE, false, &pItem ))
-        {
-            sal_uInt32 nNumberFormat = static_cast<const SfxUInt32Item*>(pItem)->GetValue();
-            // oj #105473# change order of calls
-            const SvNumberformat* pFormat = pFormatter->GetEntry(nNumberFormat);
-            if( pFormat )
-                eCurLanguage = pFormat->GetLanguage();
-            // SetDefFormat uses eCurLanguage to look for if this format already in the list
-            SetDefFormat(nNumberFormat);
-        }
-        if( bShowLanguageControl && SfxItemState::SET == pOutSet->GetItemState(
-            SID_ATTR_NUMBERFORMAT_ADD_AUTO, false, &pItem ))
-        {
-            bUseAutomaticLanguage = static_cast<const SfxBoolItem*>(pItem)->GetValue();
-        }
-    }
-    else
-        SetDefFormat(nFormat);
-
-}
-
-double NumFormatListBox::GetDefValue(const SvNumFormatType nFormatType)
+double SwNumFormatBase::GetDefValue(const SvNumFormatType nFormatType)
 {
     SvxNumValCategory nDefValue = SvxNumValCategory::Standard;
 
@@ -448,13 +118,6 @@ double NumFormatListBox::GetDefValue(const SvNumFormatType nFormatType)
     return fSvxNumValConst[nDefValue];
 }
 
-void NumFormatListBox::Clear()
-{
-    ListBox::Clear();
-    mbCurrFormatTypeNeedsInit = true;
-    nCurrFormatType = SvNumFormatType::ALL;
-}
-
 SwNumFormatBase::SwNumFormatBase()
     : nCurrFormatType(SvNumFormatType::ALL)
     , mbCurrFormatTypeNeedsInit(true)
@@ -588,7 +251,7 @@ void SwNumFormatBase::SetFormatType(const SvNumFormatType nFormatType)
     const SvNumberformat* pFormat;
     sal_Int32 i = 0;
     Color* pCol;
-    double fVal = NumFormatListBox::GetDefValue(nFormatType);
+    double fVal = SwNumFormatBase::GetDefValue(nFormatType);
     OUString sValue;
 
     const sal_uInt32 nSysNumFormat = pFormatter->GetFormatIndex(
@@ -680,7 +343,7 @@ void SwNumFormatBase::SetDefFormat(const sal_uInt32 nDefaultFormat)
     }
     else
     {
-        pFormatter->GetOutputString(NumFormatListBox::GetDefValue(nType), nDefaultFormat, sValue, &pCol);
+        pFormatter->GetOutputString(SwNumFormatBase::GetDefValue(nType), nDefaultFormat, sValue, &pCol);
     }
 
     sal_Int32 nPos = 0;
@@ -730,7 +393,7 @@ void SwNumFormatBase::CallSelectHdl()
             SID_ATTR_NUMBERFORMAT_ADD_AUTO,
                 SID_ATTR_NUMBERFORMAT_ADD_AUTO>{});
 
-    double fValue = NumFormatListBox::GetDefValue(nCurrFormatType);
+    double fValue = SwNumFormatBase::GetDefValue(nCurrFormatType);
 
     sal_uInt32 nFormat = pFormatter->GetStandardFormat( nCurrFormatType, eCurLanguage);
     aCoreSet.Put( SfxUInt32Item( SID_ATTR_NUMBERFORMAT_VALUE, nFormat ));


More information about the Libreoffice-commits mailing list