[Libreoffice-commits] core.git: sw/source

Matteo Casalin matteo.casalin at yahoo.com
Wed Aug 14 14:05:51 PDT 2013


 sw/source/ui/inc/insfnote.hxx  |   13 ++++++-------
 sw/source/ui/misc/insfnote.cxx |   19 +++++++++----------
 2 files changed, 15 insertions(+), 17 deletions(-)

New commits:
commit cb34d10ec875cb538d9d8d41faa995f7469ae89f
Author: Matteo Casalin <matteo.casalin at yahoo.com>
Date:   Wed Aug 14 09:53:04 2013 +0200

    String to OUString + prefix for data member
    
    Change-Id: I11c106cedc3346dbe129fe7c4cecf59f559680aa
    Reviewed-on: https://gerrit.libreoffice.org/5405
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    Tested-by: Michael Stahl <mstahl at redhat.com>

diff --git a/sw/source/ui/inc/insfnote.hxx b/sw/source/ui/inc/insfnote.hxx
index 71ee27a..cb65e52 100644
--- a/sw/source/ui/inc/insfnote.hxx
+++ b/sw/source/ui/inc/insfnote.hxx
@@ -16,8 +16,8 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
-#ifndef _INSFNOTE_HXX
-#define _INSFNOTE_HXX
+#ifndef INSFNOTE_HXX
+#define INSFNOTE_HXX
 
 #include <svx/stddlg.hxx>
 
@@ -35,7 +35,7 @@ class SwInsFootNoteDlg: public SvxStandardDialog
     SwWrtShell     &rSh;
 
     // everything for the character(s)
-    String          aFontName;
+    OUString        m_aFontName;
     CharSet         eCharSet;
     sal_Bool        bExtCharAvailable;
     sal_Bool        bEdit;
@@ -70,14 +70,13 @@ public:
 
     CharSet         GetCharSet() { return eCharSet; }
     sal_Bool        IsExtCharAvailable() { return bExtCharAvailable; }
-    String          GetFontName() { return aFontName; }
+    OUString        GetFontName() { return m_aFontName; }
     sal_Bool        IsEndNote() { return m_pEndNoteBtn->IsChecked(); }
-    String          GetStr()
+    OUString        GetStr()
                     {
                         if ( m_pNumberCharBtn->IsChecked() )
                             return m_pNumberCharEdit->GetText();
-                        else
-                            return String();
+                        return OUString();
                     }
 };
 
diff --git a/sw/source/ui/misc/insfnote.cxx b/sw/source/ui/misc/insfnote.cxx
index ad8327e..8a848c3 100644
--- a/sw/source/ui/misc/insfnote.cxx
+++ b/sw/source/ui/misc/insfnote.cxx
@@ -46,7 +46,7 @@ static sal_Bool bFootnote = sal_True;
 
 void SwInsFootNoteDlg::Apply()
 {
-    String aStr;
+    OUString aStr;
 
     if ( m_pNumberCharBtn->IsChecked() )
         aStr = m_pNumberCharEdit->GetText();
@@ -65,7 +65,7 @@ void SwInsFootNoteDlg::Apply()
             SfxItemSet aSet( rSh.GetAttrPool(), RES_CHRATR_FONT, RES_CHRATR_FONT );
             rSh.GetCurAttr( aSet );
             SvxFontItem &rFont = (SvxFontItem &) aSet.Get( RES_CHRATR_FONT );
-            SvxFontItem aFont( rFont.GetFamily(), aFontName,
+            SvxFontItem aFont( rFont.GetFamily(), m_aFontName,
                                rFont.GetStyleName(), rFont.GetPitch(),
                                eCharSet, RES_CHRATR_FONT );
             aSet.Put( aFont );
@@ -129,14 +129,13 @@ IMPL_LINK_NOARG(SwInsFootNoteDlg, NumberExtCharHdl)
         SFX_ITEMSET_ARG( pDlg->GetOutputItemSet(), pFontItem, SvxFontItem, SID_ATTR_CHAR_FONT, sal_False );
         if ( pItem )
         {
-            String sExtChars(pItem->GetValue());
-            m_pNumberCharEdit->SetText( sExtChars );
+            m_pNumberCharEdit->SetText( pItem->GetValue() );
 
             if ( pFontItem )
             {
-                aFontName = pFontItem->GetFamilyName();
+                m_aFontName = pFontItem->GetFamilyName();
                 eCharSet  = pFontItem->GetCharSet();
-                Font aFont( aFontName, pFontItem->GetStyleName(), m_pNumberCharEdit->GetFont().GetSize() );
+                Font aFont( m_aFontName, pFontItem->GetStyleName(), m_pNumberCharEdit->GetFont().GetSize() );
                 aFont.SetCharSet( pFontItem->GetCharSet() );
                 aFont.SetPitch( pFontItem->GetPitch() );
                 m_pNumberCharEdit->SetFont( aFont  );
@@ -216,7 +215,7 @@ SwInsFootNoteDlg::~SwInsFootNoteDlg()
 void SwInsFootNoteDlg::Init()
 {
     SwFmtFtn aFtnNote;
-    String sNumStr;
+    OUString sNumStr;
     Font aFont;
     bExtCharAvailable = sal_False;
 
@@ -234,9 +233,9 @@ void SwInsFootNoteDlg::Init()
             const SvxFontItem &rFont = (SvxFontItem &) aSet.Get( RES_CHRATR_FONT );
 
             aFont = m_pNumberCharEdit->GetFont();
-            aFontName = rFont.GetFamilyName();
+            m_aFontName = rFont.GetFamilyName();
             eCharSet = rFont.GetCharSet();
-            aFont.SetName(aFontName);
+            aFont.SetName(m_aFontName);
             aFont.SetCharSet(eCharSet);
             bExtCharAvailable = sal_True;
             rSh.Left( CRSR_SKIP_CHARS, sal_False, 1, sal_False );
@@ -245,7 +244,7 @@ void SwInsFootNoteDlg::Init()
     }
     m_pNumberCharEdit->SetFont(aFont);
 
-    bool bNumChar = sNumStr.Len() != 0;
+    const bool bNumChar = !sNumStr.isEmpty();
 
     m_pNumberCharEdit->SetText(sNumStr);
     m_pNumberCharBtn->Check(bNumChar);


More information about the Libreoffice-commits mailing list