[Libreoffice-commits] core.git: sw/inc sw/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Wed Oct 28 20:44:34 UTC 2020
sw/inc/doc.hxx | 2 +-
sw/inc/editsh.hxx | 3 ++-
sw/source/core/SwNumberTree/SwNodeNum.cxx | 14 +++++++-------
sw/source/core/doc/DocumentRedlineManager.cxx | 4 ++--
sw/source/core/doc/docfmt.cxx | 4 ++--
sw/source/core/doc/docnum.cxx | 2 +-
sw/source/core/doc/docruby.cxx | 2 +-
sw/source/core/edit/edatmisc.cxx | 2 +-
sw/source/core/inc/UndoAttribute.hxx | 6 +++---
sw/source/core/txtnode/ndtxt.cxx | 12 ++++++------
sw/source/core/undo/unattr.cxx | 2 +-
sw/source/core/unocore/unocrsrhelper.cxx | 2 +-
sw/source/core/unocore/unoobj.cxx | 16 ++++++++--------
sw/source/core/unocore/unoparagraph.cxx | 2 +-
sw/source/uibase/shells/langhelper.cxx | 4 ++--
sw/source/uibase/shells/textsh1.cxx | 6 +++---
sw/source/uibase/uiview/view2.cxx | 2 +-
sw/source/uibase/wrtsh/wrtsh1.cxx | 8 ++++----
18 files changed, 47 insertions(+), 46 deletions(-)
New commits:
commit e7c4d06369f0c495ad59acdea0cd846526e66823
Author: Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Wed Oct 28 18:43:40 2020 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Oct 28 21:43:46 2020 +0100
std::set->o3tl::sorted_vector in sw
Change-Id: Ib647878c129171e5d633a783a262a56f4c1fb7af
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104969
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index fdcc5e4091f0..0eef11b1530f 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -697,7 +697,7 @@ public:
control, if the side effect "send data changed events" is triggered or not. */
void ResetAttrs( const SwPaM &rRg,
bool bTextAttr = true,
- const std::set<sal_uInt16> &rAttrs = std::set<sal_uInt16>(),
+ const o3tl::sorted_vector<sal_uInt16> &rAttrs = o3tl::sorted_vector<sal_uInt16>(),
const bool bSendDataChangedEvents = true,
SwRootFrame const* pLayout = nullptr);
void RstTextAttrs(const SwPaM &rRg, bool bInclRefToxMark = false,
diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx
index f47edfafa5a1..82e32c208347 100644
--- a/sw/inc/editsh.hxx
+++ b/sw/inc/editsh.hxx
@@ -32,6 +32,7 @@
#include <memory>
#include <vector>
#include <set>
+#include <o3tl/sorted_vector.hxx>
namespace tools { class PolyPolygon; }
class SwDoc;
@@ -273,7 +274,7 @@ public:
return static_cast<const T&>(GetDefault(sal_uInt16(nWhich)));
}
- void ResetAttr( const std::set<sal_uInt16> &attrs = std::set<sal_uInt16>(), SwPaM* pCursor = nullptr );
+ void ResetAttr( const o3tl::sorted_vector<sal_uInt16> &attrs = o3tl::sorted_vector<sal_uInt16>(), SwPaM* pCursor = nullptr );
void GCAttr();
/// @return the scripttype of the selection.
diff --git a/sw/source/core/SwNumberTree/SwNodeNum.cxx b/sw/source/core/SwNumberTree/SwNodeNum.cxx
index 795d1c8b8745..c433a4e36351 100644
--- a/sw/source/core/SwNumberTree/SwNodeNum.cxx
+++ b/sw/source/core/SwNumberTree/SwNodeNum.cxx
@@ -337,13 +337,13 @@ void SwNodeNum::UnregisterMeAndChildrenDueToRootDelete( SwNodeNum& rNodeNum )
pTextNode->RemoveFromList();
// --> clear all list attributes and the list style
- 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 );
+ o3tl::sorted_vector<sal_uInt16> 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 );
SwPaM aPam( *pTextNode );
pTextNode->GetDoc().ResetAttrs( aPam, false,
aResetAttrsArray,
diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx
index a3496039ab0f..22893963b5b1 100644
--- a/sw/source/core/doc/DocumentRedlineManager.cxx
+++ b/sw/source/core/doc/DocumentRedlineManager.cxx
@@ -799,7 +799,7 @@ namespace
// expand range to the whole paragraph
// and reset only the paragraph attributes
SwPaM aPam( *pTNd, pTNd->GetText().getLength() );
- std::set<sal_uInt16> aResetAttrsArray;
+ o3tl::sorted_vector<sal_uInt16> aResetAttrsArray;
sal_uInt16 aResetableSetRange[] = {
RES_PARATR_BEGIN, RES_PARATR_END - 1,
@@ -811,7 +811,7 @@ namespace
while (*pUShorts)
{
for (sal_uInt16 i = pUShorts[0]; i <= pUShorts[1]; ++i)
- aResetAttrsArray.insert( aResetAttrsArray.end(), i );
+ aResetAttrsArray.insert( i );
pUShorts += 2;
}
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index 6a913565867f..9de4d960a430 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -240,7 +240,7 @@ void SwDoc::RstTextAttrs(const SwPaM &rRg, bool bInclRefToxMark,
void SwDoc::ResetAttrs( const SwPaM &rRg,
bool bTextAttr,
- const std::set<sal_uInt16> &rAttrs,
+ const o3tl::sorted_vector<sal_uInt16> &rAttrs,
const bool bSendDataChangedEvents,
SwRootFrame const*const pLayout)
{
@@ -322,7 +322,7 @@ void SwDoc::ResetAttrs( const SwPaM &rRg,
RES_TXTATR_INETFMT, RES_TXTATR_UNKNOWN_CONTAINER,
RES_PARATR_BEGIN, RES_FRMATR_END - 1,
RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END - 1>{});
- for( std::set<sal_uInt16>::const_reverse_iterator it = rAttrs.rbegin(); it != rAttrs.rend(); ++it )
+ for( auto it = rAttrs.rbegin(); it != rAttrs.rend(); ++it )
{
if( POOLATTR_END > *it )
aDelSet.Put( *GetDfltAttr( *it ));
diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx
index 10895e96af2f..35740d0127a6 100644
--- a/sw/source/core/doc/docnum.cxx
+++ b/sw/source/core/doc/docnum.cxx
@@ -59,7 +59,7 @@ namespace {
void lcl_ResetIndentAttrs(SwDoc *pDoc, const SwPaM &rPam, sal_uInt16 marker,
SwRootFrame const*const pLayout)
{
- std::set<sal_uInt16> aResetAttrsArray;
+ o3tl::sorted_vector<sal_uInt16> aResetAttrsArray;
aResetAttrsArray.insert( marker );
// #i114929#
// On a selection setup a corresponding Point-and-Mark in order to get
diff --git a/sw/source/core/doc/docruby.cxx b/sw/source/core/doc/docruby.cxx
index f1ce56a0dd09..283195ee1c8d 100644
--- a/sw/source/core/doc/docruby.cxx
+++ b/sw/source/core/doc/docruby.cxx
@@ -94,7 +94,7 @@ sal_uInt16 SwDoc::FillRubyList( const SwPaM& rPam, SwRubyList& rList )
void SwDoc::SetRubyList( const SwPaM& rPam, const SwRubyList& rList )
{
GetIDocumentUndoRedo().StartUndo( SwUndoId::SETRUBYATTR, nullptr );
- std::set<sal_uInt16> aDelArr;
+ o3tl::sorted_vector<sal_uInt16> aDelArr;
aDelArr.insert( RES_TXTATR_CJK_RUBY );
SwRubyList::size_type nListEntry = 0;
diff --git a/sw/source/core/edit/edatmisc.cxx b/sw/source/core/edit/edatmisc.cxx
index 9a98a51e9584..4e26e33773a1 100644
--- a/sw/source/core/edit/edatmisc.cxx
+++ b/sw/source/core/edit/edatmisc.cxx
@@ -29,7 +29,7 @@
* hard formatting (Attribute)
*/
-void SwEditShell::ResetAttr( const std::set<sal_uInt16> &attrs, SwPaM* pPaM )
+void SwEditShell::ResetAttr( const o3tl::sorted_vector<sal_uInt16> &attrs, SwPaM* pPaM )
{
CurrShell aCurr( this );
SwPaM* pCursor = pPaM ? pPaM : GetCursor( );
diff --git a/sw/source/core/inc/UndoAttribute.hxx b/sw/source/core/inc/UndoAttribute.hxx
index dc53f6add668..4aa7001db613 100644
--- a/sw/source/core/inc/UndoAttribute.hxx
+++ b/sw/source/core/inc/UndoAttribute.hxx
@@ -26,7 +26,7 @@
#include <svl/itemset.hxx>
#include <swtypes.hxx>
#include <calbck.hxx>
-#include <set>
+#include <o3tl/sorted_vector.hxx>
class SvxTabStopItem;
class SwFormat;
@@ -64,7 +64,7 @@ public:
class SwUndoResetAttr : public SwUndo, private SwUndRng
{
const std::unique_ptr<SwHistory> m_pHistory;
- std::set<sal_uInt16> m_Ids;
+ o3tl::sorted_vector<sal_uInt16> m_Ids;
const sal_uInt16 m_nFormatId; // Format-Id for Redo
public:
@@ -77,7 +77,7 @@ public:
virtual void RedoImpl( ::sw::UndoRedoContext & ) override;
virtual void RepeatImpl( ::sw::RepeatContext & ) override;
- void SetAttrs( const std::set<sal_uInt16> &rAttrs );
+ void SetAttrs( const o3tl::sorted_vector<sal_uInt16> &rAttrs );
SwHistory& GetHistory() { return *m_pHistory; }
};
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 2b565f2b4021..b2141ba2a7b9 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -3722,12 +3722,12 @@ void SwTextNode::ReplaceText( const SwIndex& rStart, const sal_Int32 nDelLen,
namespace {
void lcl_ResetParAttrs( SwTextNode &rTextNode )
{
- 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 );
+ o3tl::sorted_vector<sal_uInt16> aAttrs;
+ aAttrs.insert( RES_PARATR_LIST_ID );
+ aAttrs.insert( RES_PARATR_LIST_LEVEL );
+ aAttrs.insert( RES_PARATR_LIST_ISRESTART );
+ aAttrs.insert( RES_PARATR_LIST_RESTARTVALUE );
+ aAttrs.insert( RES_PARATR_LIST_ISCOUNTED );
SwPaM aPam( rTextNode );
// #i96644#
// suppress side effect "send data changed events"
diff --git a/sw/source/core/undo/unattr.cxx b/sw/source/core/undo/unattr.cxx
index 4df433c34e4e..b1a63c1cf454 100644
--- a/sw/source/core/undo/unattr.cxx
+++ b/sw/source/core/undo/unattr.cxx
@@ -638,7 +638,7 @@ void SwUndoResetAttr::RepeatImpl(::sw::RepeatContext & rContext)
}
}
-void SwUndoResetAttr::SetAttrs( const std::set<sal_uInt16> &rAttrs )
+void SwUndoResetAttr::SetAttrs( const o3tl::sorted_vector<sal_uInt16> &rAttrs )
{
m_Ids = rAttrs;
}
diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx
index 8e51f25a51b8..0186b5f9613f 100644
--- a/sw/source/core/unocore/unocrsrhelper.cxx
+++ b/sw/source/core/unocore/unocrsrhelper.cxx
@@ -1016,7 +1016,7 @@ void resetCursorPropertyValue(const SfxItemPropertySimpleEntry& rEntry, SwPaM& r
break;
case FN_UNO_CHARFMT_SEQUENCE:
{
- std::set<sal_uInt16> aWhichIds;
+ o3tl::sorted_vector<sal_uInt16> aWhichIds;
aWhichIds.insert( RES_TXTATR_CHARFMT);
rDoc.ResetAttrs(rPam, true, aWhichIds);
}
diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx
index ef08aeb38e89..eb100abb6e54 100644
--- a/sw/source/core/unocore/unoobj.cxx
+++ b/sw/source/core/unocore/unoobj.cxx
@@ -1982,7 +1982,7 @@ beans::PropertyState SwUnoCursorHelper::GetPropertyState(
static void
lcl_SelectParaAndReset( SwPaM &rPaM, SwDoc & rDoc,
- std::set<sal_uInt16> const &rWhichIds )
+ o3tl::sorted_vector<sal_uInt16> const &rWhichIds )
{
// if we are resetting paragraph attributes, we need to select the full paragraph first
SwPosition aStart = *rPaM.Start();
@@ -2025,7 +2025,7 @@ void SwUnoCursorHelper::SetPropertyToDefault(
if (pEntry->nWID < RES_FRMATR_END)
{
- std::set<sal_uInt16> aWhichIds;
+ o3tl::sorted_vector<sal_uInt16> aWhichIds;
aWhichIds.insert( pEntry->nWID );
if (pEntry->nWID < RES_PARATR_BEGIN)
{
@@ -2310,7 +2310,7 @@ static sal_uInt16 g_ResetableSetRange[] = {
};
static void
-lcl_EnumerateIds(sal_uInt16 const* pIdRange, std::set<sal_uInt16> &rWhichIds)
+lcl_EnumerateIds(sal_uInt16 const* pIdRange, o3tl::sorted_vector<sal_uInt16> &rWhichIds)
{
while (*pIdRange)
{
@@ -2318,7 +2318,7 @@ lcl_EnumerateIds(sal_uInt16 const* pIdRange, std::set<sal_uInt16> &rWhichIds)
const sal_uInt16 nEnd = *pIdRange++;
for (sal_uInt16 nId = nStart + 1; nId <= nEnd; ++nId)
{
- rWhichIds.insert( rWhichIds.end(), nId );
+ rWhichIds.insert( nId );
}
}
}
@@ -2330,8 +2330,8 @@ SwXTextCursor::setAllPropertiesToDefault()
SwUnoCursor & rUnoCursor( m_pImpl->GetCursorOrThrow() );
- std::set<sal_uInt16> aParaWhichIds;
- std::set<sal_uInt16> aWhichIds;
+ o3tl::sorted_vector<sal_uInt16> aParaWhichIds;
+ o3tl::sorted_vector<sal_uInt16> aWhichIds;
lcl_EnumerateIds(g_ParaResetableSetRange, aParaWhichIds);
lcl_EnumerateIds(g_ResetableSetRange, aWhichIds);
if (!aParaWhichIds.empty())
@@ -2357,8 +2357,8 @@ SwXTextCursor::setPropertiesToDefault(
return;
SwDoc& rDoc = rUnoCursor.GetDoc();
- std::set<sal_uInt16> aWhichIds;
- std::set<sal_uInt16> aParaWhichIds;
+ o3tl::sorted_vector<sal_uInt16> aWhichIds;
+ o3tl::sorted_vector<sal_uInt16> aParaWhichIds;
for (const OUString& rName : rPropertyNames)
{
SfxItemPropertySimpleEntry const*const pEntry =
diff --git a/sw/source/core/unocore/unoparagraph.cxx b/sw/source/core/unocore/unoparagraph.cxx
index 2494aba60516..ab2dcae3e49d 100644
--- a/sw/source/core/unocore/unoparagraph.cxx
+++ b/sw/source/core/unocore/unoparagraph.cxx
@@ -1110,7 +1110,7 @@ SwXParagraph::setPropertyToDefault(const OUString& rPropertyName)
if(bBelowFrameAtrEnd || bDrawingLayerRange)
{
- std::set<sal_uInt16> aWhichIds;
+ o3tl::sorted_vector<sal_uInt16> aWhichIds;
// For FillBitmapMode two IDs have to be reset (!)
if(OWN_ATTR_FILLBMP_MODE == pEntry->nWID)
diff --git a/sw/source/uibase/shells/langhelper.cxx b/sw/source/uibase/shells/langhelper.cxx
index bff1dc05530f..53e039f057e1 100644
--- a/sw/source/uibase/shells/langhelper.cxx
+++ b/sw/source/uibase/shells/langhelper.cxx
@@ -346,7 +346,7 @@ namespace SwLangHelper
}
else // change language for all text
{
- std::set<sal_uInt16> aAttribs;
+ o3tl::sorted_vector<sal_uInt16> aAttribs;
for (sal_uInt16 i : aLangWhichId_Writer)
{
rWrtSh.SetDefault( SvxLanguageItem( LANGUAGE_NONE, i ) );
@@ -375,7 +375,7 @@ namespace SwLangHelper
}
else
{
- std::set<sal_uInt16> aAttribs;
+ o3tl::sorted_vector<sal_uInt16> aAttribs;
aAttribs.insert( RES_CHRATR_LANGUAGE );
aAttribs.insert( RES_CHRATR_CJK_LANGUAGE );
aAttribs.insert( RES_CHRATR_CTL_LANGUAGE );
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx
index 17550dc717f3..b7d3d60f2d97 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -595,7 +595,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)
- std::set<sal_uInt16> aAttribs;
+ o3tl::sorted_vector<sal_uInt16> aAttribs;
sal_uInt16 aResetableSetRange[] = {
RES_FRMATR_BEGIN, RES_FRMATR_END-1,
@@ -612,7 +612,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
while (*pUShorts)
{
for (sal_uInt16 i = pUShorts[0]; i <= pUShorts[1]; ++i)
- aAttribs.insert( aAttribs.end(), i );
+ aAttribs.insert( i );
pUShorts += 2;
}
// we don't want to change writing direction.
@@ -904,7 +904,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
rWrtSh.SelWrd();
}
//now remove the attribute
- std::set<sal_uInt16> aAttribs;
+ o3tl::sorted_vector<sal_uInt16> aAttribs;
aAttribs.insert( RES_TXTATR_INETFMT );
rWrtSh.ResetAttr( aAttribs );
if(!bSel)
diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx
index ff12532203b6..b7021abc7cd7 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -173,7 +173,7 @@ static void lcl_SetAllTextToDefaultLanguage( SwWrtShell &rWrtSh, sal_uInt16 nWhi
rWrtSh.ExtendedSelectAll();
// set language attribute to default for all text
- std::set<sal_uInt16> aAttribs;
+ o3tl::sorted_vector<sal_uInt16> aAttribs;
aAttribs.insert( nWhichId );
rWrtSh.ResetAttr( aAttribs );
diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx
index 5fb1b42f75d2..be6eb5cfb897 100644
--- a/sw/source/uibase/wrtsh/wrtsh1.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh1.cxx
@@ -245,11 +245,11 @@ void SwWrtShell::Insert( const OUString &rStr )
SwPaM aPaM(pEnd->nNode.GetNode(), pEnd->nContent.GetIndex() - rStr.getLength(),
pEnd->nNode.GetNode(), pEnd->nContent.GetIndex());
- std::set<sal_uInt16> aAttribs;
+ o3tl::sorted_vector<sal_uInt16> aAttribs;
for (sal_uInt16 i = RES_CHRATR_BEGIN; i < RES_CHRATR_END; ++i)
if (i != sal_uInt16(RES_CHRATR_RSID))
- aAttribs.insert(aAttribs.end(), i);
- aAttribs.insert(aAttribs.end(), RES_TXTATR_CHARFMT);
+ aAttribs.insert(i);
+ aAttribs.insert(RES_TXTATR_CHARFMT);
ResetAttr(aAttribs, &aPaM);
SetAttrSet(aCharAttrSet, SetAttrMode::DEFAULT, &aPaM);
@@ -1616,7 +1616,7 @@ void SwWrtShell::AutoUpdatePara(SwTextFormatColl* pColl, const SfxItemSet& rStyl
StartAction();
if(bReset)
{
- ResetAttr( std::set<sal_uInt16>(), pCursor );
+ ResetAttr( o3tl::sorted_vector<sal_uInt16>(), pCursor );
SetAttrSet(aCoreSet, SetAttrMode::DEFAULT, pCursor);
}
mxDoc->ChgFormat(*pColl, rStyleSet );
More information about the Libreoffice-commits
mailing list