convert svx/source/svdraw/*.cxx from String to OUString

Change-Id: I081cc5220fb0f55af2c08ae24bb92e4bf8d3f546
This commit is contained in:
Noel Grandin
2013-09-04 13:43:19 +02:00
parent dea5704e93
commit 5da63b03c0
21 changed files with 114 additions and 119 deletions

View File

@@ -176,13 +176,13 @@ public:
// EndUndo() gerufen. NotifyNewUndoAction() wird nicht gerufen bei einer
// leeren Klammerung.
void BegUndo() { pMod->BegUndo(); } // Undo-Klammerung auf
void BegUndo(const String& rComment) { pMod->BegUndo(rComment); } // Undo-Klammerung auf
void BegUndo(const String& rComment, const String& rObjDescr, SdrRepeatFunc eFunc=SDRREPFUNC_OBJ_NONE) { pMod->BegUndo(rComment,rObjDescr,eFunc); } // Undo-Klammerung auf
void BegUndo(const OUString& rComment) { pMod->BegUndo(rComment); } // Undo-Klammerung auf
void BegUndo(const OUString& rComment, const OUString& rObjDescr, SdrRepeatFunc eFunc=SDRREPFUNC_OBJ_NONE) { pMod->BegUndo(rComment,rObjDescr,eFunc); } // Undo-Klammerung auf
void EndUndo(); // Undo-Klammerung zu (inkl BroadcastEdges)
void AddUndo(SdrUndoAction* pUndo) { pMod->AddUndo(pUndo); } // Action hinzufuegen
// nur nach dem 1. BegUndo oder vor dem letzten EndUndo:
void SetUndoComment(const String& rComment) { pMod->SetUndoComment(rComment); }
void SetUndoComment(const String& rComment, const String& rObjDescr) { pMod->SetUndoComment(rComment,rObjDescr); }
void SetUndoComment(const OUString& rComment) { pMod->SetUndoComment(rComment); }
void SetUndoComment(const OUString& rComment, const OUString& rObjDescr) { pMod->SetUndoComment(rComment,rObjDescr); }
bool IsUndoEnabled() const;
std::vector< SdrUndoAction* > CreateConnectorUndo( SdrObject& rO );

View File

@@ -405,7 +405,7 @@ sal_Bool SdrCreateView::ImpBegCreateObj(sal_uInt32 nInvent, sal_uInt16 nIdent, c
}
if (pCreatePV!=NULL)
{ // otherwise no side registered!
String aLay(aAktLayer);
OUString aLay(aAktLayer);
if(nInvent == SdrInventor && nIdent == OBJ_MEASURE && !aMeasureLayer.isEmpty())
{

View File

@@ -971,8 +971,7 @@ void SdrEditView::SetAttrToMarked(const SfxItemSet& rAttr, sal_Bool bReplaceAll)
}
if(bHasEEFeatureItems)
{
String aMessage;
aMessage.AppendAscii("SdrEditView::SetAttrToMarked(): Setting EE_FEATURE items at the SdrView does not make sense! It only leads to overhead and unreadable documents.");
OUString aMessage("SdrEditView::SetAttrToMarked(): Setting EE_FEATURE items at the SdrView does not make sense! It only leads to overhead and unreadable documents.");
InfoBox(NULL, aMessage).Execute();
}
}

View File

@@ -1183,7 +1183,7 @@ void SdrEditView::CombineMarkedObjects(sal_Bool bNoPolyPoly)
// Undo-String will be set later
if( bUndo )
BegUndo(String(), String(), bNoPolyPoly ? SDRREPFUNC_OBJ_COMBINE_ONEPOLY : SDRREPFUNC_OBJ_COMBINE_POLYPOLY);
BegUndo("", "", bNoPolyPoly ? SDRREPFUNC_OBJ_COMBINE_ONEPOLY : SDRREPFUNC_OBJ_COMBINE_POLYPOLY);
// #105899# First, guarantee that all objects are converted to polyobjects,
// especially for SdrGrafObj with bitmap filling this is necessary to not
@@ -1615,8 +1615,7 @@ void SdrEditView::DismantleMarkedObjects(sal_Bool bMakeLines)
if( bUndo )
{
// comment is constructed later
BegUndo(String(), String(),
bMakeLines ? SDRREPFUNC_OBJ_DISMANTLE_LINES : SDRREPFUNC_OBJ_DISMANTLE_POLYS);
BegUndo("", "", bMakeLines ? SDRREPFUNC_OBJ_DISMANTLE_LINES : SDRREPFUNC_OBJ_DISMANTLE_POLYS);
}
sal_uIntPtr nm;
@@ -1791,7 +1790,7 @@ void SdrEditView::UnGroupMarked()
const bool bUndo = IsUndoEnabled();
if( bUndo )
BegUndo(String(), String(), SDRREPFUNC_OBJ_UNGROUP);
BegUndo("", "", SDRREPFUNC_OBJ_UNGROUP);
sal_uIntPtr nCount=0;
OUString aName1;
@@ -1979,7 +1978,7 @@ void SdrEditView::DoImportMarkedMtf(SvdProgressInfo *pProgrInfo)
const bool bUndo = IsUndoEnabled();
if( bUndo )
BegUndo(String(), String(), SDRREPFUNC_OBJ_IMPORTMTF);
BegUndo("", "", SDRREPFUNC_OBJ_IMPORTMTF);
SortMarkedObjects();
SdrMarkList aForTheDescription;

View File

@@ -1517,8 +1517,7 @@ sal_Bool SdrObjEditView::SetAttributes(const SfxItemSet& rSet, sal_Bool bReplace
if(bHasEEFeatureItems)
{
String aMessage;
aMessage.AppendAscii("SdrObjEditView::SetAttributes(): Setting EE_FEATURE items at the SdrView does not make sense! It only leads to overhead and unreadable documents.");
OUString aMessage("SdrObjEditView::SetAttributes(): Setting EE_FEATURE items at the SdrView does not make sense! It only leads to overhead and unreadable documents.");
InfoBox(NULL, aMessage).Execute();
}
}

View File

@@ -1196,7 +1196,7 @@ void SdrHdlGradient::FromIAOToItem(SdrObject* _pObj, sal_Bool bSetItemOnObject,
GradTransGradient aGradTransGradient;
GradTransVector aGradTransVector;
String aString;
OUString aString;
aGradTransVector.maPositionA = basegfx::B2DPoint(GetPos().X(), GetPos().Y());
aGradTransVector.maPositionB = basegfx::B2DPoint(Get2ndPos().X(), Get2ndPos().Y());
@@ -1220,13 +1220,13 @@ void SdrHdlGradient::FromIAOToItem(SdrObject* _pObj, sal_Bool bSetItemOnObject,
if(IsGradient())
{
aString = String();
aString = "";
XFillGradientItem aNewGradItem(aString, aGradTransGradient.aGradient);
aNewSet.Put(aNewGradItem);
}
else
{
aString = String();
aString = "";
XFillFloatTransparenceItem aNewTransItem(aString, aGradTransGradient.aGradient);
aNewSet.Put(aNewTransItem);
}

View File

@@ -536,7 +536,7 @@ void SdrModel::BegUndo()
{
if( mpImpl->mpUndoManager )
{
const String aEmpty;
const OUString aEmpty;
mpImpl->mpUndoManager->EnterListAction(aEmpty,aEmpty);
nUndoLevel++;
}
@@ -558,7 +558,7 @@ void SdrModel::BegUndo(const OUString& rComment)
{
if( mpImpl->mpUndoManager )
{
const String aEmpty;
const OUString aEmpty;
mpImpl->mpUndoManager->EnterListAction( rComment, aEmpty );
nUndoLevel++;
}
@@ -581,7 +581,7 @@ void SdrModel::BegUndo(const OUString& rComment, const OUString& rObjDescr, SdrR
{
aComment = aComment.replaceFirst("%1", rObjDescr);
}
const String aEmpty;
const OUString aEmpty;
mpImpl->mpUndoManager->EnterListAction( aComment,aEmpty );
nUndoLevel++;
}
@@ -1173,7 +1173,7 @@ void SdrModel::TakeUnitStr(FieldUnit eUnit, OUString& rStr)
case FUNIT_NONE :
case FUNIT_CUSTOM :
{
rStr = String();
rStr = "";
break;
}
case FUNIT_100TH_MM:
@@ -1327,10 +1327,10 @@ void SdrModel::TakeMetricStr(long nVal, OUString& rStr, bool bNoUnitChars, sal_I
// if necessary, add separators before every third digit
if( nVorKomma > 3 )
{
String aThoSep( rLoc.getNumThousandSep() );
if ( aThoSep.Len() > 0 )
OUString aThoSep( rLoc.getNumThousandSep() );
if ( !aThoSep.isEmpty() )
{
sal_Unicode cTho( aThoSep.GetChar(0) );
sal_Unicode cTho( aThoSep[0] );
sal_Int32 i(nVorKomma - 3);
while(i > 0)
@@ -1342,11 +1342,11 @@ void SdrModel::TakeMetricStr(long nVal, OUString& rStr, bool bNoUnitChars, sal_I
}
if (aBuf.isEmpty())
aBuf.append(sal_Unicode('0'));
aBuf.append("0");
if(bNegative)
{
aBuf.insert(0, sal_Unicode('-'));
aBuf.insert(0, "-");
}
if(!bNoUnitChars)

View File

@@ -410,20 +410,20 @@ Reference< XCustomShapeEngine > SdrObjCustomShape::GetCustomShapeEngine() const
if (mxCustomShapeEngine.is())
return mxCustomShapeEngine;
String aEngine(((SdrCustomShapeEngineItem&)GetMergedItem( SDRATTR_CUSTOMSHAPE_ENGINE )).GetValue());
if ( !aEngine.Len() )
aEngine = String( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.drawing.EnhancedCustomShapeEngine" ) );
OUString aEngine(((SdrCustomShapeEngineItem&)GetMergedItem( SDRATTR_CUSTOMSHAPE_ENGINE )).GetValue());
if ( aEngine.isEmpty() )
aEngine = "com.sun.star.drawing.EnhancedCustomShapeEngine";
Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
Reference< XShape > aXShape = GetXShapeForSdrObject(const_cast<SdrObjCustomShape*>(this));
if ( aXShape.is() )
{
if ( aEngine.Len() )
if ( !aEngine.isEmpty() )
{
Sequence< Any > aArgument( 1 );
Sequence< PropertyValue > aPropValues( 1 );
aPropValues[ 0 ].Name = OUString("CustomShape");
aPropValues[ 0 ].Name = "CustomShape";
aPropValues[ 0 ].Value <<= aXShape;
aArgument[ 0 ] <<= aPropValues;
Reference< XInterface > xInterface( xContext->getServiceManager()->createInstanceWithArgumentsAndContext( aEngine, aArgument, xContext ) );

View File

@@ -387,7 +387,7 @@ OUString SdrCaptionObj::getSpecialDragComment(const SdrDragStat& rDrag) const
if(bCreateComment)
{
return String();
return OUString();
}
else
{

View File

@@ -67,7 +67,7 @@ using namespace ::com::sun::star::io;
#define SWAPGRAPHIC_TIMEOUT 5000
const Graphic ImpLoadLinkedGraphic( const String aFileName, const String aFilterName )
const Graphic ImpLoadLinkedGraphic( const OUString aFileName, const OUString aFilterName )
{
Graphic aGraphic;
@@ -80,12 +80,12 @@ const Graphic ImpLoadLinkedGraphic( const String aFileName, const String aFilter
pInStrm->Seek( STREAM_SEEK_TO_BEGIN );
GraphicFilter& rGF = GraphicFilter::GetGraphicFilter();
const sal_uInt16 nFilter = aFilterName.Len() && rGF.GetImportFormatCount()
const sal_uInt16 nFilter = !aFilterName.isEmpty() && rGF.GetImportFormatCount()
? rGF.GetImportFormatNumber( aFilterName )
: GRFILTER_FORMAT_DONTKNOW;
String aEmptyStr;
com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > aFilterData( 1 );
OUString aEmptyStr;
css::uno::Sequence< css::beans::PropertyValue > aFilterData( 1 );
// TODO: Room for improvement:
// As this is a linked graphic the GfxLink is not needed if saving/loading our own format.
@@ -122,12 +122,12 @@ public:
class SdrGraphicUpdater : public ::osl::Thread
{
public:
SdrGraphicUpdater( const String& rFileName, const String& rFilterName, SdrGraphicLink& );
SdrGraphicUpdater( const OUString& rFileName, const OUString& rFilterName, SdrGraphicLink& );
virtual ~SdrGraphicUpdater( void );
void SAL_CALL Terminate( void );
bool GraphicLinkChanged( const String& rFileName ){ return maFileName != rFileName; };
bool GraphicLinkChanged( const OUString& rFileName ){ return maFileName != rFileName; };
protected:
@@ -143,14 +143,14 @@ protected:
private:
const String maFileName;
const String maFilterName;
const OUString maFileName;
const OUString maFilterName;
SdrGraphicLink& mrGraphicLink;
volatile bool mbIsTerminated;
};
SdrGraphicUpdater::SdrGraphicUpdater( const String& rFileName, const String& rFilterName, SdrGraphicLink& rGraphicLink )
SdrGraphicUpdater::SdrGraphicUpdater( const OUString& rFileName, const OUString& rFilterName, SdrGraphicLink& rGraphicLink )
: maFileName( rFileName )
, maFilterName( rFilterName )
, mrGraphicLink( rGraphicLink )
@@ -277,9 +277,9 @@ sdr::contact::ViewContact* SdrGrafObj::CreateObjectSpecificViewContact()
void SdrGrafObj::onGraphicChanged()
{
String aName;
String aTitle;
String aDesc;
OUString aName;
OUString aTitle;
OUString aDesc;
if(pGraphic)
{
@@ -308,17 +308,17 @@ void SdrGrafObj::onGraphicChanged()
}
}
if(aName.Len())
if(!aName.isEmpty())
{
SetName(aName);
}
if(aTitle.Len())
if(!aTitle.isEmpty())
{
SetTitle(aTitle);
}
if(aDesc.Len())
if(!aDesc.isEmpty())
{
SetDescription(aDesc);
}
@@ -563,7 +563,7 @@ void SdrGrafObj::ForceSwapIn() const
if( mbIsPreview )
{
// removing preview graphic
const String aUserData( pGraphic->GetUserData() );
const OUString aUserData( pGraphic->GetUserData() );
Graphic aEmpty;
pGraphic->SetGraphic( aEmpty );
@@ -1350,11 +1350,11 @@ IMPL_LINK( SdrGrafObj, ImpSwapHdl, GraphicObject*, pO )
com::sun::star::awt::Size aPreviewSizeHint( 64, 64 );
sal_Bool bAllowPartialStreamRead = true;
sal_Bool bCreateNativeLink = false;
(*pFilterData)[ 0 ].Name = String( RTL_CONSTASCII_USTRINGPARAM( "PreviewSizeHint" ) );
(*pFilterData)[ 0 ].Name = "PreviewSizeHint";
(*pFilterData)[ 0 ].Value <<= aPreviewSizeHint;
(*pFilterData)[ 1 ].Name = String( RTL_CONSTASCII_USTRINGPARAM( "AllowPartialStreamRead" ) );
(*pFilterData)[ 1 ].Name = "AllowPartialStreamRead";
(*pFilterData)[ 1 ].Value <<= bAllowPartialStreamRead;
(*pFilterData)[ 2 ].Name = String( RTL_CONSTASCII_USTRINGPARAM( "CreateNativeLink" ) );
(*pFilterData)[ 2 ].Name = "CreateNativeLink";
(*pFilterData)[ 2 ].Value <<= bCreateNativeLink;
mbIsPreview = true;
@@ -1364,7 +1364,7 @@ IMPL_LINK( SdrGrafObj, ImpSwapHdl, GraphicObject*, pO )
aGraphic, aUserData, *pStream,
GRFILTER_FORMAT_DONTKNOW, NULL, 0, pFilterData))
{
const String aNewUserData( pGraphic->GetUserData() );
const OUString aNewUserData( pGraphic->GetUserData() );
pGraphic->SetGraphic( aGraphic );
pGraphic->SetUserData( aNewUserData );

View File

@@ -284,7 +284,7 @@ struct ImpMeasureRec : public SdrDragStatUserData
FieldUnit eMeasureUnit;
Fraction aMeasureScale;
bool bShowUnit;
String aFormatString;
OUString aFormatString;
bool bTextAutoAngle;
long nTextAutoAngleView;
bool bTextIsFixedAngle;

View File

@@ -683,7 +683,7 @@ public:
bool mbConnected;
SdrEmbedObjectLink* mpObjectLink;
String maLinkURL;
OUString maLinkURL;
SdrOle2ObjImpl()
: pGraphicObject( NULL )
@@ -967,7 +967,7 @@ void SdrOle2Obj::BreakFileLink_Impl()
uno::Reference< embed::XLinkageSupport > xLinkSupport( xObjRef.GetObject(), uno::UNO_QUERY_THROW );
xLinkSupport->breakLink( xStorage, mpImpl->aPersistName );
DisconnectFileLink_Impl();
mpImpl->maLinkURL = String();
mpImpl->maLinkURL = "";
}
catch( ::com::sun::star::uno::Exception& )
{
@@ -1005,8 +1005,8 @@ void SdrOle2Obj::CheckFileLink_Impl()
uno::Reference< embed::XLinkageSupport > xLinkSupport( xObjRef.GetObject(), uno::UNO_QUERY );
if ( xLinkSupport.is() && xLinkSupport->isLink() )
{
String aLinkURL = xLinkSupport->getLinkURL();
if ( aLinkURL.Len() )
OUString aLinkURL = xLinkSupport->getLinkURL();
if ( !aLinkURL.isEmpty() )
{
// this is a file link so the model link manager should handle it
sfx2::LinkManager* pLinkManager = pModel->GetLinkManager();

View File

@@ -496,7 +496,7 @@ public:
bool beginPathDrag( SdrDragStat& rDrag ) const;
bool movePathDrag( SdrDragStat& rDrag ) const;
bool endPathDrag( SdrDragStat& rDrag );
String getSpecialDragComment(const SdrDragStat& rDrag) const;
OUString getSpecialDragComment(const SdrDragStat& rDrag) const;
basegfx::B2DPolyPolygon getSpecialDragPoly(const SdrDragStat& rDrag) const;
// create stuff
@@ -906,9 +906,9 @@ bool ImpPathForDragAndCreate::endPathDrag(SdrDragStat& rDrag)
return true;
}
String ImpPathForDragAndCreate::getSpecialDragComment(const SdrDragStat& rDrag) const
OUString ImpPathForDragAndCreate::getSpecialDragComment(const SdrDragStat& rDrag) const
{
XubString aStr;
OUString aStr;
const SdrHdl* pHdl = rDrag.GetHdl();
const bool bCreateComment(rDrag.GetView() && &mrSdrPathObject == rDrag.GetView()->GetCreateObj());
@@ -930,41 +930,41 @@ String ImpPathForDragAndCreate::getSpecialDragComment(const SdrDragStat& rDrag)
aNow = pU->aLineEnd;
aNow -= aPrev;
aStr.AppendAscii(" (");
aStr += " (";
OUString aMetr;
if(pU->bCircle)
{
mrSdrPathObject.GetModel()->TakeWinkStr(std::abs(pU->nCircRelWink), aMetr);
aStr.Append(aMetr);
aStr.AppendAscii(" r=");
aStr += aMetr;
aStr += " r=";
mrSdrPathObject.GetModel()->TakeMetricStr(pU->nCircRadius, aMetr, sal_True);
aStr.Append(aMetr);
aStr += aMetr;
}
aStr.AppendAscii("dx=");
aStr += "dx=";
mrSdrPathObject.GetModel()->TakeMetricStr(aNow.X(), aMetr, sal_True);
aStr.Append(aMetr);
aStr += aMetr;
aStr.AppendAscii(" dy=");
aStr += " dy=";
mrSdrPathObject.GetModel()->TakeMetricStr(aNow.Y(), aMetr, sal_True);
aStr.Append(aMetr);
aStr += aMetr;
if(!IsFreeHand(meObjectKind))
{
sal_Int32 nLen(GetLen(aNow));
aStr.AppendAscii(" l=");
aStr += " l=";
mrSdrPathObject.GetModel()->TakeMetricStr(nLen, aMetr, sal_True);
aStr.Append(aMetr);
aStr += aMetr;
sal_Int32 nWink(GetAngle(aNow));
aStr += sal_Unicode(' ');
aStr += " ";
mrSdrPathObject.GetModel()->TakeWinkStr(nWink, aMetr);
aStr.Append(aMetr);
aStr += aMetr;
}
aStr += sal_Unicode(')');
aStr += ")";
}
else if(!mrSdrPathObject.GetModel() || !pHdl)
{
@@ -989,7 +989,7 @@ String ImpPathForDragAndCreate::getSpecialDragComment(const SdrDragStat& rDrag)
if(!pDragData)
{
OSL_FAIL("ImpPathForDragAndCreate::MovDrag(): ImpSdrPathDragData is invalid.");
return String();
return OUString();
}
if(!pDragData->IsMultiPointDrag() && pDragData->bEliminate)
@@ -1015,14 +1015,14 @@ String ImpPathForDragAndCreate::getSpecialDragComment(const SdrDragStat& rDrag)
Point aBeg(rDrag.GetStart());
Point aNow(rDrag.GetNow());
aStr = String();
aStr.AppendAscii("dx=");
aStr = "";
aStr += "dx=";
mrSdrPathObject.GetModel()->TakeMetricStr(aNow.X() - aBeg.X(), aMetr, sal_True);
aStr.Append(aMetr);
aStr += aMetr;
aStr.AppendAscii(" dy=");
aStr += " dy=";
mrSdrPathObject.GetModel()->TakeMetricStr(aNow.Y() - aBeg.Y(), aMetr, sal_True);
aStr.Append(aMetr);
aStr += aMetr;
if(!pDragData->IsMultiPointDrag())
{
@@ -1047,14 +1047,14 @@ String ImpPathForDragAndCreate::getSpecialDragComment(const SdrDragStat& rDrag)
aNow -= rXPoly[nRef];
sal_Int32 nLen(GetLen(aNow));
aStr.AppendAscii(" l=");
aStr += " l=";
mrSdrPathObject.GetModel()->TakeMetricStr(nLen, aMetr, sal_True);
aStr.Append(aMetr);
aStr += aMetr;
sal_Int32 nWink(GetAngle(aNow));
aStr += sal_Unicode(' ');
aStr += " ";
mrSdrPathObject.GetModel()->TakeWinkStr(nWink, aMetr);
aStr.Append(aMetr);
aStr += aMetr;
}
else if(nPntAnz > 1)
{
@@ -1093,12 +1093,12 @@ String ImpPathForDragAndCreate::getSpecialDragComment(const SdrDragStat& rDrag)
aPt -= rXPoly[nPt1];
sal_Int32 nLen(GetLen(aPt));
aStr.AppendAscii(" l=");
aStr += " l=";
mrSdrPathObject.GetModel()->TakeMetricStr(nLen, aMetr, sal_True);
aStr += aMetr;
sal_Int32 nWink(GetAngle(aPt));
aStr += sal_Unicode(' ');
aStr += " ";
mrSdrPathObject.GetModel()->TakeWinkStr(nWink, aMetr);
aStr += aMetr;
}
@@ -1106,20 +1106,20 @@ String ImpPathForDragAndCreate::getSpecialDragComment(const SdrDragStat& rDrag)
if(bPt2)
{
if(bPt1)
aStr.AppendAscii(" / ");
aStr += " / ";
else
aStr.AppendAscii(" ");
aStr += " ";
Point aPt(aNow);
aPt -= rXPoly[nPt2];
sal_Int32 nLen(GetLen(aPt));
aStr.AppendAscii("l=");
aStr += "l=";
mrSdrPathObject.GetModel()->TakeMetricStr(nLen, aMetr, sal_True);
aStr += aMetr;
sal_Int32 nWink(GetAngle(aPt));
aStr += sal_Unicode(' ');
aStr += " ";
mrSdrPathObject.GetModel()->TakeWinkStr(nWink, aMetr);
aStr += aMetr;
}

View File

@@ -1000,25 +1000,25 @@ OUString SdrTextObj::TakeObjNameSingul() const
if(pOutlinerParaObject && eTextKind != OBJ_OUTLINETEXT)
{
// shouldn't currently cause any problems at OUTLINETEXT
XubString aStr2(comphelper::string::stripStart(pOutlinerParaObject->GetTextObject().GetText(0), ' '));
OUString aStr2(comphelper::string::stripStart(pOutlinerParaObject->GetTextObject().GetText(0), ' '));
// avoid non expanded text portions in object name
// (second condition is new)
if(aStr2.Len() && aStr2.Search(sal_Unicode(255)) == STRING_NOTFOUND)
if(!aStr2.isEmpty() && aStr2.indexOf(sal_Unicode(255)) == -1)
{
// space between ResStr and content text
aStr += sal_Unicode(' ');
aStr += " ";
aStr += sal_Unicode('\'');
aStr += "\'";
if(aStr2.Len() > 10)
if(aStr2.getLength() > 10)
{
aStr2.Erase(8);
aStr2.AppendAscii("...", 3);
aStr2 = aStr2.replaceAt(8, 1, "");
aStr2 += "...";
}
aStr += aStr2;
aStr += sal_Unicode('\'');
aStr += "\'";
}
}

View File

@@ -468,11 +468,11 @@ namespace
}
else if(pPageField)
{
pPrimitive = new drawinglayer::primitive2d::TextHierarchyFieldPrimitive2D(aSequence, drawinglayer::primitive2d::FIELD_TYPE_PAGE, String());
pPrimitive = new drawinglayer::primitive2d::TextHierarchyFieldPrimitive2D(aSequence, drawinglayer::primitive2d::FIELD_TYPE_PAGE, "");
}
else
{
pPrimitive = new drawinglayer::primitive2d::TextHierarchyFieldPrimitive2D(aSequence, drawinglayer::primitive2d::FIELD_TYPE_COMMON, String());
pPrimitive = new drawinglayer::primitive2d::TextHierarchyFieldPrimitive2D(aSequence, drawinglayer::primitive2d::FIELD_TYPE_COMMON, "");
}
}

View File

@@ -71,7 +71,7 @@ namespace
class impPathTextPortion
{
basegfx::B2DVector maOffset;
String maText;
OUString maText;
xub_StrLen mnTextStart;
xub_StrLen mnTextLength;
sal_Int32 mnParagraph;
@@ -124,7 +124,7 @@ namespace
}
const basegfx::B2DVector& getOffset() const { return maOffset; }
const String& getText() const { return maText; }
const OUString& getText() const { return maText; }
xub_StrLen getTextStart() const { return mnTextStart; }
xub_StrLen getTextLength() const { return mnTextLength; }
sal_Int32 getParagraph() const { return mnParagraph; }
@@ -481,7 +481,7 @@ namespace
aNewTransformB.translate(aPerpendicular.getX(), aPerpendicular.getY());
}
if(pCandidate->getText().Len() && nNextGlyphLen)
if(!pCandidate->getText().isEmpty() && nNextGlyphLen)
{
const xub_StrLen nPortionIndex(pCandidate->getPortionIndex(nUsedTextLength, nNextGlyphLen));
::std::vector< double > aNewDXArray;

View File

@@ -224,7 +224,7 @@ void SdrTextObj::ImpSetTextStyleSheetListeners()
SfxStyleSheetBasePool* pStylePool=pModel!=NULL ? pModel->GetStyleSheetPool() : NULL;
if (pStylePool!=NULL)
{
std::vector<XubString*> aStyleNames;
std::vector<OUString> aStyleNames;
OutlinerParaObject* pOutlinerParaObject = GetOutlinerParaObject();
if (pOutlinerParaObject!=NULL)
{
@@ -256,12 +256,12 @@ void SdrTextObj::ImpSetTextStyleSheetListeners()
{
// we don't want duplicate stylesheets
nNum--;
bFnd = aStyleName.equals(*aStyleNames[nNum]);
bFnd = aStyleName == aStyleNames[nNum];
}
if(!bFnd)
{
aStyleNames.push_back(new XubString(aStyleName));
aStyleNames.push_back(aStyleName);
}
}
}
@@ -270,20 +270,19 @@ void SdrTextObj::ImpSetTextStyleSheetListeners()
// now convert the strings in the vector from names to StyleSheet*
std::set<SfxStyleSheet*> aStyleSheets;
while (!aStyleNames.empty()) {
XubString* pName=aStyleNames.back();
OUString aName = aStyleNames.back();
aStyleNames.pop_back();
String aFam = pName->Copy(0, pName->Len() - 6);
OUString aFam = aName.copy(0, aName.getLength() - 6);
aFam.Erase(0,1);
aFam = aFam.copy(1);
aFam = comphelper::string::stripEnd(aFam, ' ');
sal_uInt16 nFam = (sal_uInt16)aFam.ToInt32();
sal_uInt16 nFam = (sal_uInt16)aFam.toInt32();
SfxStyleFamily eFam=(SfxStyleFamily)nFam;
SfxStyleSheetBase* pStyleBase=pStylePool->Find(*pName,eFam);
SfxStyleSheet* pStyle=PTR_CAST(SfxStyleSheet,pStyleBase);
delete pName;
SfxStyleFamily eFam = (SfxStyleFamily)nFam;
SfxStyleSheetBase* pStyleBase = pStylePool->Find(aName,eFam);
SfxStyleSheet* pStyle = PTR_CAST(SfxStyleSheet,pStyleBase);
if (pStyle!=NULL && pStyle!=GetStyleSheet()) {
aStyleSheets.insert(pStyle);
}

View File

@@ -75,7 +75,7 @@ sal_Bool SdrTextObj::BegTextEdit(SdrOutliner& rOutl)
{
// Outliner has no text so we must set some
// empty text so the outliner initialise itself
rOutl.SetText( String(), rOutl.GetParagraph( 0 ) );
rOutl.SetText( "", rOutl.GetParagraph( 0 ) );
if(GetStyleSheet())
rOutl.SetStyleSheet( 0, GetStyleSheet());

View File

@@ -316,7 +316,7 @@ SdrUnoObj& SdrUnoObj::operator= (const SdrUnoObj& rObj)
OUString aStr;
if( aValue >>= aStr )
aUnoControlTypeName = String(aStr);
aUnoControlTypeName = aStr;
}
uno::Reference< lang::XComponent > xComp(xUnoControlModel, uno::UNO_QUERY);
@@ -516,7 +516,7 @@ void SdrUnoObj::SetUnoControlModel( const uno::Reference< awt::XControlModel >&
uno::Any aValue( xSet->getPropertyValue(String("DefaultControl", osl_getThreadTextEncoding())) );
OUString aStr;
if( aValue >>= aStr )
aUnoControlTypeName = String(aStr);
aUnoControlTypeName = aStr;
}
uno::Reference< lang::XComponent > xComp(xUnoControlModel, uno::UNO_QUERY);

View File

@@ -1051,8 +1051,7 @@ void SdrPaintView::SetDefaultAttr(const SfxItemSet& rAttr, sal_Bool bReplaceAll)
if(bHasEEFeatureItems)
{
String aMessage;
aMessage.AppendAscii("SdrPaintView::SetDefaultAttr(): Setting EE_FEATURE items at the SdrView does not make sense! It only leads to overhead and unreadable documents.");
OUString aMessage("SdrPaintView::SetDefaultAttr(): Setting EE_FEATURE items at the SdrView does not make sense! It only leads to overhead and unreadable documents.");
InfoBox(NULL, aMessage).Execute();
}
}

View File

@@ -91,7 +91,7 @@ void SdrUndoAction::SdrRepeat(SdrView& /*rView*/)
OUString SdrUndoAction::GetSdrRepeatComment(SdrView& /*rView*/) const
{
return String();
return OUString();
}
////////////////////////////////////////////////////////////////////////////////////////////////////