Skip to content

Commit

Permalink
Further code cleanup for removing Writer page shadows
Browse files Browse the repository at this point in the history
  • Loading branch information
Pilot-Pirx committed May 2, 2022
1 parent 2bfabe8 commit e421cc8
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 62 deletions.
5 changes: 0 additions & 5 deletions main/sw/source/core/inc/pagefrm.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ class SwPageFrm: public SwFtnBossFrm

// OD 12.02.2003 #i9719#, #105645#
static const sal_Int8 mnBorderPxWidth;
static const sal_Int8 mnShadowPxWidth;

void _UpdateAttr( const SfxPoolItem*, const SfxPoolItem*, sal_uInt8 &,
SwAttrSetChg *pa = 0, SwAttrSetChg *pb = 0 );
Expand Down Expand Up @@ -400,10 +399,6 @@ public:
{
return mnBorderPxWidth;
}
inline sal_Int8 ShadowPxWidth() const
{
return mnShadowPxWidth;
}

// OD 22.09.2003 #110978#
const SwRect PrtWithoutHeaderAndFooter() const;
Expand Down
35 changes: 16 additions & 19 deletions main/sw/source/core/layout/layact.cxx
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
/**************************************************************
*
*
* 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
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*
*************************************************************/


Expand Down Expand Up @@ -149,7 +149,7 @@ static void BreakPoint()

#define RESCHEDULE \
{ \
if ( IsReschedule() ) \
if ( IsReschedule() ) \
{ \
if (pProgress) pProgress->Reschedule(); \
::RescheduleProgress( pImp->GetShell()->GetDoc()->GetDocShell() ); \
Expand Down Expand Up @@ -839,7 +839,7 @@ void SwLayAction::InternalAction()
//Wenn ein Input anliegt wollen wir keinen Inhalt mehr Formatieren,
//Das Layout muessen wir aber schon in Ordnung bringen.
//Andernfalls kann folgende Situation auftreten (Bug: 3244):
//Am Ende des Absatz der letzten Seite wird Text eingegeben, so das
//Am Ende des Absatz der letzten Seite wird Text eingegeben, so dass
//der Absatz einen Follow fuer die nachste Seite erzeugt, ausserdem
//wird gleich schnell weitergetippt - Es liegt waehrend der
//Verarbeitung ein Input an. Der Absatz auf der neuen Seite wurde
Expand Down Expand Up @@ -1223,17 +1223,17 @@ sal_Bool SwLayAction::IsShortCut( SwPageFrm *&prPage )
{
bRet = sal_True;

//Jetzt wird es ein bischen unangenehm: Der erste CntntFrm dieser Seite
//im Bodytext muss Formatiert werden, wenn er dabei die Seite
//Jetzt wird es ein bisschen unangenehm: Der erste CntntFrm dieser Seite
//im Bodytext muss formatiert werden, wenn er dabei die Seite
//wechselt, muss ich nochmal eine Seite zuvor anfangen, denn
//es wurde ein PageBreak verarbeitet.
//Noch unangenehmer: Der naechste CntntFrm ueberhaupt muss
//Formatiert werden, denn es kann passieren, dass kurzfristig
//formatiert werden, denn es kann passieren, dass kurzfristig
//leere Seiten existieren (Bsp. Absatz ueber mehrere Seiten
//wird geloescht oder verkleinert).

//Ist fuer den Browser uninteressant, wenn der letzte Cnt davor bereits
//nicht mehr sichbar ist.
//nicht mehr sichtbar ist.

const SwPageFrm *p2ndPage = prPage;
const SwCntntFrm *pCntnt;
Expand Down Expand Up @@ -1450,15 +1450,13 @@ sal_Bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, sal_Bool bAddRect )
if ( !bNoPaint && IsPaint() && bAddRect && (pLay->IsCompletePaint() || bChanged) )
{
SwRect aPaint( pLay->Frm() );
// OD 13.02.2003 #i9719#, #105645# - consider border and shadow for
// OD 13.02.2003 #i9719#, #105645# - consider border (shadow removed now) for
// page frames -> enlarge paint rectangle correspondingly.
if ( pLay->IsPageFrm() )
{
SwPageFrm* pPageFrm = static_cast<SwPageFrm*>(pLay);
const int nBorderWidth =
pImp->GetShell()->GetOut()->PixelToLogic( Size( pPageFrm->BorderPxWidth(), 0 ) ).Width();
const int nShadowWidth =
pImp->GetShell()->GetOut()->PixelToLogic( Size( pPageFrm->ShadowPxWidth(), 0 ) ).Width();

//mod #i6193# added sidebar width
const SwPostItMgr* pPostItMgr = pImp->GetShell()->GetPostItMgr();
Expand All @@ -1468,21 +1466,21 @@ sal_Bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, sal_Bool bAddRect )
case sw::sidebarwindows::SIDEBAR_LEFT:
{
aPaint.Left( aPaint.Left() - nBorderWidth - nSidebarWidth);
aPaint.Right( aPaint.Right() + nBorderWidth + nShadowWidth);
aPaint.Right( aPaint.Right() + nBorderWidth );
}
break;
case sw::sidebarwindows::SIDEBAR_RIGHT:
{
aPaint.Left( aPaint.Left() - nBorderWidth );
aPaint.Right( aPaint.Right() + nBorderWidth + nShadowWidth + nSidebarWidth);
aPaint.Right( aPaint.Right() + nBorderWidth + nSidebarWidth);
}
break;
case sw::sidebarwindows::SIDEBAR_NONE:
// nothing to do
break;
}
aPaint.Top( aPaint.Top() - nBorderWidth );
aPaint.Bottom( aPaint.Bottom() + nBorderWidth + nShadowWidth);
aPaint.Bottom( aPaint.Bottom() + nBorderWidth );
}

sal_Bool bPageInBrowseMode = pLay->IsPageFrm();
Expand Down Expand Up @@ -1815,7 +1813,7 @@ sal_Bool SwLayAction::FormatLayoutTab( SwTabFrm *pTab, sal_Bool bAddRect )
if ( IsAgain() )
return sal_False;

// OD 20.10.2003 #112464# - for savety reasons:
// OD 20.10.2003 #112464# - for safety reasons:
// check page number before formatting lowers.
if ( pOldPage->GetPhyPageNum() > (pTab->FindPageFrm()->GetPhyPageNum() + 1) )
SetNextCycle( sal_True );
Expand Down Expand Up @@ -1920,7 +1918,7 @@ sal_Bool SwLayAction::FormatCntnt( const SwPageFrm *pPage )
if ( pOldUpper != pCntnt->GetUpper() )
{
const sal_uInt16 nCurNum = pCntnt->FindPageFrm()->GetPhyPageNum();
if ( nCurNum < pPage->GetPhyPageNum() )
if ( nCurNum < pPage->GetPhyPageNum() )
nPreInvaPage = nCurNum;

//Wenn der Frm mehr als eine Seite rueckwaerts geflossen ist, so
Expand Down Expand Up @@ -2619,4 +2617,3 @@ SwLayIdle::~SwLayIdle()
{
pImp->pIdleAct = 0;
}

19 changes: 9 additions & 10 deletions main/sw/source/core/layout/paintfrm.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -5431,7 +5431,6 @@ void SwPageFrm::PaintMarginArea( const SwRect& _rOutputRect,
// ----------------------------------------------------------------------

const sal_Int8 SwPageFrm::mnBorderPxWidth = 1;
const sal_Int8 SwPageFrm::mnShadowPxWidth = 0;

/** determine rectangle for page border
Expand Down Expand Up @@ -5477,10 +5476,10 @@ const sal_Int8 SwPageFrm::mnShadowPxWidth = 0;
_pViewShell->GetOut()->LogicToPixel( aAlignedPageRect.SVRect() );

Rectangle aRightShadowPxRect(
aPagePxRect.Right() + mnShadowPxWidth,
aPagePxRect.Right(),
aPagePxRect.Top() + 1,
aPagePxRect.Right() + mnBorderPxWidth + mnShadowPxWidth,
aPagePxRect.Bottom() + mnBorderPxWidth + mnShadowPxWidth );
aPagePxRect.Right() + mnBorderPxWidth,
aPagePxRect.Bottom() + mnBorderPxWidth );

if ( bRightSidebar )
AddSidebarBorders(aRightShadowPxRect,_pViewShell, bRightSidebar, true);
Expand All @@ -5507,9 +5506,9 @@ const sal_Int8 SwPageFrm::mnShadowPxWidth = 0;

Rectangle aBottomShadowPxRect(
aPagePxRect.Left() + 1,
aPagePxRect.Bottom() + mnShadowPxWidth,
aPagePxRect.Right() + mnBorderPxWidth + mnShadowPxWidth,
aPagePxRect.Bottom() + mnBorderPxWidth + mnShadowPxWidth );
aPagePxRect.Bottom(),
aPagePxRect.Right() + mnBorderPxWidth,
aPagePxRect.Bottom() + mnBorderPxWidth );

AddSidebarBorders(aBottomShadowPxRect,_pViewShell, bRightSidebar, true);

Expand Down Expand Up @@ -6182,7 +6181,7 @@ void MA_FASTCALL lcl_RefreshLine( const SwLayoutFrm *pLay,
//hinter den Fly gesetzt.
//Wenn der Endpunkt in einem Fly sitzt oder zwischen Start und Endpunkt
//ein Fly sitzt, so wird der Endpunkt eben an den Start herangezogen.
//Auf diese art und weise wird eine Portion nach der anderen
//Auf diese Art und Weise wird eine Portion nach der anderen
//ausgegeben.

//Wenn ich selbst ein Fly bin, weiche ich nur denjenigen Flys aus,
Expand Down Expand Up @@ -6599,7 +6598,7 @@ void SwFrm::Retouche( const SwPageFrm * pPage, const SwRect &rRect ) const

if ( aRetouche.HasArea() )
{
//Uebergebenes Rect ausparen. Dafuer brauchen wir leider eine Region
//Uebergebenes Rect aussparen. Dafuer brauchen wir leider eine Region
//zum ausstanzen.
SwRegionRects aRegion( aRetouche );
aRegion -= rRect;
Expand Down Expand Up @@ -6679,7 +6678,7 @@ void SwFrm::Retouche( const SwPageFrm * pPage, const SwRect &rRect ) const
set under special conditions, if background brush is taken from an index section.
@param rOrigRect
in-/output parameter - reference to the retangle the background brush is
in-/output parameter - reference to the rectangle the background brush is
considered for - adjusted to the frame, from which the background brush is
taken.
Expand Down
4 changes: 1 addition & 3 deletions main/sw/source/core/view/pagepreviewlayout.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1112,8 +1112,6 @@ bool SwPagePreviewLayout::Paint( const Rectangle _aOutRect ) const

const Font& rEmptyPgFont = SwPageFrm::GetEmptyPageFont();

// Color aEmptyPgShadowBorderColor = SwViewOption::GetFontColor(); // Is this used anywhere?

for ( std::vector<PrevwPage*>::const_iterator aPageIter = maPrevwPages.begin();
aPageIter != maPrevwPages.end();
++aPageIter )
Expand Down Expand Up @@ -1228,7 +1226,7 @@ void SwPagePreviewLayout::Repaint( const Rectangle _aInvalidCoreRect ) const
return;
}

// environment and parameter ok
// environment and parameter OK

// prepare paint
if ( maPrevwPages.size() > 0 )
Expand Down

0 comments on commit e421cc8

Please sign in to comment.