[PATCH] String to OUString

Matteo Casalin (via Code Review) gerrit at gerrit.libreoffice.org
Sun Jun 9 06:36:49 PDT 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/4212

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/12/4212/1

String to OUString

Change-Id: I89f228b64c85b5844b3049206bf97877473a04d3
---
M sw/inc/pam.hxx
M sw/qa/core/uwriter.cxx
M sw/source/core/crsr/pam.cxx
M sw/source/ui/docvw/edtwin.cxx
4 files changed, 13 insertions(+), 13 deletions(-)



diff --git a/sw/inc/pam.hxx b/sw/inc/pam.hxx
index 54c20b1..7003b64 100644
--- a/sw/inc/pam.hxx
+++ b/sw/inc/pam.hxx
@@ -298,7 +298,7 @@
 
     DECL_FIXEDMEMPOOL_NEWDEL(SwPaM);
 
-    String GetTxt() const;
+    OUString GetTxt() const;
     void InvalidatePaM();
 };
 
diff --git a/sw/qa/core/uwriter.cxx b/sw/qa/core/uwriter.cxx
index 249f838..20f974f 100644
--- a/sw/qa/core/uwriter.cxx
+++ b/sw/qa/core/uwriter.cxx
@@ -920,7 +920,7 @@
     m_pDoc->InsertString(aPaM, OUString("foobar"));
     aPaM.SetMark();
     aPaM.GetPoint()->nContent = 0;
-    CPPUNIT_ASSERT_EQUAL(String("foobar"), aPaM.GetTxt());
+    CPPUNIT_ASSERT_EQUAL(OUString("foobar"), aPaM.GetTxt());
 
     CPPUNIT_ASSERT_EQUAL(OUString("FOOBAR"),
             translitTest(*m_pDoc, aPaM,
diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx
index cb89473..c1b059b 100644
--- a/sw/source/core/crsr/pam.cxx
+++ b/sw/source/core/crsr/pam.cxx
@@ -1059,9 +1059,9 @@
     return sal_True;
 }
 
-String SwPaM::GetTxt() const
+OUString SwPaM::GetTxt() const
 {
-    String aResult;
+    OUString aResult;
 
     SwNodeIndex aNodeIndex = Start()->nNode;
 
@@ -1082,7 +1082,7 @@
 
         if (pTxtNode != NULL)
         {
-            const String & aTmpStr = pTxtNode->GetTxt();
+            const OUString aTmpStr = pTxtNode->GetTxt();
 
             if (aNodeIndex == Start()->nNode)
             {
@@ -1090,13 +1090,13 @@
                 if (End()->nNode == aNodeIndex)
                     nEnd = End()->nContent.GetIndex();
                 else
-                    nEnd = aTmpStr.Len();
+                    nEnd = aTmpStr.getLength();
 
-                aResult += aTmpStr.Copy(Start()->nContent.GetIndex(),
+                aResult += aTmpStr.copy(Start()->nContent.GetIndex(),
                                         nEnd - Start()->nContent.GetIndex()) ;
             }
             else if (aNodeIndex == End()->nNode)
-                aResult += aTmpStr.Copy(0, End()->nContent.GetIndex());
+                aResult += aTmpStr.copy(0, End()->nContent.GetIndex());
             else
                 aResult += aTmpStr;
         }
diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx
index 39526b9..f0b1951 100644
--- a/sw/source/ui/docvw/edtwin.cxx
+++ b/sw/source/ui/docvw/edtwin.cxx
@@ -860,16 +860,16 @@
             if (!rSh.GetCrsr()->HasMark())
                 rSh.GetCrsr()->SetMark();
             rSh.GetCrsr()->GetMark()->nContent = 0;
-            String aLeftText( rSh.GetCrsr()->GetTxt() );
+            OUString aLeftText( rSh.GetCrsr()->GetTxt() );
 
             SvtCTLOptions& rCTLOptions = SW_MOD()->GetCTLOptions();
 
             xub_StrLen nExpandSelection = 0;
-            if (aLeftText.Len() > 0)
+            if (aLeftText.getLength() > 0)
             {
                 sal_Unicode cChar = '\0';
 
-                xub_StrLen nTmpPos = aLeftText.Len();
+                sal_Int32 nTmpPos = aLeftText.getLength();
                 sal_Int16 nCheckMode = rCTLOptions.IsCTLSequenceCheckingRestricted() ?
                         i18n::InputSequenceCheckMode::STRICT : i18n::InputSequenceCheckMode::BASIC;
 
@@ -880,7 +880,7 @@
                     for (xub_StrLen k = 0;  k < m_aInBuffer.Len();  ++k)
                     {
                         cChar = m_aInBuffer.GetChar(k);
-                        const xub_StrLen nPrevPos = static_cast<xub_StrLen>(xISC->correctInputSequence( aNewText, nTmpPos - 1, cChar, nCheckMode ));
+                        const sal_Int32 nPrevPos =xISC->correctInputSequence( aNewText, nTmpPos - 1, cChar, nCheckMode );
 
                         // valid sequence or sequence could be corrected:
                         if (nPrevPos != aNewText.getLength())
@@ -903,7 +903,7 @@
                     if (aChgText.Len())
                     {
                         m_aInBuffer = aChgText;
-                        nExpandSelection = aLeftText.Len() - static_cast< xub_StrLen >(nChgPos);
+                        nExpandSelection = static_cast< xub_StrLen >(aLeftText.getLength() - nChgPos);
                     }
                     else
                         m_aInBuffer.Erase();

-- 
To view, visit https://gerrit.libreoffice.org/4212
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I89f228b64c85b5844b3049206bf97877473a04d3
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Matteo Casalin <matteo.casalin at yahoo.com>



More information about the LibreOffice mailing list