summaryrefslogtreecommitdiff
path: root/sw/source/uibase
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-12-18 13:35:13 +0100
committerStephan Bergmann <sbergman@redhat.com>2014-12-18 14:12:34 +0100
commitb1fab4ab325636eacf7c0387d55b6cc184f89c5f (patch)
treeae4fc4883d0106d08384eb9f628b28087babe991 /sw/source/uibase
parente5bd0f8b0a83f5c7f0f204adc081b102c765ca8e (diff)
sw: Use appropriate OUString functions on string constants
Change-Id: I9c3e03324c69beb5af4c43da208086600876f875
Diffstat (limited to 'sw/source/uibase')
-rw-r--r--sw/source/uibase/app/appenv.cxx2
-rw-r--r--sw/source/uibase/app/docstyle.cxx12
-rw-r--r--sw/source/uibase/dbui/dbmgr.cxx7
-rw-r--r--sw/source/uibase/dbui/mailmergehelper.cxx6
-rw-r--r--sw/source/uibase/dochdl/swdtflvr.cxx2
-rw-r--r--sw/source/uibase/docvw/edtwin.cxx4
-rw-r--r--sw/source/uibase/envelp/labelcfg.cxx2
-rw-r--r--sw/source/uibase/fldui/fldmgr.cxx6
-rw-r--r--sw/source/uibase/inc/view.hxx2
-rw-r--r--sw/source/uibase/ribbar/workctrl.cxx2
-rw-r--r--sw/source/uibase/shells/grfsh.cxx4
-rw-r--r--sw/source/uibase/uiview/formatclipboard.cxx4
-rw-r--r--sw/source/uibase/uiview/view.cxx2
-rw-r--r--sw/source/uibase/uiview/view1.cxx2
-rw-r--r--sw/source/uibase/uiview/viewdraw.cxx10
-rw-r--r--sw/source/uibase/uno/SwXFilterOptions.cxx2
-rw-r--r--sw/source/uibase/uno/unomailmerge.cxx2
-rw-r--r--sw/source/uibase/uno/unotxdoc.cxx12
18 files changed, 41 insertions, 42 deletions
diff --git a/sw/source/uibase/app/appenv.cxx b/sw/source/uibase/app/appenv.cxx
index 2cafbbbc163f..3f0e1731708a 100644
--- a/sw/source/uibase/app/appenv.cxx
+++ b/sw/source/uibase/app/appenv.cxx
@@ -102,7 +102,7 @@ OUString InsertLabEnvText( SwWrtShell& rSh, SwFldMgr& rFldMgr, const OUString& r
if ( nPos == -1 )
{
sTmpText = aLine;
- aLine = "";
+ aLine.clear();
}
else
{
diff --git a/sw/source/uibase/app/docstyle.cxx b/sw/source/uibase/app/docstyle.cxx
index 75046037067f..ce60c981dfd1 100644
--- a/sw/source/uibase/app/docstyle.cxx
+++ b/sw/source/uibase/app/docstyle.cxx
@@ -437,9 +437,9 @@ SwDocStyleSheet::SwDocStyleSheet( const SwDocStyleSheet& rOrg) :
void SwDocStyleSheet::Reset()
{
- aName = "";
- aFollow = "";
- aParent = "";
+ aName.clear();
+ aFollow.clear();
+ aParent.clear();
SetPhysical(false);
}
@@ -1808,7 +1808,7 @@ bool SwDocStyleSheet::FillStyleSheet( FillStyleType eFType )
if( pDesc->GetPoolHlpFileId() != UCHAR_MAX )
aHelpFile = *rDoc.GetDocPattern( pDesc->GetPoolHlpFileId() );
else
- aHelpFile = "";
+ aHelpFile.clear();
}
else if( !bCreate )
nPoolId = SwStyleNameMapper::GetPoolIdFromUIName( aName, nsSwGetPoolIdFromName::GET_POOLID_PAGEDESC );
@@ -1836,7 +1836,7 @@ bool SwDocStyleSheet::FillStyleSheet( FillStyleType eFType )
if( pNumRule->GetPoolHlpFileId() != UCHAR_MAX )
aHelpFile = *rDoc.GetDocPattern( pNumRule->GetPoolHlpFileId() );
else
- aHelpFile = "";
+ aHelpFile.clear();
}
else if( !bCreate )
nPoolId = SwStyleNameMapper::GetPoolIdFromUIName( aName, nsSwGetPoolIdFromName::GET_POOLID_NUMRULE );
@@ -1881,7 +1881,7 @@ bool SwDocStyleSheet::FillStyleSheet( FillStyleType eFType )
if( pFmt->GetPoolHlpFileId() != UCHAR_MAX )
aHelpFile = *rDoc.GetDocPattern( pFmt->GetPoolHlpFileId() );
else
- aHelpFile = "";
+ aHelpFile.clear();
if( RES_CONDTXTFMTCOLL == pFmt->Which() )
_nMask |= SWSTYLEBIT_CONDCOLL;
diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index 6005d42dc9b0..f9204f19d86e 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -832,8 +832,7 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell,
eEncoding = rHtmlOptions.GetTextEncoding();
}
else
- sBodyMimeType =
- OUString("text/plain; charset=UTF-8; format=flowed");
+ sBodyMimeType = "text/plain; charset=UTF-8; format=flowed";
}
uno::Reference< XPropertySet > xColumnProp;
@@ -1863,7 +1862,7 @@ bool SwDBManager::GetMergeColumnCnt(const OUString& rColumnName, sal_uInt16 n
{
if(!pImpl->pMergeData || !pImpl->pMergeData->xResultSet.is() || pImpl->pMergeData->bAfterSelection )
{
- rResult = "";
+ rResult.clear();
return false;
}
@@ -2509,7 +2508,7 @@ OUString SwDBManager::LoadAndRegisterDataSource(const DBConnURITypes type, const
}
catch(const Exception&)
{
- sFind = "";
+ sFind.clear();
}
return sFind;
}
diff --git a/sw/source/uibase/dbui/mailmergehelper.cxx b/sw/source/uibase/dbui/mailmergehelper.cxx
index 8142dfc90685..8590b1f75c6e 100644
--- a/sw/source/uibase/dbui/mailmergehelper.cxx
+++ b/sw/source/uibase/dbui/mailmergehelper.cxx
@@ -478,7 +478,7 @@ OUString SwAddressPreview::FillData(
}
SwAddressIterator aIter(sAddress);
- sAddress = "";
+ sAddress.clear();
while(aIter.HasMore())
{
SwMergeAddressItem aItem = aIter.Next();
@@ -518,7 +518,7 @@ OUString SwAddressPreview::FillData(
if( !rExcludeCountry.isEmpty() && sReplace != rExcludeCountry )
aItem.sText = sReplace;
else
- aItem.sText = "";
+ aItem.sText.clear();
}
else
{
@@ -578,7 +578,7 @@ SwMergeAddressItem SwAddressIterator::Next()
else if(-1 == nOpen && -1 == nReturn)
{
aRet.sText = sAddress;
- sAddress = "";
+ sAddress.clear();
}
else
{
diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx
index 1c2c6c0f2d86..41603a2ba010 100644
--- a/sw/source/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/uibase/dochdl/swdtflvr.cxx
@@ -3643,7 +3643,7 @@ SwTrnsfrDdeLink::SwTrnsfrDdeLink( SwTransferable& rTrans, SwWrtShell& rSh )
rSh.ResetModified();
}
else
- sName = "";
+ sName.clear();
rSh.DoUndo( bUndo );
}
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index 4e0a63607918..dfa4306a5177 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -900,7 +900,7 @@ void SwEditWin::FlushInBuffer()
nExpandSelection = nOldLen - nChgPos;
}
else
- m_aInBuffer = "";
+ m_aInBuffer.clear();
}
else
{
@@ -962,7 +962,7 @@ void SwEditWin::FlushInBuffer()
rSh.Insert( m_aInBuffer );
m_eBufferLanguage = LANGUAGE_DONTKNOW;
- m_aInBuffer = "";
+ m_aInBuffer.clear();
bFlushCharBuffer = false;
}
}
diff --git a/sw/source/uibase/envelp/labelcfg.cxx b/sw/source/uibase/envelp/labelcfg.cxx
index f1f608c24be5..947540b06cf4 100644
--- a/sw/source/uibase/envelp/labelcfg.cxx
+++ b/sw/source/uibase/envelp/labelcfg.cxx
@@ -229,7 +229,7 @@ static Sequence<PropertyValue> lcl_CreateProperties(
case 0: pValues[nProp].Value <<= OUString(rRec.aType); break;
case 1:
{
- rMeasure = "";
+ rMeasure.clear();
rMeasure += rRec.bCont ? OUString( "C" ) : OUString( "S" ); rMeasure += sColon;
rMeasure += OUString::number( convertTwipToMm100( rRec.lHDist ) ); rMeasure += sColon;
rMeasure += OUString::number( convertTwipToMm100( rRec.lVDist ) ); rMeasure += sColon;
diff --git a/sw/source/uibase/fldui/fldmgr.cxx b/sw/source/uibase/fldui/fldmgr.cxx
index 44436f986d48..18e2562d7d24 100644
--- a/sw/source/uibase/fldui/fldmgr.cxx
+++ b/sw/source/uibase/fldui/fldmgr.cxx
@@ -288,9 +288,9 @@ SwField* SwFldMgr::GetCurFld()
pCurFld = NULL;
// initialise strings and format
- aCurPar1 = "";
- aCurPar2 = "";
- sCurFrame = "";
+ aCurPar1.clear();
+ aCurPar2.clear();
+ sCurFrame.clear();
nCurFmt = 0;
if(!pCurFld)
diff --git a/sw/source/uibase/inc/view.hxx b/sw/source/uibase/inc/view.hxx
index 64b8dc9a8735..fd27dba2c106 100644
--- a/sw/source/uibase/inc/view.hxx
+++ b/sw/source/uibase/inc/view.hxx
@@ -557,7 +557,7 @@ public:
inline void FlipDrawSelMode() { m_bDrawSelMode = !m_bDrawSelMode; }
void NoRotate(); // turn off rotate mode
bool EnterDrawTextMode(const Point& aDocPos);
- void LeaveDrawCreate() { m_nDrawSfxId = m_nFormSfxId = USHRT_MAX; m_sDrawCustom = "";}
+ void LeaveDrawCreate() { m_nDrawSfxId = m_nFormSfxId = USHRT_MAX; m_sDrawCustom.clear();}
bool IsDrawMode() { return (m_nDrawSfxId != USHRT_MAX || m_nFormSfxId != USHRT_MAX); }
bool IsFormMode() const;
bool IsBezierEditMode();
diff --git a/sw/source/uibase/ribbar/workctrl.cxx b/sw/source/uibase/ribbar/workctrl.cxx
index 2f2a502fe5de..629ff1513acc 100644
--- a/sw/source/uibase/ribbar/workctrl.cxx
+++ b/sw/source/uibase/ribbar/workctrl.cxx
@@ -492,7 +492,7 @@ IMPL_LINK(SwScrollNaviPopup, SelectHdl, ToolBox*, pSet)
Sequence< PropertyValue > aArgs;
OUString cmd(".uno:ScrollToPrevious");
if (NID_NEXT == nSet)
- cmd = OUString(".uno:ScrollToNext");
+ cmd = ".uno:ScrollToNext";
SfxToolBoxControl::Dispatch( Reference< XDispatchProvider >( GetFrame()->getController(), UNO_QUERY ),
cmd, aArgs );
}
diff --git a/sw/source/uibase/shells/grfsh.cxx b/sw/source/uibase/shells/grfsh.cxx
index 31652274c3dd..b6714ce6e8ac 100644
--- a/sw/source/uibase/shells/grfsh.cxx
+++ b/sw/source/uibase/shells/grfsh.cxx
@@ -415,12 +415,12 @@ void SwGrfShell::Execute(SfxRequest &rReq)
if( !static_cast<const SvxBrushItem*>(pItem)->GetGraphicLink().isEmpty() )
sGrfNm = static_cast<const SvxBrushItem*>(pItem)->GetGraphicLink();
else
- sGrfNm = "";
+ sGrfNm.clear();
if( !static_cast<const SvxBrushItem*>(pItem)->GetGraphicFilter().isEmpty() )
sFilterNm = static_cast<const SvxBrushItem*>(pItem)->GetGraphicFilter();
else
- sFilterNm = "";
+ sFilterNm.clear();
if( !sGrfNm.isEmpty() )
{
diff --git a/sw/source/uibase/uiview/formatclipboard.cxx b/sw/source/uibase/uiview/formatclipboard.cxx
index 229fb83869ea..31adc5ac0acf 100644
--- a/sw/source/uibase/uiview/formatclipboard.cxx
+++ b/sw/source/uibase/uiview/formatclipboard.cxx
@@ -588,9 +588,9 @@ void SwFormatClipboard::Erase()
m_pTableItemSet = 0;
if( !m_aCharStyle.isEmpty() )
- m_aCharStyle = "";
+ m_aCharStyle.clear();
if( !m_aParaStyle.isEmpty() )
- m_aParaStyle = "";
+ m_aParaStyle.clear();
m_bPersistentCopy = false;
}
diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx
index 5fd4deb71035..d9c8990d9c0f 100644
--- a/sw/source/uibase/uiview/view.cxx
+++ b/sw/source/uibase/uiview/view.cxx
@@ -1217,7 +1217,7 @@ void SwView::ReadUserData( const OUString &rUserData, bool bBrowse )
m_pWrtShell->EnterSelFrmMode( &aCrsrPos2 );
}
m_pWrtShell->MakeSelVisible();
- m_sNewCrsrPos = "";
+ m_sNewCrsrPos.clear();
}
else if(USHRT_MAX != m_nNewPage)
{
diff --git a/sw/source/uibase/uiview/view1.cxx b/sw/source/uibase/uiview/view1.cxx
index b35767476df2..85bd42692725 100644
--- a/sw/source/uibase/uiview/view1.cxx
+++ b/sw/source/uibase/uiview/view1.cxx
@@ -75,7 +75,7 @@ void SwView::Activate(bool bMDIActivate)
if( !m_sSwViewData.isEmpty() )
{
ReadUserData(m_sSwViewData, false);
- m_sSwViewData = "";
+ m_sSwViewData.clear();
}
AttrChangedNotify(m_pWrtShell);
diff --git a/sw/source/uibase/uiview/viewdraw.cxx b/sw/source/uibase/uiview/viewdraw.cxx
index d3e3705206a4..43037c9c6ea6 100644
--- a/sw/source/uibase/uiview/viewdraw.cxx
+++ b/sw/source/uibase/uiview/viewdraw.cxx
@@ -263,7 +263,7 @@ void SwView::ExecDraw(SfxRequest& rReq)
case SID_DRAW_SELECT:
pFuncPtr = new DrawSelection(m_pWrtShell, m_pEditWin, this);
m_nDrawSfxId = m_nFormSfxId = SID_OBJECT_SELECT;
- m_sDrawCustom = "";
+ m_sDrawCustom.clear();
break;
case SID_DRAW_LINE:
@@ -276,7 +276,7 @@ void SwView::ExecDraw(SfxRequest& rReq)
case SID_DRAW_CAPTION_VERTICAL:
pFuncPtr = new ConstRectangle(m_pWrtShell, m_pEditWin, this);
m_nDrawSfxId = nSlotId;
- m_sDrawCustom = "";
+ m_sDrawCustom.clear();
break;
case SID_DRAW_POLYGON_NOFILL:
@@ -284,7 +284,7 @@ void SwView::ExecDraw(SfxRequest& rReq)
case SID_DRAW_FREELINE_NOFILL:
pFuncPtr = new ConstPolygon(m_pWrtShell, m_pEditWin, this);
m_nDrawSfxId = nSlotId;
- m_sDrawCustom = "";
+ m_sDrawCustom.clear();
break;
case SID_DRAW_ARC:
@@ -292,7 +292,7 @@ void SwView::ExecDraw(SfxRequest& rReq)
case SID_DRAW_CIRCLECUT:
pFuncPtr = new ConstArc(m_pWrtShell, m_pEditWin, this);
m_nDrawSfxId = nSlotId;
- m_sDrawCustom = "";
+ m_sDrawCustom.clear();
break;
case SID_FM_CREATE_CONTROL:
@@ -645,7 +645,7 @@ void SwView::SetDrawFuncPtr(SwDrawBase* pFuncPtr)
void SwView::SetSelDrawSlot()
{
m_nDrawSfxId = SID_OBJECT_SELECT;
- m_sDrawCustom = "";
+ m_sDrawCustom.clear();
}
bool SwView::AreOnlyFormsSelected() const
diff --git a/sw/source/uibase/uno/SwXFilterOptions.cxx b/sw/source/uibase/uno/SwXFilterOptions.cxx
index 57477a0a3661..fef02b76f6bc 100644
--- a/sw/source/uibase/uno/SwXFilterOptions.cxx
+++ b/sw/source/uibase/uno/SwXFilterOptions.cxx
@@ -67,7 +67,7 @@ uno::Sequence< beans::PropertyValue > SwXFilterOptions::getPropertyValues() thro
uno::Sequence<beans::PropertyValue> aRet(1);
beans::PropertyValue* pArray = aRet.getArray();
- pArray[0].Name = OUString( FILTER_OPTIONS_NAME );
+ pArray[0].Name = FILTER_OPTIONS_NAME;
pArray[0].Value <<= sFilterOptions;
return aRet;
diff --git a/sw/source/uibase/uno/unomailmerge.cxx b/sw/source/uibase/uno/unomailmerge.cxx
index 39627971b482..5d96097863b3 100644
--- a/sw/source/uibase/uno/unomailmerge.cxx
+++ b/sw/source/uibase/uno/unomailmerge.cxx
@@ -811,7 +811,7 @@ uno::Any SAL_CALL SwXMailMerge::execute(
if ( xCurModel.get() != xModel.get() )
{ // in case it was a temporary model -> close it, and delete the file
DeleteTmpFile_Impl( xCurModel, xCurDocSh, aTmpFileName );
- aTmpFileName = "";
+ aTmpFileName.clear();
}
// (in case it wasn't a temporary model, it will be closed in the dtor, at the latest)
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index 56c148b939f5..ea3683fc8017 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -1784,15 +1784,15 @@ Sequence< OUString > SwXTextDocument::getSupportedServiceNames(void) throw( Runt
Sequence< OUString > aRet (3);
OUString* pArray = aRet.getArray();
- pArray[0] = OUString ( ( "com.sun.star.document.OfficeDocument" ) );
- pArray[1] = OUString ( ( "com.sun.star.text.GenericTextDocument" ) );
+ pArray[0] = "com.sun.star.document.OfficeDocument";
+ pArray[1] = "com.sun.star.text.GenericTextDocument";
if (bTextDoc)
- pArray[2] = OUString ( ( "com.sun.star.text.TextDocument" ) );
+ pArray[2] = "com.sun.star.text.TextDocument";
else if (bWebDoc)
- pArray[2] = OUString ( ( "com.sun.star.text.WebDocument" ) );
+ pArray[2] = "com.sun.star.text.WebDocument";
else if (bGlobalDoc)
- pArray[2] = OUString ( ( "com.sun.star.text.GlobalDocument" ) );
+ pArray[2] = "com.sun.star.text.GlobalDocument";
return aRet;
}
@@ -3425,7 +3425,7 @@ Any SwXLinkTargetSupplier::getByName(const OUString& rName)
}
else if(sToCompare == sBookmarks)
{
- sSuffix = "";
+ sSuffix.clear();
Reference< XNameAccess > xBkms = new SwXLinkNameAccessWrapper(
pxDoc->getBookmarks(), sToCompare, sSuffix );
Reference< XPropertySet > xRet(xBkms, UNO_QUERY);