From 82d573e8bf97193c032ca9631d33fa39bbd12638 Mon Sep 17 00:00:00 2001 From: Jan-Marek Glogowski Date: Tue, 22 Jul 2014 13:01:36 +0200 Subject: Drop local FindPageDesc implementations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There are quite some places, which manually walk the vector of SwPageDesc to find the named item. Replace all of them and also drop the duplicated and unused GetPageDesc function. Additionally adds a ContainsPageDesc function, which checks the vector for the SwPageDesc pointer. Change-Id: I7ade35b78d8208dc00ee56a8f83c3ebadaebb8af Reviewed-on: https://gerrit.libreoffice.org/14508 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- sw/inc/doc.hxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sw/inc/doc.hxx') diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index b9b55515ccd5..d0b3fbc5ac2e 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -948,6 +948,9 @@ public: const SwPageDesc& GetPageDesc( const sal_uInt16 i ) const { return maPageDescs[i]; } SwPageDesc& GetPageDesc( sal_uInt16 i ) { return maPageDescs[i]; } SwPageDesc* FindPageDesc(const OUString& rName, sal_uInt16* pPos = NULL); + SwPageDesc* FindPageDesc(const OUString& rName, sal_uInt16* pPos = NULL) const; + // Just searches the pointer in the maPageDescs vector! + bool ContainsPageDesc(const SwPageDesc *pDesc, sal_uInt16* pPos = NULL); /** Copy the complete PageDesc - beyond document and "deep"! Optionally copying of PoolFmtId, -HlpId can be prevented. */ @@ -965,7 +968,6 @@ public: { CopyPageDescHeaderFooterImpl( false, rSrcFmt, rDestFmt ); } // For Reader - SwPageDesc * GetPageDesc( const OUString & rName ); void ChgPageDesc( const OUString & rName, const SwPageDesc& ); void ChgPageDesc( sal_uInt16 i, const SwPageDesc& ); void DelPageDesc( const OUString & rName, bool bBroadcast = false); -- cgit