diff options
author | Noel Grandin <noel@peralex.com> | 2013-09-09 15:19:26 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-09-11 09:45:34 +0200 |
commit | cfb4463d2afd36ca6d0fbb9e374bf5387fee84df (patch) | |
tree | 4411584498dcf21eff5e71c284e7af1ed6b5489a /sw | |
parent | b044a9535e0fb573fe5d28b0d44c96a3b5db66c2 (diff) |
convert include/editeng/brushitem.hxx from String to OUString
and convert String* to OUString, no need to hold a pointer
to a ref-counted value type.
Change-Id: I79c62979ee8ec0d5e6d2efc50609ad5595571a7d
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/html/htmlgrin.cxx | 8 | ||||
-rw-r--r-- | sw/source/filter/html/htmltabw.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/xml/xmlbrsh.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/xml/xmlexpit.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/docvw/romenu.cxx | 16 | ||||
-rw-r--r-- | sw/source/ui/frmdlg/frmpage.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/shells/grfsh.cxx | 12 | ||||
-rw-r--r-- | sw/source/ui/shells/txtnum.cxx | 10 |
8 files changed, 28 insertions, 34 deletions
diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx index 58097a1c39b9..c93aa2d1a259 100644 --- a/sw/source/filter/html/htmlgrin.cxx +++ b/sw/source/filter/html/htmlgrin.cxx @@ -907,14 +907,14 @@ void SwHTMLParser::InsertBodyOptions() if( bBGColor && !pCSS1Parser->IsBodyBGColorSet() ) { // Hintergrundfarbe aus "BGCOLOR" - String aLink; - if( aBrushItem.GetGraphicLink() ) - aLink = *aBrushItem.GetGraphicLink(); + OUString aLink; + if( !aBrushItem.GetGraphicLink().isEmpty() ) + aLink = aBrushItem.GetGraphicLink(); SvxGraphicPosition ePos = aBrushItem.GetGraphicPos(); aBrushItem.SetColor( aBGColor ); - if( aLink.Len() ) + if( !aLink.isEmpty() ) { aBrushItem.SetGraphicLink( aLink ); aBrushItem.SetGraphicPos( ePos ); diff --git a/sw/source/filter/html/htmltabw.cxx b/sw/source/filter/html/htmltabw.cxx index e55e7e66cece..7b8ae1942d4a 100644 --- a/sw/source/filter/html/htmltabw.cxx +++ b/sw/source/filter/html/htmltabw.cxx @@ -146,7 +146,7 @@ sal_Bool SwHTMLWrtTable::HasTabBackground( const SwTableBox& rBox, /// The table box has a background, if its background color is not "no fill"/ /// "auto fill" or it has a background graphic. bRet = rBrushItem.GetColor() != COL_TRANSPARENT || - rBrushItem.GetGraphicLink() || rBrushItem.GetGraphic(); + !rBrushItem.GetGraphicLink().isEmpty() || rBrushItem.GetGraphic(); } else { @@ -175,7 +175,7 @@ sal_Bool SwHTMLWrtTable::HasTabBackground( const SwTableLine& rLine, /// The table line has a background, if its background color is not "no fill"/ /// "auto fill" or it has a background graphic. sal_Bool bRet = rBrushItem.GetColor() != COL_TRANSPARENT || - rBrushItem.GetGraphicLink() || rBrushItem.GetGraphic(); + !rBrushItem.GetGraphicLink().isEmpty() || rBrushItem.GetGraphic(); if( !bRet ) { diff --git a/sw/source/filter/xml/xmlbrsh.cxx b/sw/source/filter/xml/xmlbrsh.cxx index 4364c341bd72..9d7976d0cb18 100644 --- a/sw/source/filter/xml/xmlbrsh.cxx +++ b/sw/source/filter/xml/xmlbrsh.cxx @@ -119,7 +119,7 @@ SvXMLImportContext *SwXMLBrushItemImportContext::CreateChildContext( if( xmloff::token::IsXMLToken( rLocalName, xmloff::token::XML_BINARY_DATA ) ) { - if( !xBase64Stream.is() && !pItem->GetGraphicLink() ) + if( !xBase64Stream.is() && pItem->GetGraphicLink().isEmpty() ) { const GraphicObject *pGrObj = pItem->GetGraphicObject(); if( !pGrObj || GRAPHIC_NONE == pGrObj->GetType() ) @@ -150,7 +150,7 @@ void SwXMLBrushItemImportContext::EndElement() SvXMLImportItemMapper::PutXMLValue( *pItem, sURL, MID_GRAPHIC_LINK, GetImport().GetMM100UnitConverter() ); } - if( !(pItem->GetGraphicLink() || pItem->GetGraphic() ) ) + if( pItem->GetGraphicLink().isEmpty() && !(pItem->GetGraphic()) ) pItem->SetGraphicPos( GPOS_NONE ); else if( GPOS_NONE == pItem->GetGraphicPos() ) pItem->SetGraphicPos( GPOS_TILED ); diff --git a/sw/source/filter/xml/xmlexpit.cxx b/sw/source/filter/xml/xmlexpit.cxx index f92c675e33f3..c6c5e3a41e02 100644 --- a/sw/source/filter/xml/xmlexpit.cxx +++ b/sw/source/filter/xml/xmlexpit.cxx @@ -987,9 +987,9 @@ bool SvXMLExportItemMapper::QueryXMLValue( case MID_GRAPHIC_FILTER: if( pBrush->GetGraphicPos() != GPOS_NONE && - pBrush->GetGraphicFilter() ) + !pBrush->GetGraphicFilter().isEmpty() ) { - aOut.append( *pBrush->GetGraphicFilter() ); + aOut.append( pBrush->GetGraphicFilter() ); bOk = true; } break; diff --git a/sw/source/ui/docvw/romenu.cxx b/sw/source/ui/docvw/romenu.cxx index c6d3e776933b..9a1c3c718aca 100644 --- a/sw/source/ui/docvw/romenu.cxx +++ b/sw/source/ui/docvw/romenu.cxx @@ -157,7 +157,7 @@ SwReadOnlyPopup::SwReadOnlyPopup( const Point &rDPos, SwView &rV ) : if ( GPOS_NONE != pItem->GetGraphicPos() ) { bEnableBack = sal_True; - if ( pItem->GetGraphicLink() ) + if ( !pItem->GetGraphicLink().isEmpty() ) { if ( aThemeList.empty() ) GalleryExplorer::FillThemeList( aThemeList ); @@ -240,13 +240,13 @@ void SwReadOnlyPopup::Execute( Window* pWin, sal_uInt16 nId ) SfxDispatcher &rDis = *rView.GetViewFrame()->GetDispatcher(); if ( nId >= MN_READONLY_GRAPHICTOGALLERY ) { - String sTmp; + OUString sTmp; sal_uInt16 nSaveId; if ( nId >= MN_READONLY_BACKGROUNDTOGALLERY ) { nId -= MN_READONLY_BACKGROUNDTOGALLERY+3; nSaveId = MN_READONLY_SAVEBACKGROUND; - sTmp = *pItem->GetGraphicLink(); + sTmp = pItem->GetGraphicLink(); } else { @@ -257,7 +257,7 @@ void SwReadOnlyPopup::Execute( Window* pWin, sal_uInt16 nId ) if ( !bGrfToGalleryAsLnk ) sTmp = SaveGraphic( nSaveId ); - if ( sTmp.Len() ) + if ( !sTmp.isEmpty() ) GalleryExplorer::InsertURL( aThemeList[nId], sTmp ); return; @@ -347,15 +347,15 @@ String SwReadOnlyPopup::SaveGraphic( sal_uInt16 nId ) // fish out the graphic's name if ( MN_READONLY_SAVEBACKGROUND == nId ) { - if ( pItem->GetGraphicLink() ) - sGrfName = *pItem->GetGraphicLink(); + if ( !pItem->GetGraphicLink().isEmpty() ) + sGrfName = pItem->GetGraphicLink(); ((SvxBrushItem*)pItem)->SetDoneLink( Link() ); const Graphic *pGrf = pItem->GetGraphic(); if ( pGrf ) { aGraphic = *pGrf; - if ( pItem->GetGraphicLink() ) - sGrfName = *pItem->GetGraphicLink(); + if ( !pItem->GetGraphicLink().isEmpty() ) + sGrfName = pItem->GetGraphicLink(); } else return aEmptyStr; diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx index cae822c4ac83..25803247bd93 100644 --- a/sw/source/ui/frmdlg/frmpage.cxx +++ b/sw/source/ui/frmdlg/frmpage.cxx @@ -2440,9 +2440,9 @@ void SwGrfExtPage::ActivatePage(const SfxItemSet& rSet) if( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_GRAF_GRAPHIC, sal_False, &pItem ) ) { const SvxBrushItem& rBrush = *(SvxBrushItem*)pItem; - if( rBrush.GetGraphicLink() ) + if( !rBrush.GetGraphicLink().isEmpty() ) { - aGrfName = aNewGrfName = *rBrush.GetGraphicLink(); + aGrfName = aNewGrfName = rBrush.GetGraphicLink(); m_pConnectED->SetText( aNewGrfName ); } const Graphic* pGrf = rBrush.GetGraphic(); diff --git a/sw/source/ui/shells/grfsh.cxx b/sw/source/ui/shells/grfsh.cxx index 9e2c7649c0aa..566ecd9bdfde 100644 --- a/sw/source/ui/shells/grfsh.cxx +++ b/sw/source/ui/shells/grfsh.cxx @@ -373,15 +373,15 @@ void SwGrfShell::Execute(SfxRequest &rReq) if( SFX_ITEM_SET == pSet->GetItemState( SID_ATTR_GRAF_GRAPHIC, sal_True, &pItem )) { - if( ((SvxBrushItem*)pItem)->GetGraphicLink() ) - sGrfNm = *((SvxBrushItem*)pItem)->GetGraphicLink(); + if( !((SvxBrushItem*)pItem)->GetGraphicLink().isEmpty() ) + sGrfNm = ((SvxBrushItem*)pItem)->GetGraphicLink(); else - sGrfNm = OUString(); + sGrfNm = ""; - if( ((SvxBrushItem*)pItem)->GetGraphicFilter() ) - sFilterNm = *((SvxBrushItem*)pItem)->GetGraphicFilter(); + if( !((SvxBrushItem*)pItem)->GetGraphicFilter().isEmpty() ) + sFilterNm = ((SvxBrushItem*)pItem)->GetGraphicFilter(); else - sFilterNm = OUString(); + sFilterNm = ""; if( !sGrfNm.isEmpty() ) { diff --git a/sw/source/ui/shells/txtnum.cxx b/sw/source/ui/shells/txtnum.cxx index f55e3f22fdaf..d3b716f15ffd 100644 --- a/sw/source/ui/shells/txtnum.cxx +++ b/sw/source/ui/shells/txtnum.cxx @@ -126,10 +126,7 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq) if(SVX_NUM_BITMAP == aFmt.GetNumberingType()) { const SvxBrushItem* pBrush = aFmt.GetBrush(); - const String* pLinkStr; - if(pBrush && - 0 != (pLinkStr = pBrush->GetGraphicLink()) && - pLinkStr->Len()) + if(pBrush && !pBrush->GetGraphicLink().isEmpty()) aFmt.SetNumberingType(SvxExtNumType(SVX_NUM_BITMAP|LINK_TOKEN)); aRule.SetLevel(i, aFmt, aRule.Get(i) != 0); } @@ -289,10 +286,7 @@ void SwTextShell::ExecSetNumber(SfxRequest &rReq) if(SVX_NUM_BITMAP == aFmt.GetNumberingType()) { const SvxBrushItem* pBrush = aFmt.GetBrush(); - const String* pLinkStr; - if(pBrush && - 0 != (pLinkStr = pBrush->GetGraphicLink()) && - pLinkStr->Len()) + if( pBrush && !pBrush->GetGraphicLink().isEmpty() ) aFmt.SetNumberingType(SvxExtNumType(SVX_NUM_BITMAP|LINK_TOKEN)); aSvxRule.SetLevel(i, aFmt, aSvxRule.Get(i) != 0); } |