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

Matteo Casalin matteo.casalin at yahoo.com
Mon Aug 19 07:20:16 PDT 2013


 sw/inc/fesh.hxx                          |    8 ++++----
 sw/inc/frmfmt.hxx                        |   10 ++++------
 sw/inc/ndnotxt.hxx                       |   10 ++++------
 sw/source/core/access/accnotextframe.cxx |    2 +-
 sw/source/core/access/acctextframe.cxx   |    2 +-
 sw/source/core/doc/doclay.cxx            |    8 ++++----
 sw/source/core/docnode/ndnotxt.cxx       |   24 ++++++++++--------------
 sw/source/core/frmedt/fefly1.cxx         |   30 ++++++++++--------------------
 sw/source/core/layout/atrfrm.cxx         |   24 ++++++++++--------------
 9 files changed, 48 insertions(+), 70 deletions(-)

New commits:
commit edba90dc39fc3141a8a9e441aa97b46baa4c6ca2
Author: Matteo Casalin <matteo.casalin at yahoo.com>
Date:   Sat Aug 17 12:53:07 2013 +0200

    String to OUString + whitespaces, log messages
    
    Change-Id: I76014ecb4dd0f040b6770965cb690cc9839bedb5
    Reviewed-on: https://gerrit.libreoffice.org/5474
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/inc/fesh.hxx b/sw/inc/fesh.hxx
index 7f9499f..43a8a95 100644
--- a/sw/inc/fesh.hxx
+++ b/sw/inc/fesh.hxx
@@ -338,10 +338,10 @@ public:
     const Graphic *GetGrfAtPos( const Point &rDocPos,
                                 String &rName, sal_Bool &rbLink ) const;
 
-    const String GetObjTitle() const;
-    void SetObjTitle( const String& rTitle );
-    const String GetObjDescription() const;
-    void SetObjDescription( const String& rDescription );
+    OUString GetObjTitle() const;
+    void SetObjTitle( const OUString& rTitle );
+    OUString GetObjDescription() const;
+    void SetObjDescription( const OUString& rDescription );
 
 
     sal_Bool IsFrmSelected() const;
diff --git a/sw/inc/frmfmt.hxx b/sw/inc/frmfmt.hxx
index bf016ee..c6e5ebf 100644
--- a/sw/inc/frmfmt.hxx
+++ b/sw/inc/frmfmt.hxx
@@ -175,12 +175,10 @@ public:
 
     virtual bool GetInfo( SfxPoolItem& rInfo ) const;
 
-    const String GetObjTitle() const;
-    void SetObjTitle( const String& rTitle,
-                      bool bBroadcast = false );
-    const String GetObjDescription() const;
-    void SetObjDescription( const String& rDescription,
-                            bool bBroadcast = false );
+    OUString GetObjTitle() const;
+    void SetObjTitle( const OUString& rTitle, bool bBroadcast = false );
+    OUString GetObjDescription() const;
+    void SetObjDescription( const OUString& rDescription, bool bBroadcast = false );
 
     /** SwFlyFrmFmt::IsBackgroundTransparent
 
diff --git a/sw/inc/ndnotxt.hxx b/sw/inc/ndnotxt.hxx
index 0cb7151..f9d65c5 100644
--- a/sw/inc/ndnotxt.hxx
+++ b/sw/inc/ndnotxt.hxx
@@ -60,12 +60,10 @@ public:
     virtual sal_Bool SavePersistentData();
     virtual sal_Bool RestorePersistentData();
 
-    const String GetTitle() const;
-    void SetTitle( const String& rTitle,
-                   bool bBroadcast = false );
-    const String GetDescription() const;
-    void SetDescription( const String& rDescription,
-                         bool bBroadcast = false );
+    OUString GetTitle() const;
+    void SetTitle( const OUString& rTitle, bool bBroadcast = false );
+    OUString GetDescription() const;
+    void SetDescription( const OUString& rDescription, bool bBroadcast = false );
 
     void               SetContour( const PolyPolygon *pPoly,
                                    sal_Bool bAutomatic = sal_False );
diff --git a/sw/source/core/access/accnotextframe.cxx b/sw/source/core/access/accnotextframe.cxx
index 1cbf2f6..34224f5 100644
--- a/sw/source/core/access/accnotextframe.cxx
+++ b/sw/source/core/access/accnotextframe.cxx
@@ -110,7 +110,7 @@ void SwAccessibleNoTextFrame::Modify( const SfxPoolItem* pOld, const SfxPoolItem
             aEvent.NewValue <<= msTitle;
             FireAccessibleEvent( aEvent );
 
-            if ( pNd->GetDescription().Len() != 0 )
+            if ( !pNd->GetDescription().isEmpty() )
             {
                 break;
             }
diff --git a/sw/source/core/access/acctextframe.cxx b/sw/source/core/access/acctextframe.cxx
index 17e1a42..b805e56 100644
--- a/sw/source/core/access/acctextframe.cxx
+++ b/sw/source/core/access/acctextframe.cxx
@@ -105,7 +105,7 @@ void SwAccessibleTextFrame::Modify( const SfxPoolItem* pOld, const SfxPoolItem *
 
             const SwFlyFrmFmt* pFlyFrmFmt =
                             dynamic_cast<const SwFlyFrmFmt*>( pFlyFrm->GetFmt() );
-            if ( pFlyFrmFmt->GetObjDescription().Len() != 0 )
+            if ( !pFlyFrmFmt->GetObjDescription().isEmpty() )
             {
                 break;
             }
diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index c8cbb27..e2bf370 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -1214,12 +1214,12 @@ lcl_InsertLabel(SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl,
                 // <title> and <description> attributes are lost when calling <DelFrms()>.
                 // Thus, keep them and restore them after the calling <MakeFrms()>
                 const bool bIsSwFlyFrmFmtInstance( dynamic_cast<SwFlyFrmFmt*>(pOldFmt) != 0 );
-                const String sTitle( bIsSwFlyFrmFmtInstance
+                const OUString sTitle( bIsSwFlyFrmFmtInstance
                                      ? static_cast<SwFlyFrmFmt*>(pOldFmt)->GetObjTitle()
-                                     : String() );
-                const String sDescription( bIsSwFlyFrmFmtInstance
+                                     : OUString() );
+                const OUString sDescription( bIsSwFlyFrmFmtInstance
                                            ? static_cast<SwFlyFrmFmt*>(pOldFmt)->GetObjDescription()
-                                           : String() );
+                                           : OUString() );
                 pOldFmt->DelFrms();
 
                 pNewFmt = rDoc.MakeFlyFrmFmt( rDoc.GetUniqueFrameName(),
diff --git a/sw/source/core/docnode/ndnotxt.cxx b/sw/source/core/docnode/ndnotxt.cxx
index 2d9559d..7711ead 100644
--- a/sw/source/core/docnode/ndnotxt.cxx
+++ b/sw/source/core/docnode/ndnotxt.cxx
@@ -263,12 +263,11 @@ Graphic SwNoTxtNode::GetGraphic() const
 }
 
 // #i73249#
-void SwNoTxtNode::SetTitle( const String& rTitle, bool bBroadcast )
+void SwNoTxtNode::SetTitle( const OUString& rTitle, bool bBroadcast )
 {
     // Title attribute of <SdrObject> replaces own AlternateText attribute
     SwFlyFrmFmt* pFlyFmt = dynamic_cast<SwFlyFrmFmt*>(GetFlyFmt());
-    OSL_ENSURE( pFlyFmt,
-            "<SwNoTxtNode::SetTitle(..)> - missing <SwFlyFrmFmt> instance" );
+    OSL_ENSURE( pFlyFmt, "<SwNoTxtNode::SetTitle(..)> - missing <SwFlyFrmFmt> instance" );
     if ( !pFlyFmt )
     {
         return;
@@ -277,24 +276,22 @@ void SwNoTxtNode::SetTitle( const String& rTitle, bool bBroadcast )
     pFlyFmt->SetObjTitle( rTitle, bBroadcast );
 }
 
-const String SwNoTxtNode::GetTitle() const
+OUString SwNoTxtNode::GetTitle() const
 {
     const SwFlyFrmFmt* pFlyFmt = dynamic_cast<const SwFlyFrmFmt*>(GetFlyFmt());
-    OSL_ENSURE( pFlyFmt,
-            "<SwNoTxtNode::GetTitle(..)> - missing <SwFlyFrmFmt> instance" );
+    OSL_ENSURE( pFlyFmt, "<SwNoTxtNode::GetTitle(..)> - missing <SwFlyFrmFmt> instance" );
     if ( !pFlyFmt )
     {
-        return aEmptyStr;
+        return OUString();
     }
 
     return pFlyFmt->GetObjTitle();
 }
 
-void SwNoTxtNode::SetDescription( const String& rDescription, bool bBroadcast )
+void SwNoTxtNode::SetDescription( const OUString& rDescription, bool bBroadcast )
 {
     SwFlyFrmFmt* pFlyFmt = dynamic_cast<SwFlyFrmFmt*>(GetFlyFmt());
-    OSL_ENSURE( pFlyFmt,
-            "<SwNoTxtNode::SetDescription(..)> - missing <SwFlyFrmFmt> instance" );
+    OSL_ENSURE( pFlyFmt, "<SwNoTxtNode::SetDescription(..)> - missing <SwFlyFrmFmt> instance" );
     if ( !pFlyFmt )
     {
         return;
@@ -303,14 +300,13 @@ void SwNoTxtNode::SetDescription( const String& rDescription, bool bBroadcast )
     pFlyFmt->SetObjDescription( rDescription, bBroadcast );
 }
 
-const String SwNoTxtNode::GetDescription() const
+OUString SwNoTxtNode::GetDescription() const
 {
     const SwFlyFrmFmt* pFlyFmt = dynamic_cast<const SwFlyFrmFmt*>(GetFlyFmt());
-    OSL_ENSURE( pFlyFmt,
-            "<SwNoTxtNode::GetDescription(..)> - missing <SwFlyFrmFmt> instance" );
+    OSL_ENSURE( pFlyFmt, "<SwNoTxtNode::GetDescription(..)> - missing <SwFlyFrmFmt> instance" );
     if ( !pFlyFmt )
     {
-        return aEmptyStr;
+        return OUString();
     }
 
     return pFlyFmt->GetObjDescription();
diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx
index 4765b71..9f5a557 100644
--- a/sw/source/core/frmedt/fefly1.cxx
+++ b/sw/source/core/frmedt/fefly1.cxx
@@ -2007,10 +2007,8 @@ void SwFEShell::GetConnectableFrmFmts(SwFrmFmt & rFmt,
 }
 
 // #i73249#
-const String SwFEShell::GetObjTitle() const
+OUString SwFEShell::GetObjTitle() const
 {
-    String aTitle;
-
     if ( Imp()->HasDrawView() )
     {
         const SdrMarkList *pMrkList = &Imp()->GetDrawView()->GetMarkedObjectList();
@@ -2020,19 +2018,16 @@ const String SwFEShell::GetObjTitle() const
             const SwFrmFmt* pFmt = FindFrmFmt( pObj );
             if ( pFmt->Which() == RES_FLYFRMFMT )
             {
-                aTitle = dynamic_cast<const SwFlyFrmFmt*>(pFmt)->GetObjTitle();
-            }
-            else
-            {
-                aTitle = pObj->GetTitle();
+                return dynamic_cast<const SwFlyFrmFmt*>(pFmt)->GetObjTitle();
             }
+            return pObj->GetTitle();
         }
     }
 
-    return aTitle;
+    return OUString();
 }
 
-void SwFEShell::SetObjTitle( const String& rTitle )
+void SwFEShell::SetObjTitle( const OUString& rTitle )
 {
     if ( Imp()->HasDrawView() )
     {
@@ -2054,10 +2049,8 @@ void SwFEShell::SetObjTitle( const String& rTitle )
     }
 }
 
-const String SwFEShell::GetObjDescription() const
+OUString SwFEShell::GetObjDescription() const
 {
-    String aDescription;
-
     if ( Imp()->HasDrawView() )
     {
         const SdrMarkList *pMrkList = &Imp()->GetDrawView()->GetMarkedObjectList();
@@ -2067,19 +2060,16 @@ const String SwFEShell::GetObjDescription() const
             const SwFrmFmt* pFmt = FindFrmFmt( pObj );
             if ( pFmt->Which() == RES_FLYFRMFMT )
             {
-                aDescription = dynamic_cast<const SwFlyFrmFmt*>(pFmt)->GetObjDescription();
-            }
-            else
-            {
-                aDescription = pObj->GetDescription();
+                return dynamic_cast<const SwFlyFrmFmt*>(pFmt)->GetObjDescription();
             }
+            return pObj->GetDescription();
         }
     }
 
-    return aDescription;
+    return OUString();
 }
 
-void SwFEShell::SetObjDescription( const String& rDescription )
+void SwFEShell::SetObjDescription( const OUString& rDescription )
 {
     if ( Imp()->HasDrawView() )
     {
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index c71b8a0..38f5158 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -2846,11 +2846,10 @@ bool SwFlyFrmFmt::GetInfo( SfxPoolItem& rInfo ) const
 }
 
 // #i73249#
-void SwFlyFrmFmt::SetObjTitle( const String& rTitle, bool bBroadcast )
+void SwFlyFrmFmt::SetObjTitle( const OUString& rTitle, bool bBroadcast )
 {
     SdrObject* pMasterObject = FindSdrObject();
-    OSL_ENSURE( pMasterObject,
-            "<SwNoTxtNode::SetObjTitle(..)> - missing <SdrObject> instance" );
+    OSL_ENSURE( pMasterObject, "<SwFlyFrmFmt::SetObjTitle(..)> - missing <SdrObject> instance" );
     if ( !pMasterObject )
     {
         return;
@@ -2869,24 +2868,22 @@ void SwFlyFrmFmt::SetObjTitle( const String& rTitle, bool bBroadcast )
     }
 }
 
-const String SwFlyFrmFmt::GetObjTitle() const
+OUString SwFlyFrmFmt::GetObjTitle() const
 {
     const SdrObject* pMasterObject = FindSdrObject();
-    OSL_ENSURE( pMasterObject,
-            "<SwFlyFrmFmt::GetObjTitle(..)> - missing <SdrObject> instance" );
+    OSL_ENSURE( pMasterObject, "<SwFlyFrmFmt::GetObjTitle(..)> - missing <SdrObject> instance" );
     if ( !pMasterObject )
     {
-        return aEmptyStr;
+        return OUString();
     }
 
     return pMasterObject->GetTitle();
 }
 
-void SwFlyFrmFmt::SetObjDescription( const String& rDescription, bool bBroadcast )
+void SwFlyFrmFmt::SetObjDescription( const OUString& rDescription, bool bBroadcast )
 {
     SdrObject* pMasterObject = FindSdrObject();
-    OSL_ENSURE( pMasterObject,
-            "<SwFlyFrmFmt::SetDescription(..)> - missing <SdrObject> instance" );
+    OSL_ENSURE( pMasterObject, "<SwFlyFrmFmt::SetDescription(..)> - missing <SdrObject> instance" );
     if ( !pMasterObject )
     {
         return;
@@ -2905,14 +2902,13 @@ void SwFlyFrmFmt::SetObjDescription( const String& rDescription, bool bBroadcast
     }
 }
 
-const String SwFlyFrmFmt::GetObjDescription() const
+OUString SwFlyFrmFmt::GetObjDescription() const
 {
     const SdrObject* pMasterObject = FindSdrObject();
-    OSL_ENSURE( pMasterObject,
-            "<SwNoTxtNode::GetDescription(..)> - missing <SdrObject> instance" );
+    OSL_ENSURE( pMasterObject, "<SwFlyFrmFmt::GetDescription(..)> - missing <SdrObject> instance" );
     if ( !pMasterObject )
     {
-        return aEmptyStr;
+        return OUString();
     }
 
     return pMasterObject->GetDescription();


More information about the Libreoffice-commits mailing list