diff options
Diffstat (limited to 'cui/source')
-rw-r--r-- | cui/source/dialogs/cuires.src | 10 | ||||
-rw-r--r-- | cui/source/inc/cuires.hrc | 3 | ||||
-rw-r--r-- | cui/source/inc/numfmt.hxx | 3 | ||||
-rw-r--r-- | cui/source/tabpages/numfmt.cxx | 38 |
4 files changed, 52 insertions, 2 deletions
diff --git a/cui/source/dialogs/cuires.src b/cui/source/dialogs/cuires.src index fe97a9c901c9..a738423f593d 100644 --- a/cui/source/dialogs/cuires.src +++ b/cui/source/dialogs/cuires.src @@ -60,6 +60,16 @@ String RID_SVXSTR_AUTO_ENTRY Text [ en-US ] = "Automatic"; }; +String RID_SVXSTR_THOUSAND_SEP +{ + Text [ en-US ] = "Thousands separator"; +}; + +String RID_SVXSTR_ENGINEERING +{ + Text [ en-US ] = "Engineering notation"; +}; + String RID_SVXSTR_EDIT_GRAPHIC { Text [ en-US ] = "Link" ; diff --git a/cui/source/inc/cuires.hrc b/cui/source/inc/cuires.hrc index a8cf111a864a..d6852c35c3c3 100644 --- a/cui/source/inc/cuires.hrc +++ b/cui/source/inc/cuires.hrc @@ -440,6 +440,9 @@ #define RID_SVXSTR_PERSONA_MUSIC (RID_SVX_START + 1288) #define RID_SVXSTR_PERSONA_NATURE (RID_SVX_START + 1289) +#define RID_SVXSTR_THOUSAND_SEP (RID_SVX_START + 1290) +#define RID_SVXSTR_ENGINEERING (RID_SVX_START + 1291) + #define RID_SVXPAGE_OPENCL (RID_SVX_START + 254) #endif diff --git a/cui/source/inc/numfmt.hxx b/cui/source/inc/numfmt.hxx index 65e9f1aa56e2..c4413ab894fd 100644 --- a/cui/source/inc/numfmt.hxx +++ b/cui/source/inc/numfmt.hxx @@ -130,6 +130,8 @@ private: short nFixedCategory; OUString sAutomaticEntry; + OUString sThousandSeparator; + OUString sEngineeringNotation; VclPtr<vcl::Window> pLastActivWindow; @@ -138,6 +140,7 @@ private: void FillFormatListBox_Impl( std::vector<OUString>& rEntries ); void UpdateOptions_Impl( bool bCheckCatChange ); void UpdateFormatListBox_Impl( bool bCat, bool bUpdateEdit ); + void UpdateThousandEngineeringText(); void Obstructing(); void EnableBySourceFormat_Impl(); void SetCategory( sal_uInt16 nPos ); diff --git a/cui/source/tabpages/numfmt.cxx b/cui/source/tabpages/numfmt.cxx index 352077ea2721..5720e2d9ccd1 100644 --- a/cui/source/tabpages/numfmt.cxx +++ b/cui/source/tabpages/numfmt.cxx @@ -243,6 +243,8 @@ SvxNumberFormatTabPage::SvxNumberFormatTabPage(vcl::Window* pParent, , pNumFmtShell(NULL) , nInitFormat(ULONG_MAX) , sAutomaticEntry(CUI_RES(RID_SVXSTR_AUTO_ENTRY)) + , sThousandSeparator(CUI_RES(RID_SVXSTR_THOUSAND_SEP)) + , sEngineeringNotation(CUI_RES(RID_SVXSTR_ENGINEERING)) , pLastActivWindow(NULL) { get(m_pFtCategory, "categoryft"); @@ -355,6 +357,7 @@ void SvxNumberFormatTabPage::Init_Impl() m_pIbAdd->SetClickHdl( HDL( ClickHdl_Impl ) ); m_pIbRemove->SetClickHdl( HDL( ClickHdl_Impl ) ); m_pIbInfo->SetClickHdl( HDL( ClickHdl_Impl ) ); + UpdateThousandEngineeringText(); aLink = LINK( this, SvxNumberFormatTabPage, LostFocusHdl_Impl); @@ -907,7 +910,7 @@ void SvxNumberFormatTabPage::FillFormatListBox_Impl( std::vector<OUString>& rEnt void SvxNumberFormatTabPage::UpdateOptions_Impl( bool bCheckCatChange /*= sal_False*/ ) { - OUString theFormat = m_pEdFormat->GetText(); + OUString theFormat = m_pEdFormat->GetText(); sal_Int32 nCurCategory = m_pLbCategory->GetSelectEntryPos(); sal_uInt16 nCategory = static_cast<sal_uInt16>(nCurCategory); sal_uInt16 nDecimals = 0; @@ -965,10 +968,18 @@ void SvxNumberFormatTabPage::UpdateOptions_Impl( bool bCheckCatChange /*= sal_Fa switch ( nCategory ) { + case CAT_SCIENTIFIC: // bThousand is for Engineering notation + { + sal_uInt16 nIntDigits = pNumFmtShell->GetFormatIntegerDigits(theFormat); + if ( (nIntDigits > 0) && (nIntDigits % 3 == 0) ) + bThousand = true; + else + bThousand = false; + } + // fallthru case CAT_NUMBER: case CAT_PERCENT: case CAT_CURRENCY: - case CAT_SCIENTIFIC: m_pFtOptions->Enable(); m_pFtDecimals->Enable(); m_pEdDecimals->Enable(); @@ -1002,6 +1013,7 @@ void SvxNumberFormatTabPage::UpdateOptions_Impl( bool bCheckCatChange /*= sal_Fa m_pBtnNegRed->Check( false ); m_pBtnThousand->Check( false ); } + UpdateThousandEngineeringText(); } @@ -1113,6 +1125,28 @@ void SvxNumberFormatTabPage::UpdateFormatListBox_Impl /************************************************************************* +#* Method: UpdateThousandEngineeringText +#*------------------------------------------------------------------------ +#* +#* Class: SvxNumberFormatTabPage +#* Function: Updates the text of Thousands seprator checkbox +#* if scientific format "Engineering notation" +#* else "Thousands separator" +#* Input: --- +#* Output: --- +#* +#************************************************************************/ + +void SvxNumberFormatTabPage::UpdateThousandEngineeringText() +{ + if ( m_pLbCategory->GetSelectEntryPos() == CAT_SCIENTIFIC ) + m_pBtnThousand->SetText(sEngineeringNotation); + else + m_pBtnThousand->SetText(sThousandSeparator); +} + + +/************************************************************************* #* Handle: DoubleClickHdl_Impl #*------------------------------------------------------------------------ #* |