diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-10-25 15:53:44 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-10-27 06:08:51 +0000 |
commit | a7ea18ffe715776cb0e2b39e98569c75605ee332 (patch) | |
tree | 1e32da87f2ad0e8d111ba8ed99180bb6b4cf2a77 /sw | |
parent | eca5ea9f79181d45cd7fbabe2313617d3025818a (diff) |
loplugin:expandablemethods in sw
Change-Id: Ibc9edc28f4041235ab30c026bd3774bd74b7e960
Reviewed-on: https://gerrit.libreoffice.org/30287
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
55 files changed, 118 insertions, 383 deletions
diff --git a/sw/inc/PostItMgr.hxx b/sw/inc/PostItMgr.hxx index 85f1133cd33a..68887aa73a5d 100644 --- a/sw/inc/PostItMgr.hxx +++ b/sw/inc/PostItMgr.hxx @@ -189,8 +189,6 @@ class SwPostItMgr: public SfxListener void InsertItem( SfxBroadcaster* pItem, bool bCheckExistance, bool bFocus); void RemoveItem( SfxBroadcaster* pBroadcast ); - void Sort(); - public: SwPostItMgr(SwView* aDoc); virtual ~SwPostItMgr() override; diff --git a/sw/inc/SwNumberTree.hxx b/sw/inc/SwNumberTree.hxx index 28281fd887ca..eab279312f3d 100644 --- a/sw/inc/SwNumberTree.hxx +++ b/sw/inc/SwNumberTree.hxx @@ -480,13 +480,6 @@ protected: bool bValidating = false) const; /** - Set this node as last valid child of its parent. - - @param bValidation see above - */ - void SetLastValid(bool bValidating) const; - - /** Return if this node is notifiable. @attention If a not is not notifiable a notify request is *not* diff --git a/sw/inc/dcontact.hxx b/sw/inc/dcontact.hxx index 37ba7c1b7791..82a3ae2fb1fc 100644 --- a/sw/inc/dcontact.hxx +++ b/sw/inc/dcontact.hxx @@ -403,10 +403,6 @@ class SwDrawContact : public SwContact { return maAnchoredDrawObj.GetPageFrame(); } - void SetPageFrame( SwPageFrame* _pNewPageFrame ) - { - return maAnchoredDrawObj.SetPageFrame( _pNewPageFrame ); - } void ChkPage(); SwPageFrame* FindPage( const SwRect &rRect ); diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index 4d881ad1547b..33e4473681ef 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -828,8 +828,6 @@ public: const SwGrfFormatColls *GetGrfFormatColls() const { return mpGrfFormatCollTable; } SwGrfFormatColl *MakeGrfFormatColl(const OUString &rFormatName, SwGrfFormatColl *pDerivedFrom); - SwGrfFormatColl* FindGrfFormatCollByName( const OUString& rName ) const - { return static_cast<SwGrfFormatColl*>(FindFormatByName( (SwFormatsBase&)*mpGrfFormatCollTable, rName )); } // Table formatting const SwFrameFormats* GetTableFrameFormats() const { return mpTableFrameFormatTable; } @@ -1551,19 +1549,6 @@ public: const int nListLevel, const bool bValue ); - /** Marks/Unmarks a list level of a certain list - - levels of a certain lists are marked now - - @param rList list whose level has to be marked/unmarked - @param nListLevel level to mark - @param bValue - true mark the level - - false unmark the level - */ - static void MarkListLevel( SwList& rList, - const int nListLevel, - const bool bValue ); - // Change a format undoable. void ChgFormat(SwFormat & rFormat, const SfxItemSet & rSet); diff --git a/sw/inc/expfld.hxx b/sw/inc/expfld.hxx index 38344e151448..bee8249837ea 100644 --- a/sw/inc/expfld.hxx +++ b/sw/inc/expfld.hxx @@ -303,9 +303,6 @@ class SW_DLLPUBLIC SwInputField : public SwField // Accessing Input Field's content const OUString& getContent() const { return aContent;} - void LockNotifyContentChange(); - void UnlockNotifyContentChange(); - public: /// Direct input via dialog; delete old value. SwInputField( diff --git a/sw/inc/fmtmeta.hxx b/sw/inc/fmtmeta.hxx index 5e655c034c5b..549b7a1a454f 100644 --- a/sw/inc/fmtmeta.hxx +++ b/sw/inc/fmtmeta.hxx @@ -141,7 +141,6 @@ protected: SwFormatMeta * GetFormatMeta() const { return m_pFormat; } void SetFormatMeta( SwFormatMeta * const i_pFormat ) { m_pFormat = i_pFormat; }; - void NotifyChangeTextNodeImpl(); void NotifyChangeTextNode(SwTextNode *const pTextNode); css::uno::WeakReference<css::rdf::XMetadatable> const& GetXMeta() const diff --git a/sw/inc/hhcwrp.hxx b/sw/inc/hhcwrp.hxx index 3248b62daab7..c4b86a518f96 100644 --- a/sw/inc/hhcwrp.hxx +++ b/sw/inc/hhcwrp.hxx @@ -56,7 +56,6 @@ class SW_DLLPUBLIC SwHHCWrapper : public editeng::HangulHanjaConversion bool FindConvText_impl(); ///< former FindSpellError /// from SwSpellWrapper copied and modified - bool HasOtherCnt_impl(); void ConvStart_impl( SwConversionArgs *pConvArgs, SvxSpellArea eSpell ); ///< former SpellStart void ConvEnd_impl( SwConversionArgs *pConvArgs ); ///< former SpellEnd bool ConvContinue_impl( SwConversionArgs *pConvArgs ); ///< former SpellContinue diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx index 0d481b1b751d..87f4a7b28e81 100644 --- a/sw/inc/ndtxt.hxx +++ b/sw/inc/ndtxt.hxx @@ -158,14 +158,6 @@ class SW_DLLPUBLIC SwTextNode: public SwContentNode, public ::sfx2::Metadatable /// Start: Data collected during idle time - SAL_DLLPRIVATE void SetParaNumberOfWords( sal_uLong nTmpWords ) const; - SAL_DLLPRIVATE sal_uLong GetParaNumberOfWords() const; - SAL_DLLPRIVATE void SetParaNumberOfAsianWords( sal_uLong nTmpAsianWords ) const; - SAL_DLLPRIVATE sal_uLong GetParaNumberOfAsianWords() const; - SAL_DLLPRIVATE void SetParaNumberOfChars( sal_uLong nTmpChars ) const; - SAL_DLLPRIVATE sal_uLong GetParaNumberOfChars() const; - SAL_DLLPRIVATE void SetParaNumberOfCharsExcludingSpaces( sal_uLong nTmpChars ) const; - SAL_DLLPRIVATE sal_uLong GetParaNumberOfCharsExcludingSpaces() const; SAL_DLLPRIVATE void InitSwParaStatistics( bool bNew ); /** create number for this text node, if not already existing diff --git a/sw/inc/swcrsr.hxx b/sw/inc/swcrsr.hxx index f5c59e033a02..b2d03e0b62a0 100644 --- a/sw/inc/swcrsr.hxx +++ b/sw/inc/swcrsr.hxx @@ -81,7 +81,6 @@ class SW_DLLPUBLIC SwCursor : public SwPaM SwCursor(SwCursor const& rPaM) = delete; protected: - SwCursor_SavePos* CreateNewSavePos() const; void SaveState(); void RestoreState(); diff --git a/sw/inc/txtinet.hxx b/sw/inc/txtinet.hxx index 409e46843d6f..ad93d97761e0 100644 --- a/sw/inc/txtinet.hxx +++ b/sw/inc/txtinet.hxx @@ -70,7 +70,8 @@ inline const SwTextNode& SwTextINetFormat::GetTextNode() const inline SwTextNode& SwTextINetFormat::GetTextNode() { - return const_cast<SwTextNode&>( const_cast<SwTextINetFormat const*>(this)->GetTextNode() ); + assert( m_pTextNode ); + return *m_pTextNode; } #endif diff --git a/sw/inc/undobj.hxx b/sw/inc/undobj.hxx index d081e63b90d5..ef154ca2d41c 100644 --- a/sw/inc/undobj.hxx +++ b/sw/inc/undobj.hxx @@ -77,7 +77,6 @@ protected: // the 4 methods that derived classes have to override // base implementation does nothing virtual void RepeatImpl( ::sw::RepeatContext & ); - bool CanRepeatImpl( ::sw::RepeatContext & ) const; public: // should not be public, but ran into trouble in untbl.cxx virtual void UndoImpl( ::sw::UndoRedoContext & ) = 0; virtual void RedoImpl( ::sw::UndoRedoContext & ) = 0; diff --git a/sw/inc/unoframe.hxx b/sw/inc/unoframe.hxx index 27e8dc01ef46..efbef6b83a1f 100644 --- a/sw/inc/unoframe.hxx +++ b/sw/inc/unoframe.hxx @@ -312,15 +312,11 @@ public: void SAL_CALL operator delete( void * ) throw(); }; -class SwXOLEListener : public cppu::WeakImplHelper -< - css::util::XModifyListener ->, +class SwXOLEListener : public cppu::WeakImplHelper<css::util::XModifyListener>, public SwClient { css::uno::Reference< css::frame::XModel > xOLEModel; - SwFormat* GetFormat() const { return const_cast<SwFormat*>(static_cast<const SwFormat*>(GetRegisteredIn())); } public: SwXOLEListener(SwFormat& rOLEFormat, css::uno::Reference< css::frame::XModel > const & xOLE); virtual ~SwXOLEListener() override; diff --git a/sw/inc/unotbl.hxx b/sw/inc/unotbl.hxx index 8bb80366d9bf..a244cb3128e1 100644 --- a/sw/inc/unotbl.hxx +++ b/sw/inc/unotbl.hxx @@ -116,8 +116,6 @@ public: { return const_cast<SwXCell*>(this)->getValue(); }; virtual void SAL_CALL setValue( double nValue ) throw(css::uno::RuntimeException, std::exception) override; virtual css::table::CellContentType SAL_CALL getType( ) throw(css::uno::RuntimeException, std::exception) override; - css::table::CellContentType SAL_CALL getType( ) const throw(css::uno::RuntimeException, std::exception) - { return const_cast<SwXCell*>(this)->getType(); }; virtual sal_Int32 SAL_CALL getError( ) throw(css::uno::RuntimeException, std::exception) override; //XText diff --git a/sw/source/core/SwNumberTree/SwNumberTree.cxx b/sw/source/core/SwNumberTree/SwNumberTree.cxx index 49be27e7bdb9..69564bfb5416 100644 --- a/sw/source/core/SwNumberTree/SwNumberTree.cxx +++ b/sw/source/core/SwNumberTree/SwNumberTree.cxx @@ -1070,21 +1070,14 @@ void SwNumberTreeNode::SetLastValid ++aIt; } - SetLastValid(bValidating); + if (mpParent) + { + mpParent->SetLastValid(mpParent->GetIterator(this), bValidating); + } } } } -void SwNumberTreeNode::SetLastValid(bool bValidating) const -{ - if (mpParent) - { - tSwNumberTreeChildren::const_iterator aIt = mpParent->GetIterator(this); - - mpParent->SetLastValid(aIt, bValidating); - } -} - void SwNumberTreeNode::InvalidateTree() const { // do not call SetInvalid, would cause loop !!! diff --git a/sw/source/core/access/accportions.cxx b/sw/source/core/access/accportions.cxx index 2efc1f6d4cf3..a98098a202df 100644 --- a/sw/source/core/access/accportions.cxx +++ b/sw/source/core/access/accportions.cxx @@ -267,11 +267,6 @@ bool SwAccessiblePortionData::IsSpecialPortion( size_t nPortionNo ) const return IsPortionAttrSet(nPortionNo, PORATTR_SPECIAL); } -bool SwAccessiblePortionData::IsReadOnlyPortion( size_t nPortionNo ) const -{ - return IsPortionAttrSet(nPortionNo, PORATTR_READONLY); -} - bool SwAccessiblePortionData::IsGrayPortionType( sal_uInt16 nType ) const { // gray portions? @@ -729,7 +724,7 @@ bool SwAccessiblePortionData::GetEditableRange( for( size_t nPor = nStartPortion; nPor <= nLastPortion; nPor++ ) { - bIsEditable &= ! IsReadOnlyPortion( nPor ); + bIsEditable &= ! IsPortionAttrSet(nPor, PORATTR_READONLY); } return bIsEditable; diff --git a/sw/source/core/access/accportions.hxx b/sw/source/core/access/accportions.hxx index 70ffd53349bd..bd84e2cbf4bd 100644 --- a/sw/source/core/access/accportions.hxx +++ b/sw/source/core/access/accportions.hxx @@ -84,7 +84,6 @@ class SwAccessiblePortionData : public SwPortionHandler /// Access to portion attributes bool IsPortionAttrSet( size_t nPortionNo, sal_uInt8 nAttr ) const; bool IsSpecialPortion( size_t nPortionNo ) const; - bool IsReadOnlyPortion( size_t nPortionNo ) const; bool IsGrayPortionType( sal_uInt16 nType ) const; // helper method for GetEditableRange(...): diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx index 69de007de8d7..fa9b732b8e2c 100644 --- a/sw/source/core/crsr/swcrsr.cxx +++ b/sw/source/core/crsr/swcrsr.cxx @@ -167,7 +167,7 @@ bool SwCursor::IsSkipOverProtectSections() const // own SaveObjects if needed and validate them in the virtual check routines. void SwCursor::SaveState() { - SwCursor_SavePos* pNew = CreateNewSavePos(); + SwCursor_SavePos* pNew = new SwCursor_SavePos( *this ); pNew->pNext = m_pSavePos; m_pSavePos = pNew; } @@ -182,11 +182,6 @@ void SwCursor::RestoreState() } } -SwCursor_SavePos* SwCursor::CreateNewSavePos() const -{ - return new SwCursor_SavePos( *this ); -} - /// determine if point is outside of the node-array's content area bool SwCursor::IsNoContent() const { diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx index e96c431c347c..ac85fe589b96 100644 --- a/sw/source/core/doc/docfmt.cxx +++ b/sw/source/core/doc/docfmt.cxx @@ -1227,7 +1227,7 @@ SwTextFormatColl* SwDoc::CopyTextColl( const SwTextFormatColl& rColl ) /// copy the graphic nodes SwGrfFormatColl* SwDoc::CopyGrfColl( const SwGrfFormatColl& rColl ) { - SwGrfFormatColl* pNewColl = FindGrfFormatCollByName( rColl.GetName() ); + SwGrfFormatColl* pNewColl = static_cast<SwGrfFormatColl*>(FindFormatByName( (SwFormatsBase&)*mpGrfFormatCollTable, rColl.GetName() )); if( pNewColl ) return pNewColl; diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx index 033379339b14..21e1726900be 100644 --- a/sw/source/core/doc/docnum.cxx +++ b/sw/source/core/doc/docnum.cxx @@ -2300,18 +2300,11 @@ void SwDoc::MarkListLevel( const OUString& sListId, if ( pList ) { - MarkListLevel( *pList, nListLevel, bValue ); + // Set new marked list level and notify all affected nodes of the changed mark. + pList->MarkListLevel( nListLevel, bValue ); } } -void SwDoc::MarkListLevel( SwList& rList, - const int nListLevel, - const bool bValue ) -{ - // Set new marked list level and notify all affected nodes of the changed mark. - rList.MarkListLevel( nListLevel, bValue ); -} - bool SwDoc::IsFirstOfNumRuleAtPos( const SwPosition & rPos ) { bool bResult = false; diff --git a/sw/source/core/docnode/threadmanager.cxx b/sw/source/core/docnode/threadmanager.cxx index d82d84fdc7c7..89f97e575b7f 100644 --- a/sw/source/core/docnode/threadmanager.cxx +++ b/sw/source/core/docnode/threadmanager.cxx @@ -74,7 +74,7 @@ oslInterlockedCount ThreadManager::AddThread( // create new thread tThreadData aThreadData; - oslInterlockedCount nNewThreadID( RetrieveNewThreadID() ); + oslInterlockedCount nNewThreadID( osl_atomic_increment( &mnThreadIDCounter ) ); { aThreadData.nThreadID = nNewThreadID; diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx index c282108e1a6a..c60b09022062 100644 --- a/sw/source/core/draw/dcontact.cxx +++ b/sw/source/core/draw/dcontact.cxx @@ -1939,7 +1939,7 @@ void SwDrawContact::ChkPage() if ( GetPageFrame() ) GetPageFrame()->RemoveDrawObjFromPage( maAnchoredDrawObj ); pPg->AppendDrawObjToPage( maAnchoredDrawObj ); - SetPageFrame( pPg ); + maAnchoredDrawObj.SetPageFrame( pPg ); } } } diff --git a/sw/source/core/fields/expfld.cxx b/sw/source/core/fields/expfld.cxx index b313d9cc2a92..3f78a1db9b39 100644 --- a/sw/source/core/fields/expfld.cxx +++ b/sw/source/core/fields/expfld.cxx @@ -1146,30 +1146,6 @@ void SwInputField::SetFormatField( SwFormatField& rFormatField ) } -void SwInputField::LockNotifyContentChange() -{ - if ( GetFormatField() != nullptr ) - { - SwTextInputField* pTextInputField = dynamic_cast< SwTextInputField* >(GetFormatField()->GetTextField()); - if ( pTextInputField != nullptr ) - { - pTextInputField->LockNotifyContentChange(); - } - } -} - -void SwInputField::UnlockNotifyContentChange() -{ - if ( GetFormatField() != nullptr ) - { - SwTextInputField* pTextInputField = dynamic_cast< SwTextInputField* >(GetFormatField()->GetTextField()); - if ( pTextInputField != nullptr ) - { - pTextInputField->UnlockNotifyContentChange(); - } - } -} - void SwInputField::applyFieldContent( const OUString& rNewFieldContent ) { if ( (nSubType & 0x00ff) == INP_TXT ) @@ -1185,10 +1161,22 @@ void SwInputField::applyFieldContent( const OUString& rNewFieldContent ) pUserTyp->SetContent( rNewFieldContent ); // trigger update of the corresponding User Fields and other related Input Fields + if ( GetFormatField() != nullptr ) + { + SwTextInputField* pTextInputField = dynamic_cast< SwTextInputField* >(GetFormatField()->GetTextField()); + if ( pTextInputField != nullptr ) + { + pTextInputField->LockNotifyContentChange(); + } + } + pUserTyp->UpdateFields(); + if ( GetFormatField() != nullptr ) { - LockNotifyContentChange(); - pUserTyp->UpdateFields(); - UnlockNotifyContentChange(); + SwTextInputField* pTextInputField = dynamic_cast< SwTextInputField* >(GetFormatField()->GetTextField()); + if ( pTextInputField != nullptr ) + { + pTextInputField->UnlockNotifyContentChange(); + } } } } diff --git a/sw/source/core/inc/anchoredobjectposition.hxx b/sw/source/core/inc/anchoredobjectposition.hxx index f4fc3b72a314..afe6717c3de4 100644 --- a/sw/source/core/inc/anchoredobjectposition.hxx +++ b/sw/source/core/inc/anchoredobjectposition.hxx @@ -100,10 +100,6 @@ namespace objectpositioning { return *mpAnchorFrame; } - inline SwContact& GetContact() const - { - return *mpContact; - } inline const SwFrameFormat& GetFrameFormat() const { return *mpFrameFormat; diff --git a/sw/source/core/inc/cntfrm.hxx b/sw/source/core/inc/cntfrm.hxx index ea2dba49861e..5826ca4ff9b9 100644 --- a/sw/source/core/inc/cntfrm.hxx +++ b/sw/source/core/inc/cntfrm.hxx @@ -76,7 +76,6 @@ public: inline const SwContentFrame *GetFollow() const; inline SwContentFrame *GetFollow(); - inline const SwContentFrame *GetPrecede() const; SwTextFrame* FindMaster() const; // layout dependent cursor travelling @@ -134,11 +133,6 @@ inline SwContentFrame *SwContentFrame::GetFollow() return static_cast<SwContentFrame*>(SwFlowFrame::GetFollow()); } -inline const SwContentFrame *SwContentFrame::GetPrecede() const -{ - return static_cast<const SwContentFrame*>(SwFlowFrame::GetPrecede()); -} - #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/inc/flyfrm.hxx b/sw/source/core/inc/flyfrm.hxx index d207bb0f6f43..37b6ba8f7950 100644 --- a/sw/source/core/inc/flyfrm.hxx +++ b/sw/source/core/inc/flyfrm.hxx @@ -125,7 +125,6 @@ protected: void Unlock() { m_bLocked = false; } Size CalcRel( const SwFormatFrameSize &rSz ) const; - SwTwips CalcAutoWidth() const; SwFlyFrame( SwFlyFrameFormat*, SwFrame*, SwFrame *pAnchor ); diff --git a/sw/source/core/inc/frmtool.hxx b/sw/source/core/inc/frmtool.hxx index 6885a6b9bbd3..168ed121dfe9 100644 --- a/sw/source/core/inc/frmtool.hxx +++ b/sw/source/core/inc/frmtool.hxx @@ -192,8 +192,6 @@ class SwLayNotify : public SwFrameNotify { bool bLowersComplete; - SwLayoutFrame *GetLay() { return static_cast<SwLayoutFrame*>(mpFrame); } - public: SwLayNotify( SwLayoutFrame *pLayFrame ); ~SwLayNotify(); @@ -206,7 +204,6 @@ class SwFlyNotify : public SwLayNotify { SwPageFrame *pOldPage; const SwRect aFrameAndSpace; - SwFlyFrame *GetFly() { return static_cast<SwFlyFrame*>(mpFrame); } public: SwFlyNotify( SwFlyFrame *pFlyFrame ); @@ -224,8 +221,6 @@ private: bool mbInvalidatePrevPrtArea; bool mbBordersJoinedWithPrev; - SwContentFrame *GetCnt(); - public: SwContentNotify( SwContentFrame *pContentFrame ); ~SwContentNotify(); diff --git a/sw/source/core/inc/swfont.hxx b/sw/source/core/inc/swfont.hxx index 857719bf9863..fd41e411aca9 100644 --- a/sw/source/core/inc/swfont.hxx +++ b/sw/source/core/inc/swfont.hxx @@ -993,13 +993,8 @@ public: sal_uInt16 nDrawStretchText; sal_uInt16 nChangeFont; - inline void Reset() - { - nGetTextSize = nDrawText = nGetStretchTextSize = - nDrawStretchText = nChangeFont = 0; - } - - inline SvStatistics() { Reset(); } + SvStatistics() + { nGetTextSize = nDrawText = nGetStretchTextSize = nDrawStretchText = nChangeFont = 0; } }; // global variable, implemented in swfont.cxx diff --git a/sw/source/core/inc/threadmanager.hxx b/sw/source/core/inc/threadmanager.hxx index 126973bb58be..83ea7bae6b6d 100644 --- a/sw/source/core/inc/threadmanager.hxx +++ b/sw/source/core/inc/threadmanager.hxx @@ -139,11 +139,6 @@ class ThreadManager } }; - inline oslInterlockedCount RetrieveNewThreadID() - { - return osl_atomic_increment( &mnThreadIDCounter ); - } - bool StartWaitingThread(); bool StartThread( const tThreadData& aThreadData ); diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx index 4c4a655b06b1..772d4cc8a918 100644 --- a/sw/source/core/layout/flowfrm.cxx +++ b/sw/source/core/layout/flowfrm.cxx @@ -653,7 +653,7 @@ SwTextFrame* SwContentFrame::FindMaster() const { OSL_ENSURE( IsFollow(), "SwContentFrame::FindMaster(): !IsFollow" ); - const SwContentFrame* pPrec = GetPrecede(); + const SwContentFrame* pPrec = static_cast<const SwContentFrame*>(SwFlowFrame::GetPrecede()); if ( pPrec && pPrec->HasFollow() && pPrec->GetFollow() == this ) { diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index 2e7649782a12..8eb91011c6de 100644 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -66,6 +66,7 @@ using namespace ::com::sun::star; +static SwTwips lcl_CalcAutoWidth( const SwLayoutFrame& rFrame ); SwFlyFrame::SwFlyFrame( SwFlyFrameFormat *pFormat, SwFrame* pSib, SwFrame *pAnch ) : SwLayoutFrame( pFormat, pSib ), @@ -1328,7 +1329,7 @@ void SwFlyFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA if ( rFrameSz.GetWidthSizeType() != ATT_FIX_SIZE ) { // #i9046# Autowidth for fly frames - const SwTwips nAutoWidth = CalcAutoWidth(); + const SwTwips nAutoWidth = lcl_CalcAutoWidth( *this ); if ( nAutoWidth ) { if( ATT_MIN_SIZE == rFrameSz.GetWidthSizeType() ) @@ -2437,11 +2438,6 @@ static SwTwips lcl_CalcAutoWidth( const SwLayoutFrame& rFrame ) return nRet; } -SwTwips SwFlyFrame::CalcAutoWidth() const -{ - return lcl_CalcAutoWidth( *this ); -} - /// OD 16.04.2003 #i13147# - If called for paint and the <SwNoTextFrame> contains /// a graphic, load of intrinsic graphic has to be avoided. bool SwFlyFrame::GetContour( tools::PolyPolygon& rContour, diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index 874c77cd7bea..ade02ed453f3 100644 --- a/sw/source/core/layout/frmtool.cxx +++ b/sw/source/core/layout/frmtool.cxx @@ -444,7 +444,7 @@ static void lcl_InvalidatePosOfLowers( SwLayoutFrame& _rLayoutFrame ) SwLayNotify::~SwLayNotify() { - SwLayoutFrame *pLay = GetLay(); + SwLayoutFrame *pLay = static_cast<SwLayoutFrame*>(mpFrame); SwRectFnSet aRectFnSet(pLay); bool bNotify = false; if ( pLay->Prt().SSize() != maPrt.SSize() ) @@ -623,7 +623,7 @@ SwFlyNotify::SwFlyNotify( SwFlyFrame *pFlyFrame ) : SwFlyNotify::~SwFlyNotify() { - SwFlyFrame *pFly = GetFly(); + SwFlyFrame *pFly = static_cast<SwFlyFrame*>(mpFrame); if ( pFly->IsNotifyBack() ) { SwViewShell *pSh = pFly->getRootFrame()->GetCurrShell(); @@ -717,11 +717,6 @@ SwFlyNotify::~SwFlyNotify() } } -SwContentFrame *SwContentNotify::GetCnt() -{ - return static_cast<SwContentFrame*>(mpFrame); -} - SwContentNotify::SwContentNotify( SwContentFrame *pContentFrame ) : SwFrameNotify( pContentFrame ), // OD 08.01.2004 #i11859# @@ -750,7 +745,7 @@ SwContentNotify::SwContentNotify( SwContentFrame *pContentFrame ) : SwContentNotify::~SwContentNotify() { - SwContentFrame *pCnt = GetCnt(); + SwContentFrame *pCnt = static_cast<SwContentFrame*>(mpFrame); if ( bSetCompletePaintOnInvalidate ) pCnt->SetCompletePaint(); diff --git a/sw/source/core/objectpositioning/anchoredobjectposition.cxx b/sw/source/core/objectpositioning/anchoredobjectposition.cxx index 9bbe93573edc..4b300ce8bf3f 100644 --- a/sw/source/core/objectpositioning/anchoredobjectposition.cxx +++ b/sw/source/core/objectpositioning/anchoredobjectposition.cxx @@ -859,7 +859,7 @@ SwTwips SwAnchoredObjectPosition::CalcRelPosX( // it has to be drawn aside another object, which have the same horizontal // position and lay below it. if ( dynamic_cast<const SwFlyFrame*>( &GetAnchoredObj() ) != nullptr && - ( GetContact().ObjAnchoredAtPara() || GetContact().ObjAnchoredAtChar() ) && + ( mpContact->ObjAnchoredAtPara() || mpContact->ObjAnchoredAtChar() ) && ( eHoriOrient == text::HoriOrientation::LEFT || eHoriOrient == text::HoriOrientation::RIGHT ) && eRelOrient != text::RelOrientation::CHAR ) { diff --git a/sw/source/core/text/txtpaint.cxx b/sw/source/core/text/txtpaint.cxx index 8f1106f71f68..dc34ca0d1fd3 100644 --- a/sw/source/core/text/txtpaint.cxx +++ b/sw/source/core/text/txtpaint.cxx @@ -21,7 +21,7 @@ #include "swrect.hxx" #include "rootfrm.hxx" -void SwSaveClip::Reset() +SwSaveClip::~SwSaveClip() { // We recover the old state if( pOut && bChg ) diff --git a/sw/source/core/text/txtpaint.hxx b/sw/source/core/text/txtpaint.hxx index 29435b1cacb7..d520edceeda6 100644 --- a/sw/source/core/text/txtpaint.hxx +++ b/sw/source/core/text/txtpaint.hxx @@ -40,19 +40,14 @@ public: { } - inline ~SwSaveClip(); + ~SwSaveClip(); inline void ChgClip( const SwRect &rRect, const SwTextFrame* pFrame = nullptr, bool bEnlargeRect = false) { if( pOut ) ChgClip_( rRect, pFrame, bEnlargeRect ); } - void Reset(); inline bool IsOn() const { return bOn; } inline bool IsChg() const { return bChg; } }; -inline SwSaveClip::~SwSaveClip() -{ - Reset(); -} #ifdef DBG_UTIL diff --git a/sw/source/core/txtnode/fmtatr2.cxx b/sw/source/core/txtnode/fmtatr2.cxx index 53cd81afd46e..ec463aec97a0 100644 --- a/sw/source/core/txtnode/fmtatr2.cxx +++ b/sw/source/core/txtnode/fmtatr2.cxx @@ -653,8 +653,9 @@ SwTextMeta * Meta::GetTextAttr() const } -void Meta::NotifyChangeTextNodeImpl() +void Meta::NotifyChangeTextNode(SwTextNode *const pTextNode) { + m_pTextNode = pTextNode; if (m_pTextNode && (GetRegisteredIn() != m_pTextNode)) { m_pTextNode->Add(this); @@ -663,12 +664,6 @@ void Meta::NotifyChangeTextNodeImpl() { GetRegisteredInNonConst()->Remove(this); } -} - -void Meta::NotifyChangeTextNode(SwTextNode *const pTextNode) -{ - m_pTextNode = pTextNode; - NotifyChangeTextNodeImpl(); if (!pTextNode) // text node gone? invalidate UNO object! { SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT, diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx index 83370a6b9919..dca6d1b9764b 100644 --- a/sw/source/core/txtnode/txtedt.cxx +++ b/sw/source/core/txtnode/txtedt.cxx @@ -93,6 +93,36 @@ using namespace ::com::sun::star::smarttags; extern const SwTextNode *pLinguNode; extern SwTextFrame *pLinguFrame; +struct SwParaIdleData_Impl +{ + SwWrongList* pWrong; // for spell checking + SwGrammarMarkUp* pGrammarCheck; // for grammar checking / proof reading + SwWrongList* pSmartTags; + sal_uLong nNumberOfWords; + sal_uLong nNumberOfAsianWords; + sal_uLong nNumberOfChars; + sal_uLong nNumberOfCharsExcludingSpaces; + bool bWordCountDirty; + SwTextNode::WrongState eWrongDirty; ///< online spell checking needed/done? + bool bGrammarCheckDirty; + bool bSmartTagDirty; + bool bAutoComplDirty; // die ACompl-Liste muss angepasst werden + + SwParaIdleData_Impl() : + pWrong ( nullptr ), + pGrammarCheck ( nullptr ), + pSmartTags ( nullptr ), + nNumberOfWords ( 0 ), + nNumberOfAsianWords ( 0 ), + nNumberOfChars ( 0 ), + nNumberOfCharsExcludingSpaces ( 0 ), + bWordCountDirty ( true ), + eWrongDirty ( SwTextNode::WrongState::TODO ), + bGrammarCheckDirty ( true ), + bSmartTagDirty ( true ), + bAutoComplDirty ( true ) {}; +}; + /* * This has basically the same function as SwScriptInfo::MaskHiddenRanges, * only for deleted redlines @@ -2000,10 +2030,13 @@ bool SwTextNode::CountWords( SwDocStat& rStat, if ( bCountAll && !IsWordCountDirty() ) { // accumulate into DocStat record to return the values - rStat.nWord += GetParaNumberOfWords(); - rStat.nAsianWord += GetParaNumberOfAsianWords(); - rStat.nChar += GetParaNumberOfChars(); - rStat.nCharExcludingSpaces += GetParaNumberOfCharsExcludingSpaces(); + if (m_pParaIdleData_Impl) + { + rStat.nWord += m_pParaIdleData_Impl->nNumberOfWords; + rStat.nAsianWord += m_pParaIdleData_Impl->nNumberOfAsianWords; + rStat.nChar += m_pParaIdleData_Impl->nNumberOfChars; + rStat.nCharExcludingSpaces += m_pParaIdleData_Impl->nNumberOfCharsExcludingSpaces; + } return false; } @@ -2093,10 +2126,13 @@ bool SwTextNode::CountWords( SwDocStat& rStat, // If counting the whole para then update cached values and mark clean if ( bCountAll ) { - SetParaNumberOfWords( nTmpWords ); - SetParaNumberOfAsianWords( nTmpAsianWords ); - SetParaNumberOfChars( nTmpChars ); - SetParaNumberOfCharsExcludingSpaces( nTmpCharsExcludingSpaces ); + if ( m_pParaIdleData_Impl ) + { + m_pParaIdleData_Impl->nNumberOfWords = nTmpWords; + m_pParaIdleData_Impl->nNumberOfAsianWords = nTmpAsianWords; + m_pParaIdleData_Impl->nNumberOfChars = nTmpChars; + m_pParaIdleData_Impl->nNumberOfCharsExcludingSpaces = nTmpCharsExcludingSpaces; + } SetWordCountDirty( false ); } // accumulate into DocStat record to return the values @@ -2110,36 +2146,6 @@ bool SwTextNode::CountWords( SwDocStat& rStat, // Paragraph statistics start --> -struct SwParaIdleData_Impl -{ - SwWrongList* pWrong; // for spell checking - SwGrammarMarkUp* pGrammarCheck; // for grammar checking / proof reading - SwWrongList* pSmartTags; - sal_uLong nNumberOfWords; - sal_uLong nNumberOfAsianWords; - sal_uLong nNumberOfChars; - sal_uLong nNumberOfCharsExcludingSpaces; - bool bWordCountDirty; - SwTextNode::WrongState eWrongDirty; ///< online spell checking needed/done? - bool bGrammarCheckDirty; - bool bSmartTagDirty; - bool bAutoComplDirty; // die ACompl-Liste muss angepasst werden - - SwParaIdleData_Impl() : - pWrong ( nullptr ), - pGrammarCheck ( nullptr ), - pSmartTags ( nullptr ), - nNumberOfWords ( 0 ), - nNumberOfAsianWords ( 0 ), - nNumberOfChars ( 0 ), - nNumberOfCharsExcludingSpaces ( 0 ), - bWordCountDirty ( true ), - eWrongDirty ( SwTextNode::WrongState::TODO ), - bGrammarCheckDirty ( true ), - bSmartTagDirty ( true ), - bAutoComplDirty ( true ) {}; -}; - void SwTextNode::InitSwParaStatistics( bool bNew ) { if ( bNew ) @@ -2216,45 +2222,6 @@ SwWrongList* SwTextNode::GetSmartTags() return m_pParaIdleData_Impl ? m_pParaIdleData_Impl->pSmartTags : nullptr; } -void SwTextNode::SetParaNumberOfWords( sal_uLong nNew ) const -{ - if ( m_pParaIdleData_Impl ) - { - m_pParaIdleData_Impl->nNumberOfWords = nNew; - } -} - -sal_uLong SwTextNode::GetParaNumberOfWords() const -{ - return m_pParaIdleData_Impl ? m_pParaIdleData_Impl->nNumberOfWords : 0; -} - -void SwTextNode::SetParaNumberOfAsianWords( sal_uLong nNew ) const -{ - if ( m_pParaIdleData_Impl ) - { - m_pParaIdleData_Impl->nNumberOfAsianWords = nNew; - } -} - -sal_uLong SwTextNode::GetParaNumberOfAsianWords() const -{ - return m_pParaIdleData_Impl ? m_pParaIdleData_Impl->nNumberOfAsianWords : 0; -} - -void SwTextNode::SetParaNumberOfChars( sal_uLong nNew ) const -{ - if ( m_pParaIdleData_Impl ) - { - m_pParaIdleData_Impl->nNumberOfChars = nNew; - } -} - -sal_uLong SwTextNode::GetParaNumberOfChars() const -{ - return m_pParaIdleData_Impl ? m_pParaIdleData_Impl->nNumberOfChars : 0; -} - void SwTextNode::SetWordCountDirty( bool bNew ) const { if ( m_pParaIdleData_Impl ) @@ -2263,19 +2230,6 @@ void SwTextNode::SetWordCountDirty( bool bNew ) const } } -sal_uLong SwTextNode::GetParaNumberOfCharsExcludingSpaces() const -{ - return m_pParaIdleData_Impl ? m_pParaIdleData_Impl->nNumberOfCharsExcludingSpaces : 0; -} - -void SwTextNode::SetParaNumberOfCharsExcludingSpaces( sal_uLong nNew ) const -{ - if ( m_pParaIdleData_Impl ) - { - m_pParaIdleData_Impl->nNumberOfCharsExcludingSpaces = nNew; - } -} - bool SwTextNode::IsWordCountDirty() const { return m_pParaIdleData_Impl && m_pParaIdleData_Impl->bWordCountDirty; diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx index 334e75ffb48f..e630254389d6 100644 --- a/sw/source/core/undo/undobj.cxx +++ b/sw/source/core/undo/undobj.cxx @@ -249,21 +249,15 @@ void SwUndo::Repeat(SfxRepeatTarget & rContext) bool SwUndo::CanRepeat(SfxRepeatTarget & rContext) const { - ::sw::RepeatContext *const pRepeatContext( - dynamic_cast< ::sw::RepeatContext * >(& rContext)); - assert(pRepeatContext); - return CanRepeatImpl(*pRepeatContext); + assert(dynamic_cast< ::sw::RepeatContext * >(& rContext)); + (void)rContext; + return (REPEAT_START <= GetId()) && (GetId() < REPEAT_END); } void SwUndo::RepeatImpl( ::sw::RepeatContext & ) { } -bool SwUndo::CanRepeatImpl( ::sw::RepeatContext & ) const -{ - return ((REPEAT_START <= GetId()) && (GetId() < REPEAT_END)); -} - OUString SwUndo::GetComment() const { OUString aResult; diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index 5734c6de05ff..d56428d96c49 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -3626,7 +3626,7 @@ void SwXOLEListener::modified( const lang::EventObject& /*rEvent*/ ) SolarMutexGuard aGuard; SwOLENode* pNd = nullptr; - SwFormat* pFormat = GetFormat(); + SwFormat* pFormat = const_cast<SwFormat*>(static_cast<const SwFormat*>(GetRegisteredIn())); if(pFormat) {const SwNodeIndex* pIdx = pFormat->GetContent().GetContentIdx(); if(pIdx) diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index 676ea7be0239..75cfdea7bdf4 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -1202,7 +1202,7 @@ SwTableBox* SwXCell::FindBox(SwTable* pTable, SwTableBox* pBox2) double SwXCell::GetForcedNumericalValue() const { - if(table::CellContentType_TEXT != getType()) + if(table::CellContentType_TEXT != const_cast<SwXCell*>(this)->getType()) return getValue(); // now we'll try to get a useful numerical value // from the text in the cell... diff --git a/sw/source/filter/html/htmlcss1.cxx b/sw/source/filter/html/htmlcss1.cxx index 1b8bc8385390..bd0bfab5dc17 100644 --- a/sw/source/filter/html/htmlcss1.cxx +++ b/sw/source/filter/html/htmlcss1.cxx @@ -1509,7 +1509,7 @@ void SwCSS1Parser::FillDropCap( SwFormatDrop& rDrop, if( pName ) { aName = *pName; - AddFirstLetterExt( aName ); + aName += ".FL"; // first letter pCFormat = pDoc->FindCharFormatByName( aName ); } else diff --git a/sw/source/filter/html/swcss1.hxx b/sw/source/filter/html/swcss1.hxx index 13658429698a..f79c39c4d583 100644 --- a/sw/source/filter/html/swcss1.hxx +++ b/sw/source/filter/html/swcss1.hxx @@ -127,8 +127,6 @@ public: static void AddClassName( OUString& rFormatName, const OUString& rClass ); - static inline void AddFirstLetterExt( OUString& rFormatName ); - static bool MayBePositioned( const SvxCSS1PropertyInfo& rPropInfo, bool bAutoWidth=false ); @@ -160,11 +158,6 @@ public: virtual void SetDfltEncoding( rtl_TextEncoding eEnc ) override; }; -inline void SwCSS1Parser::AddFirstLetterExt( OUString& rFormatName ) -{ - rFormatName += ".FL"; // first letter -} - inline const SwPageDesc* SwCSS1Parser::GetFirstPageDesc( bool bCreate ) { return GetPageDesc( RES_POOLPAGE_FIRST, bCreate ); diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index d2d2b47ea6a5..87173dbef028 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -2133,7 +2133,8 @@ void MSWordExportBase::OutputTextNode( const SwTextNode& rNode ) if ( aAttrIter.RequiresImplicitBookmark() ) { OUString sBkmkName = "_toc" + OUString::number( rNode.GetIndex() ); - AppendWordBookmark( sBkmkName ); + // Add a bookmark converted to a Word name. + AppendBookmark( BookmarkToWord( sBkmkName ) ); } const OUString& aStr( rNode.GetText() ); diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index e54c4b2408ef..7c2dff0f59df 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -1666,11 +1666,6 @@ int MSWordExportBase::GetGrfIndex(const SvxBrushItem& rBrush) return nIndex; } -void MSWordExportBase::AppendWordBookmark( const OUString& rName ) -{ - AppendBookmark( BookmarkToWord( rName ) ); -} - void WW8_WrtRedlineAuthor::Write( Writer& rWrt ) { WW8Export & rWW8Wrt = *(static_cast<SwWW8Writer&>(rWrt).m_pExport); diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx index 272aa7ac3113..31702553ad39 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -616,9 +616,6 @@ public: /// Find the bookmark name. static OUString GetBookmarkName( sal_uInt16 nTyp, const OUString* pName, sal_uInt16 nSeqNo ); - /// Add a bookmark converted to a Word name. - void AppendWordBookmark( const OUString& rName ); - /// Use OutputItem() on an item set according to the parameters. void OutputItemSet( const SfxItemSet& rSet, bool bPapFormat, bool bChpFormat, sal_uInt16 nScript, bool bExportParentItemSet ); diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index ce09a9dc5513..f7ddc8bf362b 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -4499,14 +4499,6 @@ void WW8RStyle::ImportNewFormatStyles() Import1Style( i ); } -void WW8RStyle::ImportStyles() -{ - if (pIo->m_pWwFib->GetFIBVersion() <= ww::eWW2) - ImportOldFormatStyles(); - else - ImportNewFormatStyles(); -} - void WW8RStyle::Import() { pIo->m_pDfltTextFormatColl = pIo->m_rDoc.GetDfltTextFormatColl(); @@ -4516,7 +4508,10 @@ void WW8RStyle::Import() if( pIo->m_nIniFlags & WW8FL_NO_STYLES ) return; - ImportStyles(); + if (pIo->m_pWwFib->GetFIBVersion() <= ww::eWW2) + ImportOldFormatStyles(); + else + ImportNewFormatStyles(); for (sal_uInt16 i = 0; i < cstd; ++i) { diff --git a/sw/source/filter/ww8/ww8par2.hxx b/sw/source/filter/ww8/ww8par2.hxx index 151325c839dd..75b6f0543f29 100644 --- a/sw/source/filter/ww8/ww8par2.hxx +++ b/sw/source/filter/ww8/ww8par2.hxx @@ -116,8 +116,6 @@ friend class SwWW8ImplReader; void Import1Style(sal_uInt16 nNr); void RecursiveReg(sal_uInt16 nNr); - void ImportStyles(); - void ImportNewFormatStyles(); void ScanStyles(); void ImportOldFormatStyles(); diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx index 0a82a6f5dbc1..4377e80f9639 100644 --- a/sw/source/filter/ww8/ww8scan.cxx +++ b/sw/source/filter/ww8/ww8scan.cxx @@ -1554,12 +1554,6 @@ WW8PLCFpcd* WW8ScannerBase::OpenPieceTable( SvStream* pStr, const WW8Fib* pWwF ) return new WW8PLCFpcd( pStr, pStr->Tell(), nPLCFfLen, 8 ); } -void WW8ScannerBase::DeletePieceTable() -{ - for (auto pGrppl : aPieceGrpprls) - delete[] pGrppl; -} - WW8ScannerBase::WW8ScannerBase( SvStream* pSt, SvStream* pTableSt, SvStream* pDataSt, WW8Fib* pWwFib ) : pWw8Fib(pWwFib), pMainFdoa(nullptr), pHdFtFdoa(nullptr), pMainTxbx(nullptr), @@ -1709,7 +1703,8 @@ WW8ScannerBase::WW8ScannerBase( SvStream* pSt, SvStream* pTableSt, WW8ScannerBase::~WW8ScannerBase() { - DeletePieceTable(); + for (auto pGrppl : aPieceGrpprls) + delete[] pGrppl; delete pPLCFx_PCDAttrs; delete pPLCFx_PCD; delete pPieceIter; @@ -3122,22 +3117,11 @@ void WW8PLCFx_Cp_FKP::ResetAttrStartEnd() bLineEnd = false; } -sal_uLong WW8PLCFx_Cp_FKP::GetPCDIMax() const -{ - return pPcd ? pPcd->GetIMax() : 0; -} - sal_uLong WW8PLCFx_Cp_FKP::GetPCDIdx() const { return pPcd ? pPcd->GetIdx() : 0; } -void WW8PLCFx_Cp_FKP::SetPCDIdx( sal_uLong nIdx ) -{ - if( pPcd ) - pPcd->SetIdx( nIdx ); -} - bool WW8PLCFx_Cp_FKP::SeekPos(WW8_CP nCpPos) { if( pPcd ) // Complex @@ -3357,7 +3341,7 @@ void WW8PLCFx_Cp_FKP::advance() if ( !bComplex || !pPcd ) return; - if( GetPCDIdx() >= GetPCDIMax() ) // End of PLCF + if( GetPCDIdx() >= pPcd->GetIMax() ) // End of PLCF { nAttrStart = nAttrEnd = WW8_CP_MAX; return; @@ -5261,7 +5245,8 @@ sal_uLong WW8PLCFx_Cp_FKP::GetIdx2() const void WW8PLCFx_Cp_FKP::SetIdx2( sal_uLong nIdx ) { - SetPCDIdx( nIdx ); + if( pPcd ) + pPcd->SetIdx( nIdx ); } void WW8PLCFx_Cp_FKP::Save( WW8PLCFxSave1& rSave ) const diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx index 9e8a155f717d..c46a9187e66d 100644 --- a/sw/source/filter/ww8/ww8scan.hxx +++ b/sw/source/filter/ww8/ww8scan.hxx @@ -624,9 +624,7 @@ public: const WW8ScannerBase& rBase, ePLCFT ePl ); virtual ~WW8PLCFx_Cp_FKP() override; void ResetAttrStartEnd(); - sal_uLong GetPCDIMax() const; sal_uLong GetPCDIdx() const; - void SetPCDIdx( sal_uLong nIdx ); virtual sal_uLong GetIdx2() const override; virtual void SetIdx2( sal_uLong nIdx ) override; virtual bool SeekPos(WW8_CP nCpPos) override; @@ -1048,7 +1046,6 @@ private: std::vector<sal_uInt8*> aPieceGrpprls; // attributes of Piece-Table WW8PLCFpcd* OpenPieceTable( SvStream* pStr, const WW8Fib* pWwF ); - void DeletePieceTable(); WW8ScannerBase(const WW8ScannerBase&) = delete; WW8ScannerBase& operator=(const WW8ScannerBase&) = delete; diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx index 57e1bd635fbd..05d0d15f4e35 100644 --- a/sw/source/filter/xml/xmltbli.cxx +++ b/sw/source/filter/xml/xmltbli.cxx @@ -417,7 +417,6 @@ class SwXMLTableCellContext_Impl : public SvXMLImportContext bool HasContent() const { return bHasTextContent || bHasTableContent; } inline void InsertContent_(); inline void InsertContent(); - inline void InsertContentIfNotThere(); inline void InsertContent( SwXMLTableContext *pTable ); public: @@ -594,12 +593,6 @@ inline void SwXMLTableCellContext_Impl::InsertContent() InsertContent_(); } -inline void SwXMLTableCellContext_Impl::InsertContentIfNotThere() -{ - if( !HasContent() ) - InsertContent(); -} - inline void SwXMLTableCellContext_Impl::InsertContent( SwXMLTableContext *pTable ) { @@ -659,8 +652,8 @@ SvXMLImportContext *SwXMLTableCellContext_Impl::CreateChildContext( } else { - if( GetTable()->IsValid() ) - InsertContentIfNotThere(); + if( GetTable()->IsValid() && !HasContent() ) + InsertContent(); // fdo#60842: "office:string-value" overrides text content -> no import if (!(m_bValueTypeIsString && m_bHasStringValue)) { @@ -1639,7 +1632,7 @@ void SwXMLTableContext::InsertCell( const OUString& rStyleName, if( sStyleName.isEmpty() ) { sStyleName = (*m_pRows)[m_nCurRow]->GetDefaultCellStyleName(); - if( sStyleName.isEmpty() && HasColumnDefaultCellStyleNames() ) + if( sStyleName.isEmpty() && m_pColumnDefaultCellStyleNames ) { sStyleName = GetColumnDefaultCellStyleName( m_nCurCol ); if( sStyleName.isEmpty() ) diff --git a/sw/source/filter/xml/xmltbli.hxx b/sw/source/filter/xml/xmltbli.hxx index 091de4683d22..2bc8e106d7b8 100644 --- a/sw/source/filter/xml/xmltbli.hxx +++ b/sw/source/filter/xml/xmltbli.hxx @@ -150,7 +150,6 @@ public: sal_Int32 GetColumnWidth( sal_uInt32 nCol, sal_uInt32 nColSpan ) const; OUString GetColumnDefaultCellStyleName( sal_uInt32 nCol ) const; inline sal_uInt32 GetColumnCount() const; - inline bool HasColumnDefaultCellStyleNames() const; bool IsInsertCellPossible() const { return m_nCurCol < GetColumnCount(); } bool IsInsertColPossible() const { return m_nCurCol < USHRT_MAX; } @@ -198,11 +197,6 @@ inline const SwStartNode *SwXMLTableContext::GetLastStartNode() const return GetPrevStartNode( 0UL, GetColumnCount() ); } -inline bool SwXMLTableContext::HasColumnDefaultCellStyleNames() const -{ - return m_pColumnDefaultCellStyleNames != nullptr; -} - #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/table/tautofmt.cxx b/sw/source/ui/table/tautofmt.cxx index e240aeaf17f6..c1bf217d29cd 100644 --- a/sw/source/ui/table/tautofmt.cxx +++ b/sw/source/ui/table/tautofmt.cxx @@ -88,10 +88,8 @@ private: void PaintCells(vcl::RenderContext& rRenderContext); sal_uInt8 GetFormatIndex( size_t nCol, size_t nRow ) const; - const SvxBoxItem& GetBoxItem( size_t nCol, size_t nRow ) const; void DrawString(vcl::RenderContext& rRenderContext, size_t nCol, size_t nRow); - void DrawStrings(vcl::RenderContext& rRenderContext); void DrawBackground(vcl::RenderContext& rRenderContext); void MakeFonts(sal_uInt8 nIndex, vcl::Font& rFont, vcl::Font& rCJKFont, vcl::Font& rCTLFont); @@ -617,11 +615,6 @@ sal_uInt8 AutoFormatPreview::GetFormatIndex( size_t nCol, size_t nRow ) const return pnFormatMap[ maArray.GetCellIndex( nCol, nRow, mbRTL ) ]; } -const SvxBoxItem& AutoFormatPreview::GetBoxItem( size_t nCol, size_t nRow ) const -{ - return aCurData.GetBoxFormat( GetFormatIndex( nCol, nRow ) ).GetBox(); -} - void AutoFormatPreview::DrawString(vcl::RenderContext& rRenderContext, size_t nCol, size_t nRow) { // Output of the cell text: @@ -801,13 +794,6 @@ MAKENUMSTR: #undef FRAME_OFFSET -void AutoFormatPreview::DrawStrings(vcl::RenderContext& rRenderContext) -{ - for (size_t nRow = 0; nRow < 5; ++nRow) - for (size_t nCol = 0; nCol < 5; ++nCol) - DrawString(rRenderContext, nCol, nRow); -} - void AutoFormatPreview::DrawBackground(vcl::RenderContext& rRenderContext) { for (size_t nRow = 0; nRow < 5; ++nRow) @@ -832,7 +818,9 @@ void AutoFormatPreview::PaintCells(vcl::RenderContext& rRenderContext) DrawBackground(rRenderContext); // 2) values - DrawStrings(rRenderContext); + for (size_t nRow = 0; nRow < 5; ++nRow) + for (size_t nCol = 0; nCol < 5; ++nCol) + DrawString(rRenderContext, nCol, nRow); // 3) border if (aCurData.IsFrame()) @@ -875,7 +863,7 @@ void AutoFormatPreview::CalcLineMap() { svx::frame::Style aStyle; - const SvxBoxItem& rItem = GetBoxItem( nCol, nRow ); + const SvxBoxItem& rItem = aCurData.GetBoxFormat( GetFormatIndex( nCol, nRow ) ).GetBox(); lclSetStyleFromBorder( aStyle, rItem.GetLeft() ); maArray.SetCellStyleLeft( nCol, nRow, aStyle ); lclSetStyleFromBorder( aStyle, rItem.GetRight() ); diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx index f4fd1bbb44f0..2c1fd60a5d28 100644 --- a/sw/source/uibase/docvw/PostItMgr.cxx +++ b/sw/source/uibase/docvw/PostItMgr.cxx @@ -493,7 +493,8 @@ bool SwPostItMgr::CalcRects() // show notes in right order in navigator //prevent Anchors during layout to overlap, e.g. when moving a frame - Sort(); + if (mvPostItFields.size()>1 ) + mvPostItFields.sort(comp_pos); // sort the items into the right page vector, so layout can be done by page for(std::list<SwSidebarItem*>::iterator i = mvPostItFields.begin(); i != mvPostItFields.end() ; ++i) @@ -1513,14 +1514,6 @@ void SwPostItMgr::Show() LayoutPostIts(); } -void SwPostItMgr::Sort() -{ - if (mvPostItFields.size()>1 ) - { - mvPostItFields.sort(comp_pos); - } -} - SwSidebarWin* SwPostItMgr::GetSidebarWin( const SfxBroadcaster* pBroadcaster) const { for(const_iterator i = mvPostItFields.begin(); i != mvPostItFields.end() ; ++i) diff --git a/sw/source/uibase/docvw/srcedtw.cxx b/sw/source/uibase/docvw/srcedtw.cxx index 8f2e3bff6c09..1e7da99e0b69 100644 --- a/sw/source/uibase/docvw/srcedtw.cxx +++ b/sw/source/uibase/docvw/srcedtw.cxx @@ -671,15 +671,6 @@ void SwSrcEditWindow::DoSyntaxHighlight( sal_uInt16 nPara ) } } -void SwSrcEditWindow::DoDelayedSyntaxHighlight( sal_uInt16 nPara ) -{ - if ( !m_bHighlighting ) - { - m_aSyntaxLineTable.insert( nPara ); - m_aSyntaxIdle.Start(); - } -} - void SwSrcEditWindow::ImpDoHighlight( const OUString& rSource, sal_uInt16 nLineOff ) { TextPortions aPortionList; @@ -762,7 +753,11 @@ void SwSrcEditWindow::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) case TEXT_HINT_PARAINSERTED: case TEXT_HINT_PARACONTENTCHANGED: - DoDelayedSyntaxHighlight(static_cast<sal_uInt16>(pTextHint->GetValue())); + if ( !m_bHighlighting ) + { + m_aSyntaxLineTable.insert( static_cast<sal_uInt16>(pTextHint->GetValue()) ); + m_aSyntaxIdle.Start(); + } break; } } diff --git a/sw/source/uibase/inc/srcedtw.hxx b/sw/source/uibase/inc/srcedtw.hxx index ca5aa38d1535..d3b4f8b6d423 100644 --- a/sw/source/uibase/inc/srcedtw.hxx +++ b/sw/source/uibase/inc/srcedtw.hxx @@ -139,8 +139,6 @@ public: void SetReadonly(bool bSet){m_bReadonly = bSet;} bool IsReadonly(){return m_bReadonly;} - void DoDelayedSyntaxHighlight( sal_uInt16 nPara ); - void SetStartLine(sal_uInt16 nLine){m_nStartLine = nLine;} virtual void Command( const CommandEvent& rCEvt ) override; diff --git a/sw/source/uibase/lingu/hhcwrp.cxx b/sw/source/uibase/lingu/hhcwrp.cxx index eccab27dc41d..6d3bef97ef4e 100644 --- a/sw/source/uibase/lingu/hhcwrp.cxx +++ b/sw/source/uibase/lingu/hhcwrp.cxx @@ -638,7 +638,7 @@ bool SwHHCWrapper::ConvNext_impl( ) else if ( m_bStartDone && m_bEndDone ) { // body region done, ask about special region - if( HasOtherCnt_impl() ) + if( !m_bIsSelection && m_rWrtShell.HasOtherCnt() ) { ConvStart_impl( m_pConvArgs, SvxSpellArea::Other ); m_bIsOtherContent = bGoOn = true; @@ -679,11 +679,6 @@ bool SwHHCWrapper::FindConvText_impl() return bFound; } -bool SwHHCWrapper::HasOtherCnt_impl() -{ - return !m_bIsSelection && m_rWrtShell.HasOtherCnt(); -} - void SwHHCWrapper::ConvStart_impl( SwConversionArgs /* [out] */ *pConversionArgs, SvxSpellArea eArea ) { m_bIsDrawObj = SvxSpellArea::Other == eArea; |