[Libreoffice-commits] core.git: 3 commits - include/formula reportdesign/source sc/source svx/source

Caolán McNamara caolanm at redhat.com
Fri Aug 2 10:30:08 PDT 2013


 include/formula/IControlReferenceHandler.hxx   |    2 -
 reportdesign/source/ui/dlg/Formula.cxx         |    2 -
 reportdesign/source/ui/inc/Formula.hxx         |    2 -
 sc/source/ui/formdlg/formula.cxx               |    2 -
 sc/source/ui/inc/anyrefdg.hxx                  |   12 ++++-----
 sc/source/ui/inc/formula.hxx                   |    2 -
 sc/source/ui/miscdlgs/anyrefdg.cxx             |   30 ++++++++++++------------
 sc/source/ui/sidebar/CellLineStyleControl.cxx  |   31 +++++++++----------------
 sc/source/ui/sidebar/CellLineStyleControl.hxx  |    3 --
 sc/source/ui/sidebar/CellLineStyleValueSet.cxx |   10 +++-----
 sc/source/ui/sidebar/CellLineStyleValueSet.hxx |    6 +++-
 svx/source/svdraw/svdundo.cxx                  |    4 +--
 12 files changed, 49 insertions(+), 57 deletions(-)

New commits:
commit eace5e0a1c4bab37699429447b1a17e3c9410503
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Aug 2 16:49:24 2013 +0200

    remove last uses of XubString in sc
    
    Change-Id: I44c42f0268b0d7c2e77ab7e807610d39b7b7ea56

diff --git a/include/formula/IControlReferenceHandler.hxx b/include/formula/IControlReferenceHandler.hxx
index bee4bac..cc22e45 100644
--- a/include/formula/IControlReferenceHandler.hxx
+++ b/include/formula/IControlReferenceHandler.hxx
@@ -28,7 +28,7 @@ namespace formula
     class FORMULA_DLLPUBLIC SAL_NO_VTABLE IControlReferenceHandler
     {
     public:
-        virtual void ShowReference(const String& _sRef) = 0;
+        virtual void ShowReference(const OUString& _sRef) = 0;
         virtual void HideReference( sal_Bool bDoneRefMode = sal_True ) = 0;
         virtual void ReleaseFocus( RefEdit* pEdit, RefButton* pButton = NULL ) = 0;
         virtual void ToggleCollapsed( RefEdit* pEdit, RefButton* pButton = NULL ) = 0;
diff --git a/reportdesign/source/ui/dlg/Formula.cxx b/reportdesign/source/ui/dlg/Formula.cxx
index 84330da..6abf2f1 100644
--- a/reportdesign/source/ui/dlg/Formula.cxx
+++ b/reportdesign/source/ui/dlg/Formula.cxx
@@ -173,7 +173,7 @@ IFunctionManager* FormulaDialog::getFunctionManager()
     return m_aFunctionManager.get();
 }
 // -----------------------------------------------------------------------------
-void FormulaDialog::ShowReference(const String& /*_sRef*/)
+void FormulaDialog::ShowReference(const OUString& /*_sRef*/)
 {
 }
 // -----------------------------------------------------------------------------
diff --git a/reportdesign/source/ui/inc/Formula.hxx b/reportdesign/source/ui/inc/Formula.hxx
index fcfbc6c..c551bbd 100644
--- a/reportdesign/source/ui/inc/Formula.hxx
+++ b/reportdesign/source/ui/inc/Formula.hxx
@@ -87,7 +87,7 @@ public:
     virtual ::std::auto_ptr<formula::FormulaTokenArray> convertToTokenArray(const ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::FormulaToken >& _aTokenList);
 
     // IControlReferenceHandler
-    virtual void ShowReference(const String& _sRef);
+    virtual void ShowReference(const OUString& _sRef);
     virtual void HideReference( sal_Bool bDoneRefMode = sal_True );
     virtual void ReleaseFocus( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL );
     virtual void ToggleCollapsed( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL );
diff --git a/sc/source/ui/formdlg/formula.cxx b/sc/source/ui/formdlg/formula.cxx
index 37ee0e2..25ae7d0 100644
--- a/sc/source/ui/formdlg/formula.cxx
+++ b/sc/source/ui/formdlg/formula.cxx
@@ -497,7 +497,7 @@ void ScFormulaDlg::showReference(const String& _sFormula)
 {
     ShowReference(_sFormula);
 }
-void ScFormulaDlg::ShowReference(const String& _sFormula)
+void ScFormulaDlg::ShowReference(const OUString& _sFormula)
 {
     m_aHelper.ShowReference(_sFormula);
 }
diff --git a/sc/source/ui/inc/anyrefdg.hxx b/sc/source/ui/inc/anyrefdg.hxx
index bba97a7..660de08 100644
--- a/sc/source/ui/inc/anyrefdg.hxx
+++ b/sc/source/ui/inc/anyrefdg.hxx
@@ -75,12 +75,12 @@ public:
     ScFormulaReferenceHelper(IAnyRefDialog* _pDlg,SfxBindings* _pBindings);
     ~ScFormulaReferenceHelper();
 
-    void                ShowSimpleReference( const XubString& rStr );
-    void                ShowFormulaReference( const XubString& rStr );
+    void                ShowSimpleReference(const OUString& rStr);
+    void                ShowFormulaReference(const OUString& rStr);
     bool                ParseWithNames( ScRangeList& rRanges, const String& rStr, ScDocument* pDoc );
     void                Init();
 
-    void                ShowReference( const XubString& rStr );
+    void                ShowReference(const OUString& rStr);
     void                ReleaseFocus( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL );
     void                HideReference( bool bDoneRefMode = true );
     void                RefInputStart( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL );
@@ -136,8 +136,8 @@ protected:
 
     virtual void        RefInputStart( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL );
     virtual void        RefInputDone( sal_Bool bForced = false );
-    void                ShowSimpleReference( const XubString& rStr );
-    void                ShowFormulaReference( const XubString& rStr );
+    void                ShowSimpleReference(const OUString& rStr);
+    void                ShowFormulaReference(const OUString& rStr);
 
     bool                ParseWithNames( ScRangeList& rRanges, const String& rStr, ScDocument* pDoc );
 
@@ -155,7 +155,7 @@ public:
     virtual sal_Bool        IsTableLocked() const;
     virtual sal_Bool        IsDocAllowed( SfxObjectShell* pDocSh ) const;
 
-    virtual void        ShowReference( const XubString& rStr );
+    virtual void        ShowReference(const OUString& rStr);
     virtual void        HideReference( sal_Bool bDoneRefMode = sal_True );
 
     virtual void        ToggleCollapsed( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL );
diff --git a/sc/source/ui/inc/formula.hxx b/sc/source/ui/inc/formula.hxx
index 2082bc9..0a662e1 100644
--- a/sc/source/ui/inc/formula.hxx
+++ b/sc/source/ui/inc/formula.hxx
@@ -86,7 +86,7 @@ public:
     virtual sal_Bool    Close();
 
     // sc::IAnyRefDialog
-    virtual void ShowReference(const String& _sRef);
+    virtual void ShowReference(const OUString& _sRef);
     virtual void HideReference( sal_Bool bDoneRefMode = sal_True );
     virtual void SetReference( const ScRange& rRef, ScDocument* pD );
 
diff --git a/sc/source/ui/miscdlgs/anyrefdg.cxx b/sc/source/ui/miscdlgs/anyrefdg.cxx
index 69f6f53..1cd114e 100644
--- a/sc/source/ui/miscdlgs/anyrefdg.cxx
+++ b/sc/source/ui/miscdlgs/anyrefdg.cxx
@@ -112,7 +112,7 @@ void ScFormulaReferenceHelper::enableInput( bool bEnable )
     }
 }
 // -----------------------------------------------------------------------------
-void ScFormulaReferenceHelper::ShowSimpleReference( const XubString& rStr )
+void ScFormulaReferenceHelper::ShowSimpleReference(const OUString& rStr)
 {
     if( bEnableColorRef )
     {
@@ -172,7 +172,7 @@ bool ScFormulaReferenceHelper::ParseWithNames( ScRangeList& rRanges, const Strin
     return !bError;
 }
 // -----------------------------------------------------------------------------
-void ScFormulaReferenceHelper::ShowFormulaReference( const XubString& rStr )
+void ScFormulaReferenceHelper::ShowFormulaReference(const OUString& rStr)
 {
     if( bEnableColorRef)
     {
@@ -251,20 +251,20 @@ void ScFormulaReferenceHelper::HideReference( bool bDoneRefMode )
     }
 }
 // -----------------------------------------------------------------------------
-void ScFormulaReferenceHelper::ShowReference( const XubString& rStr )
+void ScFormulaReferenceHelper::ShowReference(const OUString& rStr)
 {
     if( bEnableColorRef )
     {
-        if( rStr.Search('(')!=STRING_NOTFOUND ||
-            rStr.Search('+')!=STRING_NOTFOUND ||
-            rStr.Search('*')!=STRING_NOTFOUND ||
-            rStr.Search('-')!=STRING_NOTFOUND ||
-            rStr.Search('/')!=STRING_NOTFOUND ||
-            rStr.Search('&')!=STRING_NOTFOUND ||
-            rStr.Search('<')!=STRING_NOTFOUND ||
-            rStr.Search('>')!=STRING_NOTFOUND ||
-            rStr.Search('=')!=STRING_NOTFOUND ||
-            rStr.Search('^')!=STRING_NOTFOUND)
+        if( rStr.indexOf('(') != -1 ||
+            rStr.indexOf('+') != -1 ||
+            rStr.indexOf('*') != -1 ||
+            rStr.indexOf('-') != -1 ||
+            rStr.indexOf('/') != -1 ||
+            rStr.indexOf('&') != -1 ||
+            rStr.indexOf('<') != -1 ||
+            rStr.indexOf('>') != -1 ||
+            rStr.indexOf('=') != -1 ||
+            rStr.indexOf('^') != -1 )
         {
             ShowFormulaReference(rStr);
         }
@@ -1014,9 +1014,9 @@ void ScRefHandler::HideReference( sal_Bool bDoneRefMode )
     m_aHelper.HideReference( bDoneRefMode );
 }
 // -----------------------------------------------------------------------------
-void ScRefHandler::ShowReference( const XubString& rStr )
+void ScRefHandler::ShowReference(const OUString& rStr)
 {
-    m_aHelper.ShowReference( rStr );
+    m_aHelper.ShowReference(rStr);
 }
 // -----------------------------------------------------------------------------
 void ScRefHandler::ReleaseFocus( formula::RefEdit* pEdit, formula::RefButton* pButton )
commit e9d8831d18d1120593137632a31b2dad9f8d20f7
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Aug 2 16:37:18 2013 +0200

    get rid of last use of UniString in LibreOffice
    
    of raw "UniString" :-), the rest use the #define UniString String alias
    
    Change-Id: I6c4ca3a6c2b425b9214691e03deda5dd1a8a11bf

diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx
index 2d478e0..f2f3b37 100644
--- a/svx/source/svdraw/svdundo.cxx
+++ b/svx/source/svdraw/svdundo.cxx
@@ -255,9 +255,9 @@ void SdrUndoAttrObj::ensureStyleSheetInStyleSheetPool(SfxStyleSheetBasePool& rSt
     {
         // re-insert remembered style which was removed in the meantime. To do this
         // without assertion, do it without parent and set parent after insertion
-        const UniString aParent(rSheet.GetParent());
+        const OUString aParent(rSheet.GetParent());
 
-        rSheet.SetParent(UniString());
+        rSheet.SetParent(OUString());
         rStyleSheetPool.Insert(&rSheet);
         rSheet.SetParent(aParent);
     }
commit fca99395ad3c3310aa04d5ff725b4a82fc17826e
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Aug 2 16:57:30 2013 +0200

    no need for dynamic array of XubStrings
    
    Change-Id: I7a25917a2bec3ecd394444f057c892b3b02a4c3d

diff --git a/sc/source/ui/sidebar/CellLineStyleControl.cxx b/sc/source/ui/sidebar/CellLineStyleControl.cxx
index 339eff3..39e140a 100644
--- a/sc/source/ui/sidebar/CellLineStyleControl.cxx
+++ b/sc/source/ui/sidebar/CellLineStyleControl.cxx
@@ -36,18 +36,12 @@ CellLineStyleControl::CellLineStyleControl(Window* pParent, CellAppearanceProper
     mrCellAppearancePropertyPanel(rPanel),
     maPushButtonMoreOptions(this, ScResId(PB_OPTIONS)),
     maCellLineStyleValueSet(this, ScResId(VS_STYLE)),
-    mpStr(0),
     mbVSfocus(true)
 {
     Initialize();
     FreeResource();
 }
 
-CellLineStyleControl::~CellLineStyleControl(void)
-{
-    delete[] mpStr;
-}
-
 void CellLineStyleControl::Initialize()
 {
     //maPushButtonMoreOptions.SetIcoPosX(2);
@@ -63,21 +57,20 @@ void CellLineStyleControl::Initialize()
         maCellLineStyleValueSet.InsertItem(i);
     }
 
-    mpStr = new XubString[9];
-    mpStr[0] = GetSettings().GetLocaleI18nHelper().GetNum( 5, 2 ).AppendAscii("pt");
-    mpStr[1] = GetSettings().GetLocaleI18nHelper().GetNum( 250, 2 ).AppendAscii("pt");
-    mpStr[2] = GetSettings().GetLocaleI18nHelper().GetNum( 400, 2 ).AppendAscii("pt");
-    mpStr[3] = GetSettings().GetLocaleI18nHelper().GetNum( 500, 2 ).AppendAscii("pt");
-    mpStr[4] = GetSettings().GetLocaleI18nHelper().GetNum( 110, 2 ).AppendAscii("pt");
-    mpStr[5] = GetSettings().GetLocaleI18nHelper().GetNum( 260, 2 ).AppendAscii("pt");
-    mpStr[6] = GetSettings().GetLocaleI18nHelper().GetNum( 450, 2 ).AppendAscii("pt");
-    mpStr[7] = GetSettings().GetLocaleI18nHelper().GetNum( 505, 2 ).AppendAscii("pt");
-    mpStr[8] = GetSettings().GetLocaleI18nHelper().GetNum( 750, 2 ).AppendAscii("pt");
-    maCellLineStyleValueSet.SetUnit(mpStr);
+    maStr[0] = GetSettings().GetLocaleI18nHelper().GetNum( 5, 2 ).AppendAscii("pt");
+    maStr[1] = GetSettings().GetLocaleI18nHelper().GetNum( 250, 2 ).AppendAscii("pt");
+    maStr[2] = GetSettings().GetLocaleI18nHelper().GetNum( 400, 2 ).AppendAscii("pt");
+    maStr[3] = GetSettings().GetLocaleI18nHelper().GetNum( 500, 2 ).AppendAscii("pt");
+    maStr[4] = GetSettings().GetLocaleI18nHelper().GetNum( 110, 2 ).AppendAscii("pt");
+    maStr[5] = GetSettings().GetLocaleI18nHelper().GetNum( 260, 2 ).AppendAscii("pt");
+    maStr[6] = GetSettings().GetLocaleI18nHelper().GetNum( 450, 2 ).AppendAscii("pt");
+    maStr[7] = GetSettings().GetLocaleI18nHelper().GetNum( 505, 2 ).AppendAscii("pt");
+    maStr[8] = GetSettings().GetLocaleI18nHelper().GetNum( 750, 2 ).AppendAscii("pt");
+    maCellLineStyleValueSet.SetUnit(&maStr[0]);
 
-    for(sal_uInt16 i = 1 ; i <= 9 ; i++)
+    for (sal_uInt16 i = 1; i <= CELL_LINE_STYLE_ENTRIES; ++i)
     {
-        maCellLineStyleValueSet.SetItemText(i, mpStr[i-1]);
+        maCellLineStyleValueSet.SetItemText(i, maStr[i-1]);
     }
 
     SetAllNoSel();
diff --git a/sc/source/ui/sidebar/CellLineStyleControl.hxx b/sc/source/ui/sidebar/CellLineStyleControl.hxx
index d7d47da..d2da90c 100644
--- a/sc/source/ui/sidebar/CellLineStyleControl.hxx
+++ b/sc/source/ui/sidebar/CellLineStyleControl.hxx
@@ -32,7 +32,7 @@ private:
     CellAppearancePropertyPanel&       mrCellAppearancePropertyPanel;
     PushButton                         maPushButtonMoreOptions;
     CellLineStyleValueSet              maCellLineStyleValueSet;
-    XubString*                         mpStr;
+    OUString                           maStr[CELL_LINE_STYLE_ENTRIES];
 
     /// bitfield
     bool                               mbVSfocus : 1;
@@ -45,7 +45,6 @@ private:
 
 public:
     CellLineStyleControl(Window* pParent, CellAppearancePropertyPanel& rPanel);
-    virtual ~CellLineStyleControl(void);
 
     void GetFocus();
     void SetLineStyleSelect(sal_uInt16 out, sal_uInt16 in, sal_uInt16 dis);
diff --git a/sc/source/ui/sidebar/CellLineStyleValueSet.cxx b/sc/source/ui/sidebar/CellLineStyleValueSet.cxx
index fc8e5e5..b093503 100644
--- a/sc/source/ui/sidebar/CellLineStyleValueSet.cxx
+++ b/sc/source/ui/sidebar/CellLineStyleValueSet.cxx
@@ -27,7 +27,6 @@ CellLineStyleValueSet::CellLineStyleValueSet( Window* pParent, const ResId& rRes
     nSelItem(0),
     bCusEnable(false)
 {
-    strUnit = new XubString[9];
     SetColCount( 1 );
     SetLineCount( 9);
 }
@@ -35,14 +34,13 @@ CellLineStyleValueSet::CellLineStyleValueSet( Window* pParent, const ResId& rRes
 CellLineStyleValueSet::~CellLineStyleValueSet()
 {
     delete pVDev;
-    delete[] strUnit;
 }
 
-void CellLineStyleValueSet::SetUnit(XubString* str)
+void CellLineStyleValueSet::SetUnit(const OUString* str)
 {
-    for(int i = 0; i < 9; i++)
+    for (int i = 0; i < CELL_LINE_STYLE_ENTRIES; ++i)
     {
-        strUnit[i] = str[i];
+        maStrUnit[i] = str[i];
     }
 }
 
@@ -121,7 +119,7 @@ void CellLineStyleValueSet::UserDraw( const UserDrawEvent& rUDEvt )
 
     pDev->SetFont(aFont);
     Point aStart(aBLPos.X() + nRectWidth * 7 / 9 - 5 , aBLPos.Y() + nRectHeight/6);
-    pDev->DrawText(aStart, strUnit[ nItemId - 1 ]); //can't set TEXT_DRAW_ENDELLIPSIS here, or the text will disapear
+    pDev->DrawText(aStart, maStrUnit[nItemId - 1]); //can't set TEXT_DRAW_ENDELLIPSIS here, or the text will disapear
 
     //draw line
     if( nSelItem ==  nItemId )
diff --git a/sc/source/ui/sidebar/CellLineStyleValueSet.hxx b/sc/source/ui/sidebar/CellLineStyleValueSet.hxx
index ebdfa53..6044b99 100644
--- a/sc/source/ui/sidebar/CellLineStyleValueSet.hxx
+++ b/sc/source/ui/sidebar/CellLineStyleValueSet.hxx
@@ -21,6 +21,8 @@
 #include <svtools/valueset.hxx>
 #include <vcl/image.hxx>
 
+#define CELL_LINE_STYLE_ENTRIES 9
+
 namespace sc { namespace sidebar {
 
 class CellLineStyleValueSet : public ValueSet
@@ -28,14 +30,14 @@ class CellLineStyleValueSet : public ValueSet
 private:
     VirtualDevice*  pVDev;
     sal_uInt16      nSelItem;
-    XubString*      strUnit;
+    OUString        maStrUnit[CELL_LINE_STYLE_ENTRIES];
     Image           imgCus;
     bool            bCusEnable;
 public:
     CellLineStyleValueSet( Window* pParent, const ResId& rResId);
     virtual ~CellLineStyleValueSet();
 
-    void SetUnit(XubString* str);
+    void SetUnit(const OUString* str);
     void SetSelItem(sal_uInt16 nSel);
     sal_uInt16 GetSelItem();
     void SetImage(Image img);


More information about the Libreoffice-commits mailing list