[PATCH] String cleanup in filter
Ricardo Montania (via Code Review)
gerrit at gerrit.libreoffice.org
Sat Feb 2 18:04:12 PST 2013
Hi,
I have submitted a patch for review:
https://gerrit.libreoffice.org/1970
To pull it, you can do:
git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/70/1970/1
String cleanup in filter
Change-Id: If9fac2f277550cc786baffe4f89c7181b2d10dfd
---
M filter/inc/filter/msfilter/svdfppt.hxx
M filter/source/msfilter/svdfppt.cxx
2 files changed, 83 insertions(+), 83 deletions(-)
diff --git a/filter/inc/filter/msfilter/svdfppt.hxx b/filter/inc/filter/msfilter/svdfppt.hxx
index 79272f5..fcc704f 100644
--- a/filter/inc/filter/msfilter/svdfppt.hxx
+++ b/filter/inc/filter/msfilter/svdfppt.hxx
@@ -63,7 +63,7 @@
sal_uInt16 nDocFileVersion;
sal_uInt8 nMajorVersion;
sal_uInt8 nMinorVersion;
- String aCurrentUser;
+ OUString aCurrentUser;
public:
@@ -92,13 +92,13 @@
sal_Int32 nPrivate2;
sal_Int32 nPrivate3;
sal_Int32 nInfo;
- String aTarget;
- String aSubAdress;
+ OUString aTarget;
+ OUString aSubAdress;
sal_Int32 nStartPos;
sal_Int32 nEndPos;
- String aConvSubString;
+ OUString aConvSubString;
ESelection aESelection;
sal_Bool bSelection;
};
@@ -260,7 +260,7 @@
struct PptFontEntityAtom
{
- String aName;
+ OUString aName;
double fScaling;
sal_uInt8 lfClipPrecision;
sal_uInt8 lfQuality;
@@ -416,7 +416,7 @@
sal_Bool bTimesNewRomanChecked : 1;
sal_Bool bTimesNewRomanAvailable : 1;
- sal_Bool ReadString( rtl::OUString& rStr ) const;
+ sal_Bool ReadString( OUString& rStr ) const;
// nur fuer PowerPoint-Filter:
virtual const PptSlideLayoutAtom* GetSlideLayoutAtom() const;
@@ -425,7 +425,7 @@
PowerPointImportParam& rImportParam;
- SdrEscherImport( PowerPointImportParam&, const String& rBaseURL );
+ SdrEscherImport( PowerPointImportParam&, const OUString& rBaseURL );
virtual ~SdrEscherImport();
virtual bool GetColorFromPalette( sal_uInt16 nNum, Color& rColor ) const;
virtual sal_Bool SeekToShape( SvStream& rSt, void* pClientData, sal_uInt32 nId ) const;
@@ -453,7 +453,7 @@
sal_uInt16 nTextRangeEnd;
SvxFieldItem* pField1;
SvxFieldItem* pField2;
- String* pString;
+ OUString* pString;
PPTFieldEntry() : nPos( 0 ), nTextRangeEnd( 0 ), pField1( NULL ), pField2( NULL ), pString( NULL ) {};
~PPTFieldEntry();
@@ -471,7 +471,7 @@
struct MSFILTER_DLLPUBLIC HeaderFooterEntry
{
const PptSlidePersistEntry* pMasterPersist;
- String pPlaceholder[ 4 ];
+ OUString pPlaceholder[ 4 ];
sal_uInt32 nAtom;
sal_uInt32 GetMaskForInstance( sal_uInt32 nInstance );
@@ -575,7 +575,7 @@
void SeekOle( SfxObjectShell* pShell, sal_uInt32 nFilterOptions );
public:
- SdrPowerPointImport( PowerPointImportParam&, const String& rBaseURL );
+ SdrPowerPointImport( PowerPointImportParam&, const OUString& rBaseURL );
virtual ~SdrPowerPointImport();
sal_uInt16 GetPageCount( PptPageKind eKind = PPT_SLIDEPAGE ) const;
void SetPageNum( sal_uInt16 nPageNum, PptPageKind = PPT_SLIDEPAGE );
@@ -916,7 +916,7 @@
sal_uInt32 mnOriginalTextPos;
sal_uInt32 mnParagraph;
- String maString;
+ OUString maString;
SvxFieldItem* mpFieldItem;
sal_uInt16 mnLanguage[ 3 ];
@@ -1049,7 +1049,7 @@
SvStream& rIn,
SdrPowerPointImport& rMan,
const DffRecordHeader& rTextHeader,
- const String& aString,
+ const OUString& aString,
PPTTextRulerInterpreter& rRuler,
sal_uInt32& nCharCount,
sal_Bool& bTextPropAtom
@@ -1057,7 +1057,7 @@
void ReadCharProps(
SvStream& rIn,
PPTCharPropSet& aCharPropSet,
- const String& aString,
+ const OUString& aString,
sal_uInt32& nCharCount,
sal_uInt32 nCharAnzRead,
sal_Bool& bTextPropAtom,
@@ -1107,7 +1107,7 @@
sal_uInt32 nInstanceInSheet,
const PPTTextObj* pTextObj
);
- sal_uInt32 Count() const { return ( mpFieldItem ) ? 1 : maString.Len(); };
+ sal_uInt32 Count() const { return ( mpFieldItem ) ? 1 : maString.getLength(); };
sal_Bool HasTabulator();
};
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index 208d8b5..537e5f2 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -437,7 +437,7 @@
cData[ i ] = ( nTemp >> 8 ) | ( nTemp << 8 );
#endif
}
- rAtom.aName = rtl::OUString(cData, i);
+ rAtom.aName = OUString(cData, i);
OutputDevice* pDev = (OutputDevice*)Application::GetDefaultDevice();
rAtom.bAvailable = pDev->IsFontAvailable( rAtom.aName );
aHd.SeekToEndOfRecord( rIn );
@@ -502,7 +502,7 @@
delete[] pPresentationObjects;
};
-SdrEscherImport::SdrEscherImport( PowerPointImportParam& rParam, const String& rBaseURL ) :
+SdrEscherImport::SdrEscherImport( PowerPointImportParam& rParam, const OUString& rBaseURL ) :
SvxMSDffManager ( rParam.rDocStream, rBaseURL ),
pFonts ( NULL ),
nStreamLen ( 0 ),
@@ -531,7 +531,7 @@
return NULL;
}
-sal_Bool SdrEscherImport::ReadString( rtl::OUString& rStr ) const
+sal_Bool SdrEscherImport::ReadString( OUString& rStr ) const
{
sal_Bool bRet = sal_False;
DffRecordHeader aStrHd;
@@ -1255,7 +1255,7 @@
return pRet;
}
-SdrPowerPointImport::SdrPowerPointImport( PowerPointImportParam& rParam, const String& rBaseURL ) :
+SdrPowerPointImport::SdrPowerPointImport( PowerPointImportParam& rParam, const OUString& rBaseURL ) :
SdrEscherImport ( rParam, rBaseURL ),
bOk ( rStCtrl.GetErrorCode() == SVSTREAM_OK ),
pPersistPtr ( NULL ),
@@ -1830,7 +1830,7 @@
}
if ( bGetItAsOle )
{
- ::rtl::OUString aNm;
+ OUString aNm;
// if ( nSvxMSDffOLEConvFlags )
{
uno::Reference < embed::XStorage > xDestStorage( pOe->pShell->GetStorage() );
@@ -1843,7 +1843,7 @@
svt::EmbeddedObjectRef aObj( xObj, pOe->nAspect );
// TODO/LATER: need MediaType for Graphic
- aObj.SetGraphic( rGraf, ::rtl::OUString() );
+ aObj.SetGraphic( rGraf, OUString() );
pRet = new SdrOle2Obj( aObj, aNm, rBoundRect, sal_False );
}
}
@@ -1902,7 +1902,7 @@
svt::EmbeddedObjectRef aObj( xObj, pOe->nAspect );
// TODO/LATER: need MediaType for Graphic
- aObj.SetGraphic( aGraphic, ::rtl::OUString() );
+ aObj.SetGraphic( aGraphic, OUString() );
pRet = new SdrOle2Obj( aObj, aNm, rBoundRect, sal_False );
}
@@ -2131,15 +2131,15 @@
// following block is necessary, because our old PowerPoint export did not set the
// correct charset
- if ( pFont->aName.EqualsIgnoreCaseAscii( "Wingdings" ) ||
- pFont->aName.EqualsIgnoreCaseAscii( "Wingdings 2" ) ||
- pFont->aName.EqualsIgnoreCaseAscii( "Wingdings 3" ) ||
- pFont->aName.EqualsIgnoreCaseAscii( "Monotype Sorts" ) ||
- pFont->aName.EqualsIgnoreCaseAscii( "Monotype Sorts 2" ) ||
- pFont->aName.EqualsIgnoreCaseAscii( "Webdings" ) ||
- pFont->aName.EqualsIgnoreCaseAscii( "StarBats" ) ||
- pFont->aName.EqualsIgnoreCaseAscii( "StarMath" ) ||
- pFont->aName.EqualsIgnoreCaseAscii( "ZapfDingbats" ) )
+ if ( pFont->aName == "Wingdings" ||
+ pFont->aName == "Wingdings 2" ||
+ pFont->aName == "Wingdings 3" ||
+ pFont->aName == "Monotype Sorts" ||
+ pFont->aName == "Monotype Sorts 2" ||
+ pFont->aName == "Webdings" ||
+ pFont->aName == "StarBats" ||
+ pFont->aName == "StarMath" ||
+ pFont->aName == "ZapfDingbats" )
{
pFont->eCharSet = RTL_TEXTENCODING_SYMBOL;
};
@@ -2220,7 +2220,7 @@
else
{
sal_Int32 nCharacters = pPortion->Count();
- const sal_Unicode* pSource = pPortion->maString.GetBuffer();
+ const sal_Unicode* pSource = pPortion->maString.getStr();
sal_Unicode* pDest = pParaText + nCurrentIndex;
sal_uInt32 nFont;
@@ -2247,7 +2247,7 @@
ESelection aSelection( nParaIndex, 0, nParaIndex, 0 );
rOutliner.Insert( String(), nParaIndex, pPara->pParaSet->mnDepth );
- rOutliner.QuickInsertText( rtl::OUString(pParaText, nCurrentIndex), aSelection );
+ rOutliner.QuickInsertText( OUString(pParaText, nCurrentIndex), aSelection );
rOutliner.SetParaAttribs( nParaIndex, rOutliner.GetEmptyItemSet() );
if ( pS )
rOutliner.SetStyleSheet( nParaIndex, pS );
@@ -2264,8 +2264,8 @@
}
else
{
- const sal_Unicode *pF, *pPtr = pPortion->maString.GetBuffer();
- const sal_Unicode *pMax = pPtr + pPortion->maString.Len();
+ const sal_Unicode *pF, *pPtr = pPortion->maString.getStr();
+ const sal_Unicode *pMax = pPtr + pPortion->maString.getLength();
sal_Int32 nLen;
for ( pF = pPtr; pPtr < pMax; pPtr++ )
{
@@ -2632,9 +2632,9 @@
void ImportComment10( SvxMSDffManager& rMan, SvStream& rStCtrl, SdrPage* pPage, DffRecordHeader& rComment10Hd )
{
- rtl::OUString sAuthor;
- rtl::OUString sText;
- rtl::OUString sInitials;
+ OUString sAuthor;
+ OUString sText;
+ OUString sInitials;
sal_Int32 nIndex = 0;
util::DateTime aDateTime;
@@ -2649,7 +2649,7 @@
{
case PPT_PST_CString :
{
- rtl::OUString aString = SvxMSDffManager::MSDFFReadZString( rStCtrl,
+ OUString aString = SvxMSDffManager::MSDFFReadZString( rStCtrl,
aCommentHd.nRecLen, sal_True );
switch ( aCommentHd.nRecInstance )
{
@@ -4753,14 +4753,14 @@
}
void PPTStyleTextPropReader::ReadParaProps( SvStream& rIn, SdrPowerPointImport& rMan, const DffRecordHeader& rTextHeader,
- const String& aString, PPTTextRulerInterpreter& rRuler,
+ const OUString& aString, PPTTextRulerInterpreter& rRuler,
sal_uInt32& nCharCount, sal_Bool& bTextPropAtom )
{
sal_uInt32 nMask = 0; //TODO: nMask initialized here to suppress warning for now, see corresponding TODO below
sal_uInt32 nCharAnzRead = 0;
sal_uInt16 nDummy16;
- sal_uInt16 nStringLen = aString.Len();
+ sal_uInt16 nStringLen = aString.getLength();
DffRecordHeader aTextHd2;
rTextHeader.SeekToContent( rIn );
@@ -4880,7 +4880,7 @@
if ( nCharCount )
{
sal_uInt32 nCount;
- const sal_Unicode* pDat = aString.GetBuffer() + nCharAnzRead;
+ const sal_Unicode* pDat = aString.getStr() + nCharAnzRead;
for ( nCount = 0; nCount < nCharCount; nCount++ )
{
if ( pDat[ nCount ] == 0xd )
@@ -4895,7 +4895,7 @@
}
}
-void PPTStyleTextPropReader::ReadCharProps( SvStream& rIn, PPTCharPropSet& aCharPropSet, const String& aString,
+void PPTStyleTextPropReader::ReadCharProps( SvStream& rIn, PPTCharPropSet& aCharPropSet, const OUString& aString,
sal_uInt32& nCharCount, sal_uInt32 nCharAnzRead,
sal_Bool& bTextPropAtom, sal_uInt32 nExtParaPos,
const std::vector< StyleTextProp9 >& aStyleTextProp9,
@@ -4905,7 +4905,7 @@
sal_uInt32 nMask = 0; //TODO: nMask initialized here to suppress warning for now, see corresponding TODO below
sal_uInt16 nDummy16;
sal_Int32 nCharsToRead;
- sal_uInt16 nStringLen = aString.Len();
+ sal_uInt16 nStringLen = aString.getLength();
rIn >> nDummy16;
nCharCount = nDummy16;
@@ -5007,7 +5007,7 @@
rIn.Seek( nMerk );
}
- String aString;
+ OUString aString;
DffRecordHeader aTextHd;
rIn >> aTextHd;
sal_uInt32 nMaxLen = aTextHd.nRecLen;
@@ -5048,7 +5048,7 @@
}
}
if ( i )
- aString = rtl::OUString(pBuf, i);
+ aString = OUString( pBuf );
delete[] pBuf;
}
else if( aTextHd.nRecType == PPT_PST_TextBytesAtom )
@@ -5073,7 +5073,7 @@
}
xub_StrLen nLen = sal::static_int_cast< xub_StrLen >( pPtr - pBuf );
if ( nLen )
- aString = String( pBuf, nLen, RTL_TEXTENCODING_MS_1252 );
+ aString = OUString( pBuf, nLen, RTL_TEXTENCODING_MS_1252 );
delete[] pBuf;
}
else
@@ -5101,7 +5101,7 @@
}
}
- if ( aString.Len() )
+ if ( aString.getLength() )
{
sal_uInt32 nCharCount;
sal_Bool bTextPropAtom = sal_False;
@@ -5113,7 +5113,7 @@
sal_uInt32 nCurrentPara = 0;
size_t i = 1; // points to the next element to process
sal_uInt32 nCurrentSpecMarker = aSpecMarkerList.empty() ? 0 : aSpecMarkerList[0];
- sal_uInt32 nStringLen = aString.Len();
+ sal_uInt32 nStringLen = aString.getLength();
while ( nCharAnzRead < nStringLen )
{
@@ -5123,7 +5123,7 @@
PPTCharPropSet aCharPropSet( nCurrentPara );
if ( bTextPropAtom )
{
- if( nCharAnzRead == ( nStringLen - 1 ) && aString.GetChar( nCharAnzRead ) == '\r' )
+ if( nCharAnzRead == ( nStringLen - 1 ) && aString == "\r" )
{
/* n#782833: Seems like the new line character at end of the para
* has two char properties and we would need to use the next one.
@@ -5165,9 +5165,9 @@
{
nLen = ( nCurrentSpecMarker & 0xffff ) - nCharAnzRead;
if ( nLen )
- aCharPropSet.maString = String( aString, (sal_uInt16)nCharAnzRead, (sal_uInt16)nLen );
+ aCharPropSet.maString = aString;
else if ( bEmptyParaPossible )
- aCharPropSet.maString = String();
+ aCharPropSet.maString = OUString();
if ( nLen || bEmptyParaPossible )
aCharPropList.push_back( new PPTCharPropSet( aCharPropSet, nCurrentPara ) );
nCurrentPara++;
@@ -5181,13 +5181,13 @@
if ( ( nCurrentSpecMarker & 0xffff ) != nCharAnzRead )
{
nLen = ( nCurrentSpecMarker & 0xffff ) - nCharAnzRead;
- aCharPropSet.maString = String( aString, (sal_uInt16)nCharAnzRead, (sal_uInt16)nLen );
+ aCharPropSet.maString = aString;
aCharPropList.push_back( new PPTCharPropSet( aCharPropSet, nCurrentPara ) );
nCharCount -= nLen;
nCharAnzRead += nLen;
}
PPTCharPropSet* pCPropSet = new PPTCharPropSet( aCharPropSet, nCurrentPara );
- pCPropSet->maString = aString.GetChar( (sal_uInt16)nCharAnzRead );
+ pCPropSet->maString = OUString( (sal_uInt16)nCharAnzRead );
if ( aCharPropSet.pCharSet->mnAttrSet & ( 1 << PPT_CharAttr_Symbol ) )
pCPropSet->SetFont( aCharPropSet.pCharSet->mnSymbolFont );
aCharPropList.push_back( pCPropSet );
@@ -5199,7 +5199,7 @@
}
else
{
- aCharPropSet.maString = String( aString, (sal_uInt16)nCharAnzRead, (sal_uInt16)nCharCount );
+ aCharPropSet.maString = aString;
aCharPropList.push_back( new PPTCharPropSet( aCharPropSet, nCurrentPara ) );
nCharAnzRead += nCharCount;
bEmptyParaPossible = sal_False;
@@ -5210,7 +5210,7 @@
if ( !aCharPropList.empty() && ( aCharPropList.back()->mnParagraph != nCurrentPara ) )
{
PPTCharPropSet* pCharPropSet = new PPTCharPropSet( *aCharPropList.back(), nCurrentPara );
- pCharPropSet->maString = String();
+ pCharPropSet->maString = OUString();
pCharPropSet->mnOriginalTextPos = nStringLen - 1;
aCharPropList.push_back( pCharPropSet );
}
@@ -5281,8 +5281,8 @@
{
sal_Bool bRetValue = sal_False;
sal_Int32 nCount;
- const sal_Unicode* pPtr = maString.GetBuffer();
- for ( nCount = 0; nCount < maString.Len(); nCount++ )
+ const sal_Unicode* pPtr = maString.getStr();
+ for ( nCount = 0; nCount < maString.getLength(); nCount++ )
{
if ( pPtr[ nCount ] == 0x9 )
{
@@ -6496,18 +6496,18 @@
pSet->mnLanguage[ 1 ] = pSpecInfo->nLanguage[ 1 ];
pSet->mnLanguage[ 2 ] = pSpecInfo->nLanguage[ 2 ];
// test if the current portion needs to be splitted
- if ( pSet->maString.Len() > 1 )
+ if ( pSet->maString.getLength() > 1 )
{
- sal_Int32 nIndexOfNextPortion = pSet->maString.Len() + pSet->mnOriginalTextPos;
+ sal_Int32 nIndexOfNextPortion = pSet->maString.getLength() + pSet->mnOriginalTextPos;
sal_Int32 nNewLen = nIndexOfNextPortion - nCharIdx;
- sal_Int32 nOldLen = pSet->maString.Len() - nNewLen;
+ sal_Int32 nOldLen = pSet->maString.getLength() - nNewLen;
if ( ( nNewLen > 0 ) && ( nOldLen > 0 ) )
{
- String aString( pSet->maString );
+ OUString aString( pSet->maString );
PPTCharPropSet* pNew = new PPTCharPropSet( *pSet );
- pSet->maString = String( aString, 0, (sal_uInt16)nOldLen );
- pNew->maString = String( aString, (sal_uInt16)nOldLen, (sal_uInt16)nNewLen );
+ pSet->maString = aString;
+ pNew->maString = aString;
pNew->mnOriginalTextPos += nOldLen;
aStyleTextPropReader.aCharPropList.insert( aStyleTextPropReader.aCharPropList.begin() + nI + 1, pNew );
}
@@ -6576,7 +6576,7 @@
if ( rPersistEntry.pHeaderFooterEntry->nAtom & 0x20000 ) // auto date time
pEntry->SetDateTime( rPersistEntry.pHeaderFooterEntry->nAtom & 0xff );
else
- pEntry->pString = new String( rPersistEntry.pHeaderFooterEntry->pPlaceholder[ nVal ] );
+ pEntry->pString = new OUString( rPersistEntry.pHeaderFooterEntry->pPlaceholder[ nVal ] );
}
}
break;
@@ -6629,7 +6629,7 @@
else if (!n)
{
// End of format string
- pEntry->pString = new String( aStr );
+ pEntry->pString = new OUString( aStr );
break;
}
else if (!inquote)
@@ -6685,11 +6685,11 @@
pEntry = new PPTFieldEntry;
pEntry->nPos = (sal_uInt16)nStartPos;
pEntry->nTextRangeEnd = (sal_uInt16)nEndPos;
- String aTarget( pHyperlink->aTarget );
- if ( pHyperlink->aConvSubString.Len() )
+ OUString aTarget( pHyperlink->aTarget );
+ if ( pHyperlink->aConvSubString.getLength() )
{
- aTarget.Append( (sal_Unicode)'#' );
- aTarget.Append( pHyperlink->aConvSubString );
+ aTarget += "#";
+ aTarget += pHyperlink->aConvSubString;
}
pEntry->pField1 = new SvxFieldItem( SvxURLField( aTarget, String(), SVXURLFORMAT_REPR ), EE_FEATURE_FIELD );
}
@@ -6731,8 +6731,8 @@
while( ( FE < FieldList.end() ) && ( n >= 0 ) && ( i >= 0 ) )
{
PPTCharPropSet* pSet = aCharPropList[n];
- String aString( pSet->maString );
- sal_uInt32 nCount = aString.Len();
+ OUString aString( pSet->maString );
+ sal_uInt32 nCount = aString.getLength();
sal_uInt32 nPos = pSet->mnOriginalTextPos + nCount;
while ( ( FE < FieldList.end() ) && nCount-- )
{
@@ -6744,14 +6744,14 @@
if ( (*FE)->nPos == nPos )
{
- if ( aString.GetChar( (sal_uInt16)nCount ) == 0x2a )
+ if ( aString[(sal_uInt16)nCount] == 0x2a )
{
- sal_uInt32 nBehind = aString.Len() - ( nCount + 1 );
- pSet->maString = String();
+ sal_uInt32 nBehind = aString.getLength() - ( nCount + 1 );
+ pSet->maString = OUString();
if ( nBehind )
{
PPTCharPropSet* pNewCPS = new PPTCharPropSet( *pSet );
- pNewCPS->maString = String( aString, (sal_uInt16)nCount + 1, (sal_uInt16)nBehind );
+ pNewCPS->maString = aString;
aCharPropList.insert( aCharPropList.begin() + n + 1, pNewCPS );
}
if ( (*FE)->pField2 )
@@ -6761,13 +6761,13 @@
aCharPropList.insert( aCharPropList.begin() + n + 1, pNewCPS );
pNewCPS = new PPTCharPropSet( *pSet );
- pNewCPS->maString = String( String( RTL_CONSTASCII_USTRINGPARAM( " " ) ) );
+ pNewCPS->maString = " ";
aCharPropList.insert( aCharPropList.begin() + n + 1, pNewCPS );
}
if ( nCount )
{
PPTCharPropSet* pNewCPS = new PPTCharPropSet( *pSet );
- pNewCPS->maString = String( aString, (sal_uInt16)0, (sal_uInt16)nCount );
+ pNewCPS->maString = aString;
aCharPropList.insert( aCharPropList.begin() + n++, pNewCPS );
}
if ( (*FE)->pField1 )
@@ -6788,7 +6788,7 @@
if ( nCount )
{
pBefCPS = new PPTCharPropSet( *pSet );
- pSet->maString = String( pSet->maString, (sal_uInt16)nCount, (sal_uInt16)( pSet->maString.Len() - nCount ) );
+ pSet->maString = pSet->maString;
}
sal_uInt32 nIdx = n;
sal_Int32 nHyperLenLeft = nHyperLen;
@@ -6799,7 +6799,7 @@
// the solution here is to clone the hyperlink...
PPTCharPropSet* pCurrent = aCharPropList[ nIdx ];
- sal_Int32 nNextStringLen = pCurrent->maString.Len();
+ sal_Int32 nNextStringLen = pCurrent->maString.getLength();
DBG_ASSERT( (*FE)->pField1, "missing field!" );
if (!(*FE)->pField1)
@@ -6836,13 +6836,13 @@
else
{
PPTCharPropSet* pNewCPS = new PPTCharPropSet( *pCurrent );
- pNewCPS->maString = String( pCurrent->maString, (sal_uInt16)nHyperLenLeft, (sal_uInt16)( nNextStringLen - nHyperLenLeft ) );
+ pNewCPS->maString = pCurrent->maString;
aCharPropList.insert( aCharPropList.begin() + nIdx + 1, pNewCPS );
- String aRepresentation( pCurrent->maString, 0, (sal_uInt16)nHyperLenLeft );
+ OUString aRepresentation( pCurrent->maString );
pCurrent->mpFieldItem = new SvxFieldItem( SvxURLField( pField->GetURL(), aRepresentation, SVXURLFORMAT_REPR ), EE_FEATURE_FIELD );
nHyperLenLeft = 0;
}
- pCurrent->maString = String();
+ pCurrent->maString = OUString();
pCurrent->SetColor( PPT_COLSCHEME_A_UND_HYPERLINK );
}
nIdx++;
@@ -6851,7 +6851,7 @@
if ( pBefCPS )
{
- pBefCPS->maString = String( aString, (sal_uInt16)0, (sal_uInt16)nCount );
+ pBefCPS->maString = aString;
aCharPropList.insert( aCharPropList.begin() + n, pBefCPS );
n++;
}
--
To view, visit https://gerrit.libreoffice.org/1970
To unsubscribe, visit https://gerrit.libreoffice.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If9fac2f277550cc786baffe4f89c7181b2d10dfd
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Ricardo Montania <ricardo at linuxafundo.com.br>
More information about the LibreOffice
mailing list