summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2013-08-17 12:53:07 +0200
committerCaolán McNamara <caolanm@redhat.com>2013-08-19 14:19:34 +0000
commitedba90dc39fc3141a8a9e441aa97b46baa4c6ca2 (patch)
tree6692756ca703bc994a05769ef39c09c1e177cf71
parent83d874ec13f6bf260f3f4093fd1613bea23bf27c (diff)
String to OUString + whitespaces, log messages
Change-Id: I76014ecb4dd0f040b6770965cb690cc9839bedb5 Reviewed-on: https://gerrit.libreoffice.org/5474 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sw/inc/fesh.hxx8
-rw-r--r--sw/inc/frmfmt.hxx10
-rw-r--r--sw/inc/ndnotxt.hxx10
-rw-r--r--sw/source/core/access/accnotextframe.cxx2
-rw-r--r--sw/source/core/access/acctextframe.cxx2
-rw-r--r--sw/source/core/doc/doclay.cxx8
-rw-r--r--sw/source/core/docnode/ndnotxt.cxx24
-rw-r--r--sw/source/core/frmedt/fefly1.cxx30
-rw-r--r--sw/source/core/layout/atrfrm.cxx24
9 files changed, 48 insertions, 70 deletions
diff --git a/sw/inc/fesh.hxx b/sw/inc/fesh.hxx
index 7f9499f778c8..43a8a950bae1 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 bf016ee46765..c6e5ebf2ac7e 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 0cb715112406..f9d65c55dfd4 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 1cbf2f6b7ec9..34224f51cec6 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 17e1a42cfbbe..b805e56a3e9a 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 c8cbb27b299a..e2bf37098716 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 2d9559d3d8c3..7711eadabf26 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 4765b7124c64..9f5a55765f88 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 c71b8a07fab3..38f51584c490 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();