[Libreoffice-commits] core.git: editeng/source include/editeng sw/inc sw/source
Matteo Casalin
matteo.casalin at yahoo.com
Sat Aug 17 14:11:01 PDT 2013
editeng/source/items/numitem.cxx | 13 ++++++-------
include/editeng/numitem.hxx | 4 ++--
sw/inc/lineinfo.hxx | 6 +++---
sw/source/core/text/frmpaint.cxx | 2 +-
sw/source/core/unocore/unosett.cxx | 2 +-
5 files changed, 13 insertions(+), 14 deletions(-)
New commits:
commit 8aee44c1814ae7c1af14e942cf0513e1612a82d9
Author: Matteo Casalin <matteo.casalin at yahoo.com>
Date: Sat Aug 17 18:41:03 2013 +0200
String to OUString
Change-Id: I41b73e0af6841247a0403974b1c66e5a66123420
Reviewed-on: https://gerrit.libreoffice.org/5483
Reviewed-by: Matteo Casalin <matteo.casalin at yahoo.com>
Tested-by: Matteo Casalin <matteo.casalin at yahoo.com>
diff --git a/editeng/source/items/numitem.cxx b/editeng/source/items/numitem.cxx
index 9698c90..1a9e800 100644
--- a/editeng/source/items/numitem.cxx
+++ b/editeng/source/items/numitem.cxx
@@ -97,18 +97,17 @@ SvxNumberType::~SvxNumberType()
xFormatter = 0;
}
-String SvxNumberType::GetNumStr( sal_uLong nNo ) const
+OUString SvxNumberType::GetNumStr( sal_uLong nNo ) const
{
const LanguageTag& rLang = Application::GetSettings().GetLanguageTag();
return GetNumStr( nNo, rLang.getLocale() );
}
-String SvxNumberType::GetNumStr( sal_uLong nNo, const Locale& rLocale ) const
+OUString SvxNumberType::GetNumStr( sal_uLong nNo, const Locale& rLocale ) const
{
lcl_getFormatter(xFormatter);
- String aTmpStr;
if(!xFormatter.is())
- return aTmpStr;
+ return OUString();
if(bShowSymbol)
{
@@ -121,7 +120,7 @@ String SvxNumberType::GetNumStr( sal_uLong nNo, const Locale& rLocale ) const
{
// '0' allowed for ARABIC numberings
if(NumberingType::ARABIC == nNumType && 0 == nNo )
- aTmpStr = '0';
+ return OUString('0');
else
{
Sequence< PropertyValue > aProperties(2);
@@ -133,7 +132,7 @@ String SvxNumberType::GetNumStr( sal_uLong nNo, const Locale& rLocale ) const
try
{
- aTmpStr = xFormatter->makeNumberingString( aProperties, rLocale );
+ return xFormatter->makeNumberingString( aProperties, rLocale );
}
catch(const Exception&)
{
@@ -142,7 +141,7 @@ String SvxNumberType::GetNumStr( sal_uLong nNo, const Locale& rLocale ) const
}
}
}
- return aTmpStr;
+ return OUString();
}
SvxNumberFormat::SvxNumberFormat( sal_Int16 eType,
diff --git a/include/editeng/numitem.hxx b/include/editeng/numitem.hxx
index fbe59e6..3df4a96 100644
--- a/include/editeng/numitem.hxx
+++ b/include/editeng/numitem.hxx
@@ -72,8 +72,8 @@ public:
SvxNumberType(const SvxNumberType& rType);
~SvxNumberType();
- String GetNumStr( sal_uLong nNo ) const;
- String GetNumStr( sal_uLong nNo, const com::sun::star::lang::Locale& rLocale ) const;
+ OUString GetNumStr( sal_uLong nNo ) const;
+ OUString GetNumStr( sal_uLong nNo, const com::sun::star::lang::Locale& rLocale ) const;
void SetNumberingType(sal_Int16 nSet) {nNumType = nSet;}
sal_Int16 GetNumberingType() const {return nNumType;}
diff --git a/sw/inc/lineinfo.hxx b/sw/inc/lineinfo.hxx
index 22bb1a9..2557ada 100644
--- a/sw/inc/lineinfo.hxx
+++ b/sw/inc/lineinfo.hxx
@@ -38,7 +38,7 @@ class SW_DLLPUBLIC SwLineNumberInfo : public SwClient /**< purpose of derivation
character style for displaying the numbers. */
{
SvxNumberType aType; ///< e.g. roman linenumbers
- String aDivider; ///< String for aditional interval (vert. lines user defined)
+ OUString aDivider; ///< String for aditional interval (vert. lines user defined)
sal_uInt16 nPosFromLeft; ///< Position for paint
sal_uInt16 nCountBy; ///< Paint only for every n line
sal_uInt16 nDividerCountBy; /**< Interval for display of an user defined
@@ -65,8 +65,8 @@ public:
const SvxNumberType &GetNumType() const { return aType; }
void SetNumType( SvxNumberType aNew ){ aType = aNew; }
- const String &GetDivider() const { return aDivider; }
- void SetDivider( const String &r ) { aDivider = r; }
+ OUString GetDivider() const { return aDivider; }
+ void SetDivider( const OUString &r ) { aDivider = r; }
sal_uInt16 GetDividerCountBy() const { return nDividerCountBy; }
void SetDividerCountBy( sal_uInt16 n ) { nDividerCountBy = n; }
diff --git a/sw/source/core/text/frmpaint.cxx b/sw/source/core/text/frmpaint.cxx
index f3a0da9..4296822 100644
--- a/sw/source/core/text/frmpaint.cxx
+++ b/sw/source/core/text/frmpaint.cxx
@@ -124,7 +124,7 @@ SwExtraPainter::SwExtraPainter( const SwTxtFrm *pFrm, ViewShell *pVwSh,
nLineNr, the first line number
bLineNum is set back to sal_False if the numbering is completely
outside of the paint rect */
- nDivider = rLineInf.GetDivider().Len() ? rLineInf.GetDividerCountBy() : 0;
+ nDivider = !rLineInf.GetDivider().isEmpty() ? rLineInf.GetDividerCountBy() : 0;
nX = pFrm->Frm().Left();
SwCharFmt* pFmt = rLineInf.GetCharFmt( const_cast<IDocumentStylePoolAccess&>(*pFrm->GetNode()->getIDocumentStylePoolAccess()) );
OSL_ENSURE( pFmt, "PaintExtraData without CharFmt" );
diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx
index 891eae1..8b06232 100644
--- a/sw/source/core/unocore/unosett.cxx
+++ b/sw/source/core/unocore/unosett.cxx
@@ -1052,7 +1052,7 @@ Any SwXLineNumberingProperties::getPropertyValue(const OUString& rPropertyName)
aRet <<= (sal_Int16)rInfo.GetCountBy();
break;
case WID_SEPARATOR_TEXT :
- aRet <<= OUString(rInfo.GetDivider());
+ aRet <<= rInfo.GetDivider();
break;
case WID_SEPARATOR_INTERVAL:
aRet <<= (sal_Int16)rInfo.GetDividerCountBy();
More information about the Libreoffice-commits
mailing list