[Libreoffice-commits] .: sc/inc sc/qa sc/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Jan 29 22:19:21 PST 2013


 sc/inc/document.hxx                           |    4 -
 sc/qa/unit/filters-test.cxx                   |    5 --
 sc/qa/unit/helper/csv_handler.hxx             |    5 --
 sc/qa/unit/subsequent_filters-test.cxx        |    5 --
 sc/qa/unit/ucalc.cxx                          |   55 +++++++++++---------------
 sc/source/core/data/documen3.cxx              |    2 
 sc/source/core/data/document.cxx              |   20 +++------
 sc/source/core/data/dptabres.cxx              |    8 +--
 sc/source/core/tool/chartarr.cxx              |   13 ++----
 sc/source/core/tool/compiler.cxx              |    3 -
 sc/source/core/tool/consoli.cxx               |   11 ++---
 sc/source/filter/excel/xepivot.cxx            |    5 --
 sc/source/filter/excel/xicontent.cxx          |    5 --
 sc/source/filter/excel/xipivot.cxx            |    3 -
 sc/source/filter/xcl97/xcl97rec.cxx           |    2 
 sc/source/ui/Accessibility/AccessibleText.cxx |    2 
 sc/source/ui/app/transobj.cxx                 |    3 -
 sc/source/ui/dbgui/filtdlg.cxx                |    2 
 sc/source/ui/dbgui/pfiltdlg.cxx               |    2 
 sc/source/ui/dbgui/tpsort.cxx                 |    4 -
 sc/source/ui/dbgui/tpsubt.cxx                 |    2 
 sc/source/ui/docshell/docfunc.cxx             |    3 -
 sc/source/ui/docshell/docsh8.cxx              |    6 +-
 sc/source/ui/docshell/impex.cxx               |    8 +--
 sc/source/ui/miscdlgs/crnrdlg.cxx             |    8 +--
 sc/source/ui/miscdlgs/datafdlg.cxx            |   24 ++++-------
 sc/source/ui/miscdlgs/optsolver.cxx           |    6 +-
 sc/source/ui/optdlg/tpusrlst.cxx              |    4 -
 sc/source/ui/undo/undodat.cxx                 |    4 -
 sc/source/ui/unoobj/chart2uno.cxx             |    6 --
 sc/source/ui/view/cellsh.cxx                  |    3 -
 sc/source/ui/view/dbfunc3.cxx                 |    3 -
 sc/source/ui/view/gridwin.cxx                 |    6 --
 sc/source/ui/view/gridwin4.cxx                |    3 -
 sc/source/ui/view/spelleng.cxx                |   29 ++-----------
 sc/source/ui/view/viewfun4.cxx                |    2 
 36 files changed, 111 insertions(+), 165 deletions(-)

New commits:
commit 8a39c27633e75819e219bc5d179375fb4308a3ca
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Wed Jan 30 01:19:15 2013 -0500

    Let's stick with just one variant of ScDocument::GetString()...
    
    Instead of having 3 of them.
    
    Change-Id: I2de9b63c33b7362162a56ea391f8b68a468163fa

diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 8456723..c3dd990 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -762,9 +762,7 @@ public:
                                   SCCOL nCol1, SCROW nRow1,
                                   SCCOL nCol2, SCROW nRow2, const ScMarkData& rMark);
 
-    SC_DLLPUBLIC void           GetString( SCCOL nCol, SCROW nRow, SCTAB nTab, String& rString );
-    SC_DLLPUBLIC void           GetString( SCCOL nCol, SCROW nRow, SCTAB nTab, rtl::OUString& rString );
-    SC_DLLPUBLIC rtl::OUString  GetString( SCCOL nCol, SCROW nRow, SCTAB nTab) { rtl::OUString aString; GetString(nCol, nRow, nTab, aString); return aString;}
+    SC_DLLPUBLIC OUString GetString( SCCOL nCol, SCROW nRow, SCTAB nTab );
     SC_DLLPUBLIC void           GetInputString( SCCOL nCol, SCROW nRow, SCTAB nTab, String& rString );
     SC_DLLPUBLIC void           GetInputString( SCCOL nCol, SCROW nRow, SCTAB nTab, rtl::OUString& rString );
     sal_uInt16                  GetStringForFormula( const ScAddress& rPos, rtl::OUString& rString );
diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx
index 755be75..980bff2 100644
--- a/sc/qa/unit/filters-test.cxx
+++ b/sc/qa/unit/filters-test.cxx
@@ -346,12 +346,11 @@ void testContentImpl(ScDocument* pDoc, sal_Int32 nFormat ) //same code for ods,
     CPPUNIT_ASSERT_MESSAGE("value not imported correctly", fValue == 1);
     pDoc->GetValue(0,1,0,fValue);
     CPPUNIT_ASSERT_MESSAGE("value not imported correctly", fValue == 2);
-    rtl::OUString aString;
-    pDoc->GetString(1,0,0,aString);
+    OUString aString = pDoc->GetString(1, 0, 0);
 
     //check string import
     CPPUNIT_ASSERT_MESSAGE("string imported not correctly", aString == rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("String1")));
-    pDoc->GetString(1,1,0,aString);
+    aString = pDoc->GetString(1, 1, 0);
     CPPUNIT_ASSERT_MESSAGE("string not imported correctly", aString == rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("String2")));
 
     //check basic formula import
diff --git a/sc/qa/unit/helper/csv_handler.hxx b/sc/qa/unit/helper/csv_handler.hxx
index b621baa..7fe94ff 100644
--- a/sc/qa/unit/helper/csv_handler.hxx
+++ b/sc/qa/unit/helper/csv_handler.hxx
@@ -132,8 +132,7 @@ public:
         else if (meStringType == PureString)
         {
             rtl::OUString aCSVString(p, n, RTL_TEXTENCODING_UTF8);
-            rtl::OUString aString;
-            mpDoc->GetString(mnCol, mnRow, mnTab, aString);
+            rtl::OUString aString = mpDoc->GetString(mnCol, mnRow, mnTab);
 
 #if DEBUG_CSV_HANDLER
                 std::cout << "String: " << rtl::OUStringToOString(aString, RTL_TEXTENCODING_UTF8).getStr() << std::endl;
@@ -154,7 +153,7 @@ public:
                 switch (meStringType)
                 {
                     case StringValue:
-                        mpDoc->GetString(mnCol, mnRow, mnTab, aString);
+                        aString = mpDoc->GetString(mnCol, mnRow, mnTab);
                         break;
                     case FormulaValue:
                         mpDoc->GetFormula(mnCol, mnRow, mnTab, aString);
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index ca1d4e4..1e823b1 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -656,12 +656,11 @@ void testFormats_Impl(ScFiltersTest* pFiltersTest, ScDocument* pDoc, sal_Int32 n
         CPPUNIT_ASSERT_EQUAL( static_cast<sal_uInt16>(1280), pDoc->GetColWidth(5,1) ); //0.889in
         CPPUNIT_ASSERT_EQUAL( static_cast<sal_uInt16>(4153), pDoc->GetColWidth(6,1) ); //2.8839in
         //test case for i53253 where a cell has text with different styles and space between the text.
-        rtl::OUString aTestStr;
-        pDoc->GetString(3,0,1, aTestStr);
+        OUString aTestStr = pDoc->GetString(3,0,1);
         rtl::OUString aKnownGoodStr("text14 space");
         CPPUNIT_ASSERT_EQUAL( aKnownGoodStr, aTestStr );
         //test case for cell text with line breaks.
-        pDoc->GetString(3,5,1, aTestStr);
+        aTestStr = pDoc->GetString(3,5,1);
         aKnownGoodStr = "Hello,\nCalc!";
         CPPUNIT_ASSERT_EQUAL( aKnownGoodStr, aTestStr );
     }
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index c6778a4..5558ead 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -347,8 +347,7 @@ void printRange(ScDocument* pDoc, const ScRange& rRange, const char* pCaption)
     {
         for (SCCOL nCol = nCol1; nCol <= nCol2; ++nCol)
         {
-            rtl::OUString aVal;
-            pDoc->GetString(nCol, nRow, rRange.aStart.Tab(), aVal);
+            rtl::OUString aVal = pDoc->GetString(nCol, nRow, rRange.aStart.Tab());
             printer.set(nRow-nRow1, nCol-nCol1, aVal);
         }
     }
@@ -475,11 +474,11 @@ void Test::testInput()
     OUString test;
 
     m_pDoc->SetString(0, 0, 0, numstr);
-    m_pDoc->GetString(0, 0, 0, test);
+    test = m_pDoc->GetString(0, 0, 0);
     bool bTest = test == "10.5";
     CPPUNIT_ASSERT_MESSAGE("String number should have the first apostrophe stripped.", bTest);
     m_pDoc->SetString(0, 0, 0, str);
-    m_pDoc->GetString(0, 0, 0, test);
+    test = m_pDoc->GetString(0, 0, 0);
     bTest = test == "'apple'";
     CPPUNIT_ASSERT_MESSAGE("Text content should have retained the first apostrophe.", bTest);
 
@@ -489,7 +488,7 @@ void Test::testInput()
     aParam.meSetTextNumFormat = ScSetStringParam::Always;
     aParam.mbHandleApostrophe = false;
     m_pDoc->SetString(0, 0, 0, "000123", &aParam);
-    m_pDoc->GetString(0, 0, 0, test);
+    test = m_pDoc->GetString(0, 0, 0);
     CPPUNIT_ASSERT_MESSAGE("Text content should have been treated as string, not number.", test == "000123");
 
     m_pDoc->DeleteTab(0);
@@ -744,9 +743,8 @@ void testFuncIFERROR(ScDocument* pDoc)
 
     for (SCROW i = 0; i < nRows; ++i)
     {
-        rtl::OUString aResult;
         SCROW nRow = 20 + i;
-        pDoc->GetString(0, nRow, 0, aResult);
+        OUString aResult = pDoc->GetString(0, nRow, 0);
         CPPUNIT_ASSERT_EQUAL_MESSAGE(
             aChecks[i].pFormula, OUString::createFromAscii( aChecks[i].pResult), aResult);
     }
@@ -827,8 +825,7 @@ void testFuncVLOOKUP(ScDocument* pDoc)
             // Skip the header row.
             continue;
 
-        rtl::OUString aRes;
-        pDoc->GetString(4, i, 0, aRes);
+        OUString aRes = pDoc->GetString(4, i, 0);
         bool bGood = aRes.equalsAscii(aChecks[i].pRes);
         if (!bGood)
         {
@@ -878,8 +875,7 @@ void runTestMATCH(ScDocument* pDoc, const char* aData[_DataSize], StrStrCheck aC
     // verify the results.
     for (size_t i = 0; i < _FormulaSize; ++i)
     {
-        rtl::OUString aStr;
-        pDoc->GetString(2, i, 0, aStr);
+        OUString aStr = pDoc->GetString(2, i, 0);
         if (!aStr.equalsAscii(aChecks[i].pRes))
         {
             cerr << "row " << (i+1) << ": expected='" << aChecks[i].pRes << "' actual='" << aStr << "'"
@@ -1761,8 +1757,7 @@ bool checkDPTableOutput(ScDocument* pDoc, const ScRange& aOutRange, const char*
     {
         for (SCCOL nCol = 0; nCol < nOutColSize; ++nCol)
         {
-            OUString aVal;
-            pDoc->GetString(nCol + s.Col(), nRow + s.Row(), s.Tab(), aVal);
+            OUString aVal = pDoc->GetString(nCol + s.Col(), nRow + s.Row(), s.Tab());
             printer.set(nRow, nCol, aVal);
             const char* p = aOutputCheck[nRow][nCol];
             if (p)
@@ -3960,10 +3955,9 @@ void Test::testExternalRef()
 
     // Test external refernces on the main document while the external
     // document is still in memory.
-    OUString test;
     m_pDoc->InsertTab(0, OUString("Test Sheet"));
     m_pDoc->SetString(0, 0, 0, OUString("='file:///extdata.fake'#Data1.A1"));
-    m_pDoc->GetString(0, 0, 0, test);
+    OUString test = m_pDoc->GetString(0, 0, 0);
     CPPUNIT_ASSERT_MESSAGE("Value is different from the original", test.equals(name));
 
     // After the initial access to the external document, the external ref
@@ -3980,7 +3974,7 @@ void Test::testExternalRef()
     CPPUNIT_ASSERT_MESSAGE("Unexpected sheet name.", aTabNames[2].equals(aExtSh3Name));
 
     m_pDoc->SetString(1, 0, 0, OUString("='file:///extdata.fake'#Data1.B1"));
-    m_pDoc->GetString(1, 0, 0, test);
+    test = m_pDoc->GetString(1, 0, 0);
     CPPUNIT_ASSERT_MESSAGE("Value is different from the original", test.equals(value));
 
     m_pDoc->SetString(0, 1, 0, OUString("='file:///extdata.fake'#Data1.A2"));
@@ -3994,7 +3988,7 @@ void Test::testExternalRef()
         const char* pChecks[] = { "Andy", "Bruce", "Charlie", "David", "0" };
         for (size_t i = 0; i < SAL_N_ELEMENTS(pChecks); ++i)
         {
-            m_pDoc->GetString(0, static_cast<SCROW>(i+1), 0, test);
+            test = m_pDoc->GetString(0, static_cast<SCROW>(i+1), 0);
             CPPUNIT_ASSERT_MESSAGE("Unexpected cell value.", test.equalsAscii(pChecks[i]));
         }
     }
@@ -4020,7 +4014,7 @@ void Test::testExternalRef()
         const char* pChecks[] = { "Name", "Edward", "Frank", "George" };
         for (size_t i = 0; i < SAL_N_ELEMENTS(pChecks); ++i)
         {
-            m_pDoc->GetString(2, static_cast<SCROW>(i), 0, test);
+            test = m_pDoc->GetString(2, static_cast<SCROW>(i), 0);
             CPPUNIT_ASSERT_MESSAGE("Unexpected cell value.", test.equalsAscii(pChecks[i]));
         }
     }
@@ -4033,7 +4027,7 @@ void Test::testExternalRef()
         const char* pChecks[] = { "Value", "99", "98", "97" };
         for (size_t i = 0; i < SAL_N_ELEMENTS(pChecks); ++i)
         {
-            m_pDoc->GetString(3, static_cast<SCROW>(i), 0, test);
+            test = m_pDoc->GetString(3, static_cast<SCROW>(i), 0);
             CPPUNIT_ASSERT_MESSAGE("Unexpected cell value.", test.equalsAscii(pChecks[i]));
         }
     }
@@ -4202,9 +4196,9 @@ void Test::testStreamValid()
     // Put values into Sheet1.
     m_pDoc->SetString(0, 0, 0, a1);
     m_pDoc->SetString(0, 1, 0, a2);
-    m_pDoc->GetString(0, 0, 0, test);
+    test = m_pDoc->GetString(0, 0, 0);
     CPPUNIT_ASSERT_MESSAGE("Unexpected value in Sheet1.A1", test.equals(a1));
-    m_pDoc->GetString(0, 1, 0, test);
+    test = m_pDoc->GetString(0, 1, 0);
     CPPUNIT_ASSERT_MESSAGE("Unexpected value in Sheet1.A2", test.equals(a2));
 
     // Put formulas into Sheet2 to Sheet4 to reference values from Sheet1.
@@ -4213,13 +4207,13 @@ void Test::testStreamValid()
     m_pDoc->SetString(0, 0, 2, OUString("=Sheet1.A1"));
     m_pDoc->SetString(0, 0, 3, OUString("=Sheet1.A2"));
 
-    m_pDoc->GetString(0, 0, 1, test);
+    test = m_pDoc->GetString(0, 0, 1);
     CPPUNIT_ASSERT_MESSAGE("Unexpected value in Sheet2.A1", test.equals(a1));
-    m_pDoc->GetString(0, 1, 1, test);
+    test = m_pDoc->GetString(0, 1, 1);
     CPPUNIT_ASSERT_MESSAGE("Unexpected value in Sheet2.A2", test.equals(a2));
-    m_pDoc->GetString(0, 0, 2, test);
+    test = m_pDoc->GetString(0, 0, 2);
     CPPUNIT_ASSERT_MESSAGE("Unexpected value in Sheet3.A1", test.equals(a1));
-    m_pDoc->GetString(0, 0, 3, test);
+    test = m_pDoc->GetString(0, 0, 3);
     CPPUNIT_ASSERT_MESSAGE("Unexpected value in Sheet3.A1", test.equals(a2));
 
     // Set all sheet streams valid after all the initial cell values are in
@@ -4237,9 +4231,9 @@ void Test::testStreamValid()
     // Now, insert a new row at row 2 position on Sheet1.  This will move cell
     // A2 downward but cell A1 remains unmoved.
     m_pDoc->InsertRow(0, 0, MAXCOL, 0, 1, 2);
-    m_pDoc->GetString(0, 0, 0, test);
+    test = m_pDoc->GetString(0, 0, 0);
     CPPUNIT_ASSERT_MESSAGE("Cell A1 should not have moved.", test.equals(a1));
-    m_pDoc->GetString(0, 3, 0, test);
+    test = m_pDoc->GetString(0, 3, 0);
     CPPUNIT_ASSERT_MESSAGE("the old cell A2 should now be at A4.", test.equals(a2));
     const ScBaseCell* pCell = m_pDoc->GetCell(ScAddress(0, 1, 0));
     CPPUNIT_ASSERT_MESSAGE("Cell A2 should be empty.", pCell == NULL);
@@ -5119,13 +5113,13 @@ void Test::testCopyPaste()
     pUndo->Undo();
     m_pDoc->GetValue(1,1,1, aValue);
     ASSERT_DOUBLES_EQUAL_MESSAGE("after undo formula should return nothing", aValue, 0);
-    m_pDoc->GetString(2,1,1, aString);
+    aString = m_pDoc->GetString(2, 1, 1);
     CPPUNIT_ASSERT_MESSAGE("after undo string should be removed", aString.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("")));
 
     pUndo->Redo();
     m_pDoc->GetValue(1,1,1, aValue);
     ASSERT_DOUBLES_EQUAL_MESSAGE("formula should return 2 after redo", aValue, 2);
-    m_pDoc->GetString(2,1,1, aString);
+    aString = m_pDoc->GetString(2, 1, 1);
     CPPUNIT_ASSERT_MESSAGE("Cell Sheet2.C2 should contain: test", aString.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("test")));
     m_pDoc->GetFormula(1,1,1, aString);
     CPPUNIT_ASSERT_MESSAGE("Formula should be correct again", aString == aFormulaString);
@@ -5745,8 +5739,7 @@ void Test::testSortWithFormulaRefs()
     nEnd = SAL_N_ELEMENTS( aResults );
     for ( SCROW i = nStart; i < nEnd; ++i )
     {
-        rtl::OUString sResult;
-        pDoc->GetString( 0, i + 1, 0, sResult );
+        OUString sResult = pDoc->GetString( 0, i + 1, 0);
         CPPUNIT_ASSERT_EQUAL( rtl::OUString::createFromAscii( aResults[ i ] ), sResult );
     }
     pDoc->DeleteTab(0);
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index 3e64847..dfe5fe8 100644
--- a/sc/source/core/data/documen3.cxx
+++ b/sc/source/core/data/documen3.cxx
@@ -1940,7 +1940,7 @@ void ScDocument::DoMergeContents( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow,
     for (nRow=nStartRow; nRow<=nEndRow; nRow++)
         for (nCol=nStartCol; nCol<=nEndCol; nCol++)
         {
-            GetString(nCol,nRow,nTab,aCellStr);
+            aCellStr = GetString(nCol, nRow, nTab);
             if (!aCellStr.isEmpty())
             {
                 if (aTotal.getLength())
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 952b401..1b11231 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -2948,20 +2948,16 @@ void ScDocument::SetValue( SCCOL nCol, SCROW nRow, SCTAB nTab, const double& rVa
             maTabs[nTab]->SetValue( nCol, nRow, rVal );
 }
 
-
-void ScDocument::GetString( SCCOL nCol, SCROW nRow, SCTAB nTab, rtl::OUString& rString )
+OUString ScDocument::GetString( SCCOL nCol, SCROW nRow, SCTAB nTab )
 {
-    if ( VALIDTAB(nTab) && nTab < static_cast<SCTAB>(maTabs.size()) && maTabs[nTab] )
-        maTabs[nTab]->GetString( nCol, nRow, rString );
+    if (ValidTab(nTab) && nTab < static_cast<SCTAB>(maTabs.size()) && maTabs[nTab])
+    {
+        OUString aStr;
+        maTabs[nTab]->GetString(nCol, nRow, aStr);
+        return aStr;
+    }
     else
-        rString = rtl::OUString();
-}
-
-void ScDocument::GetString( SCCOL nCol, SCROW nRow, SCTAB nTab, String& rString )
-{
-    rtl::OUString aString;
-    GetString( nCol, nRow, nTab, aString);
-    rString = aString;
+        return EMPTY_OUSTRING;
 }
 
 void ScDocument::GetInputString( SCCOL nCol, SCROW nRow, SCTAB nTab, rtl::OUString& rString )
diff --git a/sc/source/core/data/dptabres.cxx b/sc/source/core/data/dptabres.cxx
index fc096a8..e5e3e92 100644
--- a/sc/source/core/data/dptabres.cxx
+++ b/sc/source/core/data/dptabres.cxx
@@ -258,13 +258,13 @@ static void lcl_Indent( ScDocument* pDoc, SCROW nStartRow, const ScAddress& rPos
     SCCOL nCol = rPos.Col();
     SCTAB nTab = rPos.Tab();
 
-    String aString;
+    OUString aString;
     for (SCROW nRow = nStartRow; nRow < rPos.Row(); nRow++)
     {
-        pDoc->GetString( nCol, nRow, nTab, aString );
-        if ( aString.Len() )
+        aString = pDoc->GetString(nCol, nRow, nTab);
+        if (!aString.isEmpty())
         {
-            aString.InsertAscii( "  ", 0 );
+            aString = " " + aString;
             pDoc->SetString( nCol, nRow, nTab, aString );
         }
     }
diff --git a/sc/source/core/tool/chartarr.cxx b/sc/source/core/tool/chartarr.cxx
index 677319b..cd49af3 100644
--- a/sc/source/core/tool/chartarr.cxx
+++ b/sc/source/core/tool/chartarr.cxx
@@ -271,7 +271,7 @@ ScMemChart* ScChartArray::CreateMemChartSingle()
         {
             OUString aString, aColStr;
             if (HasColHeaders())
-                pDocument->GetString( aCols[nCol], nStrRow, nTab1, aString );
+                aString = pDocument->GetString(aCols[nCol], nStrRow, nTab1);
             if (aString.isEmpty())
             {
                 OUStringBuffer aBuf;
@@ -297,7 +297,7 @@ ScMemChart* ScChartArray::CreateMemChartSingle()
             if (HasRowHeaders())
             {
                 ScAddress aAddr( nStrCol, aRows[nRow], nTab1 );
-                pDocument->GetString( nStrCol, aRows[nRow], nTab1, aString );
+                aString = pDocument->GetString(nStrCol, aRows[nRow], nTab1);
             }
             if (aString.isEmpty())
             {
@@ -430,8 +430,7 @@ ScMemChart* ScChartArray::CreateMemChartMulti()
             OUString aString, aColStr;
             const ScAddress* pPos = GetPositionMap()->GetColHeaderPosition( static_cast<SCCOL>(nCol) );
             if ( HasColHeaders() && pPos )
-                pDocument->GetString(
-                    pPos->Col(), pPos->Row(), pPos->Tab(), aString );
+                aString = pDocument->GetString(pPos->Col(), pPos->Row(), pPos->Tab());
 
             if (aString.isEmpty())
             {
@@ -459,10 +458,8 @@ ScMemChart* ScChartArray::CreateMemChartMulti()
             OUString aString;
             const ScAddress* pPos = GetPositionMap()->GetRowHeaderPosition( nRow );
             if ( HasRowHeaders() && pPos )
-            {
-                pDocument->GetString(
-                    pPos->Col(), pPos->Row(), pPos->Tab(), aString );
-            }
+                aString = pDocument->GetString(pPos->Col(), pPos->Row(), pPos->Tab());
+
             if (aString.isEmpty())
             {
                 OUStringBuffer aBuf(ScGlobal::GetRscString(STR_ROW));
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index ca441c2..0da95b4 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -5156,8 +5156,7 @@ void ScCompiler::CreateStringFromSingleRef(rtl::OUStringBuffer& rBuffer,FormulaT
         rRef.CalcAbsIfRel( aPos );
         if ( pDoc->HasStringData( rRef.nCol, rRef.nRow, rRef.nTab ) )
         {
-            String aStr;
-            pDoc->GetString( rRef.nCol, rRef.nRow, rRef.nTab, aStr );
+            String aStr = pDoc->GetString(rRef.nCol, rRef.nRow, rRef.nTab);
             EnQuote( aStr );
             rBuffer.append(aStr);
         }
diff --git a/sc/source/core/tool/consoli.cxx b/sc/source/core/tool/consoli.cxx
index e0dc074..56cd5a7 100644
--- a/sc/source/core/tool/consoli.cxx
+++ b/sc/source/core/tool/consoli.cxx
@@ -263,7 +263,7 @@ void ScConsData::AddFields( ScDocument* pSrcDoc, SCTAB nTab,
     {
         for (SCCOL nCol=nStartCol; nCol<=nCol2; nCol++)
         {
-            pSrcDoc->GetString( nCol, nRow1, nTab, aTitle );
+            aTitle = pSrcDoc->GetString(nCol, nRow1, nTab);
             if (aTitle.Len())
             {
                 sal_Bool bFound = false;
@@ -280,7 +280,7 @@ void ScConsData::AddFields( ScDocument* pSrcDoc, SCTAB nTab,
     {
         for (SCROW nRow=nStartRow; nRow<=nRow2; nRow++)
         {
-            pSrcDoc->GetString( nCol1, nRow, nTab, aTitle );
+            aTitle = pSrcDoc->GetString(nCol1, nRow, nTab);
             if (aTitle.Len())
             {
                 sal_Bool bFound = false;
@@ -507,8 +507,7 @@ void ScConsData::AddData( ScDocument* pSrcDoc, SCTAB nTab,
 
     if ( bColByName && bRowByName )
     {
-        String aThisCorner;
-        pSrcDoc->GetString(nCol1,nRow1,nTab,aThisCorner);
+        String aThisCorner = pSrcDoc->GetString(nCol1, nRow1, nTab);
         if (bCornerUsed)
         {
             if (aCornerText != aThisCorner)
@@ -535,7 +534,7 @@ void ScConsData::AddData( ScDocument* pSrcDoc, SCTAB nTab,
         pDestCols = new SCCOL[nCol2-nStartCol+1];
         for (nCol=nStartCol; nCol<=nCol2; nCol++)
         {
-            pSrcDoc->GetString(nCol,nRow1,nTab,aTitle);
+            aTitle = pSrcDoc->GetString(nCol, nRow1, nTab);
             SCCOL nPos = SC_CONS_NOTFOUND;
             if (aTitle.Len())
             {
@@ -556,7 +555,7 @@ void ScConsData::AddData( ScDocument* pSrcDoc, SCTAB nTab,
         pDestRows = new SCROW[nRow2-nStartRow+1];
         for (nRow=nStartRow; nRow<=nRow2; nRow++)
         {
-            pSrcDoc->GetString(nCol1,nRow,nTab,aTitle);
+            aTitle = pSrcDoc->GetString(nCol1, nRow, nTab);
             SCROW nPos = SC_CONS_NOTFOUND;
             if (aTitle.Len())
             {
diff --git a/sc/source/filter/excel/xepivot.cxx b/sc/source/filter/excel/xepivot.cxx
index 7db3245..3dc4613 100644
--- a/sc/source/filter/excel/xepivot.cxx
+++ b/sc/source/filter/excel/xepivot.cxx
@@ -346,7 +346,7 @@ void XclExpPCField::InitStandardField( const ScRange& rRange )
 
     // field name is in top cell of the range
     ScAddress aPos( rRange.aStart );
-    rDoc.GetString( aPos.Col(), aPos.Row(), aPos.Tab(), maFieldInfo.maName );
+    maFieldInfo.maName = rDoc.GetString(aPos.Col(), aPos.Row(), aPos.Tab());
     // #i76047# maximum field name length in pivot cache is 255
     if (maFieldInfo.maName.getLength() > EXC_PC_MAXSTRLEN)
         maFieldInfo.maName = maFieldInfo.maName.copy(0, EXC_PC_MAXSTRLEN);
@@ -367,8 +367,7 @@ void XclExpPCField::InitStandardField( const ScRange& rRange )
         }
         else
         {
-            String aText;
-            rDoc.GetString( aPos.Col(), aPos.Row(), aPos.Tab(), aText );
+            OUString aText = rDoc.GetString(aPos.Col(), aPos.Row(), aPos.Tab());
             InsertOrigTextItem( aText );
         }
     }
diff --git a/sc/source/filter/excel/xicontent.cxx b/sc/source/filter/excel/xicontent.cxx
index 2a7b5ff..b4606ab 100644
--- a/sc/source/filter/excel/xicontent.cxx
+++ b/sc/source/filter/excel/xicontent.cxx
@@ -170,9 +170,8 @@ void lclInsertUrl( const XclImpRoot& rRoot, const String& rUrl, SCCOL nScCol, SC
         case CELLTYPE_STRING:
         case CELLTYPE_EDIT:
         {
-            String aDisplText;
-            rDoc.GetString( nScCol, nScRow, nScTab, aDisplText );
-            if( !aDisplText.Len() )
+            OUString aDisplText = rDoc.GetString(nScCol, nScRow, nScTab);
+            if (aDisplText.isEmpty())
                 aDisplText = rUrl;
 
             ScEditEngineDefaulter& rEE = rRoot.GetEditEngine();
diff --git a/sc/source/filter/excel/xipivot.cxx b/sc/source/filter/excel/xipivot.cxx
index 7d06426..73dc396 100644
--- a/sc/source/filter/excel/xipivot.cxx
+++ b/sc/source/filter/excel/xipivot.cxx
@@ -1479,8 +1479,7 @@ void XclImpPivotTable::ApplyMergeFlags(const ScRange& rOutRange, const ScDPSaveD
         rDoc.ApplyFlagsTab(itr->Col(), itr->Row(), itr->Col(), itr->Row(), itr->Tab(), SC_MF_BUTTON);
 
         sal_uInt16 nMFlag = SC_MF_BUTTON_POPUP;
-        rtl::OUString aName;
-        rDoc.GetString(itr->Col(), itr->Row(), itr->Tab(), aName);
+        rtl::OUString aName = rDoc.GetString(itr->Col(), itr->Row(), itr->Tab());
         if (rSaveData.HasInvisibleMember(aName))
             nMFlag |= SC_MF_HIDDEN_MEMBER;
 
diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx
index a7a042e..1fdfc2a 100644
--- a/sc/source/filter/xcl97/xcl97rec.cxx
+++ b/sc/source/filter/xcl97/xcl97rec.cxx
@@ -1253,7 +1253,7 @@ ExcEScenario::ExcEScenario( const XclExpRoot& rRoot, SCTAB nTab )
                             sal_True );
                 }
                 else
-                    rDoc.GetString( nCol, nRow, nTab, sText );
+                    sText = rDoc.GetString(nCol, nRow, nTab);
                 bContLoop = Append( static_cast<sal_uInt16>(nCol),
                         static_cast<sal_uInt16>(nRow), sText );
             }
diff --git a/sc/source/ui/Accessibility/AccessibleText.cxx b/sc/source/ui/Accessibility/AccessibleText.cxx
index 85cd5bd..493a205 100644
--- a/sc/source/ui/Accessibility/AccessibleText.cxx
+++ b/sc/source/ui/Accessibility/AccessibleText.cxx
@@ -768,7 +768,7 @@ void ScAccessibleCellTextData::GetCellText(const ScAddress& rCellPos, String& rT
     if (pDoc)
     {
         //  #104893#; use the displayed string
-        pDoc->GetString(rCellPos.Col(), rCellPos.Row(), rCellPos.Tab(), rText);
+        rText = pDoc->GetString(rCellPos.Col(), rCellPos.Row(), rCellPos.Tab());
         if (mpViewShell)
         {
             const ScViewOptions& aOptions = mpViewShell->GetViewData()->GetOptions();
diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx
index e8a96c5..103f64f 100644
--- a/sc/source/ui/app/transobj.cxx
+++ b/sc/source/ui/app/transobj.cxx
@@ -276,8 +276,7 @@ sal_Bool ScTransferObj::GetData( const datatransfer::DataFlavor& rFlavor )
                 }
                 else
                 {
-                    String aText;
-                    pDoc->GetString( nCol, nRow, nTab, aText );
+                    OUString aText = pDoc->GetString(nCol, nRow, nTab);
                     aEngine.SetText(aText);
                 }
             }
diff --git a/sc/source/ui/dbgui/filtdlg.cxx b/sc/source/ui/dbgui/filtdlg.cxx
index 45e59ac..e3ae181 100644
--- a/sc/source/ui/dbgui/filtdlg.cxx
+++ b/sc/source/ui/dbgui/filtdlg.cxx
@@ -487,7 +487,7 @@ void ScFilterDlg::FillFieldLists()
 
         for ( col=nFirstCol; col<=nMaxCol; col++ )
         {
-            pDoc->GetString( col, nFirstRow, nTab, aFieldName );
+            aFieldName = pDoc->GetString(col, nFirstRow, nTab);
             if (!aBtnHeader.IsChecked() || aFieldName.isEmpty())
             {
                 rtl::OUStringBuffer aBuf;
diff --git a/sc/source/ui/dbgui/pfiltdlg.cxx b/sc/source/ui/dbgui/pfiltdlg.cxx
index d23140d..6d6b50f 100644
--- a/sc/source/ui/dbgui/pfiltdlg.cxx
+++ b/sc/source/ui/dbgui/pfiltdlg.cxx
@@ -291,7 +291,7 @@ void ScPivotFilterDlg::FillFieldLists()
 
         for ( col=nFirstCol; col<=nMaxCol; col++ )
         {
-            pDoc->GetString( col, nFirstRow, nTab, aFieldName );
+            aFieldName = pDoc->GetString(col, nFirstRow, nTab);
             if ( aFieldName.isEmpty() )
             {
                rtl::OUStringBuffer aBuf;
diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx
index d458597..5eec392 100644
--- a/sc/source/ui/dbgui/tpsort.cxx
+++ b/sc/source/ui/dbgui/tpsort.cxx
@@ -369,7 +369,7 @@ void ScTabPageSortFields::FillFieldLists( sal_uInt16 nStartField )
 
                 for ( col=nFirstSortCol; col<=nMaxCol && i<SC_MAXFIELDS; col++ )
                 {
-                    pDoc->GetString( col, nFirstSortRow, nTab, aFieldName );
+                    aFieldName = pDoc->GetString(col, nFirstSortRow, nTab);
                     if ( !bHasHeader || aFieldName.isEmpty() )
                     {
                         rtl::OUStringBuffer aBuf;
@@ -392,7 +392,7 @@ void ScTabPageSortFields::FillFieldLists( sal_uInt16 nStartField )
 
                 for ( row=nFirstSortRow; row<=nMaxRow && i<SC_MAXFIELDS; row++ )
                 {
-                    pDoc->GetString( nFirstSortCol, row, nTab, aFieldName );
+                    aFieldName = pDoc->GetString(nFirstSortCol, row, nTab);
                     if ( !bHasHeader || aFieldName.isEmpty() )
                     {
                         rtl::OUStringBuffer aBuf;
diff --git a/sc/source/ui/dbgui/tpsubt.cxx b/sc/source/ui/dbgui/tpsubt.cxx
index 384970f..4bb4475 100644
--- a/sc/source/ui/dbgui/tpsubt.cxx
+++ b/sc/source/ui/dbgui/tpsubt.cxx
@@ -275,7 +275,7 @@ void ScTpSubTotalGroup::FillListBoxes()
         sal_uInt16 i=0;
         for ( col=nFirstCol; col<=nMaxCol && i<SC_MAXFIELDS; col++ )
         {
-            pDoc->GetString( col, nFirstRow, nTab, aFieldName );
+            aFieldName = pDoc->GetString(col, nFirstRow, nTab);
             if ( aFieldName.isEmpty() )
             {
                 rtl::OUStringBuffer aBuf;
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 770180d4..4115377 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -4854,8 +4854,7 @@ void ScDocFunc::CreateOneName( ScRangeName& rList,
     ScDocument* pDoc = rDocShell.GetDocument();
     if (!pDoc->HasValueData( nPosX, nPosY, nTab ))
     {
-        String aName;
-        pDoc->GetString( nPosX, nPosY, nTab, aName );
+        String aName = pDoc->GetString(nPosX, nPosY, nTab);
         ScRangeData::MakeValidName(aName);
         if (aName.Len())
         {
diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx
index 2bfbcb0..1885881 100644
--- a/sc/source/ui/docshell/docsh8.cxx
+++ b/sc/source/ui/docshell/docsh8.cxx
@@ -528,7 +528,7 @@ void lcl_GetColumnTypes(
         // Typ etc.: L; D; C[,W]; N[,W[,P]]
         if ( bHasFieldNames )
         {
-            pDoc->GetString( nCol, nFirstRow, nTab, aString );
+            aString = pDoc->GetString(nCol, nFirstRow, nTab);
             aString.ToUpperAscii();
             xub_StrLen nToken = comphelper::string::getTokenCount(aString, ',');
             if ( nToken > 1 )
@@ -997,7 +997,7 @@ sal_uLong ScDocShell::DBaseExport( const rtl::OUString& rFullFileName, CharSet e
                         break;
 
                     case sdbc::DataType::VARCHAR:
-                        aDocument.GetString( nDocCol, nDocRow, nTab, aString );
+                        aString = aDocument.GetString(nDocCol, nDocRow, nTab);
                         xRowUpdate->updateString( nCol+1, aString );
                         if ( nErr == eERR_OK && pColLengths[nCol] < aString.getLength() )
                             nErr = SCWARN_EXPORT_DATALOST;
@@ -1107,7 +1107,7 @@ sal_uLong ScDocShell::DBaseExport( const rtl::OUString& rFullFileName, CharSet e
                         break;
 
                     case sdbc::DataType::VARCHAR:
-                        aDocument.GetString( nDocCol, nDocRow, nTab, aString);
+                        aString = aDocument.GetString(nDocCol, nDocRow, nTab);
                         break;
 
                     // NOTE: length of DECIMAL fields doesn't need to be
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 12d04a1..686d0d2 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -1604,7 +1604,7 @@ bool ScImportExport::Doc2Text( SvStream& rStrm )
                         }
                         else
                         {
-                            pDoc->GetString( nCol, nRow, nStartTab, aCell );
+                            aCell = pDoc->GetString(nCol, nRow, nStartTab);
 
                             bool bMultiLineText = ( aCell.Search( _LF ) != STRING_NOTFOUND );
                             if( bMultiLineText )
@@ -1627,7 +1627,7 @@ bool ScImportExport::Doc2Text( SvStream& rStrm )
                     break;
                     case CELLTYPE_VALUE:
                     {
-                        pDoc->GetString( nCol, nRow, nStartTab, aCell );
+                        aCell = pDoc->GetString(nCol, nRow, nStartTab);
                         lcl_WriteSimpleString( rStrm, aCell );
                     }
                     break;
@@ -1636,7 +1636,7 @@ bool ScImportExport::Doc2Text( SvStream& rStrm )
                     break;
                     default:
                     {
-                        pDoc->GetString( nCol, nRow, nStartTab, aCell );
+                        aCell = pDoc->GetString(nCol, nRow, nStartTab);
 
                         bool bMultiLineText = ( aCell.Search( _LF ) != STRING_NOTFOUND );
                         if( bMultiLineText )
@@ -1982,7 +1982,7 @@ bool ScImportExport::Doc2Sylk( SvStream& rStrm )
                 case CELLTYPE_STRING:
                 case CELLTYPE_EDIT:
                 hasstring:
-                    pDoc->GetString( nCol, nRow, aRange.aStart.Tab(), aCellStr );
+                    aCellStr = pDoc->GetString(nCol, nRow, aRange.aStart.Tab());
                     aCellStr.SearchAndReplaceAll( rtl::OUString(_LF), rtl::OUString(SYLK_LF) );
 
                     aBufStr.AssignAscii(RTL_CONSTASCII_STRINGPARAM( "C;X" ));
diff --git a/sc/source/ui/miscdlgs/crnrdlg.cxx b/sc/source/ui/miscdlgs/crnrdlg.cxx
index f0ff155..d8c2a6b 100644
--- a/sc/source/ui/miscdlgs/crnrdlg.cxx
+++ b/sc/source/ui/miscdlgs/crnrdlg.cxx
@@ -526,12 +526,12 @@ void ScColRowNameRangesDlg::UpdateNames()
             strShow.AssignAscii(RTL_CONSTASCII_STRINGPARAM(" ["));
             if(pDoc!=NULL)
             {
-                pDoc->GetString(nCol1, nRow1, nTab1,rString);
+                rString = pDoc->GetString(nCol1, nRow1, nTab1);
                 strShow +=rString;
                 for(SCCOL i=nCol1+1;i<=q;i++)
                 {
                     strShow.AppendAscii(RTL_CONSTASCII_STRINGPARAM(", "));
-                    pDoc->GetString(i, nRow1, nTab1,rString);
+                    rString = pDoc->GetString(i, nRow1, nTab1);
                     strShow += rString;
                 }
             }
@@ -572,12 +572,12 @@ void ScColRowNameRangesDlg::UpdateNames()
             strShow.AssignAscii(RTL_CONSTASCII_STRINGPARAM(" ["));
             if(pDoc!=NULL)
             {
-                pDoc->GetString(nCol1, nRow1, nTab1,rString);
+                rString = pDoc->GetString(nCol1, nRow1, nTab1);
                 strShow += rString;
                 for(SCROW i=nRow1+1;i<=q;i++)
                 {
                     strShow.AppendAscii(RTL_CONSTASCII_STRINGPARAM(", "));
-                    pDoc->GetString(nCol1, i, nTab1,rString);
+                    rString = pDoc->GetString(nCol1, i, nTab1);
                     strShow += rString;
                 }
             }
diff --git a/sc/source/ui/miscdlgs/datafdlg.cxx b/sc/source/ui/miscdlgs/datafdlg.cxx
index 36fe409..f9850c6 100644
--- a/sc/source/ui/miscdlgs/datafdlg.cxx
+++ b/sc/source/ui/miscdlgs/datafdlg.cxx
@@ -86,11 +86,10 @@ ScDataFormDlg::ScDataFormDlg( Window* pParent, ScTabViewShell*  pTabViewShellOri
             //find last not blank cell in row
             for (int i=1;i<=MAX_DATAFORM_COLS;i++)
             {
-                String  aColName;
                 nEndCol++;
-                pDoc->GetString( nEndCol, nStartRow, nTab, aColName );
+                OUString aColName = pDoc->GetString(nEndCol, nStartRow, nTab);
                 int nColWidth = pDoc->GetColWidth( nEndCol, nTab );
-                if ( aColName.Len() == 0 && nColWidth)
+                if (aColName.isEmpty() && nColWidth)
                 {
                     nEndCol--;
                     break;
@@ -100,14 +99,13 @@ ScDataFormDlg::ScDataFormDlg( Window* pParent, ScTabViewShell*  pTabViewShellOri
             //find first not blank cell in row
             for (int i=1;i<=MAX_DATAFORM_COLS;i++)
             {
-                String  aColName;
                 if (nStartCol <= 0)
                     break;
                 nStartCol--;
 
-                pDoc->GetString( nStartCol, nStartRow, nTab, aColName );
+                OUString aColName = pDoc->GetString(nStartCol, nStartRow, nTab);
                 int nColWidth = pDoc->GetColWidth( nEndCol, nTab );
-                if ( aColName.Len() == 0 && nColWidth)
+                if (aColName.isEmpty() && nColWidth)
                 {
                     nStartCol++;
                     break;
@@ -129,10 +127,9 @@ ScDataFormDlg::ScDataFormDlg( Window* pParent, ScTabViewShell*  pTabViewShellOri
             //find last not blank cell in row
             for (int i=1;i<=MAX_DATAFORM_ROWS;i++)
             {
-                String  aColName;
                 nEndRow++;
-                pDoc->GetString( nStartCol, nEndRow, nTab, aColName );
-                if ( aColName.Len() == 0 )
+                OUString aColName = pDoc->GetString(nStartCol, nEndRow, nTab);
+                if (aColName.isEmpty())
                 {
                     nEndRow--;
                     break;
@@ -142,13 +139,12 @@ ScDataFormDlg::ScDataFormDlg( Window* pParent, ScTabViewShell*  pTabViewShellOri
             //find first not blank cell in row
             for (int i=1;i<=MAX_DATAFORM_ROWS;i++)
             {
-                String  aColName;
                 if (nStartRow <= 0)
                     break;
                 nStartRow--;
 
-                pDoc->GetString( nStartCol, nStartRow, nTab, aColName );
-                if ( aColName.Len() == 0 )
+                OUString aColName = pDoc->GetString(nStartCol, nStartRow, nTab);
+                if (aColName.isEmpty())
                 {
                     nStartRow++;
                     break;
@@ -181,7 +177,7 @@ ScDataFormDlg::ScDataFormDlg( Window* pParent, ScTabViewShell*  pTabViewShellOri
 
         for(sal_uInt16 nIndex = 0; nIndex < aColLength; nIndex++)
         {
-            pDoc->GetString( nIndex + nStartCol, nStartRow, nTab, aFieldName );
+            aFieldName = pDoc->GetString(nIndex + nStartCol, nStartRow, nTab);
             int nColWidth = pDoc->GetColWidth( nIndex + nStartCol, nTab );
             if (nColWidth)
             {
@@ -253,7 +249,7 @@ void ScDataFormDlg::FillCtrls(SCROW /*nCurrentRow*/)
         {
             if (nCurrentRow<=nEndRow)
             {
-                pDoc->GetString( i + nStartCol, nCurrentRow, nTab, aFieldName );
+                aFieldName = pDoc->GetString(i + nStartCol, nCurrentRow, nTab);
                 maEdits[i].SetText(aFieldName);
             }
             else
diff --git a/sc/source/ui/miscdlgs/optsolver.cxx b/sc/source/ui/miscdlgs/optsolver.cxx
index 06f540b..8bcea3d 100644
--- a/sc/source/ui/miscdlgs/optsolver.cxx
+++ b/sc/source/ui/miscdlgs/optsolver.cxx
@@ -1026,8 +1026,10 @@ bool ScOptSolverDlg::CallSolver()       // return true -> close dialog after cal
         //! else error?
 
         // take formatted result from document (result value from component is ignored)
-        String aResultStr;
-        mpDoc->GetString( (SCCOL)aObjective.Column, (SCROW)aObjective.Row, (SCTAB)aObjective.Sheet, aResultStr );
+        OUString aResultStr = mpDoc->GetString(
+            static_cast<SCCOL>(aObjective.Column), static_cast<SCROW>(aObjective.Row),
+            static_cast<SCTAB>(aObjective.Sheet));
+
         ScSolverSuccessDialog aDialog( this, aResultStr );
         if ( aDialog.Execute() == RET_OK )
         {
diff --git a/sc/source/ui/optdlg/tpusrlst.cxx b/sc/source/ui/optdlg/tpusrlst.cxx
index e6b0107..5b4f763 100644
--- a/sc/source/ui/optdlg/tpusrlst.cxx
+++ b/sc/source/ui/optdlg/tpusrlst.cxx
@@ -398,7 +398,7 @@ void ScTpUserLists::CopyListFromArea( const ScRefAddress& rStartPos,
                 {
                     if ( pDoc->HasStringData( col, row, nTab ) )
                     {
-                        pDoc->GetString( col, row, nTab, aStrField );
+                        aStrField = pDoc->GetString(col, row, nTab);
 
                         if ( aStrField.Len() > 0 )
                         {
@@ -422,7 +422,7 @@ void ScTpUserLists::CopyListFromArea( const ScRefAddress& rStartPos,
                 {
                     if ( pDoc->HasStringData( col, row, nTab ) )
                     {
-                        pDoc->GetString( col, row, nTab, aStrField );
+                        aStrField = pDoc->GetString(col, row, nTab);
 
                         if ( aStrField.Len() > 0 )
                         {
diff --git a/sc/source/ui/undo/undodat.cxx b/sc/source/ui/undo/undodat.cxx
index ee81052..81106e5 100644
--- a/sc/source/ui/undo/undodat.cxx
+++ b/sc/source/ui/undo/undodat.cxx
@@ -2050,8 +2050,8 @@ void ScUndoDataForm::DoChange( const sal_Bool bUndo )
 
     for ( sal_uInt16 i=0; i <= ( aBlockRange.aEnd.Col() - aBlockRange.aStart.Col() ); i++ )
     {
-        String aOldString;
-        pUndoDoc->GetString( aBlockRange.aStart.Col()+i , aBlockRange.aStart.Row() , aBlockRange.aStart.Tab() , aOldString );
+        OUString aOldString = pUndoDoc->GetString(
+            aBlockRange.aStart.Col()+i, aBlockRange.aStart.Row(), aBlockRange.aStart.Tab());
         pDoc->SetString( aBlockRange.aStart.Col()+i , aBlockRange.aStart.Row() , aBlockRange.aStart.Tab() , aOldString );
     }
 
diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx
index cd94ab9..3ace857 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -2603,11 +2603,7 @@ void ScChart2DataSequence::BuildDataCache()
                         if (pCell->HasStringData())
                             rItem.maString = pCell->GetStringData();
                         else
-                        {
-                            String aStr;
-                            m_pDocument->GetString(nCol, nRow, nTab, aStr);
-                            rItem.maString = aStr;
-                        }
+                            rItem.maString = m_pDocument->GetString(nCol, nRow, nTab);
 
                         switch (pCell->GetCellType())
                         {
diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx
index 790739e..faecae8 100644
--- a/sc/source/ui/view/cellsh.cxx
+++ b/sc/source/ui/view/cellsh.cxx
@@ -628,8 +628,7 @@ void ScCellShell::GetState(SfxItemSet &rSet)
 
             case SID_RANGE_TEXTVALUE:
                 {
-                    String aString;
-                    pDoc->GetString( nPosX, nPosY, nTab, aString );
+                    OUString aString = pDoc->GetString(nPosX, nPosY, nTab);
                     rSet.Put( SfxStringItem( nWhich, aString ) );
                 }
                 break;
diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx
index 714230a..3a9dc0a 100644
--- a/sc/source/ui/view/dbfunc3.cxx
+++ b/sc/source/ui/view/dbfunc3.cxx
@@ -1344,8 +1344,7 @@ void ScDBFunc::DataPilotInput( const ScAddress& rPos, const rtl::OUString& rStri
     if (!pDPObj)
         return;
 
-    rtl::OUString aOldText;
-    pDoc->GetString( rPos.Col(), rPos.Row(), rPos.Tab(), aOldText );
+    OUString aOldText = pDoc->GetString(rPos.Col(), rPos.Row(), rPos.Tab());
 
     if ( aOldText == rString )
     {
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 2a8d705..7bbbc18 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -1101,8 +1101,7 @@ void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, SCROW nRow, bool bDataSelec
     else                                                // AutoFilter
     {
         //! wird der Titel ueberhaupt ausgewertet ???
-        String aString;
-        pDoc->GetString( nCol, nRow, nTab, aString );
+        OUString aString = pDoc->GetString(nCol, nRow, nTab);
         pFilterBox->SetText( aString );
 
         long nMaxText = 0;
@@ -1238,8 +1237,7 @@ void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, SCROW nRow, bool bDataSelec
             if (pData)
             {
                 ScTypedStrData* pNew = NULL;
-                rtl::OUString aDocStr;
-                pDoc->GetString( nCol, nRow, nTab, aDocStr );
+                OUString aDocStr = pDoc->GetString(nCol, nRow, nTab);
                 if ( pDoc->HasValueData( nCol, nRow, nTab ) )
                 {
                     double fVal = pDoc->GetValue(ScAddress(nCol, nRow, nTab));
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 64e4bbc..9c48dd2 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -1229,8 +1229,7 @@ void ScGridWindow::DrawButtons( SCCOL nX1, SCCOL nX2, ScTableInfo& rTabInfo, Out
                 long nPosY = aScrPos.Y();
                 // bLayoutRTL is handled in setBoundingBox
 
-                String aStr;
-                pDoc->GetString(nCol, nRow, nTab, aStr);
+                OUString aStr = pDoc->GetString(nCol, nRow, nTab);
                 aCellBtn.setText(aStr);
                 aCellBtn.setBoundingBox(Point(nPosX, nPosY), Size(nSizeX-1, nSizeY-1), bLayoutRTL);
                 aCellBtn.setPopupLeft(false);   // DataPilot popup is always right-aligned for now
diff --git a/sc/source/ui/view/spelleng.cxx b/sc/source/ui/view/spelleng.cxx
index 783b570..6cb0cc5 100644
--- a/sc/source/ui/view/spelleng.cxx
+++ b/sc/source/ui/view/spelleng.cxx
@@ -44,21 +44,6 @@
 
 using namespace ::com::sun::star;
 
-// ============================================================================
-
-namespace {
-
-bool lclHasString( ScDocument& rDoc, SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString )
-{
-    String aCompStr;
-    rDoc.GetString( nCol, nRow, nTab, aCompStr );
-    return aCompStr == rString;      //! case-insensitive?
-}
-
-} // namespace
-
-// ----------------------------------------------------------------------------
-
 ScConversionEngineBase::ScConversionEngineBase(
         SfxItemPool* pEnginePoolP, ScViewData& rViewData,
         ScDocument* pUndoDoc, ScDocument* pRedoDoc ) :
@@ -105,19 +90,18 @@ bool ScConversionEngineBase::FindNextConversionCell()
 
         String aNewStr = GetText();
 
-        sal_Bool bMultiTab = (rMark.GetSelectCount() > 1);
-        String aVisibleStr;
+        bool bMultiTab = (rMark.GetSelectCount() > 1);
+        OUString aVisibleStr;
         if( bMultiTab )
-            mrDoc.GetString( mnCurrCol, mnCurrRow, mnStartTab, aVisibleStr );
+            aVisibleStr = mrDoc.GetString(mnCurrCol, mnCurrRow, mnStartTab);
 
         for( SCTAB nTab = 0, nTabCount = mrDoc.GetTableCount(); nTab < nTabCount; ++nTab )
         {
             //  always change the cell on the visible tab,
             //  on the other selected tabs only if they contain the same text
 
-            if( (nTab == mnStartTab) ||
-                (bMultiTab && rMark.GetTableSelect( nTab ) &&
-                 lclHasString( mrDoc, mnCurrCol, mnCurrRow, nTab, aVisibleStr )) )
+            if ((nTab == mnStartTab) ||
+                (bMultiTab && rMark.GetTableSelect(nTab) && mrDoc.GetString(mnCurrCol, mnCurrRow, nTab) == aVisibleStr))
             {
                 ScAddress aPos( mnCurrCol, mnCurrRow, nTab );
                 CellType eCellType = mrDoc.GetCellType( aPos );
@@ -281,8 +265,7 @@ void ScConversionEngineBase::FillFromCell( SCCOL nCol, SCROW nRow, SCTAB nTab )
     {
         case CELLTYPE_STRING:
         {
-            String aText;
-            mrDoc.GetString( nCol, nRow, nTab, aText );
+            OUString aText = mrDoc.GetString(nCol, nRow, nTab);
             SetText( aText );
         }
         break;
diff --git a/sc/source/ui/view/viewfun4.cxx b/sc/source/ui/view/viewfun4.cxx
index 2de541a..5698878 100644
--- a/sc/source/ui/view/viewfun4.cxx
+++ b/sc/source/ui/view/viewfun4.cxx
@@ -366,7 +366,7 @@ void ScViewFunc::DoThesaurus( sal_Bool bRecord )
 
     if (eCellType == CELLTYPE_STRING)
     {
-        pDoc->GetString(nCol, nRow, nTab, sOldText);
+        sOldText = pDoc->GetString(nCol, nRow, nTab);
         pThesaurusEngine->SetText(sOldText);
     }
     else if (eCellType == CELLTYPE_EDIT)


More information about the Libreoffice-commits mailing list