summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorThomas Arnhold <thomas@arnhold.org>2013-09-13 12:52:35 +0200
committerCaolán McNamara <caolanm@redhat.com>2013-09-13 11:33:01 +0000
commit91c5143087b8da37a050b4e54d8b665396bf2d13 (patch)
tree0b21e940a2365ddd1f095a4a17c8b1324a98d557 /sw/source
parent3e55e00662b50b02c289ca4a1d94d4306bd8c86b (diff)
String to OUString
Change-Id: I14d6a7e4a53e65070357a2a5ceab3b25498a9fd4 Reviewed-on: https://gerrit.libreoffice.org/5933 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/bastyp/init.cxx9
-rw-r--r--sw/source/core/doc/docdde.cxx10
-rw-r--r--sw/source/core/tox/txmsrt.cxx10
-rw-r--r--sw/source/filter/html/htmlfly.cxx24
-rw-r--r--sw/source/filter/html/htmlgrin.cxx20
-rw-r--r--sw/source/filter/html/htmlplug.cxx4
-rw-r--r--sw/source/filter/html/htmltabw.cxx2
-rw-r--r--sw/source/filter/html/swhtml.cxx18
-rw-r--r--sw/source/filter/html/wrthtml.cxx22
-rw-r--r--sw/source/filter/ww8/wrtw8nds.cxx2
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx8
-rw-r--r--sw/source/ui/docvw/edtwin2.cxx16
-rw-r--r--sw/source/ui/uiview/view2.cxx23
-rw-r--r--sw/source/ui/uno/unotxdoc.cxx34
-rw-r--r--sw/source/ui/utlui/content.cxx12
15 files changed, 103 insertions, 111 deletions
diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx
index 4bdc84e063e6..94b859a86a99 100644
--- a/sw/source/core/bastyp/init.cxx
+++ b/sw/source/core/bastyp/init.cxx
@@ -425,15 +425,6 @@ sal_uInt16* SwAttrPool::pVersionMap5 = 0;
sal_uInt16* SwAttrPool::pVersionMap6 = 0;
sal_uInt16* SwAttrPool::pVersionMap7 = 0;
-const sal_Char* pMarkToTable = "table";
-const sal_Char* pMarkToFrame = "frame";
-const sal_Char* pMarkToRegion = "region";
-const sal_Char* pMarkToText = "text";
-const sal_Char* pMarkToOutline = "outline";
-const sal_Char* pMarkToGraphic = "graphic";
-const sal_Char* pMarkToOLE = "ole";
-const sal_Char* pMarkToSequence = "sequence";
-
std::vector<SvGlobalName*> *pGlobalOLEExcludeList = 0;
SwAutoCompleteWord* SwDoc::mpACmpltWords = 0;
diff --git a/sw/source/core/doc/docdde.cxx b/sw/source/core/doc/docdde.cxx
index d1863d81fe8f..46f2e7d27d11 100644
--- a/sw/source/core/doc/docdde.cxx
+++ b/sw/source/core/doc/docdde.cxx
@@ -298,12 +298,12 @@ bool SwDoc::SelectServerObj( const String& rStr, SwPaM*& rpPam,
{
bool bWeiter = false;
String sName( sItem.Copy( 0, nPos ) );
- String sCmp( sItem.Copy( nPos + 1 ));
+ OUString sCmp( sItem.Copy( nPos + 1 ));
sItem = rCC.lowercase( sItem );
_FindItem aPara( sName );
- if( sCmp.EqualsAscii( pMarkToTable ) )
+ if( sCmp == "table" )
{
sName = rCC.lowercase( sName );
BOOST_FOREACH( const SwFrmFmt* pFmt, *mpTblFrmFmtTbl )
@@ -318,7 +318,7 @@ bool SwDoc::SelectServerObj( const String& rStr, SwPaM*& rpPam,
return true;
}
}
- else if( sCmp.EqualsAscii( pMarkToFrame ) )
+ else if( sCmp == "frame" )
{
SwNodeIndex* pIdx;
SwNode* pNd;
@@ -331,12 +331,12 @@ bool SwDoc::SelectServerObj( const String& rStr, SwPaM*& rpPam,
return true;
}
}
- else if( sCmp.EqualsAscii( pMarkToRegion ) )
+ else if( sCmp == "region" )
{
sItem = sName; // Is being dealt with further down!
bWeiter = true;
}
- else if( sCmp.EqualsAscii( pMarkToOutline ) )
+ else if( sCmp == "outline" )
{
SwPosition aPos( SwNodeIndex( (SwNodes&)GetNodes() ));
if( GotoOutline( aPos, sName ))
diff --git a/sw/source/core/tox/txmsrt.cxx b/sw/source/core/tox/txmsrt.cxx
index 7ead4744d2a7..935b870fa852 100644
--- a/sw/source/core/tox/txmsrt.cxx
+++ b/sw/source/core/tox/txmsrt.cxx
@@ -688,9 +688,9 @@ String SwTOXPara::GetURL() const
const sal_Char* pStr;
switch( eType )
{
- case nsSwTOXElement::TOX_OLE: pStr = pMarkToOLE; break;
- case nsSwTOXElement::TOX_GRAPHIC: pStr = pMarkToGraphic; break;
- case nsSwTOXElement::TOX_FRAME: pStr = pMarkToFrame; break;
+ case nsSwTOXElement::TOX_OLE: pStr = "ole"; break;
+ case nsSwTOXElement::TOX_GRAPHIC: pStr = "graphic"; break;
+ case nsSwTOXElement::TOX_FRAME: pStr = "frame"; break;
default: pStr = 0;
}
if( pStr )
@@ -701,7 +701,7 @@ String SwTOXPara::GetURL() const
case nsSwTOXElement::TOX_SEQUENCE:
{
aTxt = "#" + m_sSequenceName + OUString(cMarkSeparator)
- + OUString::createFromAscii(pMarkToSequence);
+ + "sequence";
}
break;
default: break;
@@ -756,7 +756,7 @@ String SwTOXTable::GetURL() const
if ( sName.isEmpty() )
return String();
- return "#" + sName + OUString(cMarkSeparator) + OUString::createFromAscii( pMarkToTable );
+ return "#" + sName + OUString(cMarkSeparator) + "table";
}
SwTOXAuthority::SwTOXAuthority( const SwCntntNode& rNd,
diff --git a/sw/source/filter/html/htmlfly.cxx b/sw/source/filter/html/htmlfly.cxx
index dabdd9c83cd8..2abf566ddcdd 100644
--- a/sw/source/filter/html/htmlfly.cxx
+++ b/sw/source/filter/html/htmlfly.cxx
@@ -1510,7 +1510,7 @@ static Writer & OutHTML_FrmFmtAsImage( Writer& rWrt, const SwFrmFmt& rFrmFmt,
Graphic aGraphic( ((SwFrmFmt &)rFrmFmt).MakeGraphic( &aIMap ) );
Size aSz( 0, 0 );
OutHTML_Image( rWrt, rFrmFmt, aGraphic, rFrmFmt.GetName(), aSz,
- HTML_FRMOPTS_GENIMG, pMarkToFrame,
+ HTML_FRMOPTS_GENIMG, "frame",
aIMap.GetIMapObjectCount() ? &aIMap : 0 );
return rWrt;
@@ -1535,7 +1535,7 @@ static Writer& OutHTML_FrmFmtGrfNode( Writer& rWrt, const SwFrmFmt& rFrmFmt,
Graphic aGraphic = pGrfNd->GetGraphic();
OutHTML_Image( rWrt, rFrmFmt, aGraphic, pGrfNd->GetTitle(),
- pGrfNd->GetTwipSize(), nFrmFlags, pMarkToGraphic );
+ pGrfNd->GetTwipSize(), nFrmFlags, "graphic" );
return rWrt;
}
@@ -1685,18 +1685,18 @@ void SwHTMLWriter::AddLinkTarget( const String& rURL )
String aURL( rURL.Copy( 1 ) );
// nPos-1+1/3 (-1 wg. Erase)
- String sCmp(comphelper::string::remove(aURL.Copy(bEncoded ? nPos+2 : nPos),
+ OUString sCmp(comphelper::string::remove(aURL.Copy(bEncoded ? nPos+2 : nPos),
' '));
- if( !sCmp.Len() )
+ if( sCmp.isEmpty() )
return;
- sCmp.ToLowerAscii();
+ sCmp = sCmp.toAsciiLowerCase();
- if( sCmp.EqualsAscii( pMarkToRegion ) ||
- sCmp.EqualsAscii( pMarkToFrame ) ||
- sCmp.EqualsAscii( pMarkToGraphic ) ||
- sCmp.EqualsAscii( pMarkToOLE ) ||
- sCmp.EqualsAscii( pMarkToTable ) )
+ if( sCmp == "region" ||
+ sCmp == "frame" ||
+ sCmp == "graphic" ||
+ sCmp == "ole" ||
+ sCmp == "table" )
{
// Einfach nur in einem sortierten Array merken
if( bEncoded )
@@ -1706,7 +1706,7 @@ void SwHTMLWriter::AddLinkTarget( const String& rURL )
}
aImplicitMarks.insert( aURL );
}
- else if( sCmp.EqualsAscii( pMarkToOutline ) )
+ else if( sCmp == "outline" )
{
// Hier brauchen wir Position und Name. Deshalb sortieren wir
// ein sal_uInt16 und ein String-Array selbst
@@ -1730,7 +1730,7 @@ void SwHTMLWriter::AddLinkTarget( const String& rURL )
aOutlineMarks.insert( aOutlineMarks.begin()+nIns, new String( aURL ) );
}
}
- else if( sCmp.EqualsAscii( pMarkToText ) )
+ else if( sCmp == "text" )
{
//
}
diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx
index c93aa2d1a259..f30669adc309 100644
--- a/sw/source/filter/html/htmlgrin.cxx
+++ b/sw/source/filter/html/htmlgrin.cxx
@@ -1122,17 +1122,17 @@ ANCHOR_SETEVENT:
xub_StrLen nPos = sDecoded.SearchBackward( cMarkSeparator );
if( STRING_NOTFOUND != nPos )
{
- String sCmp(comphelper::string::remove(sDecoded.Copy(nPos+1), ' '));
- if( sCmp.Len() )
+ OUString sCmp(comphelper::string::remove(sDecoded.Copy(nPos+1), ' '));
+ if( !sCmp.isEmpty() )
{
- sCmp.ToLowerAscii();
- if( sCmp.EqualsAscii( pMarkToRegion ) ||
- sCmp.EqualsAscii( pMarkToFrame ) ||
- sCmp.EqualsAscii( pMarkToGraphic ) ||
- sCmp.EqualsAscii( pMarkToOLE ) ||
- sCmp.EqualsAscii( pMarkToTable ) ||
- sCmp.EqualsAscii( pMarkToOutline ) ||
- sCmp.EqualsAscii( pMarkToText ) )
+ sCmp = sCmp.toAsciiLowerCase();
+ if( sCmp == "region" ||
+ sCmp == "frame" ||
+ sCmp == "graphic" ||
+ sCmp == "ole" ||
+ sCmp == "table" ||
+ sCmp == "outline" ||
+ sCmp == "text" )
{
aName.Erase();
}
diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx
index e47c6d11cb1b..d18033870cc5 100644
--- a/sw/source/filter/html/htmlplug.cxx
+++ b/sw/source/filter/html/htmlplug.cxx
@@ -1016,7 +1016,7 @@ Writer& OutHTML_FrmFmtOLENode( Writer& rWrt, const SwFrmFmt& rFrmFmt,
if( !rFrmFmt.GetName().isEmpty() )
rHTMLWrt.OutImplicitMark( rFrmFmt.GetName(),
- pMarkToOLE );
+ "ole" );
uno::Any aAny;
SvGlobalName aGlobName( xObj->getClassID() );
OStringBuffer sOut;
@@ -1268,7 +1268,7 @@ Writer& OutHTML_FrmFmtOLENodeGrf( Writer& rWrt, const SwFrmFmt& rFrmFmt,
: HTML_FRMOPTS_GENIMG;
OutHTML_Image( rWrt, rFrmFmt, aGraphic,
pOLENd->GetTitle(), pOLENd->GetTwipSize(),
- nFlags, pMarkToOLE );
+ nFlags, "ole" );
}
return rWrt;
diff --git a/sw/source/filter/html/htmltabw.cxx b/sw/source/filter/html/htmltabw.cxx
index 7b8ae1942d4a..6ebe035cf14f 100644
--- a/sw/source/filter/html/htmltabw.cxx
+++ b/sw/source/filter/html/htmltabw.cxx
@@ -1098,7 +1098,7 @@ Writer& OutHTML_SwTblNode( Writer& rWrt, SwTableNode & rNode,
nFlyHSpace = nFlyVSpace = 0;
if( !pFmt->GetName().isEmpty() )
- rHTMLWrt.OutImplicitMark( pFmt->GetName(), pMarkToTable );
+ rHTMLWrt.OutImplicitMark( pFmt->GetName(), "table" );
if( text::HoriOrientation::NONE!=eDivHoriOri )
{
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index 7fd0a1e27b67..b27eedaa3f4a 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -368,25 +368,25 @@ SwHTMLParser::SwHTMLParser( SwDoc* pD, SwPaM& rCrsr, SvStream& rIn,
sal_Int32 nLastPos = sJmpMark.lastIndexOf( cMarkSeparator );
sal_Int32 nPos = nLastPos != -1 ? nLastPos : 0;
- String sCmp;
+ OUString sCmp;
if (nPos)
{
sCmp = comphelper::string::remove(
sJmpMark.copy(nPos + 1), ' ');
}
- if( sCmp.Len() )
+ if( !sCmp.isEmpty() )
{
- sCmp.ToLowerAscii();
- if( sCmp.EqualsAscii( pMarkToRegion ) )
+ sCmp = sCmp.toAsciiLowerCase();
+ if( sCmp == "region" )
eJumpTo = JUMPTO_REGION;
- else if( sCmp.EqualsAscii( pMarkToTable ) )
+ else if( sCmp == "table" )
eJumpTo = JUMPTO_TABLE;
- else if( sCmp.EqualsAscii( pMarkToGraphic ) )
+ else if( sCmp == "graphic" )
eJumpTo = JUMPTO_GRAPHIC;
- else if( sCmp.EqualsAscii( pMarkToOutline ) ||
- sCmp.EqualsAscii( pMarkToText ) ||
- sCmp.EqualsAscii( pMarkToFrame ) )
+ else if( sCmp == "outline" ||
+ sCmp == "text" ||
+ sCmp == "frame" )
eJumpTo = JUMPTO_NONE; // das ist nichts gueltiges!
else
// ansonsten ist das ein normaler (Book)Mark
diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx
index 93085c0c3198..8bd79871aa81 100644
--- a/sw/source/filter/html/wrthtml.cxx
+++ b/sw/source/filter/html/wrthtml.cxx
@@ -614,7 +614,7 @@ static void lcl_html_OutSectionStartTag( SwHTMLWriter& rHTMLWrt,
rHTMLWrt.bLFPossible = sal_True;
if( rName.Len() && !bContinued )
- rHTMLWrt.OutImplicitMark( rName, pMarkToRegion );
+ rHTMLWrt.OutImplicitMark( rName, "region" );
rHTMLWrt.IncIndentLevel();
}
@@ -1091,17 +1091,17 @@ void SwHTMLWriter::OutHyperlinkHRefValue( const String& rURL )
xub_StrLen nPos = sURL.SearchBackward( cMarkSeparator );
if( STRING_NOTFOUND != nPos )
{
- String sCmp(comphelper::string::remove(sURL.Copy(nPos+1), ' '));
- if( sCmp.Len() )
+ OUString sCmp(comphelper::string::remove(sURL.Copy(nPos+1), ' '));
+ if( !sCmp.isEmpty() )
{
- sCmp.ToLowerAscii();
- if( sCmp.EqualsAscii( pMarkToRegion ) ||
- sCmp.EqualsAscii( pMarkToFrame ) ||
- sCmp.EqualsAscii( pMarkToGraphic ) ||
- sCmp.EqualsAscii( pMarkToOLE ) ||
- sCmp.EqualsAscii( pMarkToTable ) ||
- sCmp.EqualsAscii( pMarkToOutline ) ||
- sCmp.EqualsAscii( pMarkToText ) )
+ sCmp = sCmp.toAsciiLowerCase();
+ if( sCmp == "region" ||
+ sCmp == "frame" ||
+ sCmp == "graphic" ||
+ sCmp == "ole" ||
+ sCmp == "table" ||
+ sCmp == "outline" ||
+ sCmp == "text" )
{
sURL.SearchAndReplaceAll( '?', '_' ); // '?' causes problems in IE/Netscape 5
}
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 0c34fc72403e..633c70982528 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -787,7 +787,7 @@ bool AttributeOutputBase::AnalyzeURL( const OUString& rUrl, const OUString& /*rT
OUString());
// #i21465# Only interested in outline references
- if ( sRefType.equalsAscii( pMarkToOutline ) )
+ if ( sRefType == "outline" )
{
OUString sLink = sMark.copy(0, nPos);
SwImplBookmarksIter bkmkIterEnd = GetExport().maImplicitBookmarks.end();
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index f5c07e826fc9..1c3ab9584877 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -2860,13 +2860,13 @@ void MSWordExportBase::AddLinkTarget(const String& rURL)
if( nPos < 2 )
return;
- String sCmp(comphelper::string::remove(aURL.Copy(nPos+1), ' '));
- if( !sCmp.Len() )
+ OUString sCmp(comphelper::string::remove(aURL.Copy(nPos+1), ' '));
+ if( sCmp.isEmpty() )
return;
- sCmp.ToLowerAscii();
+ sCmp = sCmp.toAsciiLowerCase();
- if( sCmp.EqualsAscii( pMarkToOutline ) )
+ if( sCmp == "outline" )
{
SwPosition aPos( *pCurPam->GetPoint() );
String aOutline( BookmarkToWriter(aURL.Copy( 0, nPos )) );
diff --git a/sw/source/ui/docvw/edtwin2.cxx b/sw/source/ui/docvw/edtwin2.cxx
index 57588811b65b..a63553036c04 100644
--- a/sw/source/ui/docvw/edtwin2.cxx
+++ b/sw/source/ui/docvw/edtwin2.cxx
@@ -166,14 +166,14 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
xub_StrLen nFound = sTxt.Search(cMarkSeparator);
if( nFound != STRING_NOTFOUND && (++nFound) < sTxt.Len() )
{
- String sSuffix( sTxt.Copy(nFound) );
- if( sSuffix.EqualsAscii( pMarkToTable ) ||
- sSuffix.EqualsAscii( pMarkToFrame ) ||
- sSuffix.EqualsAscii( pMarkToRegion ) ||
- sSuffix.EqualsAscii( pMarkToOutline ) ||
- sSuffix.EqualsAscii( pMarkToText ) ||
- sSuffix.EqualsAscii( pMarkToGraphic ) ||
- sSuffix.EqualsAscii( pMarkToOLE ))
+ OUString sSuffix( sTxt.Copy(nFound) );
+ if( sSuffix == "table" ||
+ sSuffix == "frame" ||
+ sSuffix == "region" ||
+ sSuffix == "outline" ||
+ sSuffix == "text" ||
+ sSuffix == "graphic" ||
+ sSuffix == "ole" )
sTxt = sTxt.Copy( 0, nFound - 1);
}
// #i104300#
diff --git a/sw/source/ui/uiview/view2.cxx b/sw/source/ui/uiview/view2.cxx
index d2e515d8972e..dab63e7f712f 100644
--- a/sw/source/ui/uiview/view2.cxx
+++ b/sw/source/ui/uiview/view2.cxx
@@ -1865,7 +1865,8 @@ bool SwView::JumpToSwMark( const String& rMark )
m_pWrtShell->ShGetFcs( sal_False );
const SwFmtINetFmt* pINet;
- String sCmp, sMark( INetURLObject::decode( rMark, INET_HEX_ESCAPE,
+ OUString sCmp;
+ String sMark( INetURLObject::decode( rMark, INET_HEX_ESCAPE,
INetURLObject::DECODE_WITH_CHARSET,
RTL_TEXTENCODING_UTF8 ));
@@ -1880,34 +1881,34 @@ bool SwView::JumpToSwMark( const String& rMark )
if( STRING_NOTFOUND != nPos )
sCmp = comphelper::string::remove(sMark.Copy(nPos + 1), ' ');
- if( sCmp.Len() )
+ if( !sCmp.isEmpty() )
{
rtl::OUString sName( sMark.Copy( 0, nPos ) );
- sCmp.ToLowerAscii();
+ sCmp = sCmp.toAsciiLowerCase();
FlyCntType eFlyType = FLYCNTTYPE_ALL;
- if( COMPARE_EQUAL == sCmp.CompareToAscii( pMarkToRegion ) )
+ if( sCmp == "region" )
{
m_pWrtShell->EnterStdMode();
bRet = m_pWrtShell->GotoRegion( sName );
}
- else if( COMPARE_EQUAL == sCmp.CompareToAscii( pMarkToOutline ) )
+ else if( sCmp == "outline" )
{
m_pWrtShell->EnterStdMode();
bRet = m_pWrtShell->GotoOutline( sName );
}
- else if( COMPARE_EQUAL == sCmp.CompareToAscii( pMarkToFrame ) )
+ else if( sCmp == "frame" )
eFlyType = FLYCNTTYPE_FRM;
- else if( COMPARE_EQUAL == sCmp.CompareToAscii( pMarkToGraphic ) )
+ else if( sCmp == "graphic" )
eFlyType = FLYCNTTYPE_GRF;
- else if( COMPARE_EQUAL == sCmp.CompareToAscii( pMarkToOLE ) )
+ else if( sCmp == "ole" )
eFlyType = FLYCNTTYPE_OLE;
- else if( COMPARE_EQUAL == sCmp.CompareToAscii( pMarkToTable ) )
+ else if( sCmp == "table" )
{
m_pWrtShell->EnterStdMode();
bRet = m_pWrtShell->GotoTable( sName );
}
- else if( COMPARE_EQUAL == sCmp.CompareToAscii( pMarkToSequence ) )
+ else if( sCmp == "sequence" )
{
m_pWrtShell->EnterStdMode();
sal_Int32 nNoPos = sName.indexOf( cSequenceMarkSeparator );
@@ -1918,7 +1919,7 @@ bool SwView::JumpToSwMark( const String& rMark )
m_pWrtShell->GotoRefMark( sName, REF_SEQUENCEFLD, nSeqNo );
}
}
- else if( COMPARE_EQUAL == sCmp.CompareToAscii( pMarkToText ) )
+ else if( sCmp == "text" )
{
// Normale Textsuche
m_pWrtShell->EnterStdMode();
diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx
index 5d96e875a9f4..dd2ee425a031 100644
--- a/sw/source/ui/uno/unotxdoc.cxx
+++ b/sw/source/ui/uno/unotxdoc.cxx
@@ -3365,7 +3365,7 @@ Any SwXLinkTargetSupplier::getByName(const OUString& rName)
String sSuffix = OUString('|');
if(sToCompare == sTables)
{
- sSuffix += OUString::createFromAscii(pMarkToTable);
+ sSuffix += "table";
Reference< XNameAccess > xTbls = new SwXLinkNameAccessWrapper(
pxDoc->getTextTables(), sToCompare, sSuffix );
@@ -3374,7 +3374,7 @@ Any SwXLinkTargetSupplier::getByName(const OUString& rName)
}
else if(sToCompare == sFrames)
{
- sSuffix += OUString::createFromAscii(pMarkToFrame);
+ sSuffix += "frame";
Reference< XNameAccess > xTbls = new SwXLinkNameAccessWrapper(
pxDoc->getTextFrames(), sToCompare, sSuffix );
Reference< XPropertySet > xRet(xTbls, UNO_QUERY);
@@ -3382,7 +3382,7 @@ Any SwXLinkTargetSupplier::getByName(const OUString& rName)
}
else if(sToCompare == sSections)
{
- sSuffix += OUString::createFromAscii(pMarkToRegion);
+ sSuffix += "region";
Reference< XNameAccess > xTbls = new SwXLinkNameAccessWrapper(
pxDoc->getTextSections(), sToCompare, sSuffix );
Reference< XPropertySet > xRet(xTbls, UNO_QUERY);
@@ -3390,7 +3390,7 @@ Any SwXLinkTargetSupplier::getByName(const OUString& rName)
}
else if(sToCompare == sGraphics)
{
- sSuffix += OUString::createFromAscii(pMarkToGraphic);
+ sSuffix += "graphic";
Reference< XNameAccess > xTbls = new SwXLinkNameAccessWrapper(
pxDoc->getGraphicObjects(), sToCompare, sSuffix );
Reference< XPropertySet > xRet(xTbls, UNO_QUERY);
@@ -3398,7 +3398,7 @@ Any SwXLinkTargetSupplier::getByName(const OUString& rName)
}
else if(sToCompare == sOLEs)
{
- sSuffix += OUString::createFromAscii(pMarkToOLE);
+ sSuffix += "ole";
Reference< XNameAccess > xTbls = new SwXLinkNameAccessWrapper(
pxDoc->getEmbeddedObjects(), sToCompare, sSuffix );
Reference< XPropertySet > xRet(xTbls, UNO_QUERY);
@@ -3406,7 +3406,7 @@ Any SwXLinkTargetSupplier::getByName(const OUString& rName)
}
else if(sToCompare == sOutlines)
{
- sSuffix += OUString::createFromAscii(pMarkToOutline);
+ sSuffix += "outline";
Reference< XNameAccess > xTbls = new SwXLinkNameAccessWrapper(
*pxDoc, sToCompare, sSuffix );
Reference< XPropertySet > xRet(xTbls, UNO_QUERY);
@@ -3578,7 +3578,7 @@ Sequence< OUString > SwXLinkNameAccessWrapper::getElementNames(void)
aRet.realloc(nOutlineCount);
OUString* pResArr = aRet.getArray();
String sSuffix = OUString('|');
- sSuffix += OUString::createFromAscii(pMarkToOutline);
+ sSuffix += OUString::createFromAscii("outline");
const SwNumRule* pOutlRule = pDoc->GetOutlineNumRule();
for (sal_uInt16 i = 0; i < nOutlineCount; ++i)
{
@@ -3678,26 +3678,26 @@ void SwXLinkNameAccessWrapper::setPropertyValue(
throw UnknownPropertyException();
}
-static Any lcl_GetDisplayBitmap(String sLinkSuffix)
+static Any lcl_GetDisplayBitmap(OUString sLinkSuffix)
{
Any aRet;
- if(sLinkSuffix.Len())
- sLinkSuffix.Erase(0, 1);
+ if(!sLinkSuffix.isEmpty())
+ sLinkSuffix = sLinkSuffix.copy(1);
sal_uInt16 nImgId = USHRT_MAX;
- if(COMPARE_EQUAL == sLinkSuffix.CompareToAscii(pMarkToOutline))
+ if(sLinkSuffix == "outline")
nImgId = CONTENT_TYPE_OUTLINE;
- else if(COMPARE_EQUAL == sLinkSuffix.CompareToAscii(pMarkToTable))
+ else if(sLinkSuffix == "table")
nImgId = CONTENT_TYPE_TABLE;
- else if(COMPARE_EQUAL == sLinkSuffix.CompareToAscii(pMarkToFrame))
+ else if(sLinkSuffix == "frame")
nImgId = CONTENT_TYPE_FRAME;
- else if(COMPARE_EQUAL == sLinkSuffix.CompareToAscii(pMarkToGraphic))
+ else if(sLinkSuffix == "graphic")
nImgId = CONTENT_TYPE_GRAPHIC;
- else if(COMPARE_EQUAL == sLinkSuffix.CompareToAscii(pMarkToRegion))
+ else if(sLinkSuffix == "region")
nImgId = CONTENT_TYPE_REGION;
- else if(COMPARE_EQUAL == sLinkSuffix.CompareToAscii(pMarkToOLE))
+ else if(sLinkSuffix == "ole")
nImgId = CONTENT_TYPE_OLE;
- else if(!sLinkSuffix.Len())
+ else if(sLinkSuffix.isEmpty())
nImgId = CONTENT_TYPE_BOOKMARK;
if(USHRT_MAX != nImgId)
{
diff --git a/sw/source/ui/utlui/content.cxx b/sw/source/ui/utlui/content.cxx
index 6d5ea1f721c0..bc9bb6004f88 100644
--- a/sw/source/ui/utlui/content.cxx
+++ b/sw/source/ui/utlui/content.cxx
@@ -214,7 +214,7 @@ void SwContentType::Init(sal_Bool* pbInvalidateWindow)
{
case CONTENT_TYPE_OUTLINE :
{
- sTypeToken = OUString::createFromAscii(pMarkToOutline);
+ sTypeToken = "outline";
sal_uInt16 nOutlineCount = nMemberCount =
static_cast<sal_uInt16>(pWrtShell->getIDocumentOutlineNodesAccess()->getOutlineNodesCount());
if(nOutlineLevel < MAXLEVEL)
@@ -230,7 +230,7 @@ void SwContentType::Init(sal_Bool* pbInvalidateWindow)
break;
case CONTENT_TYPE_TABLE :
- sTypeToken = OUString::createFromAscii(pMarkToTable);
+ sTypeToken = "table";
nMemberCount = pWrtShell->GetTblFrmFmtCount(true);
bEdit = true;
break;
@@ -240,16 +240,16 @@ void SwContentType::Init(sal_Bool* pbInvalidateWindow)
case CONTENT_TYPE_OLE :
{
FlyCntType eType = FLYCNTTYPE_FRM;
- sTypeToken = OUString::createFromAscii(pMarkToFrame);
+ sTypeToken = "frame";
if(nContentType == CONTENT_TYPE_OLE)
{
eType = FLYCNTTYPE_OLE;
- sTypeToken = OUString::createFromAscii(pMarkToOLE);
+ sTypeToken = "ole";
}
else if(nContentType == CONTENT_TYPE_GRAPHIC)
{
eType = FLYCNTTYPE_GRF;
- sTypeToken = OUString::createFromAscii(pMarkToGraphic);
+ sTypeToken = "graphic";
}
nMemberCount = pWrtShell->GetFlyCount(eType);
bEdit = true;
@@ -317,7 +317,7 @@ void SwContentType::Init(sal_Bool* pbInvalidateWindow)
}
}
nMemberCount = pMember->size();
- sTypeToken = OUString::createFromAscii(pMarkToRegion);
+ sTypeToken = "region";
bEdit = true;
bDelete = false;
if(pOldMember)