This is an automated email from the ASF dual-hosted git repository.
mseidel pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/openoffice.git
The following commit(s) were added to refs/heads/trunk by this push:
new e421cc8f5a Further code cleanup for removing Writer page shadows
e421cc8f5a is described below
commit e421cc8f5a44fb75e600a9c9b13043c3230766fa
Author: mseidel <[email protected]>
AuthorDate: Mon May 2 21:32:30 2022 +0200
Further code cleanup for removing Writer page shadows
---
main/sw/source/core/inc/pagefrm.hxx | 5 ---
main/sw/source/core/layout/layact.cxx | 35 +++++++++---------
main/sw/source/core/layout/paintfrm.cxx | 19 +++++-----
main/sw/source/core/view/pagepreviewlayout.cxx | 4 +--
main/sw/source/core/view/viewsh.cxx | 49 +++++++++++++-------------
5 files changed, 50 insertions(+), 62 deletions(-)
diff --git a/main/sw/source/core/inc/pagefrm.hxx
b/main/sw/source/core/inc/pagefrm.hxx
index 3cd7503c82..255f8731d2 100644
--- a/main/sw/source/core/inc/pagefrm.hxx
+++ b/main/sw/source/core/inc/pagefrm.hxx
@@ -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 );
@@ -400,10 +399,6 @@ public:
{
return mnBorderPxWidth;
}
- inline sal_Int8 ShadowPxWidth() const
- {
- return mnShadowPxWidth;
- }
// OD 22.09.2003 #110978#
const SwRect PrtWithoutHeaderAndFooter() const;
diff --git a/main/sw/source/core/layout/layact.cxx
b/main/sw/source/core/layout/layact.cxx
index 05cbb474a9..94dfd4aa48 100644
--- a/main/sw/source/core/layout/layact.cxx
+++ b/main/sw/source/core/layout/layact.cxx
@@ -1,5 +1,5 @@
/**************************************************************
- *
+ *
* 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
@@ -7,16 +7,16 @@
* 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.
- *
+ *
*************************************************************/
@@ -149,7 +149,7 @@ static void BreakPoint()
#define RESCHEDULE \
{ \
- if ( IsReschedule() ) \
+ if ( IsReschedule() ) \
{ \
if (pProgress) pProgress->Reschedule(); \
::RescheduleProgress(
pImp->GetShell()->GetDoc()->GetDocShell() ); \
@@ -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
@@ -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;
@@ -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();
@@ -1468,13 +1466,13 @@ 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:
@@ -1482,7 +1480,7 @@ sal_Bool SwLayAction::FormatLayout( SwLayoutFrm *pLay,
sal_Bool bAddRect )
break;
}
aPaint.Top( aPaint.Top() - nBorderWidth );
- aPaint.Bottom( aPaint.Bottom() + nBorderWidth +
nShadowWidth);
+ aPaint.Bottom( aPaint.Bottom() + nBorderWidth );
}
sal_Bool bPageInBrowseMode = pLay->IsPageFrm();
@@ -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 );
@@ -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
@@ -2619,4 +2617,3 @@ SwLayIdle::~SwLayIdle()
{
pImp->pIdleAct = 0;
}
-
diff --git a/main/sw/source/core/layout/paintfrm.cxx
b/main/sw/source/core/layout/paintfrm.cxx
index 240a66a099..8c3281901a 100644
--- a/main/sw/source/core/layout/paintfrm.cxx
+++ b/main/sw/source/core/layout/paintfrm.cxx
@@ -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
@@ -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);
@@ -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);
@@ -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,
@@ -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;
@@ -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.
diff --git a/main/sw/source/core/view/pagepreviewlayout.cxx
b/main/sw/source/core/view/pagepreviewlayout.cxx
index 6ec805e5c2..1302128695 100644
--- a/main/sw/source/core/view/pagepreviewlayout.cxx
+++ b/main/sw/source/core/view/pagepreviewlayout.cxx
@@ -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 )
@@ -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 )
diff --git a/main/sw/source/core/view/viewsh.cxx
b/main/sw/source/core/view/viewsh.cxx
index b642e0f49c..68737b783c 100644
--- a/main/sw/source/core/view/viewsh.cxx
+++ b/main/sw/source/core/view/viewsh.cxx
@@ -1,5 +1,5 @@
/**************************************************************
- *
+ *
* 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
@@ -7,18 +7,20 @@
* 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.
- *
+ *
*************************************************************/
+
+
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
@@ -113,7 +115,7 @@ void ViewShell::DLPrePaint2(const Region& rRegion)
if ( !HasDrawView() )
MakeDrawView();
- // Prefer window; if tot available, get pOut (e.g. printer)
+ // Prefer window; if not available, get pOut (e.g. printer)
mpPrePostOutDev = (GetWin() ? GetWin() : GetOut());
// #i74769# use SdrPaintWindow now direct
@@ -236,7 +238,7 @@ void ViewShell::ImplEndAction( const sal_Bool bIdleEnd )
//JP 27.11.97: wer die Selection hided, muss sie aber
auch
// wieder Showen. Sonst
gibt es Paintfehler!
- // z.B.: addional Mode, Seite vertikal hab zu
sehen, in der
+ // z.B.: addional Mode, Seite vertikal halb zu
sehen, in der
// Mitte eine Selektion und mit einem anderen Cursor an
linken
// rechten Rand springen. Ohne ShowCrsr verschwindet die
// Selektion
@@ -250,7 +252,7 @@ void ViewShell::ImplEndAction( const sal_Bool bIdleEnd )
Imp()->pRegion = NULL;
- //Erst Invert dann Compress, niemals andersherum!
+ //Erst Invert, dann Compress, niemals andersherum!
pRegion->Invert();
pRegion->Compress();
@@ -326,7 +328,7 @@ void ViewShell::ImplEndAction( const sal_Bool bIdleEnd )
// need to do begin/end
DrawingLayer preparation for each single rectangle of the
// repaint region. I already
tried to prepare only once for the whole Region. This
// seems to work (and does
technically) but fails with transparent objects. Since the
- // region given to
BeginDarwLayers() defines the clip region for DrawingLayer paint,
+ // region given to
BeginDrawLayers() defines the clip region for DrawingLayer paint,
// transparent objects in the
single rectangles will indeed be painted multiple times.
DLPrePaint2(Region(aRect.SVRect()));
@@ -380,7 +382,7 @@ void ViewShell::ImplEndAction( const sal_Bool bIdleEnd )
else
{
Imp()->DelRegion();
- bPaintWorks = sal_True;
+ bPaintWorks = sal_True;
}
}
else
@@ -393,7 +395,7 @@ void ViewShell::ImplEndAction( const sal_Bool bIdleEnd )
//Damit sich die automatischen Scrollbars auch richtig anordnen k?nnen
//muessen wir die Aktion hier kuenstlich beenden (EndAction loesst ein
- //Notify aus, und das muss Start-/EndAction rufen um die Scrollbars
+ //Notify aus, und das muss Start-/EndAction rufen um die Scrollbars
//klarzubekommen.
--nStartAction;
UISizeNotify();
@@ -1185,12 +1187,9 @@ void ViewShell::VisPortChgd( const SwRect &rRect)
if ( aPageRect.IsOver( aBoth ) )
{
- // OD 12.02.2003 #i9719#, #105645# - consider new border
- // and shadow width
+ // OD 12.02.2003 #i9719#, #105645# - consider border width
(shadow removed now)
const SwTwips nBorderWidth =
GetOut()->PixelToLogic( Size(
pPage->BorderPxWidth(), 0 ) ).Width();
- const SwTwips nShadowWidth =
- GetOut()->PixelToLogic( Size(
pPage->ShadowPxWidth(), 0 ) ).Width();
SwTwips nPageLeft = 0;
SwTwips nPageRight = 0;
@@ -1199,13 +1198,13 @@ void ViewShell::VisPortChgd( const SwRect &rRect)
case sw::sidebarwindows::SIDEBAR_LEFT:
{
nPageLeft = aPageRect.Left() - nBorderWidth -
nSidebarWidth;
- nPageRight = aPageRect.Right() + nBorderWidth +
nShadowWidth;
+ nPageRight = aPageRect.Right() + nBorderWidth;
}
break;
case sw::sidebarwindows::SIDEBAR_RIGHT:
{
nPageLeft = aPageRect.Left() - nBorderWidth;
- nPageRight = aPageRect.Right() + nBorderWidth +
nShadowWidth + nSidebarWidth;
+ nPageRight = aPageRect.Right() + nBorderWidth +
nSidebarWidth;
}
break;
case sw::sidebarwindows::SIDEBAR_NONE:
@@ -1335,7 +1334,7 @@ sal_Bool ViewShell::SmoothScroll( long lXDiff, long
lYDiff, const Rectangle *pRe
(void) bOnlyYScroll;
(void) bAllowedWithChildWindows;
#else
- const bool bSmoothScrollAllowed(bOnlyYScroll && bEnableSmooth &&
GetViewOptions()->IsSmoothScroll() && bAllowedWithChildWindows);
+ const bool bSmoothScrollAllowed(bOnlyYScroll && bEnableSmooth &&
GetViewOptions()->IsSmoothScroll() && bAllowedWithChildWindows);
#endif
// <-
const bool bIAmCursorShell(ISA(SwCrsrShell));
@@ -1347,7 +1346,7 @@ sal_Bool ViewShell::SmoothScroll( long lXDiff, long
lYDiff, const Rectangle *pRe
// #i75172# with cursors on overlay, smooth scroll should be allowed
with it
const bool bAllowedForMultipleCursors(true || (bIAmCursorShell &&
((SwCrsrShell*)this)->GetCrsrCnt() < 2));
- if(bSmoothScrollAllowed && bAllowedForSelection &&
bAllowedForMultipleCursors)
+ if(bSmoothScrollAllowed && bAllowedForSelection &&
bAllowedForMultipleCursors)
{
Imp()->bStopSmooth = sal_False;
@@ -1438,7 +1437,7 @@ sal_Bool ViewShell::SmoothScroll( long lXDiff, long
lYDiff, const Rectangle *pRe
aVisArea = aOldVis;
//Jetzt Stueckchenweise schieben und die neuen Pixel
aus dem
- //VirDev kopieren.
+ //VirDev kopieren.
// ??????????????????????
// or is it better to get the scrollfactor from the User
@@ -2205,7 +2204,7 @@ void ViewShell::ApplyViewOptions( const SwViewOption
&rOpt )
ImplApplyViewOptions( rOpt );
// swmod 080115
- // With one layout per view it is not longer necessary
+ // With one layout per view it is not longer necessary
// to sync these "layout related" view options
// But as long as we have to disable "multiple layout"
pSh = (ViewShell*)this->GetNext();
@@ -2437,7 +2436,7 @@ void ViewShell::SetReadonlyOption(sal_Bool bSet)
/* -----------------28.08.2003 15:45-----------------
--------------------------------------------------*/
-void ViewShell::SetPDFExportOption(sal_Bool bSet)
+void ViewShell::SetPDFExportOption(sal_Bool bSet)
{
if( bSet != pOpt->IsPDFExport() )
{
@@ -2449,7 +2448,7 @@ void ViewShell::SetPDFExportOption(sal_Bool bSet)
/* -----------------------------2002/07/31 17:06------------------------------
---------------------------------------------------------------------------*/
-void ViewShell::SetReadonlySelectionOption(sal_Bool bSet)
+void ViewShell::SetReadonlySelectionOption(sal_Bool bSet)
{
if( bSet != pOpt->IsSelectionInReadonly() )
{
@@ -2493,7 +2492,7 @@ void ViewShell::UISizeNotify()
}
-void ViewShell::SetRestoreActions(sal_uInt16 nSet)
+void ViewShell::SetRestoreActions(sal_uInt16 nSet)
{
DBG_ASSERT(!GetRestoreActions()||!nSet, "mehrfaches Restore der Actions
?");
Imp()->SetRestoreActions(nSet);
@@ -2533,7 +2532,7 @@ ViewShell::CreateAccessiblePreview()
ASSERT( GetWin(), "no window, no access" );
// OD 15.01.2003 #103492# - add condition <IsPreView()>
- if ( IsPreView() && GetLayout()&& GetWin() )
+ if ( IsPreView() && GetLayout()&& GetWin() )
{
// OD 14.01.2003 #103492# - adjustment for new method signature
return Imp()->GetAccessibleMap().GetDocumentPreview(
@@ -2730,7 +2729,7 @@ void ViewShell::DeleteReplacementBitmaps()
SwPostItMgr* ViewShell::GetPostItMgr()
{
- SwView* pView = GetDoc()->GetDocShell() ?
GetDoc()->GetDocShell()->GetView() : 0;
+ SwView* pView = GetDoc()->GetDocShell() ?
GetDoc()->GetDocShell()->GetView() : 0;
if ( pView )
return pView->GetPostItMgr();