[Libreoffice-commits] core.git: solenv/clang-format sw/inc sw/Library_sw.mk sw/source
Miklos Vajna (via logerrit)
logerrit at kemper.freedesktop.org
Fri May 8 07:02:28 UTC 2020
solenv/clang-format/blacklist | 2
sw/Library_sw.mk | 1
sw/inc/pch/precompiled_sw.hxx | 1
sw/source/core/inc/blink.hxx | 93 --------------------
sw/source/core/layout/newfrm.cxx | 3
sw/source/core/text/blink.cxx | 176 ---------------------------------------
sw/source/core/text/frmform.cxx | 3
sw/source/core/text/itrform2.cxx | 3
sw/source/core/text/porfld.cxx | 3
sw/source/core/text/porlay.cxx | 6 -
sw/source/core/text/porlin.cxx | 3
sw/source/core/text/txtdrop.cxx | 3
sw/source/core/text/txtinit.cxx | 2
13 files changed, 1 insertion(+), 298 deletions(-)
New commits:
commit b6ad72a34c150df18905e47e588fd35c400dd6b9
Author: Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Thu May 7 21:16:29 2020 +0200
Commit: Miklos Vajna <vmiklos at collabora.com>
CommitDate: Fri May 8 09:01:48 2020 +0200
sw: remove now unused SwBlinkPortion
Change-Id: If2ae13219f7907eb2b2a66a38bcd636dd64dfe3a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93676
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
diff --git a/solenv/clang-format/blacklist b/solenv/clang-format/blacklist
index db09c4a5d8a9..19dc44686a92 100644
--- a/solenv/clang-format/blacklist
+++ b/solenv/clang-format/blacklist
@@ -14563,7 +14563,6 @@ sw/source/core/inc/acorrect.hxx
sw/source/core/inc/anchoredobjectposition.hxx
sw/source/core/inc/annotationmark.hxx
sw/source/core/inc/ascharanchoredobjectposition.hxx
-sw/source/core/inc/blink.hxx
sw/source/core/inc/bodyfrm.hxx
sw/source/core/inc/bookmrk.hxx
sw/source/core/inc/cellfrm.hxx
@@ -14721,7 +14720,6 @@ sw/source/core/text/EnhancedPDFExportHelper.cxx
sw/source/core/text/SwGrammarMarkUp.cxx
sw/source/core/text/atrhndl.hxx
sw/source/core/text/atrstck.cxx
-sw/source/core/text/blink.cxx
sw/source/core/text/frmcrsr.cxx
sw/source/core/text/frmform.cxx
sw/source/core/text/frminf.cxx
diff --git a/sw/Library_sw.mk b/sw/Library_sw.mk
index b6d75fd890bf..fcb8786d704f 100644
--- a/sw/Library_sw.mk
+++ b/sw/Library_sw.mk
@@ -369,7 +369,6 @@ $(eval $(call gb_Library_add_exception_objects,sw,\
sw/source/core/text/EnhancedPDFExportHelper \
sw/source/core/text/SwGrammarMarkUp \
sw/source/core/text/atrstck \
- sw/source/core/text/blink \
sw/source/core/text/frmcrsr \
sw/source/core/text/frmform \
sw/source/core/text/frminf \
diff --git a/sw/inc/pch/precompiled_sw.hxx b/sw/inc/pch/precompiled_sw.hxx
index e1482f34dd8f..d52da985f3c1 100644
--- a/sw/inc/pch/precompiled_sw.hxx
+++ b/sw/inc/pch/precompiled_sw.hxx
@@ -461,7 +461,6 @@
#include <anchoredobject.hxx>
#include <authfld.hxx>
#include <basesh.hxx>
-#include <blink.hxx>
#include <bodyfrm.hxx>
#include <bookmrk.hxx>
#include <breakit.hxx>
diff --git a/sw/source/core/inc/blink.hxx b/sw/source/core/inc/blink.hxx
deleted file mode 100644
index 61c45fda8044..000000000000
--- a/sw/source/core/inc/blink.hxx
+++ /dev/null
@@ -1,93 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef INCLUDED_SW_SOURCE_CORE_INC_BLINK_HXX
-#define INCLUDED_SW_SOURCE_CORE_INC_BLINK_HXX
-
-class SwLinePortion;
-class SwRootFrame;
-class SwTextFrame;
-
-#include <vcl/timer.hxx>
-#include <tools/gen.hxx>
-#include <comphelper/stl_types.hxx>
-
-#include <set>
-#include <memory>
-
-class SwBlinkPortion
-{
- Point aPos;
- const SwLinePortion *pPor;
- const SwRootFrame *pFrame;
- sal_uInt16 nDir;
-
-public:
- SwBlinkPortion(const SwLinePortion* pPortion, sal_uInt16 nDirection)
- : pPor(pPortion)
- , pFrame(nullptr)
- , nDir(nDirection)
- {
- }
- SwBlinkPortion(const SwBlinkPortion* pBlink, const SwLinePortion* pPort)
- : aPos(pBlink->aPos)
- , pPor(pPort)
- , pFrame(pBlink->pFrame)
- , nDir(pBlink->nDir)
- {
- }
- void SetPos( const Point& aNew ){ aPos = aNew; }
- const Point& GetPos() const{ return aPos; }
- void SetRootFrame( const SwRootFrame* pNew ){ pFrame = pNew; }
- const SwRootFrame* GetRootFrame() const{ return pFrame; }
- const SwLinePortion *GetPortion() const{ return pPor; }
- sal_uInt16 GetDirection() const { return nDir; }
- bool operator<( const SwBlinkPortion& rBlinkPortion ) const
- { return reinterpret_cast<sal_IntPtr>(pPor) < reinterpret_cast<sal_IntPtr>(rBlinkPortion.pPor); }
-};
-
-typedef std::set<std::unique_ptr<SwBlinkPortion>,
- comphelper::UniquePtrValueLess<SwBlinkPortion>> SwBlinkSet;
-
-class SwBlink
-{
- SwBlinkSet m_List;
- AutoTimer aTimer;
- bool bVisible;
-
-public:
- SwBlink();
- ~SwBlink();
-
- DECL_LINK( Blinker, Timer *, void );
-
- void Insert( const Point& rPoint, const SwLinePortion* pPor,
- const SwTextFrame *pTextFrame, sal_uInt16 nDir );
- void Replace( const SwLinePortion* pOld, const SwLinePortion* pNew );
- void Delete( const SwLinePortion* pPor );
- void FrameDelete( const SwRootFrame* pRoot );
- bool IsVisible() const { return bVisible ; }
-};
-
-// Blink-Manager, global variable, see Blink.Cxx
-extern SwBlink *pBlink;
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx
index 2827a5ca68de..07ba49b7b626 100644
--- a/sw/source/core/layout/newfrm.cxx
+++ b/sw/source/core/layout/newfrm.cxx
@@ -29,7 +29,6 @@
#include <dflyobj.hxx>
#include <frmtool.hxx>
#include "virtoutp.hxx"
-#include <blink.hxx>
#include <notxtfrm.hxx>
#include <pagedesc.hxx>
#include <viewimp.hxx>
@@ -522,8 +521,6 @@ void SwRootFrame::DestroyImpl()
mbTurboAllowed = false;
mpTurbo = nullptr;
- if(pBlink)
- pBlink->FrameDelete( this );
SwFrameFormat *pRegisteredInNonConst = static_cast<SwFrameFormat*>(GetDep());
if ( pRegisteredInNonConst )
{
diff --git a/sw/source/core/text/blink.cxx b/sw/source/core/text/blink.cxx
deleted file mode 100644
index 82dd83543d3c..000000000000
--- a/sw/source/core/text/blink.cxx
+++ /dev/null
@@ -1,176 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include <memory>
-#include <viewsh.hxx>
-#include <rootfrm.hxx>
-#include <txtfrm.hxx>
-#include <blink.hxx>
-#include "porlin.hxx"
-#include "porlay.hxx"
-
-// Visible time
-#define BLINK_ON_TIME 2400
-// Invisible time
-#define BLINK_OFF_TIME 800
-
-/**
- * pBlink points to the instance where blinking portions need to register.
- * If necessary, it needs to be created by SwBlink.
- * They are then triggered rhythmically for a repaint. They can query
- * for being visible or invisible with IsVisible().
- */
-SwBlink *pBlink = nullptr;
-
-SwBlink::SwBlink()
-{
- bVisible = true;
- // Prepare the timer
- aTimer.SetTimeout( BLINK_ON_TIME );
- aTimer.SetInvokeHandler( LINK(this, SwBlink, Blinker) );
-}
-
-SwBlink::~SwBlink( )
-{
- aTimer.Stop();
-}
-
-/**
- * SwBlink::Blinker (timer):
- * Toggle visibility flag
- * Determine the repaint rectangle and invalidate them in their OleShells.
- */
-IMPL_LINK_NOARG(SwBlink, Blinker, Timer *, void)
-{
- bVisible = !bVisible;
- if( bVisible )
- aTimer.SetTimeout( BLINK_ON_TIME );
- else
- aTimer.SetTimeout( BLINK_OFF_TIME );
- if (!m_List.empty())
- {
-
- for (SwBlinkSet::iterator it = m_List.begin(); it != m_List.end(); )
- {
- const SwBlinkPortion* pTmp = it->get();
- if( pTmp->GetRootFrame() &&
- pTmp->GetRootFrame()->GetCurrShell() )
- {
- ++it;
-
- Point aPos = pTmp->GetPos();
- long nWidth, nHeight;
- switch ( pTmp->GetDirection() )
- {
- case 900:
- aPos.AdjustX( -(pTmp->GetPortion()->GetAscent()) );
- aPos.AdjustY( -(pTmp->GetPortion()->Width()) );
- nWidth = pTmp->GetPortion()->SvLSize().Height();
- nHeight = pTmp->GetPortion()->SvLSize().Width();
- break;
- case 1800:
- aPos.AdjustY( -(pTmp->GetPortion()->Height() -
- pTmp->GetPortion()->GetAscent()) );
- aPos.AdjustX( -(pTmp->GetPortion()->Width()) );
- nWidth = pTmp->GetPortion()->SvLSize().Width();
- nHeight = pTmp->GetPortion()->SvLSize().Height();
- break;
- case 2700:
- aPos.AdjustX( -(pTmp->GetPortion()->Height() -
- pTmp->GetPortion()->GetAscent()) );
- nWidth = pTmp->GetPortion()->SvLSize().Height();
- nHeight = pTmp->GetPortion()->SvLSize().Width();
- break;
- default:
- aPos.AdjustY( -(pTmp->GetPortion()->GetAscent()) );
- nWidth = pTmp->GetPortion()->SvLSize().Width();
- nHeight = pTmp->GetPortion()->SvLSize().Height();
- }
-
- tools::Rectangle aRefresh( aPos, Size( nWidth, nHeight ) );
- aRefresh.AdjustRight(( aRefresh.Bottom()- aRefresh.Top() ) / 8 );
- pTmp->GetRootFrame()
- ->GetCurrShell()->InvalidateWindows( aRefresh );
- }
- else // Portions without a shell can be removed from the list
- it = m_List.erase(it);
- }
- }
- else // If the list is empty, the timer can be stopped
- aTimer.Stop();
-}
-
-void SwBlink::Insert( const Point& rPoint, const SwLinePortion* pPor,
- const SwTextFrame *pTextFrame, sal_uInt16 nDir )
-{
- std::unique_ptr<SwBlinkPortion> pBlinkPor(new SwBlinkPortion(pPor, nDir));
-
- SwBlinkSet::iterator it = m_List.find( pBlinkPor );
- if (it != m_List.end())
- {
- (*it)->SetPos( rPoint );
- }
- else
- {
- pBlinkPor->SetPos( rPoint );
- pBlinkPor->SetRootFrame( pTextFrame->getRootFrame() );
- m_List.insert(std::move(pBlinkPor));
- pTextFrame->SetBlinkPor();
- if( pPor->IsLayPortion() || pPor->IsParaPortion() )
- const_cast<SwLineLayout*>(static_cast<const SwLineLayout*>(pPor))->SetBlinking(true);
-
- if( !aTimer.IsActive() )
- aTimer.Start();
- }
-}
-
-void SwBlink::Replace( const SwLinePortion* pOld, const SwLinePortion* pNew )
-{
- // setting direction to 0 because direction does not matter
- // for this operation
- std::unique_ptr<SwBlinkPortion> pBlinkPortion(new SwBlinkPortion(pOld, 0));
- SwBlinkSet::iterator it = m_List.find( pBlinkPortion );
- if (it != m_List.end())
- {
- std::unique_ptr<SwBlinkPortion> pTmp(new SwBlinkPortion(it->get(), pNew));
- m_List.erase( it );
- m_List.insert(std::move(pTmp));
- }
-}
-
-void SwBlink::Delete( const SwLinePortion* pPor )
-{
- // setting direction to 0 because direction does not matter
- // for this operation
- std::unique_ptr<SwBlinkPortion> pBlinkPortion(new SwBlinkPortion(pPor, 0));
- m_List.erase( pBlinkPortion );
-}
-
-void SwBlink::FrameDelete( const SwRootFrame* pRoot )
-{
- for (SwBlinkSet::iterator it = m_List.begin(); it != m_List.end(); )
- {
- if (pRoot == (*it)->GetRootFrame())
- it = m_List.erase(it);
- else
- ++it;
- }
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index c3167561a496..71e417c3ad54 100644
--- a/sw/source/core/text/frmform.cxx
+++ b/sw/source/core/text/frmform.cxx
@@ -39,7 +39,6 @@
#include "itrform2.hxx"
#include "widorp.hxx"
#include "txtcache.hxx"
-#include <blink.hxx>
#include <sectfrm.hxx>
#include <rootfrm.hxx>
#include <frmfmt.hxx>
@@ -1699,8 +1698,6 @@ void SwTextFrame::Format_( vcl::RenderContext* pRenderContext, SwParaPortion *pP
const bool bMustFit = pPara->IsPrepMustFit();
pPara->Truncate();
pPara->FormatReset();
- if( pBlink && pPara->IsBlinking() )
- pBlink->Delete( pPara );
// delete pSpaceAdd and pKanaComp
pPara->FinishSpaceAdd();
diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index 05a25f87e5f8..9e1abfa1bec8 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -44,7 +44,6 @@
#include "porftn.hxx"
#include "porhyph.hxx"
#include "pordrop.hxx"
-#include <blink.hxx>
#include "redlnitr.hxx"
#include <pagefrm.hxx>
#include <tgrditem.hxx>
@@ -1922,8 +1921,6 @@ void SwTextFormatter::FormatReset( SwTextFormatInfo &rInf )
m_pFirstOfBorderMerge = nullptr;
m_pCurr->Truncate();
m_pCurr->Init();
- if( pBlink && m_pCurr->IsBlinking() )
- pBlink->Delete( m_pCurr );
// delete pSpaceAdd and pKanaComp
m_pCurr->FinishSpaceAdd();
diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx
index 5c60bed70425..fb414dc8772e 100644
--- a/sw/source/core/text/porfld.cxx
+++ b/sw/source/core/text/porfld.cxx
@@ -30,7 +30,6 @@
#include "porlay.hxx"
#include "porfld.hxx"
#include "inftxt.hxx"
-#include <blink.hxx>
#include <fmtornt.hxx>
#include <frmatr.hxx>
#include <frmtool.hxx>
@@ -112,8 +111,6 @@ SwFieldPortion::SwFieldPortion( const SwFieldPortion& rField )
SwFieldPortion::~SwFieldPortion()
{
m_pFont.reset();
- if( pBlink )
- pBlink->Delete( this );
}
sal_uInt16 SwFieldPortion::GetViewWidth( const SwTextSizeInfo &rInf ) const
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index d572ddd45312..2b51a2eca9bc 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -20,7 +20,6 @@
#include "porlay.hxx"
#include "itrform2.hxx"
#include "porglue.hxx"
-#include <blink.hxx>
#include "redlnitr.hxx"
#include "porfly.hxx"
#include "porrst.hxx"
@@ -200,8 +199,6 @@ SwLineLayout::~SwLineLayout()
{
Truncate();
DeleteNext();
- if( pBlink )
- pBlink->Delete( this );
m_pLLSpaceAdd.reset();
m_pKanaComp.reset();
}
@@ -215,10 +212,9 @@ SwLinePortion *SwLineLayout::Insert( SwLinePortion *pIns )
if( GetLen() )
{
mpNextPortion = SwTextPortion::CopyLinePortion(*this);
- if( IsBlinking() && pBlink )
+ if( IsBlinking() )
{
SetBlinking( false );
- pBlink->Replace( this, mpNextPortion );
}
}
else
diff --git a/sw/source/core/text/porlin.cxx b/sw/source/core/text/porlin.cxx
index 8b51ebb2e07f..a9b057faa454 100644
--- a/sw/source/core/text/porlin.cxx
+++ b/sw/source/core/text/porlin.cxx
@@ -23,7 +23,6 @@
#include "porlin.hxx"
#include "inftxt.hxx"
#include "pormulti.hxx"
-#include <blink.hxx>
#if OSL_DEBUG_LEVEL > 0
static bool ChkChain( SwLinePortion *pStart )
@@ -52,8 +51,6 @@ static bool ChkChain( SwLinePortion *pStart )
SwLinePortion::~SwLinePortion()
{
- if( pBlink )
- pBlink->Delete( this );
}
SwLinePortion *SwLinePortion::Compress()
diff --git a/sw/source/core/text/txtdrop.cxx b/sw/source/core/text/txtdrop.cxx
index 274e8c39d0df..b1a3bb1214af 100644
--- a/sw/source/core/text/txtdrop.cxx
+++ b/sw/source/core/text/txtdrop.cxx
@@ -27,7 +27,6 @@
#include "pordrop.hxx"
#include "itrform2.hxx"
#include "txtpaint.hxx"
-#include <blink.hxx>
#include <breakit.hxx>
#include <com/sun/star/i18n/ScriptType.hpp>
#include <com/sun/star/i18n/WordType.hpp>
@@ -119,8 +118,6 @@ SwDropPortion::SwDropPortion( const sal_uInt16 nLineCnt,
SwDropPortion::~SwDropPortion()
{
pPart.reset();
- if( pBlink )
- pBlink->Delete( this );
}
/// nWishLen = 0 indicates that we want a whole word
diff --git a/sw/source/core/text/txtinit.cxx b/sw/source/core/text/txtinit.cxx
index e1155bc228e8..b8a6540f6318 100644
--- a/sw/source/core/text/txtinit.cxx
+++ b/sw/source/core/text/txtinit.cxx
@@ -22,7 +22,6 @@
#include <swfntcch.hxx>
#include <txtfrm.hxx>
#include "pordrop.hxx"
-#include <blink.hxx>
#include <init.hxx>
#include <txtfly.hxx>
#include <dbg_lay.hxx>
@@ -54,7 +53,6 @@ void TextFinit()
delete SwTextFrame::GetTextCache();
delete pSwFontCache;
delete pFntCache;
- delete pBlink;
delete pContourCache;
SwDropPortion::DeleteDropCapCache();
}
More information about the Libreoffice-commits
mailing list