summaryrefslogtreecommitdiff
path: root/i18npool
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-05-26 16:02:39 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-05-31 06:25:45 +0000
commit0b23eec200c8c12db5778405df44f4bf8e38e4ad (patch)
treeee45856fe1781195c51f63835024865f283cdab8 /i18npool
parent88c03cd07a171e05c7fb4dcade8baa28e7c5a770 (diff)
teach refcounting clang plugin about uno::Reference
uno::Reference is only allowed to used with classes that have a ::static_type member. So convert all those places to rtl::Reference. Maybe we need some LIBO_INTERNAL_ONLY constructors on rtl::Reference and uno::Reference to make this a little smoother? Change-Id: Icdcb35d71ca40a87b1dc474096776412adbfc7e3 Reviewed-on: https://gerrit.libreoffice.org/25516 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'i18npool')
-rw-r--r--i18npool/inc/calendar_gregorian.hxx3
-rw-r--r--i18npool/source/characterclassification/cclass_unicode.cxx3
-rw-r--r--i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx3
-rw-r--r--i18npool/source/indexentry/indexentrysupplier.cxx3
-rw-r--r--i18npool/source/transliteration/ignoreKana.cxx9
-rw-r--r--i18npool/source/transliteration/ignoreSize_ja_JP.cxx9
-rw-r--r--i18npool/source/transliteration/ignoreWidth.cxx9
-rw-r--r--i18npool/source/transliteration/transliteration_body.cxx3
-rw-r--r--i18npool/source/transliteration/transliteration_caseignore.cxx5
9 files changed, 28 insertions, 19 deletions
diff --git a/i18npool/inc/calendar_gregorian.hxx b/i18npool/inc/calendar_gregorian.hxx
index 31883d693e55..4f333815a918 100644
--- a/i18npool/inc/calendar_gregorian.hxx
+++ b/i18npool/inc/calendar_gregorian.hxx
@@ -23,6 +23,7 @@
#include "nativenumbersupplier.hxx"
#include <unicode/calendar.h>
+#include <rtl/ref.hxx>
// class Calendar_gregorian
@@ -97,7 +98,7 @@ public:
protected:
const Era *eraArray;
icu::Calendar *body;
- css::uno::Reference<NativeNumberSupplierService> mxNatNum;
+ rtl::Reference<NativeNumberSupplierService> mxNatNum;
const sal_Char* cCalendar;
css::lang::Locale aLocale;
sal_uInt32 fieldSet;
diff --git a/i18npool/source/characterclassification/cclass_unicode.cxx b/i18npool/source/characterclassification/cclass_unicode.cxx
index c4a8babb0a6f..a67023f00c2a 100644
--- a/i18npool/source/characterclassification/cclass_unicode.cxx
+++ b/i18npool/source/characterclassification/cclass_unicode.cxx
@@ -27,6 +27,7 @@
#include <cppuhelper/exc_hlp.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <breakiteratorImpl.hxx>
+#include <rtl/ref.hxx>
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
@@ -92,7 +93,7 @@ cclass_Unicode::toTitle( const OUString& Text, sal_Int32 nPos, sal_Int32 nCount,
trans->setMappingType(MappingType::ToTitle, rLocale);
rtl_uString* pStr = rtl_uString_alloc(nCount);
sal_Unicode* out = pStr->buffer;
- Reference< BreakIteratorImpl > xBrk(new BreakIteratorImpl(m_xContext));
+ rtl::Reference< BreakIteratorImpl > xBrk(new BreakIteratorImpl(m_xContext));
Boundary bdy = xBrk->getWordBoundary(Text, nPos, rLocale,
WordType::ANYWORD_IGNOREWHITESPACES, true);
for (sal_Int32 i = nPos; i < nCount + nPos; i++, out++) {
diff --git a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
index 5428d2a815b8..82f3fa434185 100644
--- a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
+++ b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
@@ -23,6 +23,7 @@
#include <com/sun/star/configuration/theDefaultProvider.hpp>
#include <com/sun/star/text/HoriOrientation.hpp>
#include <osl/diagnose.h>
+#include <rtl/ref.hxx>
#include <localedata.hxx>
#include <nativenumbersupplier.hxx>
#include <stdio.h>
@@ -858,7 +859,7 @@ DefaultNumberingProvider::makeNumberingString( const Sequence<beans::PropertyVal
}
if (natNum) {
- uno::Reference<NativeNumberSupplierService> xNatNum(new NativeNumberSupplierService);
+ rtl::Reference<NativeNumberSupplierService> xNatNum(new NativeNumberSupplierService);
result += xNatNum->getNativeNumberString(OUString::number( number ), locale, natNum);
} else if (tableSize) {
if ( number > tableSize && !bRecycleSymbol)
diff --git a/i18npool/source/indexentry/indexentrysupplier.cxx b/i18npool/source/indexentry/indexentrysupplier.cxx
index 71a61bac8a12..ed3dbe70b4b9 100644
--- a/i18npool/source/indexentry/indexentrysupplier.cxx
+++ b/i18npool/source/indexentry/indexentrysupplier.cxx
@@ -18,6 +18,7 @@
*/
#include <rtl/ustrbuf.hxx>
+#include <rtl/ref.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <indexentrysupplier.hxx>
#include <localedata.hxx>
@@ -116,7 +117,7 @@ IndexEntrySupplier::getLocaleSpecificIndexEntrySupplier(const Locale& rLocale, c
rLocale.Country == aLocale.Country && rLocale.Variant == aLocale.Variant)
return xIES;
else {
- uno::Reference<LocaleDataImpl> ld(new LocaleDataImpl);
+ rtl::Reference<LocaleDataImpl> ld(new LocaleDataImpl);
aLocale = rLocale;
if (rSortAlgorithm.isEmpty())
aSortAlgorithm = ld->getDefaultIndexAlgorithm( rLocale );
diff --git a/i18npool/source/transliteration/ignoreKana.cxx b/i18npool/source/transliteration/ignoreKana.cxx
index 6aa1e90dbd01..1e1707c1c6be 100644
--- a/i18npool/source/transliteration/ignoreKana.cxx
+++ b/i18npool/source/transliteration/ignoreKana.cxx
@@ -18,6 +18,7 @@
*/
#include <com/sun/star/uno/XComponentContext.hpp>
+#include <rtl/ref.hxx>
#include <transliteration_Ignore.hxx>
#include <transliteration_OneToOne.hxx>
@@ -31,7 +32,7 @@ OUString SAL_CALL
ignoreKana::folding( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >& offset )
throw(RuntimeException, std::exception)
{
- Reference< hiraganaToKatakana > t1(new hiraganaToKatakana);
+ rtl::Reference< hiraganaToKatakana > t1(new hiraganaToKatakana);
return t1->transliterate(inStr, startPos, nCount, offset);
}
@@ -39,8 +40,8 @@ Sequence< OUString > SAL_CALL
ignoreKana::transliterateRange( const OUString& str1, const OUString& str2 )
throw(RuntimeException, std::exception)
{
- Reference< hiraganaToKatakana > t1(new hiraganaToKatakana);
- Reference< katakanaToHiragana > t2(new katakanaToHiragana);
+ rtl::Reference< hiraganaToKatakana > t1(new hiraganaToKatakana);
+ rtl::Reference< katakanaToHiragana > t2(new katakanaToHiragana);
return transliteration_Ignore::transliterateRange(str1, str2, *t1.get(), *t2.get());
}
@@ -48,7 +49,7 @@ ignoreKana::transliterateRange( const OUString& str1, const OUString& str2 )
sal_Unicode SAL_CALL
ignoreKana::transliterateChar2Char( sal_Unicode inChar) throw(RuntimeException, MultipleCharsOutputException, std::exception)
{
- Reference< hiraganaToKatakana > t1(new hiraganaToKatakana);
+ rtl::Reference< hiraganaToKatakana > t1(new hiraganaToKatakana);
return t1->transliterateChar2Char(inChar);
}
diff --git a/i18npool/source/transliteration/ignoreSize_ja_JP.cxx b/i18npool/source/transliteration/ignoreSize_ja_JP.cxx
index 45f10be4f949..be2f4e84ee52 100644
--- a/i18npool/source/transliteration/ignoreSize_ja_JP.cxx
+++ b/i18npool/source/transliteration/ignoreSize_ja_JP.cxx
@@ -19,6 +19,7 @@
#include <transliteration_Ignore.hxx>
#include <transliteration_OneToOne.hxx>
+#include <rtl/ref.hxx>
using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
@@ -29,7 +30,7 @@ OUString SAL_CALL
ignoreSize_ja_JP::folding( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >& offset )
throw(RuntimeException, std::exception)
{
- Reference< smallToLarge_ja_JP > t1(new smallToLarge_ja_JP);
+ rtl::Reference< smallToLarge_ja_JP > t1(new smallToLarge_ja_JP);
return t1->transliterate(inStr, startPos, nCount, offset);
}
@@ -38,8 +39,8 @@ Sequence< OUString > SAL_CALL
ignoreSize_ja_JP::transliterateRange( const OUString& str1, const OUString& str2 )
throw(RuntimeException, std::exception)
{
- Reference< smallToLarge_ja_JP > t1(new smallToLarge_ja_JP);
- Reference< largeToSmall_ja_JP > t2(new largeToSmall_ja_JP);
+ rtl::Reference< smallToLarge_ja_JP > t1(new smallToLarge_ja_JP);
+ rtl::Reference< largeToSmall_ja_JP > t2(new largeToSmall_ja_JP);
return transliteration_Ignore::transliterateRange(str1, str2, *t1.get(), *t2.get());
}
@@ -47,7 +48,7 @@ ignoreSize_ja_JP::transliterateRange( const OUString& str1, const OUString& str2
sal_Unicode SAL_CALL
ignoreSize_ja_JP::transliterateChar2Char( sal_Unicode inChar) throw(RuntimeException, MultipleCharsOutputException, std::exception)
{
- Reference< smallToLarge_ja_JP > t1(new smallToLarge_ja_JP);
+ rtl::Reference< smallToLarge_ja_JP > t1(new smallToLarge_ja_JP);
return t1->transliterateChar2Char(inChar);
}
diff --git a/i18npool/source/transliteration/ignoreWidth.cxx b/i18npool/source/transliteration/ignoreWidth.cxx
index ab4ade0ace75..15f6815c2748 100644
--- a/i18npool/source/transliteration/ignoreWidth.cxx
+++ b/i18npool/source/transliteration/ignoreWidth.cxx
@@ -18,6 +18,7 @@
*/
#include <com/sun/star/uno/XComponentContext.hpp>
+#include <rtl/ref.hxx>
#include <transliteration_Ignore.hxx>
#include <transliteration_OneToOne.hxx>
@@ -31,7 +32,7 @@ OUString SAL_CALL
ignoreWidth::folding( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, Sequence< sal_Int32 >& offset )
throw(RuntimeException, std::exception)
{
- Reference< fullwidthToHalfwidth > t1(new fullwidthToHalfwidth);
+ rtl::Reference< fullwidthToHalfwidth > t1(new fullwidthToHalfwidth);
return t1->transliterate(inStr, startPos, nCount, offset);
}
@@ -39,8 +40,8 @@ Sequence< OUString > SAL_CALL
ignoreWidth::transliterateRange( const OUString& str1, const OUString& str2 )
throw(RuntimeException, std::exception)
{
- Reference< fullwidthToHalfwidth > t1(new fullwidthToHalfwidth);
- Reference< halfwidthToFullwidth > t2(new halfwidthToFullwidth);
+ rtl::Reference< fullwidthToHalfwidth > t1(new fullwidthToHalfwidth);
+ rtl::Reference< halfwidthToFullwidth > t2(new halfwidthToFullwidth);
return transliteration_Ignore::transliterateRange(str1, str2, *t1.get(), *t2.get());
}
@@ -48,7 +49,7 @@ ignoreWidth::transliterateRange( const OUString& str1, const OUString& str2 )
sal_Unicode SAL_CALL
ignoreWidth::transliterateChar2Char( sal_Unicode inChar) throw(RuntimeException, MultipleCharsOutputException, std::exception)
{
- Reference< fullwidthToHalfwidth > t1(new fullwidthToHalfwidth);
+ rtl::Reference< fullwidthToHalfwidth > t1(new fullwidthToHalfwidth);
return t1->transliterateChar2Char(inChar);
}
diff --git a/i18npool/source/transliteration/transliteration_body.cxx b/i18npool/source/transliteration/transliteration_body.cxx
index 0470ed4ac99b..0e2d4c5c84d5 100644
--- a/i18npool/source/transliteration/transliteration_body.cxx
+++ b/i18npool/source/transliteration/transliteration_body.cxx
@@ -18,6 +18,7 @@
*/
#include <rtl/ustrbuf.hxx>
+#include <rtl/ref.hxx>
#include <i18nutil/casefolding.hxx>
#include <i18nutil/unicode.hxx>
@@ -269,7 +270,7 @@ static OUString transliterate_titlecase_Impl(
if (!aText.isEmpty())
{
Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
- Reference< CharacterClassificationImpl > xCharClassImpl( new CharacterClassificationImpl( xContext ) );
+ rtl::Reference< CharacterClassificationImpl > xCharClassImpl( new CharacterClassificationImpl( xContext ) );
// because xCharClassImpl.toTitle does not handle ligatures or Beta but will raise
// an exception we need to handle the first chara manually...
diff --git a/i18npool/source/transliteration/transliteration_caseignore.cxx b/i18npool/source/transliteration/transliteration_caseignore.cxx
index e01eb1f2a71e..77d5a80ea816 100644
--- a/i18npool/source/transliteration/transliteration_caseignore.cxx
+++ b/i18npool/source/transliteration/transliteration_caseignore.cxx
@@ -18,6 +18,7 @@
*/
#include <com/sun/star/uno/XComponentContext.hpp>
+#include <rtl/ref.hxx>
#include <i18nutil/oneToOneMapping.hxx>
#include <i18nutil/casefolding.hxx>
@@ -59,8 +60,8 @@ Transliteration_caseignore::transliterateRange( const OUString& str1, const OUSt
if (str1.getLength() != 1 || str2.getLength() != 1)
throw RuntimeException();
- static Reference< Transliteration_u2l > u2l(new Transliteration_u2l);
- static Reference< Transliteration_l2u > l2u(new Transliteration_l2u);
+ static rtl::Reference< Transliteration_u2l > u2l(new Transliteration_u2l);
+ static rtl::Reference< Transliteration_l2u > l2u(new Transliteration_l2u);
u2l->loadModule((TransliterationModules)0, aLocale);
l2u->loadModule((TransliterationModules)0, aLocale);