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

2013-09-19 Thread Noel Grandin
 sw/inc/swtable.hxx  |6 +++---
 sw/inc/swtblfmt.hxx |6 +++---
 sw/inc/tblafmt.hxx  |4 ++--
 sw/inc/txtfld.hxx   |4 ++--
 sw/inc/undobj.hxx   |2 +-
 sw/inc/unochart.hxx |6 +++---
 sw/inc/unosrch.hxx  |4 ++--
 sw/inc/unotbl.hxx   |6 +++---
 sw/inc/unotxdoc.hxx |   26 +-
 sw/source/core/doc/docchart.cxx |4 ++--
 sw/source/core/table/swtable.cxx|4 ++--
 sw/source/core/undo/undobj.cxx  |2 +-
 sw/source/core/unocore/unochart.cxx |6 +++---
 sw/source/core/unocore/unotbl.cxx   |6 +++---
 sw/source/ui/uno/unotxdoc.cxx   |   18 +-
 15 files changed, 52 insertions(+), 52 deletions(-)

New commits:
commit d84b974290c494e643a83207a9aac16fc5f683bf
Author: Noel Grandin 
Date:   Thu Sep 19 08:02:20 2013 +0200

convert sw/inc/swtable.hxx from String to OUString

Change-Id: I1f5c2c612589fd86567ee9d3e09ecd5bff74ce25

diff --git a/sw/inc/swtable.hxx b/sw/inc/swtable.hxx
index 312ddd1..83c153b 100644
--- a/sw/inc/swtable.hxx
+++ b/sw/inc/swtable.hxx
@@ -269,7 +269,7 @@ public:
 // #i80314#
 // add 2nd parameter in order to control validation check in called method
 // <_GetBoxNum(..)>
-const SwTableBox* GetTblBox( const String& rName,
+const SwTableBox* GetTblBox( const OUString& rName,
  const bool bPerformValidCheck = false ) const;
 // Copy selected boxes to another document.
 bool MakeCopy( SwDoc*, const SwPosition&, const SwSelBoxes&,
@@ -293,7 +293,7 @@ public:
 bool IsTblComplex() const;
 
 // Returns true if table or selection is balanced.
-bool IsTblComplexForChart( const String& rSel ) const;
+bool IsTblComplexForChart( const OUString& rSel ) const;
 
 // Search all content-bearing boxes of the base line on which this box 
stands.
 // rBoxes as a return value for immediate use.
@@ -432,7 +432,7 @@ public:
 bool bOvrTblLns=true ) const;
 // Return name of this box. It is determined dynamically and
 // is calculated from the position in the lines/boxes/table.
-String GetName() const;
+OUString GetName() const;
 // Return "value" of box (for calculating in table).
 double GetValue( SwTblCalcPara& rPara ) const;
 
diff --git a/sw/source/core/doc/docchart.cxx b/sw/source/core/doc/docchart.cxx
index 9c6a68e..6eacb57 100644
--- a/sw/source/core/doc/docchart.cxx
+++ b/sw/source/core/doc/docchart.cxx
@@ -52,10 +52,10 @@ void SwTable::UpdateCharts() const
 GetFrmFmt()->GetDoc()->UpdateCharts( GetFrmFmt()->GetName() );
 }
 
-bool SwTable::IsTblComplexForChart( const String& rSelection ) const
+bool SwTable::IsTblComplexForChart( const OUString& rSelection ) const
 {
 const SwTableBox* pSttBox, *pEndBox;
-if( 2 < rSelection.Len() )
+if( 2 < rSelection.getLength() )
 {
 // Remove brackets at the beginning and from the end
 String sBox( rSelection );
diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx
index 1091449..c424822 100644
--- a/sw/source/core/table/swtable.cxx
+++ b/sw/source/core/table/swtable.cxx
@@ -1414,7 +1414,7 @@ sal_uInt16 SwTable::_GetBoxNum( OUString& rStr, sal_Bool 
bFirstPart,
 
 // #i80314#
 // add 2nd parameter and its handling
-const SwTableBox* SwTable::GetTblBox( const String& rName,
+const SwTableBox* SwTable::GetTblBox( const OUString& rName,
   const bool bPerformValidCheck ) const
 {
 const SwTableBox* pBox = 0;
@@ -1895,7 +1895,7 @@ void sw_GetTblBoxColStr( sal_uInt16 nCol, String& rNm )
 } while( 1 );
 }
 
-String SwTableBox::GetName() const
+OUString SwTableBox::GetName() const
 {
 if( !pSttNd )   // box without content?
 {
diff --git a/sw/source/core/unocore/unotbl.cxx 
b/sw/source/core/unocore/unotbl.cxx
index cb0a359..e99879a 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -571,7 +571,7 @@ static void lcl_InspectLines(SwTableLines& rLines, 
std::vector& rAllN
 for(sal_uInt16 j = 0; j < rBoxes.size(); j++)
 {
 SwTableBox* pBox = rBoxes[j];
-if(pBox->GetName().Len() && pBox->getRowSpan() > 0 )
+if(!pBox->GetName().isEmpty() && pBox->getRowSpan() > 0 )
 rAllNames.push_back( new OUString(pBox->GetName()) );
 SwTableLines& rBoxLines = pBox->GetTabLines();
 if(!rBoxLines.empty())
commit 04caa8bb956e8366f96acfaa9d0c271083978812
Author: Noel Grandin 
Date:   Wed Sep 18 14:33:25 2013 +0200

convert sw/inc/swtblfmt.hxx from String to OUString

Change-Id: I00f7fdaa33bc8b5ede2e3a7f1d1d938b62cc0646

diff --git a/sw/inc/swtblfmt.hxx b/sw/inc/swtblfmt.hxx
index a54faa49..26ea0d8 100644
--- a/sw/inc/swtblfmt.hxx
+++ b/sw/inc/swtblfmt.hxx
@@ -32,7 +32,7 @@ p

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

2013-10-05 Thread Matteo Casalin
 sw/inc/ndgrf.hxx  |   11 ---
 sw/source/core/doc/docedt.cxx |   53 +++---
 sw/source/core/graphic/ndgrf.cxx  |  137 ++
 sw/source/filter/xml/xmltexte.cxx |3 
 sw/source/ui/dochdl/swdtflvr.cxx  |9 +-
 sw/source/ui/inc/wrtsh.hxx|2 
 sw/source/ui/wrtsh/wrtsh3.cxx |6 -
 7 files changed, 108 insertions(+), 113 deletions(-)

New commits:
commit 849352c724426c06dea98c9b3df10ef629f04942
Author: Matteo Casalin 
Date:   Sat Oct 5 19:41:51 2013 +0200

Correct prefix for OUString + constify

Change-Id: I4662fa9c63717c57ccfb6bcee685c4d47c715eff

diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx
index 1469568..e569613 100644
--- a/sw/source/core/graphic/ndgrf.cxx
+++ b/sw/source/core/graphic/ndgrf.cxx
@@ -472,28 +472,28 @@ struct StreamAndStorageNames
 OUString sStorage;
 };
 
-StreamAndStorageNames lcl_GetStreamStorageNames( OUString aUserData )
+StreamAndStorageNames lcl_GetStreamStorageNames( const OUString sUserData )
 {
 StreamAndStorageNames aNames;
-if( aUserData.isEmpty() )
+if( sUserData.isEmpty() )
 return aNames;
 
 const OUString aProt( "vnd.sun.star.Package:" );
-if (aUserData.startsWith(aProt))
+if (sUserData.startsWith(aProt))
 {
 // 6.0 (XML) Package
-const sal_Int32 nPos = aUserData.indexOf('/');
+const sal_Int32 nPos = sUserData.indexOf('/');
 if (nPos<0)
 {
-aNames.sStream = aUserData.copy(aProt.getLength());
+aNames.sStream = sUserData.copy(aProt.getLength());
 }
 else
 {
 sal_Int32 nPathStart = aProt.getLength();
-if (aUserData.startsWith("./"))
+if (sUserData.startsWith("./"))
 nPathStart += 2;
-aNames.sStorage = aUserData.copy( nPathStart, nPos-nPathStart );
-aNames.sStream = aUserData.copy( nPos+1 );
+aNames.sStorage = sUserData.copy( nPathStart, nPos-nPathStart );
+aNames.sStream = sUserData.copy( nPos+1 );
 }
 }
 else
commit 7770eb9bd639312b166a575c2e64c6db5ac5d44b
Author: Matteo Casalin 
Date:   Sat Oct 5 17:55:58 2013 +0200

String to OUString + better names

Change-Id: I811789b9fec38d7745bcb57659aa5e3dc59f

diff --git a/sw/inc/ndgrf.hxx b/sw/inc/ndgrf.hxx
index d99c1cd..d41364a 100644
--- a/sw/inc/ndgrf.hxx
+++ b/sw/inc/ndgrf.hxx
@@ -104,7 +104,7 @@ class SW_DLLPUBLIC SwGrfNode: public SwNoTxtNode
 */
 SvStream* _GetStreamForEmbedGrf(
 const ::com::sun::star::uno::Reference< 
::com::sun::star::embed::XStorage >& _refPics,
-const String& rStrmName ) const;
+const OUString& rStreamName ) const;
 
 /** helper method to get a substorage of the document storage for readonly 
access.
 
diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx
index 439d992..1469568 100644
--- a/sw/source/core/graphic/ndgrf.cxx
+++ b/sw/source/core/graphic/ndgrf.cxx
@@ -870,37 +870,36 @@ uno::Reference< embed::XStorage > 
SwGrfNode::_GetDocSubstorageOrRoot( const Stri
 */
 SvStream* SwGrfNode::_GetStreamForEmbedGrf(
 const uno::Reference< embed::XStorage >& _refPics,
-const String& rStrmName ) const
+const OUString& rStreamName ) const
 {
 SvStream* pStrm( 0L );
 
-if( _refPics.is() && rStrmName.Len() )
+if( _refPics.is() && !rStreamName.isEmpty() )
 {
-String _aStrmName(rStrmName);
+OUString sStreamName(rStreamName);
 // If stream doesn't exist in the storage, try access the graphic file 
by
 // re-generating its name.
 // A save action can have changed the filename of the embedded graphic,
 // because a changed unique ID of the graphic is calculated.
 // --> recursive calls of  have to be avoided.
 // Thus, use local static boolean to assure this.
-if ( !_refPics->hasByName( _aStrmName ) ||
-   !_refPics->isStreamElement( _aStrmName ) )
+if ( !_refPics->hasByName( sStreamName ) ||
+ !_refPics->isStreamElement( sStreamName ) )
 {
-xub_StrLen nExtPos = _aStrmName.Search( '.' );
-String aExtStr = _aStrmName.Copy( nExtPos );
 if ( GetGrfObj().GetType() != GRAPHIC_NONE )
 {
-_aStrmName = OStringToOUString(GetGrfObj().GetUniqueID(),
-RTL_TEXTENCODING_ASCII_US);
-_aStrmName += aExtStr;
+const sal_Int32 nExtPos = sStreamName.indexOf('.');
+const OUString aExtStr = (nExtPos>=0) ? sStreamName.copy( 
nExtPos ) : OUString();
+sStreamName = OStringToOUString(GetGrfObj().GetUniqueID(),
+RTL_TEXTENCODING_ASCII_US) + aExtStr;
 }
 }
 
 // assure that graphic file exist in the storage.
-if ( _refPics->hasByName(