summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx5
-rw-r--r--sd/source/core/drawdoc3.cxx17
-rw-r--r--sd/source/filter/eppt/eppt.cxx6
-rw-r--r--sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx52
-rw-r--r--sd/source/ui/annotations/annotationtag.cxx6
-rw-r--r--sd/source/ui/framework/configuration/Configuration.cxx14
-rw-r--r--sd/source/ui/framework/tools/FrameworkHelper.cxx10
-rw-r--r--sd/source/ui/func/fuinsfil.cxx8
-rw-r--r--sd/source/ui/func/fulinend.cxx4
-rw-r--r--sd/source/ui/unoidl/unolayer.cxx3
-rw-r--r--sd/source/ui/view/DocumentRenderer.cxx3
-rw-r--r--sdext/source/pdfimport/pdfparse/pdfentries.cxx18
-rw-r--r--sdext/source/pdfimport/pdfparse/pdfparse.cxx11
13 files changed, 66 insertions, 91 deletions
diff --git a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx
index cee792543ef1..3d78ed662161 100644
--- a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx
+++ b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx
@@ -370,7 +370,6 @@ void ExportDocumentHandler::exportTableRows()
pCellAtt->AddAttribute(sValueType, "string");
bool bRemoveString = true;
- OUString sFormula;
const sal_Int32 nCount = m_aColumns.getLength();
if ( m_nColumnCount > nCount )
{
@@ -391,9 +390,7 @@ void ExportDocumentHandler::exportTableRows()
}
for(sal_Int32 i = 0; i < nCount ; ++i)
{
- sFormula = "field:[";
- sFormula += m_aColumns[i];
- sFormula += "]";
+ OUString sFormula = "field:[" + m_aColumns[i] + "]";
SvXMLAttributeList* pList = new SvXMLAttributeList();
uno::Reference< xml::sax::XAttributeList > xAttribs = pList;
pList->AddAttribute(sFormulaAttrib,sFormula);
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index 5cd4c61cd185..aa72ae612206 100644
--- a/sd/source/core/drawdoc3.cxx
+++ b/sd/source/core/drawdoc3.cxx
@@ -1368,27 +1368,18 @@ bool isMasterPageLayoutNameUnique(const SdDrawDocument& rDoc, const OUString& rC
OUString createNewMasterPageLayoutName(const SdDrawDocument& rDoc)
{
const OUString aBaseName(SdResId(STR_LAYOUT_DEFAULT_NAME));
- OUString aRetval;
sal_uInt16 nCount(0);
-
- while (aRetval.isEmpty())
+ for (;;)
{
- aRetval = aBaseName;
-
+ OUString aRetval = aBaseName;
if(nCount)
{
aRetval += OUString::number(nCount);
}
-
+ if (isMasterPageLayoutNameUnique(rDoc, aRetval))
+ return aRetval;
nCount++;
-
- if(!isMasterPageLayoutNameUnique(rDoc, aRetval))
- {
- aRetval.clear();
- }
}
-
- return aRetval;
}
void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
diff --git a/sd/source/filter/eppt/eppt.cxx b/sd/source/filter/eppt/eppt.cxx
index 395fb50b2677..28edf2321323 100644
--- a/sd/source/filter/eppt/eppt.cxx
+++ b/sd/source/filter/eppt/eppt.cxx
@@ -1046,7 +1046,7 @@ bool PPTWriter::ImplCreateMainNotes()
static OUString getInitials( const OUString& rName )
{
- OUString sInitials;
+ OUStringBuffer sInitials;
const sal_Unicode * pStr = rName.getStr();
sal_Int32 nLength = rName.getLength();
@@ -1062,7 +1062,7 @@ static OUString getInitials( const OUString& rName )
// take letter
if( nLength )
{
- sInitials += OUStringLiteral1( *pStr );
+ sInitials.append( *pStr );
nLength--; pStr++;
}
@@ -1073,7 +1073,7 @@ static OUString getInitials( const OUString& rName )
}
}
- return sInitials;
+ return sInitials.makeStringAndClear();
}
void ImplExportComments( const uno::Reference< drawing::XDrawPage >& xPage, SvMemoryStream& rBinaryTagData10Atom )
diff --git a/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx b/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx
index b3f570c1193d..f4cc1a71b0b6 100644
--- a/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx
+++ b/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx
@@ -683,7 +683,7 @@ uno::Any SAL_CALL AccessibleDocumentViewBase::getExtendedAttributes()
::osl::MutexGuard aGuard (maMutex);
uno::Any anyAtrribute;
- OUString sValue;
+ OUStringBuffer sValue;
if (nullptr != dynamic_cast<const ::sd::DrawViewShell* > (mpViewShell))
{
::sd::DrawViewShell* pDrViewSh = static_cast< ::sd::DrawViewShell*>(mpViewShell);
@@ -699,13 +699,11 @@ uno::Any SAL_CALL AccessibleDocumentViewBase::getExtendedAttributes()
sDisplay = sDisplay.replaceFirst( ",", "\\," );
sDisplay = sDisplay.replaceFirst( ":", "\\:" );
sValue = sName + sDisplay ;
- sName = ";page-number:";
- sValue += sName;
- sValue += OUString::number(static_cast<sal_Int16>(static_cast<sal_uInt16>((pDrViewSh->getCurrentPage()->GetPageNum()-1)>>1) + 1)) ;
- sName = ";total-pages:";
- sValue += sName;
- sValue += OUString::number(pDrViewSh->GetPageTabControl().GetPageCount()) ;
- sValue += ";";
+ sValue.append(";page-number:");
+ sValue.append(OUString::number(static_cast<sal_Int16>(static_cast<sal_uInt16>((pDrViewSh->getCurrentPage()->GetPageNum()-1)>>1) + 1)) );
+ sValue.append(";total-pages:");
+ sValue.append(OUString::number(pDrViewSh->GetPageTabControl().GetPageCount()) );
+ sValue.append(";");
if(pDrViewSh->IsLayerModeActive() && pDrViewSh->GetLayerTabControl()) // #i87182#
{
sName = "page-name:";
@@ -731,14 +729,12 @@ uno::Any SAL_CALL AccessibleDocumentViewBase::getExtendedAttributes()
sDisplay = sDisplay.replaceFirst( ";", "\\;" );
sDisplay = sDisplay.replaceFirst( ",", "\\," );
sDisplay = sDisplay.replaceFirst( ":", "\\:" );
- sValue += sDisplay;
- sName = ";page-number:";
- sValue += sName;
- sValue += OUString::number(pDrViewSh->GetActiveTabLayerIndex()+1) ;
- sName = ";total-pages:";
- sValue += sName;
- sValue += OUString::number(pDrViewSh->GetLayerTabControl()->GetPageCount()) ;
- sValue += ";";
+ sValue.append(sDisplay);
+ sValue.append(";page-number:");
+ sValue.append(OUString::number(pDrViewSh->GetActiveTabLayerIndex()+1) );
+ sValue.append(";total-pages:");
+ sValue.append(OUString::number(pDrViewSh->GetLayerTabControl()->GetPageCount()) );
+ sValue.append(";");
}
}
if (dynamic_cast<const ::sd::PresentationViewShell* >(mpViewShell) != nullptr )
@@ -755,7 +751,7 @@ uno::Any SAL_CALL AccessibleDocumentViewBase::getExtendedAttributes()
OutlinerParaObject* pPara = pNotesObj->GetOutlinerParaObject();
if (pPara)
{
- sValue += "note:";
+ sValue.append("note:");
const EditTextObject& rEdit = pPara->GetTextObject();
for (sal_Int32 i=0;i<rEdit.GetParagraphCount();i++)
{
@@ -765,8 +761,8 @@ uno::Any SAL_CALL AccessibleDocumentViewBase::getExtendedAttributes()
strNote = strNote.replaceFirst( ";", "\\;" );
strNote = strNote.replaceFirst( ",", "\\," );
strNote = strNote.replaceFirst( ":", "\\:" );
- sValue += strNote;
- sValue += ";";//to divide each paragraph
+ sValue.append(strNote);
+ sValue.append(";");//to divide each paragraph
}
}
}
@@ -774,30 +770,26 @@ uno::Any SAL_CALL AccessibleDocumentViewBase::getExtendedAttributes()
}
if (dynamic_cast<const ::sd::OutlineViewShell* >(mpViewShell ) != nullptr )
{
- OUString sName;
OUString sDisplay;
SdPage* pCurrPge = mpViewShell->GetActualPage();
SdDrawDocument* pDoc = mpViewShell->GetDoc();
if(pCurrPge && pDoc)
{
- sName = "page-name:";
sDisplay = pCurrPge->GetName();
sDisplay = sDisplay.replaceFirst( "=", "\\=" );
sDisplay = sDisplay.replaceFirst( ";", "\\;" );
sDisplay = sDisplay.replaceFirst( ",", "\\," );
sDisplay = sDisplay.replaceFirst( ":", "\\:" );
- sValue = sName + sDisplay ;
- sName = ";page-number:";
- sValue += sName;
- sValue += OUString::number(static_cast<sal_Int16>(static_cast<sal_uInt16>((pCurrPge->GetPageNum()-1)>>1) + 1)) ;
- sName = ";total-pages:";
- sValue += sName;
- sValue += OUString::number(pDoc->GetSdPageCount(PageKind::Standard)) ;
- sValue += ";";
+ sValue = "page-name:" + sDisplay;
+ sValue.append(";page-number:");
+ sValue.append(OUString::number(static_cast<sal_Int16>(static_cast<sal_uInt16>((pCurrPge->GetPageNum()-1)>>1) + 1)) );
+ sValue.append(";total-pages:");
+ sValue.append(OUString::number(pDoc->GetSdPageCount(PageKind::Standard)) );
+ sValue.append(";");
}
}
if (sValue.getLength())
- anyAtrribute <<= sValue;
+ anyAtrribute <<= sValue.makeStringAndClear();
return anyAtrribute;
}
diff --git a/sd/source/ui/annotations/annotationtag.cxx b/sd/source/ui/annotations/annotationtag.cxx
index 4c6a53b3c1a2..2572ea40b0b2 100644
--- a/sd/source/ui/annotations/annotationtag.cxx
+++ b/sd/source/ui/annotations/annotationtag.cxx
@@ -60,7 +60,7 @@ static const int DRGPIX = 2; // Drag MinMove i
static OUString getInitials( const OUString& rName )
{
- OUString sInitials;
+ OUStringBuffer sInitials;
const sal_Unicode * pStr = rName.getStr();
sal_Int32 nLength = rName.getLength();
@@ -76,7 +76,7 @@ static OUString getInitials( const OUString& rName )
// take letter
if( nLength )
{
- sInitials += OUStringLiteral1( *pStr );
+ sInitials.append(*pStr);
nLength--; pStr++;
}
@@ -87,7 +87,7 @@ static OUString getInitials( const OUString& rName )
}
}
- return sInitials;
+ return sInitials.makeStringAndClear();
}
class AnnotationDragMove : public SdrDragMove
diff --git a/sd/source/ui/framework/configuration/Configuration.cxx b/sd/source/ui/framework/configuration/Configuration.cxx
index ee9fa6622aaa..dec44f8ed01d 100644
--- a/sd/source/ui/framework/configuration/Configuration.cxx
+++ b/sd/source/ui/framework/configuration/Configuration.cxx
@@ -195,11 +195,11 @@ Reference<util::XCloneable> SAL_CALL Configuration::createClone()
OUString SAL_CALL Configuration::getName()
{
::osl::MutexGuard aGuard (maMutex);
- OUString aString;
+ OUStringBuffer aString;
if (rBHelper.bDisposed || rBHelper.bInDispose)
- aString += "DISPOSED ";
- aString += "Configuration[";
+ aString.append("DISPOSED ");
+ aString.append("Configuration[");
ResourceContainer::const_iterator iResource;
for (iResource=mpResourceContainer->begin();
@@ -207,12 +207,12 @@ OUString SAL_CALL Configuration::getName()
++iResource)
{
if (iResource != mpResourceContainer->begin())
- aString += ", ";
- aString += FrameworkHelper::ResourceIdToString(*iResource);
+ aString.append(", ");
+ aString.append(FrameworkHelper::ResourceIdToString(*iResource));
}
- aString += "]";
+ aString.append("]");
- return aString;
+ return aString.makeStringAndClear();
}
void SAL_CALL Configuration::setName (const OUString&)
diff --git a/sd/source/ui/framework/tools/FrameworkHelper.cxx b/sd/source/ui/framework/tools/FrameworkHelper.cxx
index aff76eeb6dcd..5a4af572f1af 100644
--- a/sd/source/ui/framework/tools/FrameworkHelper.cxx
+++ b/sd/source/ui/framework/tools/FrameworkHelper.cxx
@@ -750,21 +750,21 @@ void FrameworkHelper::UpdateConfiguration()
OUString FrameworkHelper::ResourceIdToString (const Reference<XResourceId>& rxResourceId)
{
- OUString sString;
+ OUStringBuffer sString;
if (rxResourceId.is())
{
- sString += rxResourceId->getResourceURL();
+ sString.append(rxResourceId->getResourceURL());
if (rxResourceId->hasAnchor())
{
Sequence<OUString> aAnchorURLs (rxResourceId->getAnchorURLs());
for (sal_Int32 nIndex=0; nIndex < aAnchorURLs.getLength(); ++nIndex)
{
- sString += " | ";
- sString += aAnchorURLs[nIndex];
+ sString.append(" | ");
+ sString.append(aAnchorURLs[nIndex]);
}
}
}
- return sString;
+ return sString.makeStringAndClear();
}
Reference<XResourceId> FrameworkHelper::CreateResourceId (const OUString& rsResourceURL)
diff --git a/sd/source/ui/func/fuinsfil.cxx b/sd/source/ui/func/fuinsfil.cxx
index a71502a61b45..92ea81841391 100644
--- a/sd/source/ui/func/fuinsfil.cxx
+++ b/sd/source/ui/func/fuinsfil.cxx
@@ -77,7 +77,7 @@ namespace
OUString lcl_GetExtensionsList ( ::std::vector< FilterDesc > const& rFilterDescList )
{
- OUString aExtensions;
+ OUStringBuffer aExtensions;
::std::vector< FilterDesc >::const_iterator aIter( rFilterDescList.begin() );
while (aIter != rFilterDescList.end())
@@ -87,14 +87,14 @@ OUString lcl_GetExtensionsList ( ::std::vector< FilterDesc > const& rFilterDescL
if ( aExtensions.indexOf( sWildcard ) == -1 )
{
if ( !aExtensions.isEmpty() )
- aExtensions += ";";
- aExtensions += sWildcard;
+ aExtensions.append(";");
+ aExtensions.append(sWildcard);
}
++aIter;
}
- return aExtensions;
+ return aExtensions.makeStringAndClear();
}
void lcl_AddFilter ( ::std::vector< FilterDesc >& rFilterDescList,
diff --git a/sd/source/ui/func/fulinend.cxx b/sd/source/ui/func/fulinend.cxx
index a4910d96dbac..64a7c78b3bbc 100644
--- a/sd/source/ui/func/fulinend.cxx
+++ b/sd/source/ui/func/fulinend.cxx
@@ -103,9 +103,7 @@ void FuLineEnd::DoExecute( SfxRequest& )
while( !bDifferent )
{
- aName = aNewName;
- aName += " ";
- aName += OUString::number(j++);
+ aName = aNewName + " " + OUString::number(j++);
bDifferent = true;
for( long i = 0; i < nCount && bDifferent; i++ )
{
diff --git a/sd/source/ui/unoidl/unolayer.cxx b/sd/source/ui/unoidl/unolayer.cxx
index c7cb0f0387aa..a55f913a9f84 100644
--- a/sd/source/ui/unoidl/unolayer.cxx
+++ b/sd/source/ui/unoidl/unolayer.cxx
@@ -484,8 +484,7 @@ uno::Reference< drawing::XLayer > SAL_CALL SdLayerManager::insertNewByIndex( sal
// Test for existing names
while( aLayerName.isEmpty() || rLayerAdmin.GetLayer( aLayerName ) )
{
- aLayerName = SdResId(STR_LAYER);
- aLayerName += OUString::number(nLayer);
+ aLayerName = SdResId(STR_LAYER) + OUString::number(nLayer);
++nLayer;
}
diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx
index 6c69c5e266fa..0b7820679956 100644
--- a/sd/source/ui/view/DocumentRenderer.cxx
+++ b/sd/source/ui/view/DocumentRenderer.cxx
@@ -1925,8 +1925,7 @@ private:
if (mpOptions->IsPrintPageName())
{
- rInfo.msPageString = pPage->GetName();
- rInfo.msPageString += " ";
+ rInfo.msPageString = pPage->GetName() + " ";
}
else
rInfo.msPageString.clear();
diff --git a/sdext/source/pdfimport/pdfparse/pdfentries.cxx b/sdext/source/pdfimport/pdfparse/pdfentries.cxx
index a55c45e7a093..64338984907d 100644
--- a/sdext/source/pdfimport/pdfparse/pdfentries.cxx
+++ b/sdext/source/pdfimport/pdfparse/pdfentries.cxx
@@ -1276,10 +1276,10 @@ PDFFileImplData* PDFFile::impl_getData() const
if( pStr )
m_pData->m_aDocID = pStr->getFilteredString();
#if OSL_DEBUG_LEVEL > 0
- OUString aTmp;
+ OUStringBuffer aTmp;
for( int i = 0; i < m_pData->m_aDocID.getLength(); i++ )
- aTmp += OUString::number(static_cast<unsigned int>(sal_uInt8(m_pData->m_aDocID[i])), 16);
- SAL_INFO("sdext.pdfimport.pdfparse", "DocId is <" << aTmp << ">");
+ aTmp.append(OUString::number(static_cast<unsigned int>(sal_uInt8(m_pData->m_aDocID[i])), 16));
+ SAL_INFO("sdext.pdfimport.pdfparse", "DocId is <" << aTmp.makeStringAndClear() << ">");
#endif
}
}
@@ -1340,11 +1340,11 @@ PDFFileImplData* PDFFile::impl_getData() const
#if OSL_DEBUG_LEVEL > 0
else
{
- OUString aTmp;
+ OUStringBuffer aTmp;
for( int i = 0; i < aEnt.getLength(); i++ )
- aTmp += " " + OUString::number(static_cast<unsigned int>(sal_uInt8(aEnt[i])), 16);
+ aTmp.append(" ").append(OUString::number(static_cast<unsigned int>(sal_uInt8(aEnt[i])), 16));
SAL_WARN("sdext.pdfimport.pdfparse",
- "O entry has length " << static_cast<int>(aEnt.getLength()) << ", should be 32 <" << aTmp << ">" );
+ "O entry has length " << static_cast<int>(aEnt.getLength()) << ", should be 32 <" << aTmp.makeStringAndClear() << ">" );
}
#endif
}
@@ -1360,11 +1360,11 @@ PDFFileImplData* PDFFile::impl_getData() const
#if OSL_DEBUG_LEVEL > 0
else
{
- OUString aTmp;
+ OUStringBuffer aTmp;
for( int i = 0; i < aEnt.getLength(); i++ )
- aTmp += " " + OUString::number(static_cast<unsigned int>(sal_uInt8(aEnt[i])), 16);
+ aTmp.append(" ").append(OUString::number(static_cast<unsigned int>(sal_uInt8(aEnt[i])), 16));
SAL_WARN("sdext.pdfimport.pdfparse",
- "U entry has length " << static_cast<int>(aEnt.getLength()) << ", should be 32 <" << aTmp << ">" );
+ "U entry has length " << static_cast<int>(aEnt.getLength()) << ", should be 32 <" << aTmp.makeStringAndClear() << ">" );
}
#endif
}
diff --git a/sdext/source/pdfimport/pdfparse/pdfparse.cxx b/sdext/source/pdfimport/pdfparse/pdfparse.cxx
index 97ba78d2a80b..64dcf7d71989 100644
--- a/sdext/source/pdfimport/pdfparse/pdfparse.cxx
+++ b/sdext/source/pdfimport/pdfparse/pdfparse.cxx
@@ -37,6 +37,7 @@
#include <string.h>
#include <rtl/strbuf.hxx>
+#include <rtl/ustrbuf.hxx>
#include <rtl/alloc.h>
// disable warnings again because someone along the line has enabled them
@@ -648,16 +649,14 @@ PDFEntry* PDFReader::read( const char* pFileName )
{
SAL_WARN("sdext.pdfimport.pdfparse", "parse error: " << rError.descriptor << " at buffer pos " << rError.where - file_start);
#if OSL_DEBUG_LEVEL > 0
- OUString aTmp;
+ OUStringBuffer aTmp;
unsigned int nElem = aGrammar.m_aObjectStack.size();
for( unsigned int i = 0; i < nElem; i++ )
{
- aTmp += " ";
- aTmp += OUString(typeid( *(aGrammar.m_aObjectStack[i]) ).name(),
- strlen(typeid( *(aGrammar.m_aObjectStack[i]) ).name()),
- RTL_TEXTENCODING_ASCII_US);
+ aTmp.append(" ");
+ aTmp.appendAscii(typeid( *(aGrammar.m_aObjectStack[i]) ).name());
}
- SAL_WARN("sdext.pdfimport.pdfparse", "parse error object stack: " << aTmp);
+ SAL_WARN("sdext.pdfimport.pdfparse", "parse error object stack: " << aTmp.makeStringAndClear());
#endif
}