[PATCH] String to OUString.

Donizete Waterkemper (via Code Review) gerrit at gerrit.libreoffice.org
Thu May 23 08:57:23 PDT 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/4014

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/14/4014/1

String to OUString.

Change-Id: I994d0ec505339201f6f78229963de45f10437212
---
M sc/source/core/tool/cellkeytranslator.cxx
M sc/source/filter/excel/xiescher.cxx
M sc/source/filter/inc/xeescher.hxx
M sc/source/filter/inc/xiescher.hxx
M sc/source/filter/oox/formulabuffer.cxx
M sc/source/ui/vba/vbahelper.cxx
6 files changed, 35 insertions(+), 7 deletions(-)



diff --git a/sc/source/core/tool/cellkeytranslator.cxx b/sc/source/core/tool/cellkeytranslator.cxx
index ec01049..b2ccd8f 100644
--- a/sc/source/core/tool/cellkeytranslator.cxx
+++ b/sc/source/core/tool/cellkeytranslator.cxx
@@ -44,17 +44,17 @@
 static LocaleMatch lclLocaleCompare(const Locale& rLocale1, const Locale& rLocale2)
 {
     LocaleMatch eMatchLevel = LOCALE_MATCH_NONE;
-    if ( !rLocale1.Language.compareTo(rLocale2.Language) )
+    if ( rLocale1.Language != rLocale2.Language )
         eMatchLevel = LOCALE_MATCH_LANG;
     else
         return eMatchLevel;
 
-    if ( !rLocale1.Country.compareTo(rLocale2.Country) )
+    if ( rLocale1.Country != rLocale2.Country )
         eMatchLevel = LOCALE_MATCH_LANG_COUNTRY;
     else
         return eMatchLevel;
 
-    if ( !rLocale1.Variant.compareTo(rLocale2.Variant) )
+    if ( rLocale1.Variant != rLocale2.Variant )
         eMatchLevel = LOCALE_MATCH_ALL;
 
     return eMatchLevel;
diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx
index bfdd175..3f321f1 100644
--- a/sc/source/filter/excel/xiescher.cxx
+++ b/sc/source/filter/excel/xiescher.cxx
@@ -3043,7 +3043,7 @@
     if( IsOcxControl() )
     {
         // #i26521# form controls to be ignored
-        if( maClassName.EqualsAscii( "Forms.HTML:Hidden.1" ) )
+        if( maClassName == "Forms.HTML:Hidden.1"  )
         {
             SetProcessSdrObj( false );
             return;
diff --git a/sc/source/filter/inc/xeescher.hxx b/sc/source/filter/inc/xeescher.hxx
index 205b4cb..9c91e72 100644
--- a/sc/source/filter/inc/xeescher.hxx
+++ b/sc/source/filter/inc/xeescher.hxx
@@ -27,6 +27,7 @@
 #include <com/sun/star/chart/XChartDocument.hpp>
 #include "svx/sdtaitm.hxx"
 #include <boost/shared_ptr.hpp>
+#include "rtl/ustring.hxx"
 
 class ScPostIt;
 
@@ -252,7 +253,7 @@
     virtual void        WriteSubRecs( XclExpStream& rStrm );
 
 private:
-    String              maClassName;        /// Class name of the control.
+    OUString            maClassName;        /// Class name of the control.
     sal_uInt32          mnStrmStart;        /// Start position in 'Ctls' stream.
     sal_uInt32          mnStrmSize;         /// Size in 'Ctls' stream.
 };
diff --git a/sc/source/filter/inc/xiescher.hxx b/sc/source/filter/inc/xiescher.hxx
index 088c6d5..5d46015 100644
--- a/sc/source/filter/inc/xiescher.hxx
+++ b/sc/source/filter/inc/xiescher.hxx
@@ -29,6 +29,8 @@
 #include "xistring.hxx"
 #include <boost/shared_ptr.hpp>
 #include <oox/ole/olehelper.hxx>
+#include "rtl/ustring.hxx"
+
 namespace com { namespace sun { namespace star {
     namespace drawing { class XShape; }
     namespace form { class XForm; }
@@ -905,7 +907,7 @@
 private:
     Graphic             maGraphic;      /// Picture or OLE placeholder graphic.
     Rectangle           maVisArea;      /// Size of graphic.
-    String              maClassName;    /// Class name of embedded OLE object.
+    OUString              maClassName;    /// Class name of embedded OLE object.
     sal_uInt32          mnStorageId;    /// Identifier of the storage for this object.
     sal_Size            mnCtlsStrmPos;  /// Position in 'Ctls' stream for this control.
     sal_Size            mnCtlsStrmSize; /// Size in 'Ctls' stream for this control.
diff --git a/sc/source/filter/oox/formulabuffer.cxx b/sc/source/filter/oox/formulabuffer.cxx
index eba84aba..0c44329 100644
--- a/sc/source/filter/oox/formulabuffer.cxx
+++ b/sc/source/filter/oox/formulabuffer.cxx
@@ -155,16 +155,41 @@
         }
     }
 }
+// bound to need this somewhere else, if so probably need to move it to
+// worksheethelper or somewhere else more suitable
+void StartCellListening( sal_Int16 nSheet, sal_Int32 nRow, sal_Int32 nCol, ScDocument& rDoc )
+{
+    ScAddress aCellPos;
+    CellAddress aAddress;
+    aAddress.Sheet = nSheet;
+    aAddress.Row = nRow;
+    aAddress.Column = nCol;
+    ScUnoConversion::FillScAddress( aCellPos, aAddress );
+    ScFormulaCell* pFCell = rDoc.GetFormulaCell( aCellPos );
+    if ( pFCell )
+        pFCell->StartListeningTo( &rDoc );
+}
 
 void FormulaBuffer::applyArrayFormulas( const std::vector< TokenRangeAddressItem >& rVector )
 {
+    ScDocument& rDoc = getScDocument();
     for ( std::vector< TokenRangeAddressItem >::const_iterator it = rVector.begin(), it_end = rVector.end(); it != it_end; ++it )
     {
         Reference< XArrayFormulaTokens > xTokens( getRange( it->maCellRangeAddress ), UNO_QUERY );
         OSL_ENSURE( xTokens.is(), "SheetDataBuffer::finalizeArrayFormula - missing formula token interface" );
         ApiTokenSequence aTokens = getFormulaParser().importFormula( it->maTokenAndAddress.maCellAddress, it->maTokenAndAddress.maTokenStr );
         if( xTokens.is() )
+        {
             xTokens->setArrayTokens( aTokens );
+            // set dependencies, add listeners on the cells in array
+            for ( sal_Int32 nCol = it->maCellRangeAddress.StartColumn; nCol <=  it->maCellRangeAddress.EndColumn; ++nCol )
+            {
+                for ( sal_Int32 nRow = it->maCellRangeAddress.StartRow; nRow <=  it->maCellRangeAddress.EndRow; ++nRow )
+                {
+                    StartCellListening( it->maCellRangeAddress.Sheet, nRow, nCol, rDoc );
+                }
+            }
+        }
     }
 }
 
diff --git a/sc/source/ui/vba/vbahelper.cxx b/sc/source/ui/vba/vbahelper.cxx
index d6b5552..197b311 100644
--- a/sc/source/ui/vba/vbahelper.cxx
+++ b/sc/source/ui/vba/vbahelper.cxx
@@ -563,7 +563,7 @@
         // I wonder why comparing lexicographically is done
         // when its a match is whats interesting?
         //if (SearchList[i].compareTo(SearchString) == 0)
-        if ( SearchList[i].equals( SearchString ) )
+        if ( SearchList[i] == SearchString )
         {
             retvalue = i;
             break;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I994d0ec505339201f6f78229963de45f10437212
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Donizete Waterkemper <dwater2 at gmail.com>



More information about the LibreOffice mailing list