diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-08-14 13:44:38 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-08-14 16:10:09 +0100 |
commit | 96f24b9cc07d3b83618811434e4cfcac515f8aa1 (patch) | |
tree | 149297f843e0d588bcc4316a8955165a3cdc1b9f /editeng | |
parent | Revert "Revert "Always disable anti-aliasing for drawing cell borders." fdo#6... (diff) | |
download | core-96f24b9cc07d3b83618811434e4cfcac515f8aa1.tar.gz core-96f24b9cc07d3b83618811434e4cfcac515f8aa1.zip |
XubString->OUString
Change-Id: I9ccb06134dfadd9bf1ecb8e5edcd24c02980b754
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/editeng.cxx | 4 | ||||
-rw-r--r-- | editeng/source/editeng/editview.cxx | 6 | ||||
-rw-r--r-- | editeng/source/outliner/outleeng.cxx | 4 | ||||
-rw-r--r-- | editeng/source/outliner/outleeng.hxx | 6 | ||||
-rw-r--r-- | editeng/source/outliner/outlin2.cxx | 2 | ||||
-rw-r--r-- | editeng/source/outliner/outliner.cxx | 59 |
6 files changed, 39 insertions, 42 deletions
diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx index 0684bfe0782d..89067a265ecc 100644 --- a/editeng/source/editeng/editeng.cxx +++ b/editeng/source/editeng/editeng.cxx @@ -2576,7 +2576,7 @@ ParagraphInfos EditEngine::GetParagraphInfos( sal_Int32 nPara ) // ===================================================================== // ====================== Virtual Methods ======================== // ===================================================================== -void EditEngine::DrawingText( const Point&, const XubString&, sal_uInt16, sal_uInt16, +void EditEngine::DrawingText( const Point&, const OUString&, sal_uInt16, sal_uInt16, const sal_Int32*, const SvxFont&, sal_Int32, sal_uInt16, sal_uInt8, const EEngineData::WrongSpellVector*, const SvxFieldData*, bool, bool, bool, const ::com::sun::star::lang::Locale*, const Color&, const Color&) @@ -2660,7 +2660,7 @@ void EditEngine::ParagraphHeightChanged( sal_Int32 nPara ) } } -XubString EditEngine::GetUndoComment( sal_uInt16 nId ) const +OUString EditEngine::GetUndoComment( sal_uInt16 nId ) const { DBG_CHKTHIS( EditEngine, 0 ); XubString aComment; diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx index 17d9fb1f1a21..af14c5ed96a0 100644 --- a/editeng/source/editeng/editview.cxx +++ b/editeng/source/editeng/editview.cxx @@ -364,7 +364,7 @@ Cursor* EditView::GetCursor() const return pImpEditView->pCursor; } -void EditView::InsertText( const XubString& rStr, sal_Bool bSelect ) +void EditView::InsertText( const OUString& rStr, sal_Bool bSelect ) { DBG_CHKTHIS( EditView, 0 ); DBG_CHKOBJ( pImpEditView->pEditEngine, EditEngine, 0 ); @@ -613,7 +613,7 @@ void EditView::SetSelectionMode( EESelectionMode eMode ) pImpEditView->SetSelectionMode( eMode ); } -XubString EditView::GetSelected() +OUString EditView::GetSelected() { DBG_CHKTHIS( EditView, 0 ); DBG_CHKOBJ( pImpEditView->pEditEngine, EditEngine, 0 ); @@ -691,7 +691,7 @@ void EditView::InsertText( const EditTextObject& rTextObject ) PIMPE->FormatAndUpdate( this ); } -void EditView::InsertText( ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > xDataObj, const String& rBaseURL, sal_Bool bUseSpecial ) +void EditView::InsertText( ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > xDataObj, const OUString& rBaseURL, sal_Bool bUseSpecial ) { DBG_CHKTHIS( EditView, 0 ); DBG_CHKOBJ( pImpEditView->pEditEngine, EditEngine, 0 ); diff --git a/editeng/source/outliner/outleeng.cxx b/editeng/source/outliner/outleeng.cxx index 6418310ea914..9396e68f8630 100644 --- a/editeng/source/outliner/outleeng.cxx +++ b/editeng/source/outliner/outleeng.cxx @@ -122,7 +122,7 @@ sal_Bool OutlinerEditEng::ConvertNextDocument() return pOwner->ConvertNextDocument(); } -XubString OutlinerEditEng::GetUndoComment( sal_uInt16 nUndoId ) const +OUString OutlinerEditEng::GetUndoComment( sal_uInt16 nUndoId ) const { switch( nUndoId ) { @@ -146,7 +146,7 @@ XubString OutlinerEditEng::GetUndoComment( sal_uInt16 nUndoId ) const } } -void OutlinerEditEng::DrawingText( const Point& rStartPos, const XubString& rText, sal_uInt16 nTextStart, sal_uInt16 nTextLen, +void OutlinerEditEng::DrawingText( const Point& rStartPos, const OUString& rText, sal_uInt16 nTextStart, sal_uInt16 nTextLen, const sal_Int32* pDXArray, const SvxFont& rFont, sal_Int32 nPara, sal_uInt16 nIndex, sal_uInt8 nRightToLeft, const EEngineData::WrongSpellVector* pWrongSpellVector, const SvxFieldData* pFieldData, diff --git a/editeng/source/outliner/outleeng.hxx b/editeng/source/outliner/outleeng.hxx index 59b4958ceb67..960e45221bb5 100644 --- a/editeng/source/outliner/outleeng.hxx +++ b/editeng/source/outliner/outleeng.hxx @@ -45,7 +45,7 @@ public: virtual void ParagraphConnected( sal_Int32 nLeftParagraph, sal_Int32 nRightParagraph ); virtual void DrawingText( - const Point& rStartPos, const XubString& rText, sal_uInt16 nTextStart, sal_uInt16 nTextLen, const sal_Int32* pDXArray, const SvxFont& rFont, + const Point& rStartPos, const OUString& rText, sal_uInt16 nTextStart, sal_uInt16 nTextLen, const sal_Int32* pDXArray, const SvxFont& rFont, sal_Int32 nPara, sal_uInt16 nIndex, sal_uInt8 nRightToLeft, const EEngineData::WrongSpellVector* pWrongSpellVector, const SvxFieldData* pFieldData, @@ -66,8 +66,8 @@ public: virtual void StyleSheetChanged( SfxStyleSheet* pStyle ); virtual void ParaAttribsChanged( sal_Int32 nPara ); - virtual sal_Bool SpellNextDocument(); - virtual XubString GetUndoComment( sal_uInt16 nUndoId ) const; + virtual sal_Bool SpellNextDocument(); + virtual OUString GetUndoComment( sal_uInt16 nUndoId ) const; // for text conversion virtual sal_Bool ConvertNextDocument(); diff --git a/editeng/source/outliner/outlin2.cxx b/editeng/source/outliner/outlin2.cxx index ff8bc7449e59..83b83c97d131 100644 --- a/editeng/source/outliner/outlin2.cxx +++ b/editeng/source/outliner/outlin2.cxx @@ -541,7 +541,7 @@ void Outliner::QuickSetAttribs( const SfxItemSet& rSet, const ESelection& rSel ) pEditEngine->QuickSetAttribs( rSet, rSel ); } -void Outliner::QuickInsertText( const XubString& rText, const ESelection& rSel ) +void Outliner::QuickInsertText( const OUString& rText, const ESelection& rSel ) { bFirstParaIsEmpty = sal_False; pEditEngine->QuickInsertText( rText, rSel ); diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index db6915d29cce..cb27c692533e 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -75,7 +75,7 @@ void Outliner::ImplCheckDepth( sal_Int16& rnDepth ) const rnDepth = nMaxDepth; } -Paragraph* Outliner::Insert(const XubString& rText, sal_Int32 nAbsPos, sal_Int16 nDepth) +Paragraph* Outliner::Insert(const OUString& rText, sal_Int32 nAbsPos, sal_Int16 nDepth) { DBG_CHKTHIS(Outliner,0); DBG_ASSERT(pParaList->GetParagraphCount(),"Insert:No Paras"); @@ -425,7 +425,7 @@ OutlinerParaObject* Outliner::CreateParaObject( sal_Int32 nStartPara, sal_Int32 return pPObj; } -void Outliner::SetText( const XubString& rText, Paragraph* pPara ) +void Outliner::SetText( const OUString& rText, Paragraph* pPara ) { DBG_CHKTHIS(Outliner,0); DBG_ASSERT(pPara,"SetText:No Para"); @@ -436,24 +436,24 @@ void Outliner::SetText( const XubString& rText, Paragraph* pPara ) sal_Int32 nPara = pParaList->GetAbsPos( pPara ); - if( !rText.Len() ) + if (rText.isEmpty()) { pEditEngine->SetText( nPara, rText ); ImplInitDepth( nPara, pPara->GetDepth(), sal_False ); } else { - XubString aText(convertLineEnd(rText, LINEEND_LF)); + OUString aText(convertLineEnd(rText, LINEEND_LF)); - if( aText.GetChar( aText.Len()-1 ) == '\x0A' ) - aText.Erase( aText.Len()-1, 1 ); // Delete the last break + if (aText[aText.getLength()-1] == '\x0A') + aText = aText.copy(0, aText.getLength()-1); // Delete the last break sal_uInt16 nCount = comphelper::string::getTokenCount(aText, '\x0A'); sal_uInt16 nPos = 0; sal_Int32 nInsPos = nPara+1; while( nCount > nPos ) { - XubString aStr = aText.GetToken( nPos, '\x0A' ); + OUString aStr = aText.getToken( nPos, '\x0A' ); sal_Int16 nCurDepth; if( nPos ) @@ -471,10 +471,10 @@ void Outliner::SetText( const XubString& rText, Paragraph* pPara ) { // Extract Tabs sal_uInt16 nTabs = 0; - while ( ( nTabs < aStr.Len() ) && ( aStr.GetChar( nTabs ) == '\t' ) ) + while ( ( nTabs < aStr.getLength() ) && ( aStr[nTabs] == '\t' ) ) nTabs++; if ( nTabs ) - aStr.Erase( 0, nTabs ); + aStr = aStr.copy(nTabs); // Keep depth? (see Outliner::Insert) if( !(pPara->nFlags & PARAFLAG_HOLDDEPTH) ) @@ -519,15 +519,12 @@ bool Outliner::ImpConvertEdtToOut( sal_Int32 nPara,EditView* pView) sal_uInt16 nTabs = 0; ESelection aDelSel; -// const SfxItemSet& rAttrs = pEditEngine->GetParaAttribs( nPara ); -// bool bAlreadyOutliner = rAttrs.GetItemState( EE_PARA_OUTLLRSPACE ) == SFX_ITEM_ON ? true : false; + OUString aName; + OUString aHeading_US( "heading" ); + OUString aNumber_US( "Numbering" ); - XubString aName; - XubString aHeading_US( RTL_CONSTASCII_USTRINGPARAM( "heading" ) ); - XubString aNumber_US( RTL_CONSTASCII_USTRINGPARAM( "Numbering" ) ); - - XubString aStr( pEditEngine->GetText( nPara ) ); - sal_Unicode* pPtr = (sal_Unicode*)aStr.GetBuffer(); + OUString aStr( pEditEngine->GetText( nPara ) ); + const sal_Unicode* pPtr = aStr.getStr(); sal_uInt16 nHeadingNumberStart = 0; sal_uInt16 nNumberingNumberStart = 0; @@ -535,17 +532,17 @@ bool Outliner::ImpConvertEdtToOut( sal_Int32 nPara,EditView* pView) if( pStyle ) { aName = pStyle->GetName(); - sal_uInt16 nSearch; - if ( ( nSearch = aName.Search( aHeading_US ) ) != STRING_NOTFOUND ) - nHeadingNumberStart = nSearch + aHeading_US.Len(); - else if ( ( nSearch = aName.Search( aNumber_US ) ) != STRING_NOTFOUND ) - nNumberingNumberStart = nSearch + aNumber_US.Len(); + sal_Int32 nSearch; + if ( ( nSearch = aName.indexOf( aHeading_US ) ) != -1 ) + nHeadingNumberStart = nSearch + aHeading_US.getLength(); + else if ( ( nSearch = aName.indexOf( aNumber_US ) ) != -1 ) + nNumberingNumberStart = nSearch + aNumber_US.getLength(); } if ( nHeadingNumberStart || nNumberingNumberStart ) { // PowerPoint import ? - if( nHeadingNumberStart && ( aStr.Len() >= 2 ) && + if( nHeadingNumberStart && ( aStr.getLength() >= 2 ) && ( pPtr[0] != '\t' ) && ( pPtr[1] == '\t' ) ) { // Extract Bullet and Tab @@ -553,8 +550,8 @@ bool Outliner::ImpConvertEdtToOut( sal_Int32 nPara,EditView* pView) } sal_uInt16 nPos = nHeadingNumberStart ? nHeadingNumberStart : nNumberingNumberStart; - String aLevel = comphelper::string::stripStart(aName.Copy(nPos), ' '); - nTabs = sal::static_int_cast< sal_uInt16 >(aLevel.ToInt32()); + OUString aLevel = comphelper::string::stripStart(aName.copy(nPos), ' '); + nTabs = sal::static_int_cast< sal_uInt16 >(aLevel.toInt32()); if( nTabs ) nTabs--; // Level 0 = "heading 1" bConverted = sal_True; @@ -1749,17 +1746,17 @@ EBulletInfo Outliner::GetBulletInfo( sal_Int32 nPara ) return aInfo; } -XubString Outliner::GetText( Paragraph* pParagraph, sal_Int32 nCount ) const +OUString Outliner::GetText( Paragraph* pParagraph, sal_Int32 nCount ) const { DBG_CHKTHIS(Outliner,0); - XubString aText; + OUString aText; sal_Int32 nStartPara = pParaList->GetAbsPos( pParagraph ); for ( sal_Int32 n = 0; n < nCount; n++ ) { aText += pEditEngine->GetText( nStartPara + n ); if ( (n+1) < nCount ) - aText += '\n'; + aText += "\n"; } return aText; } @@ -1788,7 +1785,7 @@ void Outliner::StripPortions() bStrippingPortions = sal_False; } -void Outliner::DrawingText( const Point& rStartPos, const XubString& rText, sal_uInt16 nTextStart, sal_uInt16 nTextLen, const sal_Int32* pDXArray,const SvxFont& rFont, +void Outliner::DrawingText( const Point& rStartPos, const OUString& rText, sal_uInt16 nTextStart, sal_uInt16 nTextLen, const sal_Int32* pDXArray,const SvxFont& rFont, sal_Int32 nPara, sal_uInt16 nIndex, sal_uInt8 nRightToLeft, const EEngineData::WrongSpellVector* pWrongSpellVector, const SvxFieldData* pFieldData, @@ -1973,14 +1970,14 @@ void Outliner::ImplCalcBulletText( sal_Int32 nPara, sal_Bool bRecalcLevel, sal_B while ( pPara ) { - XubString aBulletText; + OUString aBulletText; const SvxNumberFormat* pFmt = GetNumberFormat( nPara ); if( pFmt && ( pFmt->GetNumberingType() != SVX_NUM_BITMAP ) ) { aBulletText += pFmt->GetPrefix(); if( pFmt->GetNumberingType() == SVX_NUM_CHAR_SPECIAL ) { - aBulletText += pFmt->GetBulletChar(); + aBulletText += OUString(pFmt->GetBulletChar()); } else if( pFmt->GetNumberingType() != SVX_NUM_NUMBER_NONE ) { |