diff options
-rw-r--r-- | sw/inc/doc.hxx | 2 | ||||
-rw-r--r-- | sw/inc/editsh.hxx | 3 | ||||
-rw-r--r-- | sw/source/core/SwNumberTree/SwNodeNum.cxx | 16 | ||||
-rw-r--r-- | sw/source/core/doc/docfmt.cxx | 20 | ||||
-rw-r--r-- | sw/source/core/doc/docnum.cxx | 62 | ||||
-rw-r--r-- | sw/source/core/doc/docruby.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/edit/edatmisc.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/inc/UndoAttribute.hxx | 9 | ||||
-rw-r--r-- | sw/source/core/inc/UndoTable.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/txtnode/ndtxt.cxx | 40 | ||||
-rw-r--r-- | sw/source/core/undo/unattr.cxx | 19 | ||||
-rw-r--r-- | sw/source/core/unocore/unocrsrhelper.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/unocore/unoobj.cxx | 44 | ||||
-rw-r--r-- | sw/source/core/unocore/unoparagraph.cxx | 8 | ||||
-rw-r--r-- | sw/source/ui/shells/langhelper.cxx | 16 | ||||
-rw-r--r-- | sw/source/ui/shells/textsh1.cxx | 12 | ||||
-rw-r--r-- | sw/source/ui/uiview/view2.cxx | 6 |
17 files changed, 124 insertions, 151 deletions
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index 798213975ae8..eb6d411e7145 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -1153,7 +1153,7 @@ public: // control, if the side effect "send data changed events" is triggered or not. void ResetAttrs( const SwPaM &rRg, sal_Bool bTxtAttr = sal_True, - const SvUShortsSort* = 0, + const std::set<sal_uInt16> &rAttrs = std::set<sal_uInt16>(), const bool bSendDataChangedEvents = true ); void RstTxtAttrs(const SwPaM &rRg, sal_Bool bInclRefToxMark = sal_False ); diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx index 0d09cda564b0..1331f9efd957 100644 --- a/sw/inc/editsh.hxx +++ b/sw/inc/editsh.hxx @@ -45,6 +45,7 @@ #include <IMark.hxx> #include <vector> +#include <set> #include <swundo.hxx> #include <svtools/embedhlp.hxx> @@ -258,7 +259,7 @@ public: // Query default attribute of document. const SfxPoolItem& GetDefault( sal_uInt16 nFmtHint ) const; - void ResetAttr( const SvUShortsSort* pAttrs = 0 ); + void ResetAttr( const std::set<sal_uInt16> &attrs = std::set<sal_uInt16>() ); void GCAttr(); // Returns the scripttpye of the selection. diff --git a/sw/source/core/SwNumberTree/SwNodeNum.cxx b/sw/source/core/SwNumberTree/SwNodeNum.cxx index c0e52c1d97bc..23750b4c0530 100644 --- a/sw/source/core/SwNumberTree/SwNodeNum.cxx +++ b/sw/source/core/SwNumberTree/SwNodeNum.cxx @@ -372,16 +372,16 @@ void SwNodeNum::_UnregisterMeAndChildrenDueToRootDelete( SwNodeNum& rNodeNum ) { pTxtNode->RemoveFromList(); // --> clear all list attributes and the list style - SvUShortsSort aResetAttrsArray; - aResetAttrsArray.Insert( RES_PARATR_LIST_ID ); - aResetAttrsArray.Insert( RES_PARATR_LIST_LEVEL ); - aResetAttrsArray.Insert( RES_PARATR_LIST_ISRESTART ); - aResetAttrsArray.Insert( RES_PARATR_LIST_RESTARTVALUE ); - aResetAttrsArray.Insert( RES_PARATR_LIST_ISCOUNTED ); - aResetAttrsArray.Insert( RES_PARATR_NUMRULE ); + std::set<sal_uInt16> aResetAttrsArray; + aResetAttrsArray.insert( aResetAttrsArray.end(), RES_PARATR_LIST_ID ); + aResetAttrsArray.insert( aResetAttrsArray.end(), RES_PARATR_LIST_LEVEL ); + aResetAttrsArray.insert( aResetAttrsArray.end(), RES_PARATR_LIST_ISRESTART ); + aResetAttrsArray.insert( aResetAttrsArray.end(), RES_PARATR_LIST_RESTARTVALUE ); + aResetAttrsArray.insert( aResetAttrsArray.end(), RES_PARATR_LIST_ISCOUNTED ); + aResetAttrsArray.insert( aResetAttrsArray.end(), RES_PARATR_NUMRULE ); SwPaM aPam( *pTxtNode ); pTxtNode->GetDoc()->ResetAttrs( aPam, sal_False, - &aResetAttrsArray, + aResetAttrsArray, false ); } } diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx index 8aabcf4b07e6..2fd8ef96369c 100644 --- a/sw/source/core/doc/docfmt.cxx +++ b/sw/source/core/doc/docfmt.cxx @@ -349,12 +349,11 @@ void SwDoc::RstTxtAttrs(const SwPaM &rRg, sal_Bool bInclRefToxMark ) void SwDoc::ResetAttrs( const SwPaM &rRg, sal_Bool bTxtAttr, - const SvUShortsSort* pAttrs, + const std::set<sal_uInt16> &rAttrs, const bool bSendDataChangedEvents ) { SwPaM* pPam = (SwPaM*)&rRg; - if( !bTxtAttr && pAttrs && pAttrs->Count() && - RES_TXTATR_END > (*pAttrs)[ 0 ] ) + if( !bTxtAttr && !rAttrs.empty() && RES_TXTATR_END > *(rAttrs.begin()) ) bTxtAttr = sal_True; if( !rRg.HasMark() ) @@ -417,9 +416,9 @@ void SwDoc::ResetAttrs( const SwPaM &rRg, { SwUndoResetAttr* pUndo = new SwUndoResetAttr( rRg, static_cast<sal_uInt16>(bTxtAttr ? RES_CONDTXTFMTCOLL : RES_TXTFMTCOLL )); - if( pAttrs && pAttrs->Count() ) + if( !rAttrs.empty() ) { - pUndo->SetAttrs( *pAttrs ); + pUndo->SetAttrs( rAttrs ); } pHst = &pUndo->GetHistory(); GetIDocumentUndoRedo().AppendUndo(pUndo); @@ -443,12 +442,13 @@ void SwDoc::ResetAttrs( const SwPaM &rRg, }; SfxItemSet aDelSet( GetAttrPool(), aResetableSetRange ); - if( pAttrs && pAttrs->Count() ) + if( !rAttrs.empty() ) { - for( sal_uInt16 n = pAttrs->Count(); n; ) - if( POOLATTR_END > (*pAttrs)[ --n ] ) - aDelSet.Put( *GetDfltAttr( (*pAttrs)[ n ] )); - + for( std::set<sal_uInt16>::reverse_iterator it = rAttrs.rbegin(); it != rAttrs.rend(); ++it ) + { + if( POOLATTR_END > *it ) + aDelSet.Put( *GetDfltAttr( *it )); + } if( aDelSet.Count() ) aPara.pDelSet = &aDelSet; } diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx index 0ec45c64cc90..fa3761491dad 100644 --- a/sw/source/core/doc/docnum.cxx +++ b/sw/source/core/doc/docnum.cxx @@ -66,6 +66,30 @@ #include <map> +namespace { + static void lcl_ResetIndentAttrs(SwDoc *pDoc, const SwPaM &rPam, sal_uInt16 marker ) + { + std::set<sal_uInt16> aResetAttrsArray; + aResetAttrsArray.insert( marker ); + // #i114929# + // On a selection setup a corresponding Point-and-Mark in order to get + // the indentation attribute reset on all paragraphs touched by the selection + if ( rPam.HasMark() && + rPam.End()->nNode.GetNode().GetTxtNode() ) + { + SwPaM aPam( rPam.Start()->nNode, + rPam.End()->nNode ); + aPam.Start()->nContent = 0; + aPam.End()->nContent = rPam.End()->nNode.GetNode().GetTxtNode()->Len(); + pDoc->ResetAttrs( aPam, sal_False, aResetAttrsArray ); + } + else + { + pDoc->ResetAttrs( rPam, sal_False, aResetAttrsArray ); + } + } +} + inline sal_uInt8 GetUpperLvlChg( sal_uInt8 nCurLvl, sal_uInt8 nLevel, sal_uInt16 nMask ) { if( 1 < nLevel ) @@ -927,24 +951,7 @@ void SwDoc::SetNumRule( const SwPaM& rPam, if ( bResetIndentAttrs && pNew && pNew->Get( 0 ).GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT ) { - SvUShortsSort aResetAttrsArray; - aResetAttrsArray.Insert( RES_LR_SPACE ); - // #i114929# - // On a selection setup a corresponding Point-and-Mark in order to get - // the indentation attribute reset on all paragraphs touched by the selection - if ( rPam.HasMark() && - rPam.End()->nNode.GetNode().GetTxtNode() ) - { - SwPaM aPam( rPam.Start()->nNode, - rPam.End()->nNode ); - aPam.Start()->nContent = 0; - aPam.End()->nContent = rPam.End()->nNode.GetNode().GetTxtNode()->Len(); - ResetAttrs( aPam, sal_False, &aResetAttrsArray ); - } - else - { - ResetAttrs( rPam, sal_False, &aResetAttrsArray ); - } + ::lcl_ResetIndentAttrs(this, rPam, RES_LR_SPACE); } if (GetIDocumentUndoRedo().DoesUndo()) @@ -959,24 +966,7 @@ void SwDoc::SetCounted(const SwPaM & rPam, bool bCounted) { if ( bCounted ) { - SvUShortsSort aResetAttrsArray; - aResetAttrsArray.Insert( RES_PARATR_LIST_ISCOUNTED ); - // #i114929# - // On a selection setup a corresponding Point-and-Mark in order to get - // the list-is-counted attribute reset on all paragraphs touched by the selection - if ( rPam.HasMark() && - rPam.End()->nNode.GetNode().GetTxtNode() ) - { - SwPaM aPam( rPam.Start()->nNode, - rPam.End()->nNode ); - aPam.Start()->nContent = 0; - aPam.End()->nContent = rPam.End()->nNode.GetNode().GetTxtNode()->Len(); - ResetAttrs( aPam, sal_False, &aResetAttrsArray ); - } - else - { - ResetAttrs( rPam, sal_False, &aResetAttrsArray ); - } + ::lcl_ResetIndentAttrs(this, rPam, RES_PARATR_LIST_ISCOUNTED); } else { diff --git a/sw/source/core/doc/docruby.cxx b/sw/source/core/doc/docruby.cxx index 564e8d7e6989..47fa864aa0c5 100644 --- a/sw/source/core/doc/docruby.cxx +++ b/sw/source/core/doc/docruby.cxx @@ -111,8 +111,8 @@ sal_uInt16 SwDoc::SetRubyList( const SwPaM& rPam, const SwRubyList& rList, sal_uInt16 nMode ) { GetIDocumentUndoRedo().StartUndo( UNDO_SETRUBYATTR, NULL ); - SvUShortsSort aDelArr; - aDelArr.Insert( RES_TXTATR_CJK_RUBY ); + std::set<sal_uInt16> aDelArr; + aDelArr.insert( RES_TXTATR_CJK_RUBY ); sal_uInt16 nListEntry = 0; @@ -147,7 +147,7 @@ sal_uInt16 SwDoc::SetRubyList( const SwPaM& rPam, const SwRubyList& rList, } else { - ResetAttrs( aPam, sal_True, &aDelArr ); + ResetAttrs( aPam, sal_True, aDelArr ); } } diff --git a/sw/source/core/edit/edatmisc.cxx b/sw/source/core/edit/edatmisc.cxx index bb5d650484b2..c4ba463b70ab 100644 --- a/sw/source/core/edit/edatmisc.cxx +++ b/sw/source/core/edit/edatmisc.cxx @@ -44,7 +44,7 @@ *************************************/ -void SwEditShell::ResetAttr( const SvUShortsSort* pAttrs ) +void SwEditShell::ResetAttr( const std::set<sal_uInt16> &attrs ) { SET_CURR_SHELL( this ); StartAllAction(); @@ -56,7 +56,7 @@ void SwEditShell::ResetAttr( const SvUShortsSort* pAttrs ) FOREACHPAM_START(this) - GetDoc()->ResetAttrs(*PCURCRSR, sal_True, pAttrs); + GetDoc()->ResetAttrs(*PCURCRSR, sal_True, attrs); FOREACHPAM_END() if( bUndoGroup ) diff --git a/sw/source/core/inc/UndoAttribute.hxx b/sw/source/core/inc/UndoAttribute.hxx index 24f01b0b3f6e..3566eb8687de 100644 --- a/sw/source/core/inc/UndoAttribute.hxx +++ b/sw/source/core/inc/UndoAttribute.hxx @@ -35,16 +35,13 @@ #ifndef _SVSTDARR_HXX #define _SVSTDARR_USHORTS #define _SVSTDARR_ULONGS -#define _SVSTDARR_BOOLS -#define _SVSTDARR_BYTES -#define _SVSTDARR_USHORTSSORT #include <svl/svstdarr.hxx> #endif #include <svl/itemset.hxx> #include <swtypes.hxx> #include <calbck.hxx> - +#include <set> class SvxTabStopItem; class SwFmt; @@ -82,7 +79,7 @@ public: class SwUndoResetAttr : public SwUndo, private SwUndRng { const ::std::auto_ptr<SwHistory> m_pHistory; - SvUShortsSort m_Ids; + std::set<sal_uInt16> m_Ids; const sal_uInt16 m_nFormatId; // Format-Id for Redo public: @@ -95,7 +92,7 @@ public: virtual void RedoImpl( ::sw::UndoRedoContext & ); virtual void RepeatImpl( ::sw::RepeatContext & ); - void SetAttrs( const SvUShortsSort& rArr ); + void SetAttrs( const std::set<sal_uInt16> &rAttrs ); SwHistory& GetHistory() { return *m_pHistory; } diff --git a/sw/source/core/inc/UndoTable.hxx b/sw/source/core/inc/UndoTable.hxx index d7705a398ee2..c96184cbda2c 100644 --- a/sw/source/core/inc/UndoTable.hxx +++ b/sw/source/core/inc/UndoTable.hxx @@ -33,8 +33,6 @@ #ifndef _SVSTDARR_HXX #define _SVSTDARR_USHORTS #define _SVSTDARR_ULONGS -#define _SVSTDARR_BOOLS -#define _SVSTDARR_BYTES #define _SVSTDARR_USHORTSSORT #include <svl/svstdarr.hxx> #endif diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index 753896ef22de..0117facb916c 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -3272,6 +3272,20 @@ void SwTxtNode::ReplaceText( const SwIndex& rStart, const xub_StrLen nDelLen, } namespace { + static void lcl_ResetParAttrs( SwTxtNode &rTxtNode ) + { + std::set<sal_uInt16> aAttrs; + aAttrs.insert( aAttrs.end(), RES_PARATR_LIST_ID ); + aAttrs.insert( aAttrs.end(), RES_PARATR_LIST_LEVEL ); + aAttrs.insert( aAttrs.end(), RES_PARATR_LIST_ISRESTART ); + aAttrs.insert( aAttrs.end(), RES_PARATR_LIST_RESTARTVALUE ); + aAttrs.insert( aAttrs.end(), RES_PARATR_LIST_ISCOUNTED ); + SwPaM aPam( rTxtNode ); + // #i96644# + // suppress side effect "send data changed events" + rTxtNode.GetDoc()->ResetAttrs( aPam, sal_False, aAttrs, false ); + } + // Helper method for special handling of modified attributes at text node. // The following is handled: // (1) on changing the paragraph style - RES_FMT_CHG: @@ -3388,18 +3402,7 @@ namespace { rTxtNode.RemoveFromList(); if ( bParagraphStyleChanged ) { - SvUShortsSort aResetAttrsArray; - aResetAttrsArray.Insert( RES_PARATR_LIST_ID ); - aResetAttrsArray.Insert( RES_PARATR_LIST_LEVEL ); - aResetAttrsArray.Insert( RES_PARATR_LIST_ISRESTART ); - aResetAttrsArray.Insert( RES_PARATR_LIST_RESTARTVALUE ); - aResetAttrsArray.Insert( RES_PARATR_LIST_ISCOUNTED ); - SwPaM aPam( rTxtNode ); - // #i96644# - // suppress side effect "send data changed events" - rTxtNode.GetDoc()->ResetAttrs( aPam, sal_False, - &aResetAttrsArray, - false ); + ::lcl_ResetParAttrs(rTxtNode); } } else @@ -3428,18 +3431,7 @@ namespace { rTxtNode.RemoveFromList(); if ( bParagraphStyleChanged ) { - SvUShortsSort aResetAttrsArray; - aResetAttrsArray.Insert( RES_PARATR_LIST_ID ); - aResetAttrsArray.Insert( RES_PARATR_LIST_LEVEL ); - aResetAttrsArray.Insert( RES_PARATR_LIST_ISRESTART ); - aResetAttrsArray.Insert( RES_PARATR_LIST_RESTARTVALUE ); - aResetAttrsArray.Insert( RES_PARATR_LIST_ISCOUNTED ); - SwPaM aPam( rTxtNode ); - // #i96644# - // suppress side effect "send data changed events" - rTxtNode.GetDoc()->ResetAttrs( aPam, sal_False, - &aResetAttrsArray, - false ); + ::lcl_ResetParAttrs(rTxtNode); // #i70748# if ( dynamic_cast<const SfxUInt16Item &>(rTxtNode.GetAttr( RES_PARATR_OUTLINELEVEL, sal_False )).GetValue() > 0 ) { diff --git a/sw/source/core/undo/unattr.cxx b/sw/source/core/undo/unattr.cxx index ad7ac4b5d208..0406dd309827 100644 --- a/sw/source/core/undo/unattr.cxx +++ b/sw/source/core/undo/unattr.cxx @@ -701,7 +701,6 @@ void SwUndoResetAttr::RedoImpl(::sw::UndoRedoContext & rContext) { SwDoc & rDoc = rContext.GetDoc(); SwPaM & rPam = AddUndoRedoPaM(rContext); - SvUShortsSort* pIdArr = m_Ids.Count() ? &m_Ids : 0; switch ( m_nFormatId ) { @@ -709,10 +708,10 @@ void SwUndoResetAttr::RedoImpl(::sw::UndoRedoContext & rContext) rDoc.RstTxtAttrs(rPam); break; case RES_TXTFMTCOLL: - rDoc.ResetAttrs(rPam, sal_False, pIdArr ); + rDoc.ResetAttrs(rPam, sal_False, m_Ids ); break; case RES_CONDTXTFMTCOLL: - rDoc.ResetAttrs(rPam, sal_True, pIdArr ); + rDoc.ResetAttrs(rPam, sal_True, m_Ids ); break; case RES_TXTATR_TOXMARK: @@ -763,29 +762,25 @@ void SwUndoResetAttr::RepeatImpl(::sw::RepeatContext & rContext) return; } - SvUShortsSort* pIdArr = m_Ids.Count() ? &m_Ids : 0; switch ( m_nFormatId ) { case RES_CHRFMT: rContext.GetDoc().RstTxtAttrs(rContext.GetRepeatPaM()); break; case RES_TXTFMTCOLL: - rContext.GetDoc().ResetAttrs(rContext.GetRepeatPaM(), false, pIdArr); + rContext.GetDoc().ResetAttrs(rContext.GetRepeatPaM(), false, m_Ids); break; case RES_CONDTXTFMTCOLL: - rContext.GetDoc().ResetAttrs(rContext.GetRepeatPaM(), true, pIdArr); + rContext.GetDoc().ResetAttrs(rContext.GetRepeatPaM(), true, m_Ids); break; } } -void SwUndoResetAttr::SetAttrs( const SvUShortsSort& rArr ) +void SwUndoResetAttr::SetAttrs( const std::set<sal_uInt16> &rAttrs ) { - if ( m_Ids.Count() ) - { - m_Ids.Remove( 0, m_Ids.Count() ); - } - m_Ids.Insert( &rArr ); + m_Ids.clear(); + m_Ids.insert( rAttrs.begin(), rAttrs.end() ); } // ----------------------------------------------------- diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx index b74238b23702..7c8b4d050dc5 100644 --- a/sw/source/core/unocore/unocrsrhelper.cxx +++ b/sw/source/core/unocore/unocrsrhelper.cxx @@ -770,9 +770,9 @@ void resetCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry, SwPaM& rPa break; case FN_UNO_CHARFMT_SEQUENCE: { - SvUShortsSort aWhichIds; - aWhichIds.Insert(RES_TXTATR_CHARFMT); - pDoc->ResetAttrs(rPam, sal_True, &aWhichIds); + std::set<sal_uInt16> aWhichIds; + aWhichIds.insert( RES_TXTATR_CHARFMT); + pDoc->ResetAttrs(rPam, sal_True, aWhichIds); } break; } diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx index cb904ab60a3f..83828f523366 100644 --- a/sw/source/core/unocore/unoobj.cxx +++ b/sw/source/core/unocore/unoobj.cxx @@ -2045,7 +2045,7 @@ throw (beans::UnknownPropertyException, uno::RuntimeException) static void lcl_SelectParaAndReset( SwPaM &rPaM, SwDoc & rDoc, - SvUShortsSort const*const pWhichIds = 0 ) + std::set<sal_uInt16> const &rWhichIds ) { // if we are reseting paragraph attributes, we need to select the full paragraph first SwPosition aStart = *rPaM.Start(); @@ -2062,7 +2062,7 @@ lcl_SelectParaAndReset( SwPaM &rPaM, SwDoc & rDoc, { pTemp->MovePara(fnParaCurr, fnParaEnd); } - rDoc.ResetAttrs(*pTemp, sal_True, pWhichIds); + rDoc.ResetAttrs(*pTemp, sal_True, rWhichIds); } void SwUnoCursorHelper::SetPropertyToDefault( @@ -2089,15 +2089,15 @@ throw (beans::UnknownPropertyException, uno::RuntimeException) if (pEntry->nWID < RES_FRMATR_END) { - SvUShortsSort aWhichIds; - aWhichIds.Insert(pEntry->nWID); + std::set<sal_uInt16> aWhichIds; + aWhichIds.insert( pEntry->nWID ); if (pEntry->nWID < RES_PARATR_BEGIN) { - rDoc.ResetAttrs(rPaM, sal_True, &aWhichIds); + rDoc.ResetAttrs(rPaM, sal_True, aWhichIds); } else { - lcl_SelectParaAndReset ( rPaM, rDoc, &aWhichIds ); + lcl_SelectParaAndReset ( rPaM, rDoc, aWhichIds ); } } else @@ -2328,7 +2328,7 @@ static sal_uInt16 g_ResetableSetRange[] = { }; static void -lcl_EnumerateIds(sal_uInt16 const* pIdRange, SvUShortsSort & rWhichIds) +lcl_EnumerateIds(sal_uInt16 const* pIdRange, std::set<sal_uInt16> &rWhichIds) { while (*pIdRange) { @@ -2336,7 +2336,7 @@ lcl_EnumerateIds(sal_uInt16 const* pIdRange, SvUShortsSort & rWhichIds) const sal_uInt16 nEnd = sal::static_int_cast<sal_uInt16>(*pIdRange++); for (sal_uInt16 nId = nStart + 1; nId <= nEnd; ++nId) { - rWhichIds.Insert( nId ); + rWhichIds.insert( rWhichIds.end(), nId ); } } } @@ -2349,18 +2349,18 @@ throw (uno::RuntimeException) SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); - SvUShortsSort aParaWhichIds; - SvUShortsSort aWhichIds; + std::set<sal_uInt16> aParaWhichIds; + std::set<sal_uInt16> aWhichIds; lcl_EnumerateIds(g_ParaResetableSetRange, aParaWhichIds); lcl_EnumerateIds(g_ResetableSetRange, aWhichIds); - if (aParaWhichIds.Count()) + if (!aParaWhichIds.empty()) { lcl_SelectParaAndReset(rUnoCursor, *rUnoCursor.GetDoc(), - &aParaWhichIds); + aParaWhichIds); } - if (aWhichIds.Count()) + if (!aWhichIds.empty()) { - rUnoCursor.GetDoc()->ResetAttrs(rUnoCursor, sal_True, &aWhichIds); + rUnoCursor.GetDoc()->ResetAttrs(rUnoCursor, sal_True, aWhichIds); } } @@ -2378,8 +2378,8 @@ throw (beans::UnknownPropertyException, uno::RuntimeException) { SwDoc & rDoc = *rUnoCursor.GetDoc(); const OUString * pNames = rPropertyNames.getConstArray(); - SvUShortsSort aWhichIds; - SvUShortsSort aParaWhichIds; + std::set<sal_uInt16> aWhichIds; + std::set<sal_uInt16> aParaWhichIds; for (sal_Int32 i = 0; i < nCount; i++) { SfxItemPropertySimpleEntry const*const pEntry = @@ -2411,11 +2411,11 @@ throw (beans::UnknownPropertyException, uno::RuntimeException) { if (pEntry->nWID < RES_PARATR_BEGIN) { - aWhichIds.Insert(pEntry->nWID); + aWhichIds.insert( pEntry->nWID ); } else { - aParaWhichIds.Insert(pEntry->nWID); + aParaWhichIds.insert( pEntry->nWID ); } } else if (pEntry->nWID == FN_UNO_NUM_START_VALUE) @@ -2424,13 +2424,13 @@ throw (beans::UnknownPropertyException, uno::RuntimeException) } } - if (aParaWhichIds.Count()) + if (!aParaWhichIds.empty()) { - lcl_SelectParaAndReset(rUnoCursor, rDoc, &aParaWhichIds); + lcl_SelectParaAndReset(rUnoCursor, rDoc, aParaWhichIds); } - if (aWhichIds.Count()) + if (!aWhichIds.empty()) { - rDoc.ResetAttrs(rUnoCursor, sal_True, &aWhichIds); + rDoc.ResetAttrs(rUnoCursor, sal_True, aWhichIds); } } } diff --git a/sw/source/core/unocore/unoparagraph.cxx b/sw/source/core/unocore/unoparagraph.cxx index 2143b1c57df4..bbaf479e2897 100644 --- a/sw/source/core/unocore/unoparagraph.cxx +++ b/sw/source/core/unocore/unoparagraph.cxx @@ -1021,11 +1021,11 @@ throw (beans::UnknownPropertyException, uno::RuntimeException) if (pEntry->nWID < RES_FRMATR_END) { - SvUShortsSort aWhichIds; - aWhichIds.Insert(pEntry->nWID); + std::set<sal_uInt16> aWhichIds; + aWhichIds.insert( pEntry->nWID ); if (pEntry->nWID < RES_PARATR_BEGIN) { - aCursor.GetDoc()->ResetAttrs(aCursor, sal_True, &aWhichIds); + aCursor.GetDoc()->ResetAttrs(aCursor, sal_True, aWhichIds); } else { @@ -1047,7 +1047,7 @@ throw (beans::UnknownPropertyException, uno::RuntimeException) { pTemp->MovePara(fnParaCurr, fnParaEnd); } - pTemp->GetDoc()->ResetAttrs(*pTemp, sal_True, &aWhichIds); + pTemp->GetDoc()->ResetAttrs(*pTemp, sal_True, aWhichIds); } } else diff --git a/sw/source/ui/shells/langhelper.cxx b/sw/source/ui/shells/langhelper.cxx index 50b5bb586e3b..47a8ccbaa411 100644 --- a/sw/source/ui/shells/langhelper.cxx +++ b/sw/source/ui/shells/langhelper.cxx @@ -377,16 +377,16 @@ namespace SwLangHelper } else // change language for all text { - SvUShortsSort aAttribs; + std::set<sal_uInt16> aAttribs; for (sal_uInt16 i = 0; i < 3; ++i) { rWrtSh.SetDefault( SvxLanguageItem( LANGUAGE_NONE, aLangWhichId_Writer[i] ) ); - aAttribs.Insert( aLangWhichId_Writer[i] ); + aAttribs.insert( aLangWhichId_Writer[i] ); } // set all language attributes to default // (for all text in the document - which should be selected by now...) - rWrtSh.ResetAttr( &aAttribs ); + rWrtSh.ResetAttr( aAttribs ); } } @@ -414,11 +414,11 @@ namespace SwLangHelper } else { - SvUShortsSort aAttribs; - aAttribs.Insert( RES_CHRATR_LANGUAGE ); - aAttribs.Insert( RES_CHRATR_CJK_LANGUAGE ); - aAttribs.Insert( RES_CHRATR_CTL_LANGUAGE ); - rWrtSh.ResetAttr( &aAttribs ); + std::set<sal_uInt16> aAttribs; + aAttribs.insert( RES_CHRATR_LANGUAGE ); + aAttribs.insert( RES_CHRATR_CJK_LANGUAGE ); + aAttribs.insert( RES_CHRATR_CTL_LANGUAGE ); + rWrtSh.ResetAttr( aAttribs ); } } diff --git a/sw/source/ui/shells/textsh1.cxx b/sw/source/ui/shells/textsh1.cxx index cfbfc2e7c9d4..f1c8c6ff9e06 100644 --- a/sw/source/ui/shells/textsh1.cxx +++ b/sw/source/ui/shells/textsh1.cxx @@ -490,7 +490,7 @@ void SwTextShell::Execute(SfxRequest &rReq) // #i78856, reset all attributes but not the language attributes // (for this build an array of all relevant attributes and // remove the languages from that) - SvUShortsSort aAttribs; + std::set<sal_uInt16> aAttribs; sal_uInt16 aResetableSetRange[] = { RES_FRMATR_BEGIN, RES_FRMATR_END-1, @@ -510,11 +510,11 @@ void SwTextShell::Execute(SfxRequest &rReq) sal_uInt16 nL = pUShorts[1] - pUShorts[0] + 1; sal_uInt16 nE = pUShorts[0]; for (sal_uInt16 i = 0; i < nL; ++i) - aAttribs.Insert( nE++ ); + aAttribs.insert( aAttribs.end(), nE++ ); pUShorts += 2; } - rWrtSh.ResetAttr( &aAttribs ); + rWrtSh.ResetAttr( aAttribs ); rReq.Done(); break; } @@ -809,9 +809,9 @@ void SwTextShell::Execute(SfxRequest &rReq) rWrtSh.SelWrd(); } //now remove the attribute - SvUShortsSort aAttribs; - aAttribs.Insert( RES_TXTATR_INETFMT ); - rWrtSh.ResetAttr( &aAttribs ); + std::set<sal_uInt16> aAttribs; + aAttribs.insert( RES_TXTATR_INETFMT ); + rWrtSh.ResetAttr( aAttribs ); if(!bSel) { rWrtSh.Pop(sal_False); diff --git a/sw/source/ui/uiview/view2.cxx b/sw/source/ui/uiview/view2.cxx index 3b5a57d2df06..b7cec7a5325a 100644 --- a/sw/source/ui/uiview/view2.cxx +++ b/sw/source/ui/uiview/view2.cxx @@ -176,9 +176,9 @@ static void lcl_SetAllTextToDefaultLanguage( SwWrtShell &rWrtSh, sal_uInt16 nWhi rWrtSh.ExtendedSelectAll(); // set language attribute to default for all text - SvUShortsSort aAttribs; - aAttribs.Insert( nWhichId ); - rWrtSh.ResetAttr( &aAttribs ); + std::set<sal_uInt16> aAttribs; + aAttribs.insert( nWhichId ); + rWrtSh.ResetAttr( aAttribs ); rWrtSh.Pop( sal_False ); rWrtSh.LockView( sal_False ); |