diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-07-28 16:43:06 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-07-31 22:00:27 +0200 |
commit | 90ac4671c13ed4f548bb4188355b02217b9e24ba (patch) | |
tree | b07d9238cbe7b7d39530b6e18875196278790368 /sc | |
parent | d62d07b3d29014f76c0d676c891cbafa80d0765f (diff) |
make IntlWrapper arg to GetPresentation non-implicit and non-optional
which requires explicitly adding null in
1) SdrItemBrowserControl::SetAttributes(const SfxItemSet* pSet, const SfxItemSet* p2ndSet)
where SdrItemBrowserControl is only used by SdrItemBrowser and the only use of that is
within DBG_UTIL in SdrPaintView
2) SwCursorShell::GetContentAtPos( const Point& rPt,
within a #ifdef DBG_UTIL block in
3) SvxSearchDialog::BuildAttrText_Impl( OUString& rStr,
bool bSrchFlag ) const
where the other branch uses SvxResId
4) SfxPoolItem::dumpAsXml(xmlTextWriterPtr pWriter) const
5) XFillStyleItem::dumpAsXml(xmlTextWriterPtr pWriter) const
looks very much like all uses (outside the dumpers) are intended
to be in the ui locale
results in that INetContentTypes::GetPresentation always called with UI Locale
Change-Id: I5a110c107838b4db3c355476426d6532f2b6ce52
Reviewed-on: https://gerrit.libreoffice.org/40538
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/attrib.hxx | 10 | ||||
-rw-r--r-- | sc/inc/docpool.hxx | 2 | ||||
-rw-r--r-- | sc/inc/global.hxx | 1 | ||||
-rw-r--r-- | sc/source/core/data/attrib.cxx | 10 | ||||
-rw-r--r-- | sc/source/core/data/docpool.cxx | 20 | ||||
-rw-r--r-- | sc/source/core/data/global.cxx | 10 |
6 files changed, 19 insertions, 34 deletions
diff --git a/sc/inc/attrib.hxx b/sc/inc/attrib.hxx index b2f82d2046d2..f1250400118c 100644 --- a/sc/inc/attrib.hxx +++ b/sc/inc/attrib.hxx @@ -128,7 +128,7 @@ public: MapUnit eCoreMetric, MapUnit ePresMetric, OUString& rText, - const IntlWrapper* pIntl = nullptr ) const override; + const IntlWrapper& rIntl ) const override; virtual bool operator==( const SfxPoolItem& ) const override; virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override; @@ -170,7 +170,7 @@ public: MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, - const IntlWrapper* pIntl = nullptr ) const override; + const IntlWrapper& rIntl ) const override; virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override; private: @@ -209,7 +209,7 @@ public: MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, - const IntlWrapper* pIntl = nullptr ) const override; + const IntlWrapper& rIntl ) const override; virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const override; public: @@ -271,7 +271,7 @@ public: MapUnit eCoreMetric, MapUnit ePresMetric, OUString& rText, - const IntlWrapper* pIntl = nullptr ) const override; + const IntlWrapper& rIntl ) const override; }; class ScDoubleItem : public SfxPoolItem @@ -322,7 +322,7 @@ public: virtual bool GetPresentation( SfxItemPresentation ePresentation, MapUnit, MapUnit, OUString& rText, - const IntlWrapper* = nullptr ) const override; + const IntlWrapper& ) const override; virtual bool QueryValue( css::uno::Any& rAny, sal_uInt8 nMemberId = 0 ) const override; virtual bool PutValue( const css::uno::Any& rAny, sal_uInt8 nMemberId ) override; diff --git a/sc/inc/docpool.hxx b/sc/inc/docpool.hxx index aacae2ce26a6..bafb72403692 100644 --- a/sc/inc/docpool.hxx +++ b/sc/inc/docpool.hxx @@ -61,7 +61,7 @@ public: virtual bool GetPresentation( const SfxPoolItem& rItem, MapUnit ePresentationMetric, OUString& rText, - const IntlWrapper* pIntl = nullptr ) const override; + const IntlWrapper& rIntl ) const override; static void InitVersionMaps(); static void DeleteVersionMaps(); diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx index 3a3b879f47aa..861467f09862 100644 --- a/sc/inc/global.hxx +++ b/sc/inc/global.hxx @@ -549,7 +549,6 @@ public: static CalendarWrapper* GetCalendar(); SC_DLLPUBLIC static CollatorWrapper* GetCollator(); static CollatorWrapper* GetCaseCollator(); - static IntlWrapper* GetScIntlWrapper(); static css::lang::Locale* GetLocale(); SC_DLLPUBLIC static ::utl::TransliterationWrapper* GetpTransliteration(); diff --git a/sc/source/core/data/attrib.cxx b/sc/source/core/data/attrib.cxx index 157ee78ea1ab..bdf235088b00 100644 --- a/sc/source/core/data/attrib.cxx +++ b/sc/source/core/data/attrib.cxx @@ -310,7 +310,7 @@ bool ScProtectionAttr::GetPresentation MapUnit /* eCoreMetric */, MapUnit /* ePresMetric */, OUString& rText, - const IntlWrapper* /* pIntl */ + const IntlWrapper& /* rIntl */ ) const { const OUString aStrYes ( ScGlobal::GetRscString(STR_YES) ); @@ -417,7 +417,7 @@ bool ScRangeItem::GetPresentation MapUnit /* eCoreUnit */, MapUnit /* ePresUnit */, OUString& rText, - const IntlWrapper* /* pIntl */ + const IntlWrapper& /* rIntl */ ) const { rText.clear(); @@ -513,7 +513,7 @@ bool ScTableListItem::GetPresentation MapUnit /* eCoreUnit */, MapUnit /* ePresUnit */, OUString& rText, - const IntlWrapper* /* pIntl */ + const IntlWrapper& /* rIntl */ ) const { switch ( ePres ) @@ -844,7 +844,7 @@ bool ScViewObjectModeItem::GetPresentation MapUnit /* eCoreUnit */, MapUnit /* ePresUnit */, OUString& rText, - const IntlWrapper* /* pIntl */ + const IntlWrapper& /* rIntl */ ) const { OUString aDel(": "); @@ -1007,7 +1007,7 @@ void lclAppendScalePageCount( OUString& rText, sal_uInt16 nPages ) } // namespace bool ScPageScaleToItem::GetPresentation( - SfxItemPresentation ePres, MapUnit, MapUnit, OUString& rText, const IntlWrapper* ) const + SfxItemPresentation ePres, MapUnit, MapUnit, OUString& rText, const IntlWrapper& ) const { rText.clear(); if( !IsValid()) diff --git a/sc/source/core/data/docpool.cxx b/sc/source/core/data/docpool.cxx index 89bc7a80460c..fa44eb812358 100644 --- a/sc/source/core/data/docpool.cxx +++ b/sc/source/core/data/docpool.cxx @@ -659,7 +659,7 @@ static bool lcl_HFPresentation MapUnit eCoreMetric, MapUnit ePresentationMetric, OUString& rText, - const IntlWrapper* pIntl + const IntlWrapper& rIntl ) { const SfxItemSet& rSet = static_cast<const SfxSetItem&>(rItem).GetItemSet(); @@ -709,7 +709,7 @@ static bool lcl_HFPresentation else { aText += GetMetricText( (long)nLeftMargin, - eCoreMetric, ePresentationMetric, pIntl ); + eCoreMetric, ePresentationMetric, &rIntl ); aText += " " + EditResId(GetMetricId(ePresentationMetric)); } aText += cpDelim; @@ -724,16 +724,14 @@ static bool lcl_HFPresentation else { aText += GetMetricText( (long)nRightMargin, - eCoreMetric, ePresentationMetric, pIntl ); + eCoreMetric, ePresentationMetric, &rIntl ); aText += " " + EditResId(GetMetricId(ePresentationMetric)); } } break; default: - if ( !pIntl ) - pIntl = ScGlobal::GetScIntlWrapper(); - pItem->GetPresentation( SfxItemPresentation::Complete, eCoreMetric, ePresentationMetric, aText, pIntl ); + pItem->GetPresentation( SfxItemPresentation::Complete, eCoreMetric, ePresentationMetric, aText, rIntl ); } @@ -755,7 +753,7 @@ bool ScDocumentPool::GetPresentation( const SfxPoolItem& rItem, MapUnit ePresentationMetric, OUString& rText, - const IntlWrapper* pIntl ) const + const IntlWrapper& rIntl ) const { sal_uInt16 nW = rItem.Which(); OUString aStrYes ( ScGlobal::GetRscString(STR_YES) ); @@ -852,7 +850,7 @@ bool ScDocumentPool::GetPresentation( { OUString aBuffer; - if( lcl_HFPresentation( rItem, GetMetric( nW ), ePresentationMetric, aBuffer, pIntl ) ) + if( lcl_HFPresentation( rItem, GetMetric( nW ), ePresentationMetric, aBuffer, rIntl ) ) { rText = ScGlobal::GetRscString(STR_HEADER) + " ( " + aBuffer + " ) "; } @@ -863,7 +861,7 @@ bool ScDocumentPool::GetPresentation( { OUString aBuffer; - if( lcl_HFPresentation( rItem, GetMetric( nW ), ePresentationMetric, aBuffer, pIntl ) ) + if( lcl_HFPresentation( rItem, GetMetric( nW ), ePresentationMetric, aBuffer, rIntl ) ) { rText = ScGlobal::GetRscString(STR_FOOTER) + " ( " + aBuffer + " ) "; } @@ -871,9 +869,7 @@ bool ScDocumentPool::GetPresentation( break; default: - if ( !pIntl ) - pIntl = ScGlobal::GetScIntlWrapper(); - ePresentationRet = rItem.GetPresentation( SfxItemPresentation::Complete, GetMetric( nW ), ePresentationMetric, rText, pIntl ); + ePresentationRet = rItem.GetPresentation( SfxItemPresentation::Complete, GetMetric( nW ), ePresentationMetric, rText, rIntl ); break; } diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx index a5b4e10bda3d..4a06ca612d6d 100644 --- a/sc/source/core/data/global.cxx +++ b/sc/source/core/data/global.cxx @@ -97,7 +97,6 @@ CollatorWrapper* ScGlobal::pCaseCollator = nullptr; ::utl::TransliterationWrapper* ScGlobal::pTransliteration = nullptr; ::utl::TransliterationWrapper* ScGlobal::pCaseTransliteration = nullptr; css::uno::Reference< css::i18n::XOrdinalSuffix> ScGlobal::xOrdinalSuffix = nullptr; -IntlWrapper* ScGlobal::pScIntlWrapper = nullptr; sal_Unicode ScGlobal::cListDelimiter = ','; OUString* ScGlobal::pEmptyOUString = nullptr; OUString* ScGlobal::pStrClipDocName = nullptr; @@ -576,7 +575,6 @@ void ScGlobal::Clear() pLocaleData = nullptr; DELETEZ(pSysLocale); DELETEZ(pLocale); - DELETEZ(pScIntlWrapper); DELETEZ(pStrClipDocName); DELETEZ(pUnitConverter); @@ -1039,14 +1037,6 @@ CollatorWrapper* ScGlobal::GetCaseCollator() } return pCaseTransliteration; } -IntlWrapper* ScGlobal::GetScIntlWrapper() -{ - if ( !pScIntlWrapper ) - { - pScIntlWrapper = new IntlWrapper( LanguageTag( *GetLocale()) ); - } - return pScIntlWrapper; -} css::lang::Locale* ScGlobal::GetLocale() { if ( !pLocale ) |