summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-09-17 16:21:15 +0200
committerNoel Grandin <noel@peralex.com>2013-09-19 10:14:17 +0200
commit39ba0533e1ec827d1d1b5b58f47fb1035b91f015 (patch)
tree53e59961de289eeb213a915f63566c18652adf51 /sw
parent5397d7c21313e46c615a712f16db83a0f3f273da (diff)
convert sw/inc/IDocumentContentOperations.hxx from String to OUString
Change-Id: I0ee1415b0ae8a0707faafd05f3b2f95200062614
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/IDocumentContentOperations.hxx13
-rw-r--r--sw/inc/doc.hxx12
-rw-r--r--sw/source/core/doc/doc.cxx16
-rw-r--r--sw/source/core/doc/docedt.cxx14
4 files changed, 27 insertions, 28 deletions
diff --git a/sw/inc/IDocumentContentOperations.hxx b/sw/inc/IDocumentContentOperations.hxx
index 6f0bf4067b53..590d4f60aae7 100644
--- a/sw/inc/IDocumentContentOperations.hxx
+++ b/sw/inc/IDocumentContentOperations.hxx
@@ -26,7 +26,6 @@
struct SwPosition;
class SwNode;
class SwNodeRange;
- class String;
class Graphic;
class SfxItemSet;
class SfxPoolItem;
@@ -99,11 +98,11 @@
/** Overwrite string in an existing text node.
*/
- virtual bool Overwrite(const SwPaM &rRg, const String& rStr) = 0;
+ virtual bool Overwrite(const SwPaM &rRg, const OUString& rStr) = 0;
/** Insert string into existing text node at position rRg.Point().
*/
- virtual bool InsertString(const SwPaM &rRg, const String&,
+ virtual bool InsertString(const SwPaM &rRg, const OUString&,
const enum InsertFlags nInsertMode = INS_EMPTYEXPAND ) = 0;
/** change text to Upper/Lower/Hiragana/Katagana/...
@@ -112,7 +111,7 @@
/** Insert graphic or formula. The XXXX are copied.
*/
- virtual SwFlyFrmFmt* Insert(const SwPaM &rRg, const String& rGrfName, const String& rFltName, const Graphic* pGraphic,
+ virtual SwFlyFrmFmt* Insert(const SwPaM &rRg, const OUString& rGrfName, const OUString& rFltName, const Graphic* pGraphic,
const SfxItemSet* pFlyAttrSet, const SfxItemSet* pGrfAttrSet, SwFrmFmt*) = 0;
virtual SwFlyFrmFmt* Insert(const SwPaM& rRg, const GraphicObject& rGrfObj, const SfxItemSet* pFlyAttrSet,
@@ -120,7 +119,7 @@
/** Transpose graphic (with undo)
*/
- virtual void ReRead(SwPaM&, const String& rGrfName, const String& rFltName, const Graphic* pGraphic, const GraphicObject* pGrfObj) = 0;
+ virtual void ReRead(SwPaM&, const OUString& rGrfName, const OUString& rFltName, const Graphic* pGraphic, const GraphicObject* pGrfObj) = 0;
/** Insert a DrawObject. The object must be already registered
in DrawModel.
@@ -132,7 +131,7 @@
virtual SwFlyFrmFmt* Insert(const SwPaM &rRg, const svt::EmbeddedObjectRef& xObj, const SfxItemSet* pFlyAttrSet,
const SfxItemSet* pGrfAttrSet, SwFrmFmt*) = 0;
- virtual SwFlyFrmFmt* InsertOLE(const SwPaM &rRg, const String& rObjName, sal_Int64 nAspect, const SfxItemSet* pFlyAttrSet,
+ virtual SwFlyFrmFmt* InsertOLE(const SwPaM &rRg, const OUString& rObjName, sal_Int64 nAspect, const SfxItemSet* pFlyAttrSet,
const SfxItemSet* pGrfAttrSet, SwFrmFmt*) = 0;
/** Split a node at rPos (implemented only for TxtNode).
@@ -147,7 +146,7 @@
( not \& ). E.g.: Find: "zzz", Replace: "xx\t\\t..&..\&"
--> "xx\t<Tab>..zzz..&"
*/
- virtual bool ReplaceRange(SwPaM& rPam, const String& rNewStr,
+ virtual bool ReplaceRange(SwPaM& rPam, const OUString& rNewStr,
const bool bRegExReplace) = 0;
/** Insert an attribute. If rRg spans several nodes the
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 57af66255b91..bff786859107 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -861,12 +861,12 @@ public:
virtual bool MoveRange(SwPaM&, SwPosition&, SwMoveFlags);
virtual bool MoveNodeRange(SwNodeRange&, SwNodeIndex&, SwMoveFlags);
virtual bool MoveAndJoin(SwPaM&, SwPosition&, SwMoveFlags);
- virtual bool Overwrite(const SwPaM &rRg, const String& rStr);
- virtual bool InsertString(const SwPaM &rRg, const String&,
+ virtual bool Overwrite(const SwPaM &rRg, const OUString& rStr);
+ virtual bool InsertString(const SwPaM &rRg, const OUString&,
const enum InsertFlags nInsertMode = INS_EMPTYEXPAND );
virtual bool UpdateParRsid( SwTxtNode *pTxtNode, sal_uInt32 nVal = 0 );
virtual bool UpdateRsid( const SwPaM &rRg, xub_StrLen nLen );
- virtual SwFlyFrmFmt* Insert(const SwPaM &rRg, const String& rGrfName, const String& rFltName, const Graphic* pGraphic,
+ virtual SwFlyFrmFmt* Insert(const SwPaM &rRg, const OUString& rGrfName, const OUString& rFltName, const Graphic* pGraphic,
const SfxItemSet* pFlyAttrSet, const SfxItemSet* pGrfAttrSet, SwFrmFmt*);
virtual SwFlyFrmFmt* Insert(const SwPaM& rRg, const GraphicObject& rGrfObj, const SfxItemSet* pFlyAttrSet,
const SfxItemSet* pGrfAttrSet, SwFrmFmt*);
@@ -878,14 +878,14 @@ public:
const SetAttrMode nFlags,bool bExpandCharToPara=false);
virtual bool InsertItemSet (const SwPaM &rRg, const SfxItemSet&,
const SetAttrMode nFlags);
- virtual void ReRead(SwPaM&, const String& rGrfName, const String& rFltName, const Graphic* pGraphic, const GraphicObject* pGrfObj);
+ virtual void ReRead(SwPaM&, const OUString& rGrfName, const OUString& rFltName, const Graphic* pGraphic, const GraphicObject* pGrfObj);
virtual void TransliterateText(const SwPaM& rPaM, utl::TransliterationWrapper&);
- virtual SwFlyFrmFmt* InsertOLE(const SwPaM &rRg, const String& rObjName, sal_Int64 nAspect, const SfxItemSet* pFlyAttrSet,
+ virtual SwFlyFrmFmt* InsertOLE(const SwPaM &rRg, const OUString& rObjName, sal_Int64 nAspect, const SfxItemSet* pFlyAttrSet,
const SfxItemSet* pGrfAttrSet, SwFrmFmt*);
virtual bool SplitNode(const SwPosition &rPos, bool bChkTableStart);
virtual bool AppendTxtNode(SwPosition& rPos);
virtual void SetModified(SwPaM &rPaM);
- virtual bool ReplaceRange(SwPaM& rPam, const String& rNewStr,
+ virtual bool ReplaceRange(SwPaM& rPam, const OUString& rNewStr,
const bool bRegExReplace);
virtual void RemoveLeadingWhiteSpace(const SwPosition & rPos );
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index 1750fd49db61..a4eef0e5ee96 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -916,7 +916,7 @@ bool SwDoc::AppendTxtNode( SwPosition& rPos )
return sal_True;
}
-bool SwDoc::InsertString( const SwPaM &rRg, const String &rStr,
+bool SwDoc::InsertString( const SwPaM &rRg, const OUString &rStr,
const enum InsertFlags nInsertMode )
{
// fetching DoesUndo is surprisingly expensive
@@ -928,9 +928,9 @@ bool SwDoc::InsertString( const SwPaM &rRg, const String &rStr,
if( mpACEWord ) // add to auto correction
{
- if( 1 == rStr.Len() && mpACEWord->IsDeleted() )
+ if( 1 == rStr.getLength() && mpACEWord->IsDeleted() )
{
- mpACEWord->CheckChar( rPos, rStr.GetChar( 0 ) );
+ mpACEWord->CheckChar( rPos, rStr[ 0 ] );
}
delete mpACEWord, mpACEWord = 0;
}
@@ -1028,8 +1028,8 @@ SwFlyFrmFmt* SwDoc::_InsNoTxtNode( const SwPosition& rPos, SwNoTxtNode* pNode,
}
SwFlyFrmFmt* SwDoc::Insert( const SwPaM &rRg,
- const String& rGrfName,
- const String& rFltName,
+ const OUString& rGrfName,
+ const OUString& rFltName,
const Graphic* pGraphic,
const SfxItemSet* pFlyAttrSet,
const SfxItemSet* pGrfAttrSet,
@@ -1085,7 +1085,7 @@ SwFlyFrmFmt* SwDoc::Insert(const SwPaM &rRg, const svt::EmbeddedObjectRef& xObj,
pFrmFmt );
}
-SwFlyFrmFmt* SwDoc::InsertOLE(const SwPaM &rRg, const String& rObjName,
+SwFlyFrmFmt* SwDoc::InsertOLE(const SwPaM &rRg, const OUString& rObjName,
sal_Int64 nAspect,
const SfxItemSet* pFlyAttrSet,
const SfxItemSet* pGrfAttrSet,
@@ -1940,8 +1940,8 @@ void SwDoc::ResetModified()
}
}
-void SwDoc::ReRead( SwPaM& rPam, const String& rGrfName,
- const String& rFltName, const Graphic* pGraphic,
+void SwDoc::ReRead( SwPaM& rPam, const OUString& rGrfName,
+ const OUString& rFltName, const Graphic* pGraphic,
const GraphicObject* pGrafObj )
{
SwGrfNode *pGrfNd;
diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index 9bee5812e1c1..35299c8a8820 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -702,18 +702,18 @@ void SwDoc::SetModified(SwPaM &rPaM)
SetModified();
}
-bool SwDoc::Overwrite( const SwPaM &rRg, const String &rStr )
+bool SwDoc::Overwrite( const SwPaM &rRg, const OUString &rStr )
{
SwPosition& rPt = *(SwPosition*)rRg.GetPoint();
if( mpACEWord ) // Add to AutoCorrect
{
- if( 1 == rStr.Len() )
- mpACEWord->CheckChar( rPt, rStr.GetChar( 0 ) );
+ if( 1 == rStr.getLength() )
+ mpACEWord->CheckChar( rPt, rStr[ 0 ] );
delete mpACEWord, mpACEWord = 0;
}
SwTxtNode *pNode = rPt.nNode.GetNode().GetTxtNode();
- if (!pNode || ( static_cast<size_t>(rStr.Len()) // worst case: no erase
+ if (!pNode || ( static_cast<size_t>(rStr.getLength()) // worst case: no erase
+ static_cast<size_t>(pNode->GetTxt().getLength()) > TXTNODE_MAX))
{
return false;
@@ -733,7 +733,7 @@ bool SwDoc::Overwrite( const SwPaM &rRg, const String &rStr )
bool bOldExpFlg = pNode->IsIgnoreDontExpand();
pNode->SetIgnoreDontExpand( true );
- for( xub_StrLen nCnt = 0; nCnt < rStr.Len(); ++nCnt )
+ for( sal_Int32 nCnt = 0; nCnt < rStr.getLength(); ++nCnt )
{
// start behind the characters (to fix the attributes!)
nStart = rIdx.GetIndex();
@@ -741,7 +741,7 @@ bool SwDoc::Overwrite( const SwPaM &rRg, const String &rStr )
{
lcl_SkipAttr( pNode, rIdx, nStart );
}
- sal_Unicode c = rStr.GetChar( nCnt );
+ sal_Unicode c = rStr[ nCnt ];
if (GetIDocumentUndoRedo().DoesUndo())
{
bool bMerged(false);
@@ -2155,7 +2155,7 @@ static bool lcl_GetTokenToParaBreak( String& rStr, String& rRet, bool bRegExpRpl
return bRet;
}
-bool SwDoc::ReplaceRange( SwPaM& rPam, const String& rStr,
+bool SwDoc::ReplaceRange( SwPaM& rPam, const OUString& rStr,
const bool bRegExReplace )
{
// unfortunately replace works slightly differently from delete,