Kaydet (Commit) 868cb164 authored tarafından Andrew Branch's avatar Andrew Branch Kaydeden (comit) Michael Stahl

fdo#57950: Remove some chained appends in filter in sw/access

Change-Id: I9f3b44d6ea154d628dd59e31d9403097809a2853
Reviewed-on: https://gerrit.libreoffice.org/2300Reviewed-by: 's avatarMichael Stahl <mstahl@redhat.com>
Tested-by: 's avatarMichael Stahl <mstahl@redhat.com>
üst 437b044c
...@@ -175,9 +175,7 @@ void SwDrawModellListener_Impl::Notify( SfxBroadcaster& /*rBC*/, ...@@ -175,9 +175,7 @@ void SwDrawModellListener_Impl::Notify( SfxBroadcaster& /*rBC*/,
{ {
(void)r; (void)r;
#if OSL_DEBUG_LEVEL > 0 #if OSL_DEBUG_LEVEL > 0
rtl::OStringBuffer aError(RTL_CONSTASCII_STRINGPARAM("Runtime exception caught while notifying shape.:\n")); OSL_FAIL( "Runtime exception caught while notifying shape.:\n" + OUStringToOString(r.Message, RTL_TEXTENCODING_ASCII_US) );
aError.append(rtl::OUStringToOString(r.Message, RTL_TEXTENCODING_ASCII_US));
OSL_FAIL( aError.getStr() );
#endif #endif
} }
} }
......
...@@ -141,40 +141,34 @@ void SwAccessiblePortionData::Special( ...@@ -141,40 +141,34 @@ void SwAccessiblePortionData::Special(
// construct string with representation; either directly from // construct string with representation; either directly from
// rText, or use resources for special case portions // rText, or use resources for special case portions
String sDisplay; OUString sDisplay;
switch( nType ) switch( nType )
{ {
case POR_POSTITS: case POR_POSTITS:
case POR_FLYCNT: case POR_FLYCNT:
case POR_GRFNUM: case POR_GRFNUM:
sDisplay = rtl::OUString(sal_Unicode(0xfffc)); sDisplay = OUString(sal_Unicode(0xfffc));
break; break;
case POR_NUMBER: case POR_NUMBER:
{ {
OUStringBuffer aTmpBuffer( rText.Len() + 1 ); sDisplay = OUString( rText ) + " ";
aTmpBuffer.append( rText );
aTmpBuffer.append( sal_Unicode(' ') );
sDisplay = aTmpBuffer.makeStringAndClear();
break; break;
} }
// #i111768# - apply patch from kstribley: // #i111768# - apply patch from kstribley:
// Include the control characters. // Include the control characters.
case POR_CONTROLCHAR: case POR_CONTROLCHAR:
{ {
OUStringBuffer aTmpBuffer( rText.Len() + 1 ); sDisplay = OUString( rText ) + OUString( pTxtNode->GetTxt()[nModelPosition] );
aTmpBuffer.append( rText );
aTmpBuffer.append( pTxtNode->GetTxt()[nModelPosition] );
sDisplay = aTmpBuffer.makeStringAndClear();
break; break;
} }
default: default:
sDisplay = rText; sDisplay = OUString( rText );
break; break;
} }
// ignore zero/zero portions (except for terminators) // ignore zero/zero portions (except for terminators)
if( (nLength == 0) && (sDisplay.Len() == 0) && (nType != POR_TERMINATE) ) if( (nLength == 0) && (sDisplay.getLength() == 0) && (nType != POR_TERMINATE) )
return; return;
// special treatment for zero length portion at the beginning: // special treatment for zero length portion at the beginning:
...@@ -194,7 +188,7 @@ void SwAccessiblePortionData::Special( ...@@ -194,7 +188,7 @@ void SwAccessiblePortionData::Special(
aPortionAttrs.push_back( nAttr ); aPortionAttrs.push_back( nAttr );
// update buffer + nModelPosition // update buffer + nModelPosition
aBuffer.append( OUString(sDisplay) ); aBuffer.append( sDisplay );
nModelPosition += nLength; nModelPosition += nLength;
// remember 'last' special portion (unless it's our own 'closing' // remember 'last' special portion (unless it's our own 'closing'
......
...@@ -692,12 +692,7 @@ SwAccessibleTable::SwAccessibleTable( ...@@ -692,12 +692,7 @@ SwAccessibleTable::SwAccessibleTable(
const_cast< SwFrmFmt * >( pFrmFmt )->Add( this ); const_cast< SwFrmFmt * >( pFrmFmt )->Add( this );
const String& rName = pFrmFmt->GetName(); const String& rName = pFrmFmt->GetName();
OUStringBuffer aBuffer( rName.Len() + 4 ); SetName( OUString( rName ) + "-" + OUString::number( pTabFrm->GetPhyPageNum() ) );
aBuffer.append( OUString(rName) );
aBuffer.append( static_cast<sal_Unicode>( '-' ) );
aBuffer.append( static_cast<sal_Int32>( pTabFrm->GetPhyPageNum() ) );
SetName( aBuffer.makeStringAndClear() );
OUString sArg1( static_cast< const SwTabFrm * >( GetFrm() ) OUString sArg1( static_cast< const SwTabFrm * >( GetFrm() )
->GetFmt()->GetName() ); ->GetFmt()->GetName() );
...@@ -728,12 +723,9 @@ void SwAccessibleTable::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ...@@ -728,12 +723,9 @@ void SwAccessibleTable::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew
OUString sOldName( GetName() ); OUString sOldName( GetName() );
const String& rNewTabName = pFrmFmt->GetName(); const String& rNewTabName = pFrmFmt->GetName();
OUStringBuffer aBuffer( rNewTabName.Len() + 4 );
aBuffer.append( OUString(rNewTabName) );
aBuffer.append( static_cast<sal_Unicode>( '-' ) );
aBuffer.append( static_cast<sal_Int32>( pTabFrm->GetPhyPageNum() ) );
SetName( aBuffer.makeStringAndClear() ); SetName( OUString(rNewTabName) + "-" + OUString::number( pTabFrm->GetPhyPageNum() ) );
if( sOldName != GetName() ) if( sOldName != GetName() )
{ {
AccessibleEventObject aEvent; AccessibleEventObject aEvent;
...@@ -1611,17 +1603,9 @@ SwAccessibleTableColHeaders::SwAccessibleTableColHeaders( SwAccessibleMap *pMap2 ...@@ -1611,17 +1603,9 @@ SwAccessibleTableColHeaders::SwAccessibleTableColHeaders( SwAccessibleMap *pMap2
const_cast< SwFrmFmt * >( pFrmFmt )->Add( this ); const_cast< SwFrmFmt * >( pFrmFmt )->Add( this );
const String& rName = pFrmFmt->GetName(); const String& rName = pFrmFmt->GetName();
OUStringBuffer aBuffer( rName.Len() + 15 + 6 ); SetName( OUString(rName) + "-ColumnHeaders-" + OUString::number( pTabFrm->GetPhyPageNum() ) );
aBuffer.append( OUString(rName) );
aBuffer.append( rtl::OUString("-ColumnHeaders-") );
aBuffer.append( static_cast<sal_Int32>( pTabFrm->GetPhyPageNum() ) );
SetName( aBuffer.makeStringAndClear() );
OUStringBuffer aBuffer2( rName.Len() + 14 ); OUString sArg1( OUString(rName) + "-ColumnHeaders" );
aBuffer2.append( OUString(rName) );
aBuffer2.append( rtl::OUString("-ColumnHeaders") );
OUString sArg1( aBuffer2.makeStringAndClear() );
OUString sArg2( GetFormattedPageNumber() ); OUString sArg2( GetFormattedPageNumber() );
OUString sDesc2 = GetResource( STR_ACCESS_TABLE_DESC, &sArg1, &sArg2 ); OUString sDesc2 = GetResource( STR_ACCESS_TABLE_DESC, &sArg1, &sArg2 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment