[Libreoffice-commits] .: starmath/inc starmath/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Oct 22 04:09:36 PDT 2012


 starmath/inc/view.hxx      |    4 ++--
 starmath/source/dialog.cxx |   22 +++++++++-------------
 starmath/source/view.cxx   |   10 +++++-----
 3 files changed, 16 insertions(+), 20 deletions(-)

New commits:
commit 2006bc9d5acc80038577bc295b45fa8dcd8766e2
Author: Ivan Timofeev <timofeev.i.s at gmail.com>
Date:   Mon Oct 22 15:08:50 2012 +0400

    String -> OUString
    
    Change-Id: I154c856c2813130aae1af611abcc4bcb4f0d1d13

diff --git a/starmath/inc/view.hxx b/starmath/inc/view.hxx
index 7707c50..f508cf5 100644
--- a/starmath/inc/view.hxx
+++ b/starmath/inc/view.hxx
@@ -228,7 +228,7 @@ class SmViewShell: public SfxViewShell
 
     SmGraphicWindow     aGraphic;
     SmGraphicController aGraphicController;
-    String              StatusText;
+    OUString            aStatusText;
 
     ::com::sun::star::uno:: Reference <
             ::com::sun::star::lang:: XEventListener > xClipEvtLstnr;
@@ -292,7 +292,7 @@ public:
           SmGraphicWindow & GetGraphicWindow()       { return aGraphic; }
     const SmGraphicWindow & GetGraphicWindow() const { return aGraphic; }
 
-    void        SetStatusText(const String& Text);
+    void        SetStatusText(const OUString& rText);
 
     void        ShowError( const SmErrorDesc *pErrorDesc );
     void        NextError();
diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx
index 9561087..c0cc81f 100644
--- a/starmath/source/dialog.cxx
+++ b/starmath/source/dialog.cxx
@@ -35,7 +35,6 @@
 #include <vcl/wall.hxx>
 #include <sfx2/dispatch.hxx>
 #include <sfx2/sfx.hrc>
-#include <tools/string.hxx>
 #include <osl/diagnose.h>
 #include <svx/ucsubset.hxx>
 
@@ -51,8 +50,6 @@
 #include "unomodel.hxx"
 
 
-using ::rtl::OUString;
-
 // Since it's better to set/query the FontStyle via its attributes rather
 // than via the StyleName we create a way to translate
 // Attribute <-> StyleName
@@ -1183,7 +1180,7 @@ void SmShowSymbolSet::Paint(const Rectangle&)
 
         int   nIV   = i - v;
         sal_UCS4 cChar = aSymbol.GetCharacter();
-        String aText( OUString( &cChar, 1 ) );
+        OUString aText(&cChar, 1);
         Size  aSize( GetTextWidth( aText ), GetTextHeight());
 
         DrawText(Point((nIV % nColumns) * nLen + (nLen - aSize.Width()) / 2,
@@ -1383,7 +1380,7 @@ void SmShowSymbol::SetSymbol(const SmSym *pSymbol)
         SetFont(aFont);
 
         sal_UCS4 cChar = pSymbol->GetCharacter();
-        String aText( OUString( &cChar, 1 ) );
+        OUString aText(&cChar, 1);
         SetText( aText );
     }
 
@@ -1505,13 +1502,12 @@ IMPL_LINK( SmSymbolDialog, GetClickHdl, Button *, EMPTYARG pButton )
     const SmSym *pSym = GetSymbol();
     if (pSym)
     {
-        String aText = rtl::OUString('%');
-        aText += pSym->GetName();
-        aText += (sal_Unicode)' ';
+        OUStringBuffer aText;
+        aText.append('%').append(pSym->GetName()).append(' ');
 
         rViewSh.GetViewFrame()->GetDispatcher()->Execute(
                 SID_INSERTSYMBOL, SFX_CALLMODE_STANDARD,
-                new SfxStringItem(SID_INSERTSYMBOL, aText), 0L);
+                new SfxStringItem(SID_INSERTSYMBOL, aText.makeStringAndClear()), 0L);
     }
 
     return 0;
@@ -1709,7 +1705,7 @@ void SmShowChar::SetSymbol( sal_UCS4 cChar, const Font &rFont )
     SetFont(aFont);
     aFont.SetTransparent(true);
 
-    String aText( OUString( &cChar, 1) );
+    OUString aText(&cChar, 1);
     SetText( aText );
 
     Invalidate();
@@ -1920,9 +1916,9 @@ IMPL_LINK_NOARG(SmSymDefineDialog, CharHighlightHdl)
     UpdateButtons();
 
     // display Unicode position as symbol name while iterating over characters
-    const String aHex(rtl::OUString::valueOf(static_cast<sal_Int64>(cChar), 16 ).toAsciiUpperCase());
-    const String aPattern( OUString::createFromAscii( aHex.Len() > 4 ? "Ux000000" : "Ux0000" ) );
-    String aUnicodePos( aPattern.Copy( 0, aPattern.Len() - aHex.Len() ) );
+    const OUString aHex(rtl::OUString::valueOf(static_cast<sal_Int64>(cChar), 16 ).toAsciiUpperCase());
+    const OUString aPattern( (aHex.getLength() > 4) ? OUString("Ux000000") : OUString("Ux0000") );
+    OUString aUnicodePos( aPattern.copy( 0, aPattern.getLength() - aHex.getLength() ) );
     aUnicodePos += aHex;
     aSymbols.SetText( aUnicodePos );
     aSymbolName.SetText( aUnicodePos );
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 2f7e0a7..880b8da 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -1414,11 +1414,11 @@ SmEditWindow *SmViewShell::GetEditWindow()
 }
 
 
-void SmViewShell::SetStatusText(const String& Text)
+void SmViewShell::SetStatusText(const OUString& rText)
 {
     RTL_LOGFILE_CONTEXT( aLog, "starmath: SmViewShell::SetStatusText" );
 
-    StatusText = Text;
+    aStatusText = rText;
     GetViewFrame()->GetBindings().Invalidate(SID_TEXTSTATUS);
 }
 
@@ -1576,7 +1576,7 @@ void SmViewShell::Execute(SfxRequest& rReq)
             if (pWin)
             {
                 GetDoc()->SetText( pWin->GetText() );
-                SetStatusText(String());
+                SetStatusText(OUString());
                 ShowError( 0 );
                 GetDoc()->Repaint();
             }
@@ -1935,7 +1935,7 @@ void SmViewShell::GetState(SfxItemSet &rSet)
 
         case SID_TEXTSTATUS:
             {
-                rSet.Put(SfxStringItem(nWh, StatusText));
+                rSet.Put(SfxStringItem(nWh, aStatusText));
             }
             break;
 
@@ -1970,7 +1970,7 @@ SmViewShell::SmViewShell(SfxViewFrame *pFrame_, SfxViewShell *):
 {
     RTL_LOGFILE_CONTEXT( aLog, "starmath: SmViewShell::SmViewShell" );
 
-    SetStatusText(String());
+    SetStatusText(OUString());
     SetWindow(&aGraphic);
     SfxShell::SetName(rtl::OUString("SmView"));
     SfxShell::SetUndoManager( &GetDoc()->GetEditEngine().GetUndoManager() );


More information about the Libreoffice-commits mailing list