summaryrefslogtreecommitdiff
path: root/sw/inc/txatritr.hxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2016-10-14 08:08:01 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2016-10-14 08:17:50 +0200
commitdb0cb39225c5f865c199f8aa0b3fa4aa6e721de1 (patch)
tree2e4f827846e3babd795b77536dea9d07aa83c3d4 /sw/inc/txatritr.hxx
parent94ea3a18829914aa76b5534f8a551ad37d59cf07 (diff)
loplugin:mergeclasses merge SwTextAttrIterator with SwLanguageIterator
Change-Id: Iaa9184f6145625c897fa5b919e9bf0c898b41102
Diffstat (limited to 'sw/inc/txatritr.hxx')
-rw-r--r--sw/inc/txatritr.hxx40
1 files changed, 15 insertions, 25 deletions
diff --git a/sw/inc/txatritr.hxx b/sw/inc/txatritr.hxx
index dfb44747a810..9843094fbe7e 100644
--- a/sw/inc/txatritr.hxx
+++ b/sw/inc/txatritr.hxx
@@ -48,38 +48,28 @@ public:
const OUString& GetText() const { return m_rText; }
};
-class SwTextAttrIterator
+class SwLanguageIterator
{
- SwScriptIterator aSIter;
- std::deque<const SwTextAttr*> aStack;
- const SwTextNode& rTextNd;
- const SfxPoolItem *pParaItem, *pCurItem;
- size_t nAttrPos;
- sal_Int32 nChgPos;
- sal_uInt16 nWhichId;
+ SwScriptIterator aSIter;
+ std::deque<const SwTextAttr*>
+ aStack;
+ const SwTextNode& rTextNd;
+ const SfxPoolItem* pParaItem;
+ const SfxPoolItem* pCurItem;
+ size_t nAttrPos;
+ sal_Int32 nChgPos;
+ sal_uInt16 nWhichId;
void AddToStack( const SwTextAttr& rAttr );
void SearchNextChg();
public:
- SwTextAttrIterator( const SwTextNode& rTextNd, sal_uInt16 nWhichId,
- sal_Int32 nStart );
+ SwLanguageIterator( const SwTextNode& rTextNd, sal_Int32 nStart );
- bool Next();
-
- const SfxPoolItem& GetAttr() const { return *pCurItem; }
- sal_Int32 GetChgPos() const { return nChgPos; }
-};
-
-class SwLanguageIterator : public SwTextAttrIterator
-{
-public:
- SwLanguageIterator( const SwTextNode& rTextNode, sal_Int32 nStart )
- : SwTextAttrIterator( rTextNode, RES_CHRATR_LANGUAGE, nStart )
- {}
-
- sal_uInt16 GetLanguage() const
- { return static_cast<const SvxLanguageItem&>(GetAttr()).GetValue(); }
+ bool Next();
+ sal_Int32 GetChgPos() const { return nChgPos; }
+ sal_uInt16 GetLanguage() const
+ { return static_cast<const SvxLanguageItem&>(*pCurItem).GetValue(); }
};
#endif