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

Caolán McNamara caolanm at redhat.com
Fri Feb 22 03:57:23 PST 2013


 sw/source/core/doc/docfmt.cxx    |    2 +-
 sw/source/core/doc/docnum.cxx    |    2 +-
 sw/source/core/docnode/node.cxx  |    4 ++--
 sw/source/core/txtnode/ndtxt.cxx |    8 ++++----
 sw/source/filter/ww8/wrtww8.cxx  |    8 +++++---
 sw/source/filter/ww8/ww8atr.cxx  |    4 ++--
 sw/source/filter/xml/swxml.cxx   |    2 +-
 sw/source/ui/dialog/regionsw.cxx |    6 ++++--
 sw/source/ui/shells/textsh1.cxx  |    4 ++--
 sw/source/ui/shells/txtattr.cxx  |    2 +-
 sw/source/ui/uiview/view2.cxx    |    2 +-
 sw/source/ui/utlui/attrdesc.cxx  |    2 +-
 12 files changed, 25 insertions(+), 21 deletions(-)

New commits:
commit 753628eec23f4b4ba037953f05c1430b5108bf15
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Feb 22 11:49:40 2013 +0000

    fix sw build
    
    Change-Id: I2d42420307f359b30cce5422629689bdc964ebd9

diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index 6355ec2..1a90245 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -226,7 +226,7 @@ static bool lcl_RstAttr( const SwNodePtr& rpNd, void* pArgs )
                     break;
                     case RES_PARATR_NUMRULE:
                     {
-                        bSave = 0 != ((SwNumRuleItem*)pItem)->GetValue().Len();
+                        bSave = !((SwNumRuleItem*)pItem)->GetValue().isEmpty();
                     }
                     break;
                     case RES_PARATR_OUTLINELEVEL:               //#outline level,add by zhaojianwei
diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx
index 5b16808..c4a3c1f 100644
--- a/sw/source/core/doc/docnum.cxx
+++ b/sw/source/core/doc/docnum.cxx
@@ -159,7 +159,7 @@ void SwDoc::PropagateOutlineRule()
             const SwNumRuleItem & rCollRuleItem = pColl->GetNumRule( sal_False );
 
             // Check on document setting OUTLINE_LEVEL_YIELDS_OUTLINE_RULE no longer needed.
-            if ( rCollRuleItem.GetValue().Len() == 0 )
+            if ( rCollRuleItem.GetValue().isEmpty() )
             {
                 SwNumRule * pMyOutlineRule = GetOutlineNumRule();
 
diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index 3c77fbb..cca5729 100644
--- a/sw/source/core/docnode/node.cxx
+++ b/sw/source/core/docnode/node.cxx
@@ -1041,7 +1041,7 @@ sal_Bool SwCntntNode::InvalidateNumRule()
     const SfxPoolItem* pItem;
     if( GetNodes().IsDocNodes() &&
         0 != ( pItem = GetNoCondAttr( RES_PARATR_NUMRULE, sal_True )) &&
-        ((SwNumRuleItem*)pItem)->GetValue().Len() &&
+        !((SwNumRuleItem*)pItem)->GetValue().isEmpty() &&
         0 != (pRule = GetDoc()->FindNumRulePtr(
                                 ((SwNumRuleItem*)pItem)->GetValue() ) ) )
     {
@@ -1405,7 +1405,7 @@ sal_Bool SwCntntNode::SetAttr( const SfxItemSet& rSet )
             const SfxPoolItem* pNameItem = 0;
             if ( 0 != GetCondFmtColl() ||
                  SFX_ITEM_SET != mpAttrSet->GetItemState( RES_FRMATR_STYLE_NAME, sal_False, &pNameItem ) ||
-                 0 == static_cast<const SfxStringItem*>(pNameItem)->GetValue().Len() )
+                 static_cast<const SfxStringItem*>(pNameItem)->GetValue().isEmpty() )
                 AttrSetHandleHelper::SetParent( mpAttrSet, *this, &GetAnyFmtColl(), GetFmtColl() );
             else
                 const_cast<SfxItemSet*>(mpAttrSet.get())->SetParent( &GetFmtColl()->GetAttrSet() );
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 9866117..a0bc301 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -2358,7 +2358,7 @@ SwNumRule* SwTxtNode::_GetNumRule(sal_Bool bInParent) const
             if ( pColl )
             {
                 const SwNumRuleItem& rDirectItem = pColl->GetNumRule( sal_False );
-                if ( rDirectItem.GetValue().Len() == 0 )
+                if ( rDirectItem.GetValue().isEmpty() )
                 {
                     pRet = 0L;
                 }
@@ -3465,7 +3465,7 @@ namespace {
                     if ( rTxtNode.IsEmptyListStyleDueToSetOutlineLevelAttr() )
                     {
                         const SwNumRuleItem& rNumRuleItem = rTxtNode.GetTxtColl()->GetNumRule();
-                        if ( rNumRuleItem.GetValue().Len() > 0 )
+                        if ( !rNumRuleItem.GetValue().isEmpty() )
                         {
                             rTxtNode.ResetEmptyListStyleDueToResetOutlineLevelAttr();
                         }
@@ -4292,7 +4292,7 @@ namespace {
 
                 const SwNumRuleItem& pNumRuleItem =
                                 dynamic_cast<const SwNumRuleItem&>(pItem);
-                if ( pNumRuleItem.GetValue().Len() > 0 )
+                if ( !pNumRuleItem.GetValue().isEmpty() )
                 {
                     mbAddTxtNodeToList = true;
                     // #i105562#
@@ -4406,7 +4406,7 @@ namespace {
 
             const SwNumRuleItem* pNumRuleItem =
                             dynamic_cast<const SwNumRuleItem*>(pItem);
-            if ( pNumRuleItem->GetValue().Len() > 0 )
+            if ( !pNumRuleItem->GetValue().isEmpty() )
             {
                 mbAddTxtNodeToList = true;
                 // #i70748#
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 204dffa..67eb8cf 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -2860,7 +2860,7 @@ bool SwWW8Writer::InitStd97CodecUpdateMedium( ::msfilter::MSCodec_Std97& rCodec
         {
             // try to generate the encryption data based on password
             SFX_ITEMSET_ARG( mpMedium->GetItemSet(), pPasswordItem, SfxStringItem, SID_PASSWORD, sal_False );
-            if ( pPasswordItem && pPasswordItem->GetValue().Len() && pPasswordItem->GetValue().Len() <= 15 )
+            if ( pPasswordItem && !pPasswordItem->GetValue().isEmpty() && pPasswordItem->GetValue().getLength() <= 15 )
             {
                 // Generate random number with a seed of time as salt.
                 TimeValue aTime;
@@ -2875,8 +2875,10 @@ bool SwWW8Writer::InitStd97CodecUpdateMedium( ::msfilter::MSCodec_Std97& rCodec
 
                 sal_Unicode aPassword[16];
                 memset( aPassword, 0, sizeof( aPassword ) );
-                for ( xub_StrLen nChar = 0; nChar < pPasswordItem->GetValue().Len(); ++nChar )
-                    aPassword[nChar] = pPasswordItem->GetValue().GetChar(nChar);
+
+                OUString sPassword(pPasswordItem->GetValue());
+                for ( sal_Int32 nChar = 0; nChar < sPassword.getLength(); ++nChar )
+                    aPassword[nChar] = sPassword[nChar];
 
                 rCodec.InitKey( aPassword, pDocId );
                 aEncryptionData = rCodec.GetEncryptionData();
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index e8007d5..7440be4 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -266,7 +266,7 @@ void MSWordExportBase::OutputItemSet( const SfxItemSet& rSet, bool bPapFmt, bool
             AttrOutput().OutputItem( *pItem );
 
             // switch off the numerbering?
-            if ( !( (SwNumRuleItem*)pItem )->GetValue().Len() &&
+            if ( ( (SwNumRuleItem*)pItem )->GetValue().isEmpty() &&
                  SFX_ITEM_SET != rSet.GetItemState( RES_LR_SPACE, false) &&
                  SFX_ITEM_SET == rSet.GetItemState( RES_LR_SPACE, true, &pItem ) )
             {
@@ -3272,7 +3272,7 @@ void AttributeOutputBase::ParaNumRule( const SwNumRuleItem& rNumRule )
     const SwTxtNode* pTxtNd = 0;
     sal_uInt16 nNumId;
     sal_uInt8 nLvl = 0;
-    if ( rNumRule.GetValue().Len() )
+    if (!rNumRule.GetValue().isEmpty())
     {
         const SwNumRule* pRule = GetExport().pDoc->FindNumRulePtr(
                                         rNumRule.GetValue() );
diff --git a/sw/source/filter/xml/swxml.cxx b/sw/source/filter/xml/swxml.cxx
index 2d2f108..ca25dd2 100644
--- a/sw/source/filter/xml/swxml.cxx
+++ b/sw/source/filter/xml/swxml.cxx
@@ -461,7 +461,7 @@ static void lcl_AdjustOutlineStylesForOOo( SwDoc& _rDoc )
             // apply outline numbering rule, if none is set.
             const SfxPoolItem& rItem =
                 aCreatedDefaultOutlineStyles[ i ]->GetFmtAttr( RES_PARATR_NUMRULE, sal_False );
-            if ( static_cast<const SwNumRuleItem&>(rItem).GetValue().Len() == 0 )
+            if ( static_cast<const SwNumRuleItem&>(rItem).GetValue().isEmpty() )
             {
                 SwNumRuleItem aItem( pOutlineRule->GetName() );
                 aCreatedDefaultOutlineStyles[ i ]->SetFmtAttr( aItem );
diff --git a/sw/source/ui/dialog/regionsw.cxx b/sw/source/ui/dialog/regionsw.cxx
index 80005c6..b2fcd7a 100644
--- a/sw/source/ui/dialog/regionsw.cxx
+++ b/sw/source/ui/dialog/regionsw.cxx
@@ -95,8 +95,10 @@ void SwBaseShell::InsertRegionDialog(SfxRequest& rReq)
         String aTmpStr;
         if ( SFX_ITEM_SET ==
                 pSet->GetItemState(FN_PARAM_REGION_NAME, sal_True, &pItem) )
-            aTmpStr = rSh.GetUniqueSectionName(
-                    &((const SfxStringItem *)pItem)->GetValue() );
+        {
+            String sRemoveWhenUniStringIsGone = ((const SfxStringItem *)pItem)->GetValue();
+            aTmpStr = rSh.GetUniqueSectionName(&sRemoveWhenUniStringIsGone);
+        }
         else
             aTmpStr = rSh.GetUniqueSectionName();
 
diff --git a/sw/source/ui/shells/textsh1.cxx b/sw/source/ui/shells/textsh1.cxx
index 78d6071..5a147ad 100644
--- a/sw/source/ui/shells/textsh1.cxx
+++ b/sw/source/ui/shells/textsh1.cxx
@@ -412,7 +412,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
             SFX_REQUEST_ARG( rReq, pNameItem, SfxStringItem, nSlot , sal_False );
             if ( pNameItem )
                 aStr = pNameItem->GetValue();
-            bool bFont = pFont && pFont->GetValue().Len();
+            bool bFont = pFont && !pFont->GetValue().isEmpty();
             rWrtSh.StartUndo( UNDO_UI_INSERT_FOOTNOTE );
             rWrtSh.InsertFootnote( aStr, nSlot == FN_INSERT_ENDNOTE, !bFont );
             if ( bFont )
@@ -993,7 +993,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
                     rWrtSh.StartAction();
                     if ( SFX_ITEM_SET == pSet->GetItemState(FN_DROP_TEXT, sal_False, &pItem) )
                     {
-                        if ( ((SfxStringItem*)pItem)->GetValue().Len() )
+                        if ( !((SfxStringItem*)pItem)->GetValue().isEmpty() )
                             rWrtSh.ReplaceDropTxt(((SfxStringItem*)pItem)->GetValue(), pPaM);
                     }
                     rWrtSh.SetAttr( *pSet, 0, pPaM );
diff --git a/sw/source/ui/shells/txtattr.cxx b/sw/source/ui/shells/txtattr.cxx
index 2666025..3f769db 100644
--- a/sw/source/ui/shells/txtattr.cxx
+++ b/sw/source/ui/shells/txtattr.cxx
@@ -458,7 +458,7 @@ void SwTextShell::ExecParaAttrArgs(SfxRequest &rReq)
                     rSh.StartUndo( UNDO_START );
                     if ( SFX_ITEM_SET == aSet.GetItemState(HINT_END,sal_False,&pItem) )
                     {
-                        if ( ((SfxStringItem*)pItem)->GetValue().Len() )
+                        if ( !((SfxStringItem*)pItem)->GetValue().isEmpty() )
                             rSh.ReplaceDropTxt(((SfxStringItem*)pItem)->GetValue());
                     }
                     rSh.SetAttr(*pDlg->GetOutputItemSet());
diff --git a/sw/source/ui/uiview/view2.cxx b/sw/source/ui/uiview/view2.cxx
index cf690f5..ed0245d 100644
--- a/sw/source/ui/uiview/view2.cxx
+++ b/sw/source/ui/uiview/view2.cxx
@@ -371,7 +371,7 @@ sal_Bool SwView::InsertGraphicDlg( SfxRequest& rReq )
             {
                 if ( pAsLink )
                     bAsLink = pAsLink->GetValue();
-                if ( pStyle && pStyle->GetValue().Len() )
+                if ( pStyle && !pStyle->GetValue().isEmpty() )
                     sGraphicFormat = pStyle->GetValue();
             }
             else
diff --git a/sw/source/ui/utlui/attrdesc.cxx b/sw/source/ui/utlui/attrdesc.cxx
index 11d7455..c9e5e5d 100644
--- a/sw/source/ui/utlui/attrdesc.cxx
+++ b/sw/source/ui/utlui/attrdesc.cxx
@@ -300,7 +300,7 @@ SfxItemPresentation SwNumRuleItem::GetPresentation
         case SFX_ITEM_PRESENTATION_NAMELESS:
         case SFX_ITEM_PRESENTATION_COMPLETE:
         {
-            if( GetValue().Len() )
+            if( !GetValue().isEmpty() )
                 rText = SW_RESSTR( STR_NUMRULE_ON ) +
                     "(" + GetValue() + ")";
             else


More information about the Libreoffice-commits mailing list