filter/inc/filter/msfilter/svdfppt.hxx | 28 +++--- filter/source/msfilter/svdfppt.cxx | 138 ++++++++++++++++----------------- sd/source/filter/ppt/pptin.cxx | 48 +++++------ sd/source/filter/ppt/propread.cxx | 18 ++-- sd/source/filter/ppt/propread.hxx | 2 5 files changed, 117 insertions(+), 117 deletions(-)
New commits: commit e904749eb8e1109f9a884b309fad6de5f78ad623 Author: Ricardo Montania <rica...@linuxafundo.com.br> Date: Sun Feb 3 00:02:38 2013 -0200 String cleanup in filter Change-Id: If9fac2f277550cc786baffe4f89c7181b2d10dfd Reviewed-on: https://gerrit.libreoffice.org/1970 Reviewed-by: Norbert Thiebaud <nthieb...@gmail.com> Tested-by: Norbert Thiebaud <nthieb...@gmail.com> 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 @@ struct MSFILTER_DLLPUBLIC PptCurrentUserAtom sal_uInt16 nDocFileVersion; sal_uInt8 nMajorVersion; sal_uInt8 nMinorVersion; - String aCurrentUser; + OUString aCurrentUser; public: @@ -92,13 +92,13 @@ struct SdHyperlinkEntry 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 @@ public: struct PptFontEntityAtom { - String aName; + OUString aName; double fScaling; sal_uInt8 lfClipPrecision; sal_uInt8 lfQuality; @@ -416,7 +416,7 @@ protected: 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 @@ public: 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 @@ struct MSFILTER_DLLPUBLIC PPTFieldEntry 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 PPTFieldEntry 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 @@ protected: 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 @@ struct PPTCharPropSet sal_uInt32 mnOriginalTextPos; sal_uInt32 mnParagraph; - String maString; + OUString maString; SvxFieldItem* mpFieldItem; sal_uInt16 mnLanguage[ 3 ]; @@ -1049,7 +1049,7 @@ struct PPTStyleTextPropReader 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 @@ struct PPTStyleTextPropReader 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 @@ public: 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 cd8438f..373e909 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -437,7 +437,7 @@ SvStream& operator>>( SvStream& rIn, PptFontEntityAtom& rAtom ) 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 @@ PptSlidePersistEntry::~PptSlidePersistEntry() 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 @@ const PptSlideLayoutAtom* SdrEscherImport::GetSlideLayoutAtom() const 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 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi 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 @@ SdrObject* SdrPowerPointImport::ImportOLE( long nOLEId, } if ( bGetItAsOle ) { - ::rtl::OUString aNm; + OUString aNm; // if ( nSvxMSDffOLEConvFlags ) { uno::Reference < embed::XStorage > xDestStorage( pOe->pShell->GetStorage() ); @@ -1843,7 +1843,7 @@ SdrObject* SdrPowerPointImport::ImportOLE( long nOLEId, 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 @@ SdrObject* SdrPowerPointImport::ImportOLE( long nOLEId, 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 @@ sal_Bool SdrPowerPointImport::ReadFontCollection() // 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.equalsIgnoreAsciiCase( "Wingdings" ) || + pFont->aName.equalsIgnoreAsciiCase( "Wingdings 2" ) || + pFont->aName.equalsIgnoreAsciiCase( "Wingdings 3" ) || + pFont->aName.equalsIgnoreAsciiCase( "Monotype Sorts" ) || + pFont->aName.equalsIgnoreAsciiCase( "Monotype Sorts 2" ) || + pFont->aName.equalsIgnoreAsciiCase( "Webdings" ) || + pFont->aName.equalsIgnoreAsciiCase( "StarBats" ) || + pFont->aName.equalsIgnoreAsciiCase( "StarMath" ) || + pFont->aName.equalsIgnoreAsciiCase( "ZapfDingbats" ) ) { pFont->eCharSet = RTL_TEXTENCODING_SYMBOL; }; @@ -2220,7 +2220,7 @@ SdrObject* SdrPowerPointImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* 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 @@ SdrObject* SdrPowerPointImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* 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 @@ SdrObject* SdrPowerPointImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* } 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 @@ SdrPage* SdrPowerPointImport::MakeBlancPage( sal_Bool bMaster ) const 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 @@ void ImportComment10( SvxMSDffManager& rMan, SvStream& rStCtrl, SdrPage* pPage, { case PPT_PST_CString : { - rtl::OUString aString = SvxMSDffManager::MSDFFReadZString( rStCtrl, + OUString aString = SvxMSDffManager::MSDFFReadZString( rStCtrl, aCommentHd.nRecLen, sal_True ); switch ( aCommentHd.nRecInstance ) { @@ -4749,14 +4749,14 @@ PPTStyleTextPropReader::PPTStyleTextPropReader( SvStream& rIn, SdrPowerPointImpo } 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 ); @@ -4876,7 +4876,7 @@ void PPTStyleTextPropReader::ReadParaProps( SvStream& rIn, SdrPowerPointImport& 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 ) @@ -4891,7 +4891,7 @@ void PPTStyleTextPropReader::ReadParaProps( SvStream& rIn, SdrPowerPointImport& } } -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, @@ -4901,7 +4901,7 @@ void PPTStyleTextPropReader::ReadCharProps( SvStream& rIn, PPTCharPropSet& aChar 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; @@ -5003,7 +5003,7 @@ void PPTStyleTextPropReader::Init( SvStream& rIn, SdrPowerPointImport& rMan, con rIn.Seek( nMerk ); } - String aString; + OUString aString; DffRecordHeader aTextHd; rIn >> aTextHd; sal_uInt32 nMaxLen = aTextHd.nRecLen; @@ -5044,7 +5044,7 @@ void PPTStyleTextPropReader::Init( SvStream& rIn, SdrPowerPointImport& rMan, con } } if ( i ) - aString = rtl::OUString(pBuf, i); + aString = OUString(pBuf, i); delete[] pBuf; } else if( aTextHd.nRecType == PPT_PST_TextBytesAtom ) @@ -5069,7 +5069,7 @@ void PPTStyleTextPropReader::Init( SvStream& rIn, SdrPowerPointImport& rMan, con } 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 @@ -5097,7 +5097,7 @@ void PPTStyleTextPropReader::Init( SvStream& rIn, SdrPowerPointImport& rMan, con } } - if ( aString.Len() ) + if ( !aString.isEmpty() ) { sal_uInt32 nCharCount; sal_Bool bTextPropAtom = sal_False; @@ -5109,7 +5109,7 @@ void PPTStyleTextPropReader::Init( SvStream& rIn, SdrPowerPointImport& rMan, con 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 ) { @@ -5119,7 +5119,7 @@ void PPTStyleTextPropReader::Init( SvStream& rIn, SdrPowerPointImport& rMan, con PPTCharPropSet aCharPropSet( nCurrentPara ); if ( bTextPropAtom ) { - if( nCharAnzRead == ( nStringLen - 1 ) && aString.GetChar( nCharAnzRead ) == '\r' ) + if( nCharAnzRead == ( nStringLen - 1 ) && aString[nCharAnzRead] == '\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. @@ -5161,9 +5161,9 @@ void PPTStyleTextPropReader::Init( SvStream& rIn, SdrPowerPointImport& rMan, con { nLen = ( nCurrentSpecMarker & 0xffff ) - nCharAnzRead; if ( nLen ) - aCharPropSet.maString = String( aString, (sal_uInt16)nCharAnzRead, (sal_uInt16)nLen ); + aCharPropSet.maString = aString.copy( nCharAnzRead, nLen ); else if ( bEmptyParaPossible ) - aCharPropSet.maString = String(); + aCharPropSet.maString = OUString(); if ( nLen || bEmptyParaPossible ) aCharPropList.push_back( new PPTCharPropSet( aCharPropSet, nCurrentPara ) ); nCurrentPara++; @@ -5177,13 +5177,13 @@ void PPTStyleTextPropReader::Init( SvStream& rIn, SdrPowerPointImport& rMan, con if ( ( nCurrentSpecMarker & 0xffff ) != nCharAnzRead ) { nLen = ( nCurrentSpecMarker & 0xffff ) - nCharAnzRead; - aCharPropSet.maString = String( aString, (sal_uInt16)nCharAnzRead, (sal_uInt16)nLen ); + aCharPropSet.maString = aString.copy(nCharAnzRead, nLen); 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 = aString.copy(nCharAnzRead, 1); if ( aCharPropSet.pCharSet->mnAttrSet & ( 1 << PPT_CharAttr_Symbol ) ) pCPropSet->SetFont( aCharPropSet.pCharSet->mnSymbolFont ); aCharPropList.push_back( pCPropSet ); @@ -5195,7 +5195,7 @@ void PPTStyleTextPropReader::Init( SvStream& rIn, SdrPowerPointImport& rMan, con } else { - aCharPropSet.maString = String( aString, (sal_uInt16)nCharAnzRead, (sal_uInt16)nCharCount ); + aCharPropSet.maString = aString.copy(nCharAnzRead, nLen); aCharPropList.push_back( new PPTCharPropSet( aCharPropSet, nCurrentPara ) ); nCharAnzRead += nCharCount; bEmptyParaPossible = sal_False; @@ -5206,7 +5206,7 @@ void PPTStyleTextPropReader::Init( SvStream& rIn, SdrPowerPointImport& rMan, con 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 ); } @@ -5277,8 +5277,8 @@ sal_Bool PPTPortionObj::HasTabulator() { 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 ) { @@ -6492,18 +6492,18 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport 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.copy( 0, nOldLen); + pNew->maString = aString.copy( nOldLen, nNewLen); pNew->mnOriginalTextPos += nOldLen; aStyleTextPropReader.aCharPropList.insert( aStyleTextPropReader.aCharPropList.begin() + nI + 1, pNew ); } @@ -6572,7 +6572,7 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport 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; @@ -6625,7 +6625,7 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport else if (!n) { // End of format string - pEntry->pString = new String( aStr ); + pEntry->pString = new OUString( aStr ); break; } else if (!inquote) @@ -6681,11 +6681,11 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport 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.isEmpty() ) { - aTarget.Append( (sal_Unicode)'#' ); - aTarget.Append( pHyperlink->aConvSubString ); + aTarget += "#"; + aTarget += pHyperlink->aConvSubString; } pEntry->pField1 = new SvxFieldItem( SvxURLField( aTarget, String(), SVXURLFORMAT_REPR ), EE_FEATURE_FIELD ); } @@ -6727,8 +6727,8 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport 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-- ) { @@ -6740,14 +6740,14 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport if ( (*FE)->nPos == nPos ) { - if ( aString.GetChar( (sal_uInt16)nCount ) == 0x2a ) + if ( aString[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.copy( nCount + 1, nBehind ); aCharPropList.insert( aCharPropList.begin() + n + 1, pNewCPS ); } if ( (*FE)->pField2 ) @@ -6757,13 +6757,13 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport 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.copy( 0, nCount ); aCharPropList.insert( aCharPropList.begin() + n++, pNewCPS ); } if ( (*FE)->pField1 ) @@ -6784,7 +6784,7 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport if ( nCount ) { pBefCPS = new PPTCharPropSet( *pSet ); - pSet->maString = String( pSet->maString, (sal_uInt16)nCount, (sal_uInt16)( pSet->maString.Len() - nCount ) ); + pSet->maString = pSet->maString.copy(nCount, pSet->maString.getLength() - nCount); } sal_uInt32 nIdx = n; sal_Int32 nHyperLenLeft = nHyperLen; @@ -6795,7 +6795,7 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport // 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) @@ -6832,13 +6832,13 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport else { PPTCharPropSet* pNewCPS = new PPTCharPropSet( *pCurrent ); - pNewCPS->maString = String( pCurrent->maString, (sal_uInt16)nHyperLenLeft, (sal_uInt16)( nNextStringLen - nHyperLenLeft ) ); + pNewCPS->maString = pCurrent->maString.copy( nHyperLenLeft,( nNextStringLen - nHyperLenLeft ) ); aCharPropList.insert( aCharPropList.begin() + nIdx + 1, pNewCPS ); - String aRepresentation( pCurrent->maString, 0, (sal_uInt16)nHyperLenLeft ); + OUString aRepresentation = pCurrent->maString.copy( 0, nHyperLenLeft ); 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++; @@ -6847,7 +6847,7 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport if ( pBefCPS ) { - pBefCPS->maString = String( aString, (sal_uInt16)0, (sal_uInt16)nCount ); + pBefCPS->maString = aString.copy( 0, nCount ); aCharPropList.insert( aCharPropList.begin() + n, pBefCPS ); n++; } diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx index 033355a..9226f01 100644 --- a/sd/source/filter/ppt/pptin.cxx +++ b/sd/source/filter/ppt/pptin.cxx @@ -113,9 +113,9 @@ SdPPTImport::SdPPTImport( SdDrawDocument* pDocument, SvStream& rDocStream, SvSto PropItem aPropItem; if ( pSection->GetProperty( PID_COMMENTS, aPropItem ) ) { - String aComment; + OUString aComment; aPropItem.Read( aComment ); - if ( aComment.Search( String( "Applixware" ), 0 ) != STRING_NOTFOUND ) + if ( aComment.indexOf( "Applixware", 0 ) != STRING_NOTFOUND ) { nImportFlags |= PPT_IMPORTFLAGS_NO_TEXT_ASSERT; } @@ -286,7 +286,7 @@ sal_Bool ImplSdPPTImport::Import() sal_uInt32 nSlideTitleIndex = 0, nSlideTitleCount = 0; sal_uInt32 i, nTemp; - String aUString; + OUString aUString; aPropItem >> nType >> nVecCount; @@ -303,7 +303,7 @@ sal_Bool ImplSdPPTImport::Import() if ( ( nType != VT_I4 ) && ( nType != VT_UI4 ) ) break; aPropItem >> nTemp; - if ( aUString.EqualsAscii("Slide Titles") || aUString.EqualsAscii("Folientitel") ) + if ( aUString == "Slide Titles" || aUString == "Folientitel" ) { nSlideTitleCount = nTemp; nSlideTitleIndex = nEntryCount; @@ -329,16 +329,16 @@ sal_Bool ImplSdPPTImport::Import() if ( !aPropItem.Read( aUString, nType, sal_False ) ) break; - String aString( aUString ); - if ( aString.EqualsAscii( "No Slide Title" )) - aString = String(); + OUString aString( aUString ); + if ( aString == "No Slide Title" ) + aString = OUString(); else { std::vector<String>::const_iterator pIter = std::find(maSlideNameList.begin(),maSlideNameList.end(),aString); if (pIter != maSlideNameList.end()) - aString = String(); + aString = OUString(); } maSlideNameList.push_back( aString ); } @@ -409,17 +409,17 @@ sal_Bool ImplSdPPTImport::Import() break; pHyperlink->nStartPos = pHyperlink->nEndPos = -1; - if ( pHyperlink->aSubAdress.Len() ) // get the converted subadress + if ( !pHyperlink->aSubAdress.isEmpty() ) // get the converted subadress { sal_uInt32 nPageNumber = 0; - String aString( pHyperlink->aSubAdress ); + OUString aString( pHyperlink->aSubAdress ); rtl::OString aStringAry[ 3 ]; sal_uInt16 nTokenCount = comphelper::string::getTokenCount(aString, ','); if ( nTokenCount > 3 ) nTokenCount = 3; sal_uInt16 nToken; for( nToken = 0; nToken < nTokenCount; nToken++ ) - aStringAry[nToken] = rtl::OUStringToOString(aString.GetToken( nToken, (sal_Unicode)',' ), RTL_TEXTENCODING_UTF8); + aStringAry[nToken] = rtl::OUStringToOString(aString.getToken( nToken, (sal_Unicode)',' ), RTL_TEXTENCODING_UTF8); sal_Bool bSucceeded = sal_False; @@ -449,7 +449,7 @@ sal_Bool ImplSdPPTImport::Import() { // second pass, searching for a SlideName for ( nToken = 0; nToken < nTokenCount; nToken++ ) { - String aToken( aString.GetToken( nToken, (sal_Unicode)',' ) ); + String aToken( aString.getToken( nToken, (sal_Unicode)',' ) ); std::vector<String>::const_iterator pIter = std::find(maSlideNameList.begin(),maSlideNameList.end(),aToken); @@ -480,11 +480,11 @@ sal_Bool ImplSdPPTImport::Import() { if ( nPageNumber < maSlideNameList.size() ) pHyperlink->aConvSubString = maSlideNameList[ nPageNumber ]; - if ( !pHyperlink->aConvSubString.Len() ) + if ( pHyperlink->aConvSubString.isEmpty() ) { - pHyperlink->aConvSubString = String( SdResId( STR_PAGE ) ); - pHyperlink->aConvSubString.Append( sal_Unicode( ' ' ) ); - pHyperlink->aConvSubString.Append( mpDoc->CreatePageNumValue( (sal_uInt16)nPageNumber + 1 ) ); + pHyperlink->aConvSubString = OUString( SdResId( STR_PAGE ) ); + pHyperlink->aConvSubString += " "; + pHyperlink->aConvSubString += ( mpDoc->CreatePageNumValue( (sal_uInt16)nPageNumber + 1 ) ); } } } @@ -646,9 +646,9 @@ sal_Bool ImplSdPPTImport::Import() for ( nLevel = 0; nLevel < 9; nLevel++ ) { - String aName( pPage->GetLayoutName() ); - aName.Append( (sal_Unicode)( ' ' ) ); - aName.Append( OUString::number( nLevel + 1 ) ); + OUString aName( pPage->GetLayoutName() ); + aName += " "; + aName += OUString::number( nLevel + 1 ); SfxStyleSheet* pOutlineSheet = (SfxStyleSheet*)mpDoc->GetStyleSheetPool()->Find( aName, SD_STYLE_FAMILY_MASTERPAGE ); DBG_ASSERT( pOutlineSheet, "Vorlage fuer Gliederungsobjekt nicht gefunden" ); if ( pOutlineSheet ) @@ -2087,7 +2087,7 @@ void ImplSdPPTImport::FillSdAnimationInfo( SdAnimationInfo* pInfo, PptInteractiv case 9: case 8: // hyperlink : URL { - if ( pPtr->aTarget.Len() ) + if ( !pPtr->aTarget.isEmpty() ) { ::sd::DrawDocShell* pDocShell = mpDoc->GetDocSh(); if ( pDocShell ) @@ -2111,7 +2111,7 @@ void ImplSdPPTImport::FillSdAnimationInfo( SdAnimationInfo* pInfo, PptInteractiv case 7: // hyperlink auf eine Seite { - if ( pPtr->aConvSubString.Len() ) + if ( !pPtr->aConvSubString.isEmpty() ) { pInfo->meClickAction = ::com::sun::star::presentation::ClickAction_BOOKMARK; pInfo->SetBookmark( pPtr->aConvSubString ); @@ -2203,9 +2203,9 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj { for ( sal_uInt16 nLevel = 9; nLevel; nLevel-- ) { - String aName( pPage->GetLayoutName() ); - aName.Append( (sal_Unicode)( ' ' ) ); - aName.Append( OUString::number( nLevel ) ); + OUString aName( pPage->GetLayoutName() ); + aName += " "; + aName += OUString::number( nLevel ); pSheet = (SfxStyleSheet*)mpDoc->GetStyleSheetPool()->Find( aName, SD_STYLE_FAMILY_MASTERPAGE ); if ( pSheet ) pText->StartListening( *pSheet ); diff --git a/sd/source/filter/ppt/propread.cxx b/sd/source/filter/ppt/propread.cxx index 1e698db..3b053f4 100644 --- a/sd/source/filter/ppt/propread.cxx +++ b/sd/source/filter/ppt/propread.cxx @@ -74,7 +74,7 @@ static xub_StrLen lcl_getMaxSafeStrLen(sal_uInt32 nSize) return static_cast< xub_StrLen >( nSize ); } -sal_Bool PropItem::Read( String& rString, sal_uInt32 nStringType, sal_Bool bAlign ) +sal_Bool PropItem::Read( OUString& rString, sal_uInt32 nStringType, sal_Bool bAlign ) { sal_uInt32 i, nItemSize, nType, nItemPos; sal_Bool bRetValue = sal_False; @@ -105,10 +105,10 @@ sal_Bool PropItem::Read( String& rString, sal_uInt32 nStringType, sal_Bool bAlig sal_Unicode* pWString = (sal_Unicode*)pString; for ( i = 0; i < nItemSize; i++ ) *this >> pWString[ i ]; - rString = rtl::OUString(pWString, lcl_getMaxSafeStrLen(nItemSize)); + rString = OUString(pWString, lcl_getMaxSafeStrLen(nItemSize)); } else - rString = String(); + rString = OUString(); bRetValue = sal_True; } else @@ -117,9 +117,9 @@ sal_Bool PropItem::Read( String& rString, sal_uInt32 nStringType, sal_Bool bAlig if ( pString[ nItemSize - 1 ] == 0 ) { if ( nItemSize > 1 ) - rString = rtl::OUString(pString, rtl_str_getLength(pString), mnTextEnc); + rString = OUString(pString, rtl_str_getLength(pString), mnTextEnc); else - rString = String(); + rString = OUString(); bRetValue = sal_True; } } @@ -147,9 +147,9 @@ sal_Bool PropItem::Read( String& rString, sal_uInt32 nStringType, sal_Bool bAlig if ( pString[ i - 1 ] == 0 ) { if ( (sal_uInt16)nItemSize > 1 ) - rString = rtl::OUString(pString, lcl_getMaxSafeStrLen(nItemSize)); + rString = OUString(pString, lcl_getMaxSafeStrLen(nItemSize)); else - rString = String(); + rString = OUString(); bRetValue = sal_True; } delete[] pString; @@ -295,10 +295,10 @@ sal_Bool Section::GetDictionary( Dictionary& rDict ) sal_Unicode* pWString = (sal_Unicode*)pString; for ( i = 0; i < nSize; i++ ) aStream >> pWString[ i ]; - aString = rtl::OUString(pWString, lcl_getMaxSafeStrLen(nSize)); + aString = OUString(pWString, lcl_getMaxSafeStrLen(nSize)); } else - aString = rtl::OUString(pString, lcl_getMaxSafeStrLen(nSize), mnTextEnc); + aString = OUString(pString, lcl_getMaxSafeStrLen(nSize), mnTextEnc); delete[] pString; } catch( const std::bad_alloc& ) diff --git a/sd/source/filter/ppt/propread.hxx b/sd/source/filter/ppt/propread.hxx index b05b977..fe412a0 100644 --- a/sd/source/filter/ppt/propread.hxx +++ b/sd/source/filter/ppt/propread.hxx @@ -125,7 +125,7 @@ class PropItem : public SvMemoryStream void Clear(); void SetTextEncoding( sal_uInt16 nTextEnc ){ mnTextEnc = nTextEnc; }; - sal_Bool Read( String& rString, sal_uInt32 nType = VT_EMPTY, sal_Bool bDwordAlign = sal_True ); + sal_Bool Read( OUString& rString, sal_uInt32 nType = VT_EMPTY, sal_Bool bDwordAlign = sal_True ); PropItem& operator=( PropItem& rPropItem ); using SvStream::Read; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits