diff options
author | Noel Grandin <noel@peralex.com> | 2013-09-27 17:15:56 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-10-04 08:49:01 +0200 |
commit | 52fcc738eeb9c7ff3fc023668dc335076e8bef42 (patch) | |
tree | b55c71ac2942ac1d162e1201b54936dd542ed184 | |
parent | 73873ef6b4d7ad8697bda3a44bb16b7eed9b93bd (diff) |
convert sc/source/filter/inc/xi*.hxx from String to OUString
Change-Id: I211c250768ed63d3facfbbf7574cdec5415c983a
-rw-r--r-- | sc/source/filter/excel/excform8.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/excel/xichart.cxx | 6 | ||||
-rw-r--r-- | sc/source/filter/excel/xicontent.cxx | 4 | ||||
-rw-r--r-- | sc/source/filter/excel/xihelper.cxx | 28 | ||||
-rw-r--r-- | sc/source/filter/excel/xilink.cxx | 52 | ||||
-rw-r--r-- | sc/source/filter/excel/xiname.cxx | 10 | ||||
-rw-r--r-- | sc/source/filter/excel/xiroot.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/excel/xistream.cxx | 14 | ||||
-rw-r--r-- | sc/source/filter/excel/xistring.cxx | 10 | ||||
-rw-r--r-- | sc/source/filter/excel/xistyle.cxx | 8 | ||||
-rw-r--r-- | sc/source/filter/inc/xichart.hxx | 4 | ||||
-rw-r--r-- | sc/source/filter/inc/xicontent.hxx | 7 | ||||
-rw-r--r-- | sc/source/filter/inc/xiescher.hxx | 2 | ||||
-rw-r--r-- | sc/source/filter/inc/xihelper.hxx | 4 | ||||
-rw-r--r-- | sc/source/filter/inc/xilink.hxx | 14 | ||||
-rw-r--r-- | sc/source/filter/inc/xiname.hxx | 10 | ||||
-rw-r--r-- | sc/source/filter/inc/xipivot.hxx | 2 | ||||
-rw-r--r-- | sc/source/filter/inc/xiroot.hxx | 2 | ||||
-rw-r--r-- | sc/source/filter/inc/xistream.hxx | 12 | ||||
-rw-r--r-- | sc/source/filter/inc/xistring.hxx | 16 | ||||
-rw-r--r-- | sc/source/filter/inc/xistyle.hxx | 12 |
21 files changed, 111 insertions, 110 deletions
diff --git a/sc/source/filter/excel/excform8.cxx b/sc/source/filter/excel/excform8.cxx index aa5a98f7d42c..23493ab74157 100644 --- a/sc/source/filter/excel/excform8.cxx +++ b/sc/source/filter/excel/excform8.cxx @@ -695,7 +695,7 @@ ConvErr ExcelToSc8::Convert( const ScTokenArray*& rpTokArray, XclImpStream& aIn, case xlExtDDE: { - String aApplic, aTopic; + OUString aApplic, aTopic; if( rLinkMan.GetLinkData( aApplic, aTopic, nXtiIndex ) ) { TokenId nPar1 = aPool.Store( aApplic ); diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx index 1df40dfb7b1a..b88f6105f591 100644 --- a/sc/source/filter/excel/xichart.cxx +++ b/sc/source/filter/excel/xichart.cxx @@ -769,7 +769,7 @@ void XclImpChSourceLink::ReadChSourceLink( XclImpStream& rStrm ) } } -void XclImpChSourceLink::SetString( const String& rString ) +void XclImpChSourceLink::SetString( const OUString& rString ) { if( !mxString ) mxString.reset( new XclImpString ); @@ -851,7 +851,7 @@ Reference< XDataSequence > XclImpChSourceLink::CreateDataSequence( const OUStrin // OSL_FAIL( "XclImpChSourceLink::CreateDataSequence - cannot create data sequence" ); } } - else if( rRole == EXC_CHPROP_ROLE_LABEL && mxString && mxString->GetText().Len() ) + else if( rRole == EXC_CHPROP_ROLE_LABEL && mxString && !mxString->GetText().isEmpty() ) { try { @@ -1022,7 +1022,7 @@ sal_uInt16 XclImpChText::GetRotation() const return maData.mnRotation; } -void XclImpChText::SetString( const String& rString ) +void XclImpChText::SetString( const OUString& rString ) { if( !mxSrcLink ) mxSrcLink.reset( new XclImpChSourceLink( GetChRoot() ) ); diff --git a/sc/source/filter/excel/xicontent.cxx b/sc/source/filter/excel/xicontent.cxx index c62dde8b1478..8adc3a6dfa28 100644 --- a/sc/source/filter/excel/xicontent.cxx +++ b/sc/source/filter/excel/xicontent.cxx @@ -397,7 +397,7 @@ void XclImpHyperlink::ConvertToValidTabName(String& rUrl) rUrl = aNewUrl; } -void XclImpHyperlink::InsertUrl( XclImpRoot& rRoot, const XclRange& rXclRange, const String& rUrl ) +void XclImpHyperlink::InsertUrl( XclImpRoot& rRoot, const XclRange& rXclRange, const OUString& rUrl ) { String aUrl(rUrl); ConvertToValidTabName(aUrl); @@ -955,7 +955,7 @@ void XclImpWebQuery::ReadWqtables( XclImpStream& rStrm ) void XclImpWebQuery::Apply( ScDocument& rDoc, const OUString& rFilterName ) { - if( maURL.Len() && (meMode != xlWQUnknown) && rDoc.GetDocumentShell() ) + if( !maURL.isEmpty() && (meMode != xlWQUnknown) && rDoc.GetDocumentShell() ) { ScAreaLink* pLink = new ScAreaLink( rDoc.GetDocumentShell(), maURL, rFilterName, EMPTY_STRING, maTables, maDestRange, mnRefresh * 60UL ); diff --git a/sc/source/filter/excel/xihelper.cxx b/sc/source/filter/excel/xihelper.cxx index ea41c8c91760..73b4003ad639 100644 --- a/sc/source/filter/excel/xihelper.cxx +++ b/sc/source/filter/excel/xihelper.cxx @@ -170,7 +170,7 @@ EditTextObject* lclCreateTextObject( const XclImpRoot& rRoot, else aNextRun.mnChar = 0xFFFF; - xub_StrLen nLen = rString.GetText().Len(); + sal_Int32 nLen = rString.GetText().getLength(); for( sal_uInt16 nChar = 0; nChar < nLen; ++nChar ) { // reached new different formatted text portion @@ -195,7 +195,7 @@ EditTextObject* lclCreateTextObject( const XclImpRoot& rRoot, } // set end of selection to current position - if( rString.GetText().GetChar( nChar ) == '\n' ) + if( rString.GetText()[ nChar ] == '\n' ) { ++aSelection.nEndPara; aSelection.nEndPos = 0; @@ -225,7 +225,7 @@ void XclImpStringHelper::SetToDocument( ScDocumentImport& rDoc, const ScAddress& rPos, const XclImpRoot& rRoot, const XclImpString& rString, sal_uInt16 nXFIndex ) { - if (!rString.GetText().Len()) + if (rString.GetText().isEmpty()) return; ::std::auto_ptr< EditTextObject > pTextObj( lclCreateTextObject( rRoot, rString, EXC_FONTITEM_EDITENG, nXFIndex ) ); @@ -285,7 +285,7 @@ void XclImpHFConverter::ParseString( const OUString& rHFString ) meCurrObj = EXC_HF_CENTER; // parser temporaries - maCurrText.Erase(); + maCurrText = ""; String aReadFont; // current font name String aReadStyle; // current font style sal_uInt16 nReadHeight = 0; // current font height @@ -323,7 +323,7 @@ void XclImpHFConverter::ParseString( const OUString& rHFString ) InsertLineBreak(); break; default: - maCurrText += *pChar; + maCurrText += OUString(*pChar); } } break; @@ -335,7 +335,7 @@ void XclImpHFConverter::ParseString( const OUString& rHFString ) eState = xlPSText; switch( *pChar ) { - case '&': maCurrText += '&'; break; // the '&' character + case '&': maCurrText += "&"; break; // the '&' character case 'L': SetNewPortion( EXC_HF_LEFT ); break; // Left portion case 'C': SetNewPortion( EXC_HF_CENTER ); break; // Center portion @@ -542,12 +542,12 @@ void XclImpHFConverter::ResetFontData() void XclImpHFConverter::InsertText() { - if( maCurrText.Len() ) + if( !maCurrText.isEmpty() ) { ESelection& rSel = GetCurrSel(); mrEE.QuickInsertText( maCurrText, ESelection( rSel.nEndPara, rSel.nEndPos, rSel.nEndPara, rSel.nEndPos ) ); - rSel.nEndPos = rSel.nEndPos + maCurrText.Len(); - maCurrText.Erase(); + rSel.nEndPos = rSel.nEndPos + maCurrText.getLength(); + maCurrText = ""; UpdateCurrMaxLineHeight(); } } @@ -762,13 +762,13 @@ void XclImpUrlHelper::DecodeUrl( OSL_ENSURE( aTabName.isEmpty(), "XclImpUrlHelper::DecodeUrl - sheet name ignored" ); } -bool XclImpUrlHelper::DecodeLink( String& rApplic, String& rTopic, const String rEncUrl ) +bool XclImpUrlHelper::DecodeLink( OUString& rApplic, OUString& rTopic, const OUString rEncUrl ) { - xub_StrLen nPos = rEncUrl.Search( EXC_DDE_DELIM ); - if( (nPos != STRING_NOTFOUND) && (0 < nPos) && (nPos + 1 < rEncUrl.Len()) ) + sal_Int32 nPos = rEncUrl.indexOf( EXC_DDE_DELIM ); + if( (nPos != -1) && (0 < nPos) && (nPos + 1 < rEncUrl.getLength()) ) { - rApplic = rEncUrl.Copy( 0, nPos ); - rTopic = rEncUrl.Copy( nPos + 1 ); + rApplic = rEncUrl.copy( 0, nPos ); + rTopic = rEncUrl.copy( nPos + 1 ); return true; } return false; diff --git a/sc/source/filter/excel/xilink.cxx b/sc/source/filter/excel/xilink.cxx index c598c5af3867..d72e734d2f47 100644 --- a/sc/source/filter/excel/xilink.cxx +++ b/sc/source/filter/excel/xilink.cxx @@ -66,10 +66,10 @@ class XclImpSupbookTab public: /** Stores the sheet name and marks the sheet index as invalid. The sheet index is set while creating the Calc sheet with CreateTable(). */ - explicit XclImpSupbookTab( const String& rTabName ); + explicit XclImpSupbookTab( const OUString& rTabName ); ~XclImpSupbookTab(); - inline const String& GetTabName() const { return maTabName; } + inline const OUString& GetTabName() const { return maTabName; } /** Reads a CRN record (external referenced cell) at the specified address. */ void ReadCrn( XclImpStream& rStrm, const XclAddress& rXclPos ); @@ -81,7 +81,7 @@ private: typedef std::vector< XclImpCrnRef > XclImpCrnList; XclImpCrnList maCrnList; /// List of CRN records (cached cell values). - String maTabName; /// Name of the external sheet. + OUString maTabName; /// Name of the external sheet. }; // External document (SUPBOOK) ================================================ @@ -113,11 +113,11 @@ public: @descr For DDE links: Decodes to application name and topic. For OLE object links: Decodes to class name and document URL. @return true = decoding was successful, returned strings are valid (not empty). */ - bool GetLinkData( String& rApplic, String& rDoc ) const; + bool GetLinkData( OUString& rApplic, OUString& rDoc ) const; /** Returns the specified macro name (1-based) or an empty string on error. */ - const String& GetMacroName( sal_uInt16 nXclNameIdx ) const; + const OUString& GetMacroName( sal_uInt16 nXclNameIdx ) const; - const String& GetTabName( sal_uInt16 nXtiTab ) const; + const OUString& GetTabName( sal_uInt16 nXtiTab ) const; sal_uInt16 GetTabCount() const; @@ -187,15 +187,15 @@ public: the index. */ const OUString* GetSupbookUrl( sal_uInt16 nXtiIndex ) const; - const String& GetSupbookTabName( sal_uInt16 nXti, sal_uInt16 nXtiTab ) const; + const OUString& GetSupbookTabName( sal_uInt16 nXti, sal_uInt16 nXtiTab ) const; /** Tries to decode the URL of the specified XTI entry to OLE or DDE link components. @descr For DDE links: Decodes to application name and topic. For OLE object links: Decodes to class name and document URL. @return true = decoding was successful, returned strings are valid (not empty). */ - bool GetLinkData( String& rApplic, String& rTopic, sal_uInt16 nXtiIndex ) const; + bool GetLinkData( OUString& rApplic, OUString& rTopic, sal_uInt16 nXtiIndex ) const; /** Returns the specified macro name or an empty string on error. */ - const String& GetMacroName( sal_uInt16 nExtSheet, sal_uInt16 nExtName ) const; + const OUString& GetMacroName( sal_uInt16 nExtSheet, sal_uInt16 nExtName ) const; private: /** Returns the specified XTI (link entry from BIFF8 EXTERNSHEET record). */ @@ -221,7 +221,7 @@ private: // original Excel sheet names ------------------------------------------------- -void XclImpTabInfo::AppendXclTabName( const String& rXclTabName, SCTAB nScTab ) +void XclImpTabInfo::AppendXclTabName( const OUString& rXclTabName, SCTAB nScTab ) { maTabNames[ rXclTabName ] = nScTab; } @@ -233,7 +233,7 @@ void XclImpTabInfo::InsertScTab( SCTAB nScTab ) ++aIt->second; } -SCTAB XclImpTabInfo::GetScTabFromXclName( const String& rXclTabName ) const +SCTAB XclImpTabInfo::GetScTabFromXclName( const OUString& rXclTabName ) const { XclTabNameMap::const_iterator aIt = maTabNames.find( rXclTabName ); return (aIt != maTabNames.end()) ? aIt->second : SCTAB_INVALID; @@ -396,7 +396,7 @@ XclImpExtName::~XclImpExtName() delete mpMOper; } -void XclImpExtName::CreateDdeData( ScDocument& rDoc, const String& rApplic, const String& rTopic ) const +void XclImpExtName::CreateDdeData( ScDocument& rDoc, const OUString& rApplic, const OUString& rTopic ) const { ScMatrixRef xResults; if( mxDdeMatrix.get() ) @@ -551,7 +551,7 @@ const XclAddress& XclImpCrn::GetAddress() const // Sheet in an external document ============================================== -XclImpSupbookTab::XclImpSupbookTab( const String& rTabName ) : +XclImpSupbookTab::XclImpSupbookTab( const OUString& rTabName ) : maTabName( rTabName ) { } @@ -690,22 +690,22 @@ const XclImpExtName* XclImpSupbook::GetExternName( sal_uInt16 nXclIndex ) const return &maExtNameList[nXclIndex-1]; } -bool XclImpSupbook::GetLinkData( String& rApplic, String& rTopic ) const +bool XclImpSupbook::GetLinkData( OUString& rApplic, OUString& rTopic ) const { return (meType == EXC_SBTYPE_SPECIAL) && XclImpUrlHelper::DecodeLink( rApplic, rTopic, maXclUrl ); } -const String& XclImpSupbook::GetMacroName( sal_uInt16 nXclNameIdx ) const +const OUString& XclImpSupbook::GetMacroName( sal_uInt16 nXclNameIdx ) const { OSL_ENSURE( nXclNameIdx > 0, "XclImpSupbook::GetMacroName - index must be >0" ); const XclImpName* pName = (meType == EXC_SBTYPE_SELF) ? GetNameManager().GetName( nXclNameIdx ) : 0; - return (pName && pName->IsVBName()) ? pName->GetScName() : EMPTY_STRING; + return (pName && pName->IsVBName()) ? pName->GetScName() : EMPTY_OUSTRING; } -const String& XclImpSupbook::GetTabName( sal_uInt16 nXtiTab ) const +const OUString& XclImpSupbook::GetTabName( sal_uInt16 nXtiTab ) const { if (nXtiTab >= maSupbTabList.size()) - return EMPTY_STRING; + return EMPTY_OUSTRING; return maSupbTabList[nXtiTab].GetTabName(); } @@ -817,22 +817,22 @@ const OUString* XclImpLinkManagerImpl::GetSupbookUrl( sal_uInt16 nXtiIndex ) con return &p->GetXclUrl(); } -const String& XclImpLinkManagerImpl::GetSupbookTabName( sal_uInt16 nXti, sal_uInt16 nXtiTab ) const +const OUString& XclImpLinkManagerImpl::GetSupbookTabName( sal_uInt16 nXti, sal_uInt16 nXtiTab ) const { const XclImpSupbook* p = GetSupbook(nXti); - return p ? p->GetTabName(nXtiTab) : EMPTY_STRING; + return p ? p->GetTabName(nXtiTab) : EMPTY_OUSTRING; } -bool XclImpLinkManagerImpl::GetLinkData( String& rApplic, String& rTopic, sal_uInt16 nXtiIndex ) const +bool XclImpLinkManagerImpl::GetLinkData( OUString& rApplic, OUString& rTopic, sal_uInt16 nXtiIndex ) const { const XclImpSupbook* pSupbook = GetSupbook( nXtiIndex ); return pSupbook && pSupbook->GetLinkData( rApplic, rTopic ); } -const String& XclImpLinkManagerImpl::GetMacroName( sal_uInt16 nExtSheet, sal_uInt16 nExtName ) const +const OUString& XclImpLinkManagerImpl::GetMacroName( sal_uInt16 nExtSheet, sal_uInt16 nExtName ) const { const XclImpSupbook* pSupbook = GetSupbook( nExtSheet ); - return pSupbook ? pSupbook->GetMacroName( nExtName ) : EMPTY_STRING; + return pSupbook ? pSupbook->GetMacroName( nExtName ) : EMPTY_OUSTRING; } const XclImpXti* XclImpLinkManagerImpl::GetXti( sal_uInt16 nXtiIndex ) const @@ -916,17 +916,17 @@ const OUString* XclImpLinkManager::GetSupbookUrl( sal_uInt16 nXtiIndex ) const return mxImpl->GetSupbookUrl(nXtiIndex); } -const String& XclImpLinkManager::GetSupbookTabName( sal_uInt16 nXti, sal_uInt16 nXtiTab ) const +const OUString& XclImpLinkManager::GetSupbookTabName( sal_uInt16 nXti, sal_uInt16 nXtiTab ) const { return mxImpl->GetSupbookTabName(nXti, nXtiTab); } -bool XclImpLinkManager::GetLinkData( String& rApplic, String& rTopic, sal_uInt16 nXtiIndex ) const +bool XclImpLinkManager::GetLinkData( OUString& rApplic, OUString& rTopic, sal_uInt16 nXtiIndex ) const { return mxImpl->GetLinkData( rApplic, rTopic, nXtiIndex ); } -const String& XclImpLinkManager::GetMacroName( sal_uInt16 nExtSheet, sal_uInt16 nExtName ) const +const OUString& XclImpLinkManager::GetMacroName( sal_uInt16 nExtSheet, sal_uInt16 nExtName ) const { return mxImpl->GetMacroName( nExtSheet, nExtName ); } diff --git a/sc/source/filter/excel/xiname.cxx b/sc/source/filter/excel/xiname.cxx index 66bc030f8c66..58575e581325 100644 --- a/sc/source/filter/excel/xiname.cxx +++ b/sc/source/filter/excel/xiname.cxx @@ -100,10 +100,10 @@ XclImpName::XclImpName( XclImpStream& rStrm, sal_uInt16 nXclNameIdx ) : bool bBuiltIn = ::get_flag( nFlags, EXC_NAME_BUILTIN ); // special case for BIFF5 filter range - name appears as plain text without built-in flag - if( (GetBiff() == EXC_BIFF5) && (maXclName.Equals(XclTools::GetXclBuiltInDefName(EXC_BUILTIN_FILTERDATABASE))) ) + if( (GetBiff() == EXC_BIFF5) && (maXclName == XclTools::GetXclBuiltInDefName(EXC_BUILTIN_FILTERDATABASE)) ) { bBuiltIn = true; - maXclName.Assign( EXC_BUILTIN_FILTERDATABASE ); + maXclName = OUString(EXC_BUILTIN_FILTERDATABASE); } // convert Excel name to Calc name @@ -115,8 +115,8 @@ XclImpName::XclImpName( XclImpStream& rStrm, sal_uInt16 nXclNameIdx ) : else if( bBuiltIn ) { // built-in name - if( maXclName.Len() ) - mcBuiltIn = maXclName.GetChar( 0 ); + if( !maXclName.isEmpty() ) + mcBuiltIn = maXclName[0]; if( mcBuiltIn == '?' ) // NUL character is imported as '?' mcBuiltIn = '\0'; maScName = XclTools::GetBuiltInDefName( mcBuiltIn ); @@ -281,7 +281,7 @@ void XclImpNameManager::ReadName( XclImpStream& rStrm ) maNameList.push_back( new XclImpName( rStrm, static_cast< sal_uInt16 >( nCount + 1 ) ) ); } -const XclImpName* XclImpNameManager::FindName( const String& rXclName, SCTAB nScTab ) const +const XclImpName* XclImpNameManager::FindName( const OUString& rXclName, SCTAB nScTab ) const { const XclImpName* pGlobalName = 0; // a found global name const XclImpName* pLocalName = 0; // a found local name diff --git a/sc/source/filter/excel/xiroot.cxx b/sc/source/filter/excel/xiroot.cxx index 3835d64b9d9b..0e8ada0855c4 100644 --- a/sc/source/filter/excel/xiroot.cxx +++ b/sc/source/filter/excel/xiroot.cxx @@ -268,7 +268,7 @@ XclImpTabViewSettings& XclImpRoot::GetTabViewSettings() const return *mrImpData.mxTabViewSett; } -String XclImpRoot::GetScAddInName( const String& rXclName ) const +OUString XclImpRoot::GetScAddInName( const OUString& rXclName ) const { OUString aScName; if( ScGlobal::GetAddInCollection()->GetCalcName( rXclName, aScName ) ) diff --git a/sc/source/filter/excel/xistream.cxx b/sc/source/filter/excel/xistream.cxx index 33dd89c1e231..a3b133999de0 100644 --- a/sc/source/filter/excel/xistream.cxx +++ b/sc/source/filter/excel/xistream.cxx @@ -898,7 +898,7 @@ sal_Size XclImpStream::ReadUniStringExtHeader( bool& rb16Bit, sal_uInt8 nFlags ) // ---------------------------------------------------------------------------- -String XclImpStream::ReadRawUniString( sal_uInt16 nChars, bool b16Bit ) +OUString XclImpStream::ReadRawUniString( sal_uInt16 nChars, bool b16Bit ) { String aRet; sal_uInt16 nCharsLeft = nChars; @@ -951,7 +951,7 @@ String XclImpStream::ReadRawUniString( sal_uInt16 nChars, bool b16Bit ) return aRet; } -String XclImpStream::ReadUniString( sal_uInt16 nChars, sal_uInt8 nFlags ) +OUString XclImpStream::ReadUniString( sal_uInt16 nChars, sal_uInt8 nFlags ) { bool b16Bit; sal_Size nExtSize = ReadUniStringExtHeader( b16Bit, nFlags ); @@ -960,12 +960,12 @@ String XclImpStream::ReadUniString( sal_uInt16 nChars, sal_uInt8 nFlags ) return aRet; } -String XclImpStream::ReadUniString( sal_uInt16 nChars ) +OUString XclImpStream::ReadUniString( sal_uInt16 nChars ) { return ReadUniString( nChars, ReaduInt8() ); } -String XclImpStream::ReadUniString() +OUString XclImpStream::ReadUniString() { return ReadUniString( ReaduInt16() ); } @@ -1011,17 +1011,17 @@ void XclImpStream::IgnoreUniString( sal_uInt16 nChars ) // ---------------------------------------------------------------------------- -String XclImpStream::ReadRawByteString( sal_uInt16 nChars ) +OUString XclImpStream::ReadRawByteString( sal_uInt16 nChars ) { sal_Char* pcBuffer = new sal_Char[ nChars + 1 ]; sal_uInt16 nCharsRead = ReadRawData( pcBuffer, nChars ); pcBuffer[ nCharsRead ] = '\0'; - String aRet( pcBuffer, mrRoot.GetTextEncoding() ); + OUString aRet( pcBuffer, strlen(pcBuffer), mrRoot.GetTextEncoding() ); delete[] pcBuffer; return aRet; } -String XclImpStream::ReadByteString( bool b16BitLen ) +OUString XclImpStream::ReadByteString( bool b16BitLen ) { return ReadRawByteString( ReadByteStrLen( b16BitLen ) ); } diff --git a/sc/source/filter/excel/xistring.cxx b/sc/source/filter/excel/xistring.cxx index f4504cbc9809..e03c3a8bc367 100644 --- a/sc/source/filter/excel/xistring.cxx +++ b/sc/source/filter/excel/xistring.cxx @@ -33,7 +33,7 @@ XclImpString::XclImpString() { } -XclImpString::XclImpString( const String& rString ) : +XclImpString::XclImpString( const OUString& rString ) : maString( rString ) { } @@ -165,12 +165,12 @@ XclImpStringIterator::XclImpStringIterator( const XclImpString& rString ) : ++mnFormatsEnd; // find end position of the first portion mnTextEnd = static_cast< xub_StrLen >( (mnFormatsEnd < mrFormats.size()) ? - mrFormats[ mnFormatsEnd ].mnChar : mrText.Len() ); + mrFormats[ mnFormatsEnd ].mnChar : mrText.getLength() ); } -String XclImpStringIterator::GetPortionText() const +OUString XclImpStringIterator::GetPortionText() const { - return String( mrText, mnTextBeg, mnTextEnd - mnTextBeg ); + return mrText.copy( mnTextBeg, mnTextEnd - mnTextBeg ); } sal_uInt16 XclImpStringIterator::GetPortionFont() const @@ -193,7 +193,7 @@ XclImpStringIterator& XclImpStringIterator::operator++() // character positions of next portion mnTextBeg = mnTextEnd; mnTextEnd = static_cast< xub_StrLen >( (mnFormatsEnd < mrFormats.size()) ? - mrFormats[ mnFormatsEnd ].mnChar : mrText.Len() ); + mrFormats[ mnFormatsEnd ].mnChar : mrText.getLength() ); } while( Is() && (mnTextBeg == mnTextEnd) ); } diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx index 197727e4c27c..e4d6f35ca6c0 100644 --- a/sc/source/filter/excel/xistyle.cxx +++ b/sc/source/filter/excel/xistyle.cxx @@ -1452,7 +1452,7 @@ void XclImpStyle::ReadStyle( XclImpStream& rStrm ) ScStyleSheet* XclImpStyle::CreateStyleSheet() { // #i1624# #i1768# ignore unnamed user styles - if( !mpStyleSheet && (maFinalName.Len() > 0) ) + if( !mpStyleSheet && (!maFinalName.isEmpty()) ) { bool bCreatePattern = false; XclImpXF* pXF = GetXFBuffer().GetXF( mnXfId ); @@ -1488,7 +1488,7 @@ ScStyleSheet* XclImpStyle::CreateStyleSheet() return mpStyleSheet; } -void XclImpStyle::CreateUserStyle( const String& rFinalName ) +void XclImpStyle::CreateUserStyle( const OUString& rFinalName ) { maFinalName = rFinalName; if( !IsBuiltin() || mbCustom ) @@ -1591,7 +1591,7 @@ void XclImpXFBuffer::CreateUserStyles() for( XclImpStyleList::iterator itStyle = maUserStyles.begin(); itStyle != maUserStyles.end(); ++itStyle ) { // #i1624# #i1768# ignore unnamed user styles - if( itStyle->GetName().Len() > 0 ) + if( !itStyle->GetName().isEmpty() ) { if( aCellStyles.count( itStyle->GetName() ) > 0 ) aConflictNameStyles.push_back( &(*itStyle) ); @@ -1921,7 +1921,7 @@ void XclImpXFRangeBuffer::SetBorderLine( const ScRange& rRange, SCTAB nScTab, sa rDoc.ApplyAttr( rRange.aStart.Col(), rRange.aStart.Row(), nScTab, aNewItem ); } -void XclImpXFRangeBuffer::SetHyperlink( const XclRange& rXclRange, const String& rUrl ) +void XclImpXFRangeBuffer::SetHyperlink( const XclRange& rXclRange, const OUString& rUrl ) { maHyperlinks.push_back( XclImpHyperlinkRange( rXclRange, rUrl ) ); } diff --git a/sc/source/filter/inc/xichart.hxx b/sc/source/filter/inc/xichart.hxx index 1b02b1c9fcca..8ce7d03e7079 100644 --- a/sc/source/filter/inc/xichart.hxx +++ b/sc/source/filter/inc/xichart.hxx @@ -402,7 +402,7 @@ public: /** Reads the CHSOURCELINK record (link to source data). */ void ReadChSourceLink( XclImpStream& rStrm ); /** Sets explicit string data for this text object. */ - void SetString( const String& rString ); + void SetString( const OUString& rString ); /** Sets formatting runs read from a CHFORMATRUNS record. */ void SetTextFormats( const XclFormatRunVec& rFormats ); @@ -505,7 +505,7 @@ public: virtual sal_uInt16 GetRotation() const; /** Sets explicit string data for this text object. */ - void SetString( const String& rString ); + void SetString( const OUString& rString ); /** Updates missing parts of this text object from the passed object. */ void UpdateText( const XclImpChText* pParentText ); /** Updates display type of this data point label text object. */ diff --git a/sc/source/filter/inc/xicontent.hxx b/sc/source/filter/inc/xicontent.hxx index 2a8f140f1bf6..9c9c107f3a35 100644 --- a/sc/source/filter/inc/xicontent.hxx +++ b/sc/source/filter/inc/xicontent.hxx @@ -34,7 +34,8 @@ /* ============================================================================ Classes to import the big Excel document contents (related to several cells or globals for the document). -- Shared string tables +- Shared + tables - Hyperlinks - Label ranges - Conditional formatting @@ -81,7 +82,7 @@ public: static OUString ReadEmbeddedData( XclImpStream& rStrm ); /** Inserts the URL into a range of cells. Does not modify value or formula cells. */ - static void InsertUrl( XclImpRoot& rRoot, const XclRange& rXclRange, const String& rUrl ); + static void InsertUrl( XclImpRoot& rRoot, const XclRange& rXclRange, const OUString& rUrl ); /** Convert the sheet name with invalid character(s) in URL when the URL is to a location within the same document (e.g. #'Sheet&Name'.A1). */ @@ -218,7 +219,7 @@ private: xlWQSpecTables /// Specific tables. }; - String maURL; /// Source document URL. + OUString maURL; /// Source document URL. OUString maTables; /// List of source range names. ScRange maDestRange; /// Destination range. XclImpWebQueryMode meMode; /// Current mode of the web query. diff --git a/sc/source/filter/inc/xiescher.hxx b/sc/source/filter/inc/xiescher.hxx index cdb9fd23f80c..03a6b3e392cc 100644 --- a/sc/source/filter/inc/xiescher.hxx +++ b/sc/source/filter/inc/xiescher.hxx @@ -1252,7 +1252,7 @@ private: // ------------------------------------------------------------------------ private: - typedef ::std::map< sal_uInt16, String > DefObjNameMap; + typedef ::std::map< sal_uInt16, OUString > DefObjNameMap; typedef boost::shared_ptr< XclImpSheetDrawing > XclImpSheetDrawingRef; typedef ::std::map< SCTAB, XclImpSheetDrawingRef > XclImpSheetDrawingMap; diff --git a/sc/source/filter/inc/xihelper.hxx b/sc/source/filter/inc/xihelper.hxx index 0727f2664045..fa8aac7ffd06 100644 --- a/sc/source/filter/inc/xihelper.hxx +++ b/sc/source/filter/inc/xihelper.hxx @@ -231,7 +231,7 @@ private: private: EditEngine& mrEE; /// The header/footer edit engine. XclImpHFPortionInfoVec maInfos; /// Edit engine text objects for all portions. - String maCurrText; /// Current text to insert into edit engine. + OUString maCurrText; /// Current text to insert into edit engine. XclFontDataPtr mxFontData; /// Font data of current text. XclImpHFPortion meCurrObj; /// The current portion. }; @@ -271,7 +271,7 @@ public: @descr For DDE links: Decodes to application name and topic. For OLE object links: Decodes to class name and document URL. @return true = decoding was successful, returned strings are valid (not empty). */ - static bool DecodeLink( String& rApplic, String& rTopic, const String rEncUrl ); + static bool DecodeLink( OUString& rApplic, OUString& rTopic, const OUString rEncUrl ); private: /** We don't want anybody to instantiate this class, since it is just a diff --git a/sc/source/filter/inc/xilink.hxx b/sc/source/filter/inc/xilink.hxx index 4a0f23c3132d..56770ecee2bf 100644 --- a/sc/source/filter/inc/xilink.hxx +++ b/sc/source/filter/inc/xilink.hxx @@ -56,12 +56,12 @@ public: // original Excel sheet names --------------------------------------------- /** Appends an original Excel sheet name with corresponding Calc sheet index. */ - void AppendXclTabName( const String& rXclTabName, SCTAB nScTab ); + void AppendXclTabName( const OUString& rXclTabName, SCTAB nScTab ); /** Inserts a Calc sheet index (increases all following sheet indexes). */ void InsertScTab( SCTAB nScTab ); /** Returns the Calc sheet index from the passed original Excel sheet name. */ - SCTAB GetScTabFromXclName( const String& rXclTabName ) const; + SCTAB GetScTabFromXclName( const OUString& rXclTabName ) const; // record creation order - TABID record ----------------------------------- @@ -77,7 +77,7 @@ public: sal_uInt16 GetCurrentIndex( sal_uInt16 nCreatedId, sal_uInt16 nMaxTabId = 0xFFFF ) const; private: - typedef ::std::map< String, SCTAB > XclTabNameMap; + typedef ::std::map< OUString, SCTAB > XclTabNameMap; XclTabNameMap maTabNames; /// All Excel sheet names with Calc sheet index. ScfUInt16Vec maTabIdVec; /// The vector with sheet indexes. @@ -126,7 +126,7 @@ public: /** Create and apply the cached list of this DDE Link to the document. */ void CreateDdeData( ScDocument& rDoc, - const String& rApplc, const String& rExtDoc ) const; + const OUString& rApplc, const OUString& rExtDoc ) const; void CreateExtNameData( ScDocument& rDoc, sal_uInt16 nFileId ) const; @@ -204,15 +204,15 @@ public: const OUString* GetSupbookUrl( sal_uInt16 nXtiIndex ) const; - const String& GetSupbookTabName( sal_uInt16 nXti, sal_uInt16 nXtiTab ) const; + const OUString& GetSupbookTabName( sal_uInt16 nXti, sal_uInt16 nXtiTab ) const; /** Tries to decode the URL of the specified XTI entry to OLE or DDE link components. @descr For DDE links: Decodes to application name and topic. For OLE object links: Decodes to class name and document URL. @return true = decoding was successful, returned strings are valid (not empty). */ - bool GetLinkData( String& rApplic, String& rTopic, sal_uInt16 nXtiIndex ) const; + bool GetLinkData( OUString& rApplic, OUString& rTopic, sal_uInt16 nXtiIndex ) const; /** Returns the specified macro name or an empty string on error. */ - const String& GetMacroName( sal_uInt16 nExtSheet, sal_uInt16 nExtName ) const; + const OUString& GetMacroName( sal_uInt16 nExtSheet, sal_uInt16 nExtName ) const; private: typedef ::std::auto_ptr< XclImpLinkManagerImpl > XclImpLinkMgrImplPtr; diff --git a/sc/source/filter/inc/xiname.hxx b/sc/source/filter/inc/xiname.hxx index 3d8067f92ed9..f3f3bac6e33d 100644 --- a/sc/source/filter/inc/xiname.hxx +++ b/sc/source/filter/inc/xiname.hxx @@ -51,8 +51,8 @@ class XclImpName : protected XclImpRoot, public boost::noncopyable public: explicit XclImpName( XclImpStream& rStrm, sal_uInt16 nXclNameIdx ); - inline const String& GetXclName() const { return maXclName; } - inline const String& GetScName() const { return maScName; } + inline const OUString& GetXclName() const { return maXclName; } + inline const OUString& GetScName() const { return maScName; } inline SCTAB GetScTab() const { return mnScTab; } inline const ScRangeData* GetScRangeData() const { return mpScData; } inline bool IsGlobal() const { return mnScTab == SCTAB_MAX; } @@ -63,8 +63,8 @@ public: private: void InsertName(const ScTokenArray* pArray); - String maXclName; /// Original name read from the file. - String maScName; /// Name inserted into the Calc document. + OUString maXclName; /// Original name read from the file. + OUString maScName; /// Name inserted into the Calc document. const ScRangeData* mpScData; /// Pointer to Calc defined name (no ownership). sal_Unicode mcBuiltIn; /// Excel built-in name index. SCTAB mnScTab; /// Calc sheet index of local names. @@ -96,7 +96,7 @@ public: @param nScTab The sheet index for local names or SCTAB_MAX for global names. If no local name is found, tries to find a matching global name. @return Pointer to the defined name or 0 on error. */ - const XclImpName* FindName( const String& rXclName, SCTAB nScTab = SCTAB_MAX ) const; + const XclImpName* FindName( const OUString& rXclName, SCTAB nScTab = SCTAB_MAX ) const; /** Returns the defined name specified by its Excel index. @param nXclNameIdx The index of the internal defined name. diff --git a/sc/source/filter/inc/xipivot.hxx b/sc/source/filter/inc/xipivot.hxx index f296fedd1434..bfe14536df47 100644 --- a/sc/source/filter/inc/xipivot.hxx +++ b/sc/source/filter/inc/xipivot.hxx @@ -323,7 +323,7 @@ public: sal_uInt16 GetFieldCount() const; const XclImpPTField* GetField( sal_uInt16 nFieldIdx ) const; XclImpPTField* GetFieldAcc( sal_uInt16 nFieldIdx ); - const String& GetFieldName( sal_uInt16 nFieldIdx ) const; + const OUString& GetFieldName( sal_uInt16 nFieldIdx ) const; const XclImpPTField* GetDataField( sal_uInt16 nDataFieldIdx ) const; OUString GetDataFieldName( sal_uInt16 nDataFieldIdx ) const; diff --git a/sc/source/filter/inc/xiroot.hxx b/sc/source/filter/inc/xiroot.hxx index c0220d1cbaac..10b616b9dc9e 100644 --- a/sc/source/filter/inc/xiroot.hxx +++ b/sc/source/filter/inc/xiroot.hxx @@ -203,7 +203,7 @@ public: XclImpTabViewSettings& GetTabViewSettings() const; /** Returns the Calc add-in function name for an Excel function name. */ - String GetScAddInName( const String& rXclName ) const; + OUString GetScAddInName( const OUString& rXclName ) const; /** Returns true, if the document contains a VB project. */ inline bool HasBasic() const { return mrImpData.mbHasBasic; } diff --git a/sc/source/filter/inc/xistream.hxx b/sc/source/filter/inc/xistream.hxx index 0a2199bd06fa..6bdfa30bb8dd 100644 --- a/sc/source/filter/inc/xistream.hxx +++ b/sc/source/filter/inc/xistream.hxx @@ -408,14 +408,14 @@ public: inline void SetNulSubstChar( sal_Unicode cNulSubst = '?' ) { mcNulSubst = cNulSubst; } /** Reads nChars characters and returns the string. */ - String ReadRawUniString( sal_uInt16 nChars, bool b16Bit ); + OUString ReadRawUniString( sal_uInt16 nChars, bool b16Bit ); /** Reads ext. header, nChar characters, ext. data and returns the string. */ - String ReadUniString( sal_uInt16 nChars, sal_uInt8 nFlags ); + OUString ReadUniString( sal_uInt16 nChars, sal_uInt8 nFlags ); /** Reads 8 bit flags, ext. header, nChar characters, ext. data and returns the string. */ - String ReadUniString( sal_uInt16 nChars ); + OUString ReadUniString( sal_uInt16 nChars ); /** Reads 16 bit character count, 8 bit flags, ext. header, character array, ext. data and returns the string. */ - String ReadUniString(); + OUString ReadUniString(); /** Ignores nChars characters. */ void IgnoreRawUniString( sal_uInt16 nChars, bool b16Bit ); @@ -427,9 +427,9 @@ public: // *** read/ignore 8-bit-strings, store in String *** --------------------- /** Reads nChar byte characters and returns the string. */ - String ReadRawByteString( sal_uInt16 nChars ); + OUString ReadRawByteString( sal_uInt16 nChars ); /** Reads 8/16 bit string length, character array and returns the string. */ - String ReadByteString( bool b16BitLen ); + OUString ReadByteString( bool b16BitLen ); // *** SvStream functions *** --------------------------------------------- diff --git a/sc/source/filter/inc/xistring.hxx b/sc/source/filter/inc/xistring.hxx index ac16f8e01f3c..974af8dffce3 100644 --- a/sc/source/filter/inc/xistring.hxx +++ b/sc/source/filter/inc/xistring.hxx @@ -33,7 +33,7 @@ public: /** Constructs an empty string. */ explicit XclImpString(); /** Constructs an unformatted string. */ - explicit XclImpString( const String& rString ); + explicit XclImpString( const OUString& rString ); ~XclImpString(); @@ -41,7 +41,7 @@ public: void Read( XclImpStream& rStrm, XclStrFlags nFlags = EXC_STR_DEFAULT ); /** Sets the passed string data. */ - inline void SetText( const String& rText ) { maString = rText; } + inline void SetText( const OUString& rText ) { maString = rText; } /** Sets the passed formatting buffer. */ inline void SetFormats( const XclFormatRunVec& rFormats ) { maFormats = rFormats; } /** Insert a formatting run to the format buffer. */ @@ -54,9 +54,9 @@ public: inline void ReadObjFormats( XclImpStream& rStrm, sal_uInt16 nFormatSize ) { ReadObjFormats( rStrm, maFormats, nFormatSize ); } /** Returns true, if the string is empty. */ - inline bool IsEmpty() const { return maString.Len() == 0; } + inline bool IsEmpty() const { return maString.isEmpty(); } /** Returns the pure text data of the string. */ - inline const String& GetText() const { return maString; } + inline const OUString& GetText() const { return maString; } /** Returns true, if the string contains formatting information. */ inline bool IsRich() const { return !maFormats.empty(); } @@ -73,7 +73,7 @@ public: static void ReadObjFormats( XclImpStream& rStrm, XclFormatRunVec& rFormats, sal_uInt16 nFormatSize ); private: - String maString; /// The text data of the string. + OUString maString; /// The text data of the string. XclFormatRunVec maFormats; /// All formatting runs. }; @@ -86,11 +86,11 @@ public: explicit XclImpStringIterator( const XclImpString& rString ); /** Returns true, if the iterator references a valid text portion. */ - inline bool Is() const { return mnTextBeg < mrText.Len(); } + inline bool Is() const { return mnTextBeg < mrText.getLength(); } /** Returns the index of the current text portion. */ inline size_t GetPortionIndex() const { return mnPortion; } /** Returns the string of the current text portion. */ - String GetPortionText() const; + OUString GetPortionText() const; /** Returns the font index of the current text portion. */ sal_uInt16 GetPortionFont() const; @@ -98,7 +98,7 @@ public: XclImpStringIterator& operator++(); private: - const String& mrText; /// The processed string. + const OUString& mrText; /// The processed string. const XclFormatRunVec& mrFormats; /// The vector of formatting runs. size_t mnPortion; /// Current text portion. xub_StrLen mnTextBeg; /// First character of current portion. diff --git a/sc/source/filter/inc/xistyle.hxx b/sc/source/filter/inc/xistyle.hxx index 700c3ccc469d..180e12e64fff 100644 --- a/sc/source/filter/inc/xistyle.hxx +++ b/sc/source/filter/inc/xistyle.hxx @@ -458,7 +458,7 @@ public: /** Reads a STYLE record. */ void ReadStyle( XclImpStream& rStrm ); - inline const String& GetName() const { return maName; } + inline const OUString& GetName() const { return maName; } inline sal_uInt16 GetXfId() const { return mnXfId; } inline bool IsBuiltin() const { return mbBuiltin && (mnBuiltinId != EXC_STYLE_USERDEF); } inline sal_uInt8 GetBuiltinId() const { return mnBuiltinId; } @@ -468,10 +468,10 @@ public: @return The pointer to the cell style sheet, or 0, if there is no style sheet. */ ScStyleSheet* CreateStyleSheet(); /** Creates the Calc style sheet, if this is a user-defined style. */ - void CreateUserStyle( const String& rFinalName ); + void CreateUserStyle( const OUString& rFinalName ); private: - String maName; /// Cell style name. + OUString maName; /// Cell style name. sal_uInt16 mnXfId; /// Formatting for this cell style. sal_uInt8 mnBuiltinId; /// Identifier for builtin styles. sal_uInt8 mnLevel; /// Level for builtin column/row styles. @@ -479,7 +479,7 @@ private: bool mbCustom; /// True = customized builtin style. bool mbHidden; /// True = style not visible in GUI. - String maFinalName; /// Final name used in the Calc document. + OUString maFinalName; /// Final name used in the Calc document. ScStyleSheet* mpStyleSheet; /// Calc cell style sheet. }; @@ -635,7 +635,7 @@ public: void SetColumnDefXF( SCCOL nScCol, sal_uInt16 nXFIndex ); /** Inserts a range of hyperlink cells. */ - void SetHyperlink( const XclRange& rXclRange, const String& rUrl ); + void SetHyperlink( const XclRange& rXclRange, const OUString& rUrl ); /** Inserts the first cell of a merged cell range. */ void SetMerge( SCCOL nScCol, SCROW nScRow ); @@ -669,7 +669,7 @@ private: private: typedef boost::shared_ptr< XclImpXFRangeColumn > XclImpXFRangeColumnRef; typedef ::std::vector< XclImpXFRangeColumnRef > XclImpXFRangeColumnVec; - typedef ::std::pair< XclRange, String > XclImpHyperlinkRange; + typedef ::std::pair< XclRange, OUString > XclImpHyperlinkRange; typedef ::std::list< XclImpHyperlinkRange > XclImpHyperlinkList; XclImpXFRangeColumnVec maColumns; /// Array of column XF index buffers. |