[Libreoffice-commits] .: sw/source
Thomas Arnhold
tarnhold at kemper.freedesktop.org
Wed Feb 9 11:11:15 PST 2011
sw/source/core/draw/dcontact.cxx | 21 -----------------
sw/source/core/graphic/ndgrf.cxx | 8 +-----
sw/source/core/layout/layact.cxx | 10 --------
sw/source/core/view/viewimp.cxx | 13 -----------
sw/source/core/view/viewsh.cxx | 46 ---------------------------------------
5 files changed, 3 insertions(+), 95 deletions(-)
New commits:
commit 9c696287c2021901994e9934991da94e57d5ed97
Author: Thomas Arnhold <thomas at arnhold.org>
Date: Wed Feb 9 20:10:56 2011 +0100
Remove static if-tests
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index fbe933d..3117685 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -2237,15 +2237,6 @@ namespace sdr
drawinglayer::primitive2d::Primitive2DSequence VOCOfDrawVirtObj::createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const
{
-#if OSL_DEBUG_LEVEL > 1
- // #i101734#
- static bool bCheckOtherThanTranslate(false);
- static double fShearX(0.0);
- static double fRotation(0.0);
- static double fScaleX(0.0);
- static double fScaleY(0.0);
-#endif
-
const VCOfDrawVirtObj& rVC = static_cast< const VCOfDrawVirtObj& >(GetViewContact());
const SdrObject& rReferencedObject = rVC.GetSwDrawVirtObj().GetReferencedObj();
drawinglayer::primitive2d::Primitive2DSequence xRetval;
@@ -2256,20 +2247,8 @@ namespace sdr
if(aLocalOffset.X() || aLocalOffset.Y())
{
-#if OSL_DEBUG_LEVEL > 1
- // #i101734# added debug code to check more complex transformations
- // than just a translation
- if(bCheckOtherThanTranslate)
- {
- aOffsetMatrix.scale(fScaleX, fScaleY);
- aOffsetMatrix.shearX(tan(fShearX * F_PI180));
- aOffsetMatrix.rotate(fRotation * F_PI180);
- }
-#endif
-
aOffsetMatrix.set(0, 2, aLocalOffset.X());
aOffsetMatrix.set(1, 2, aLocalOffset.Y());
-
}
if(rReferencedObject.ISA(SdrObjGroup))
diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx
index 2184429..8a10db3 100644
--- a/sw/source/core/graphic/ndgrf.cxx
+++ b/sw/source/core/graphic/ndgrf.cxx
@@ -801,12 +801,9 @@ SvStream* SwGrfNode::_GetStreamForEmbedGrf(
// because a changed unique ID of the graphic is calculated.
// --> recursive calls of <GetUniqueID()> have to be avoided.
// Thus, use local static boolean to assure this.
- static bool bInRegenerateStrmName( false );
- if ( !bInRegenerateStrmName &&
- ( !_refPics->hasByName( _aStrmName ) ||
- !_refPics->isStreamElement( _aStrmName ) ) )
+ if ( !_refPics->hasByName( _aStrmName ) ||
+ !_refPics->isStreamElement( _aStrmName ) )
{
- bInRegenerateStrmName = true;
xub_StrLen nExtPos = _aStrmName.Search( '.' );
String aExtStr = _aStrmName.Copy( nExtPos );
Graphic aGraphic( GetGrfObj().GetGraphic() );
@@ -815,7 +812,6 @@ SvStream* SwGrfNode::_GetStreamForEmbedGrf(
_aStrmName = String( GetGrfObj().GetUniqueID(), RTL_TEXTENCODING_ASCII_US );
_aStrmName += aExtStr;
}
- bInRegenerateStrmName = false;
}
// <--
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index 7f7ceb4..50a3e6d 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -2530,17 +2530,7 @@ SwLayIdle::SwLayIdle( SwRootFrm *pRt, SwViewImp *pI ) :
// #i75172# Do not invalidate indicator, this may cause a endless loop. Instead, just repaint it
// This should be replaced by an overlay object in the future, anyways. Since it's only for debug
// purposes, it is not urgent.
- static bool bCheckWithoutInvalidating(true);
- if(bCheckWithoutInvalidating)
- {
bIndicator = false; SHOW_IDLE( COL_LIGHTGREEN );
- }
- else
- {
- Rectangle aRect( 0, 0, 5, 5 );
- aRect = pImp->GetShell()->GetWin()->PixelToLogic( aRect );
- pImp->GetShell()->GetWin()->Invalidate( aRect );
- }
}
#endif
}
diff --git a/sw/source/core/view/viewimp.cxx b/sw/source/core/view/viewimp.cxx
index 614e9ad..55f96d0 100644
--- a/sw/source/core/view/viewimp.cxx
+++ b/sw/source/core/view/viewimp.cxx
@@ -247,18 +247,7 @@ void SwViewImp::MakeDrawView()
// #i68597# If document is read-only, we will not profit from overlay, so switch it off.
if(pDrawView && pDrawView->IsBufferedOverlayAllowed())
{
- bool bIsReadOnly(pSwViewOption->IsReadonly());
-
-#if OSL_DEBUG_LEVEL > 1
- // add test possibilities
- static bool bAlwaysActivateForTest(false);
- if(bAlwaysActivateForTest && bIsReadOnly)
- {
- bIsReadOnly = false;
- }
-#endif
-
- if(bIsReadOnly)
+ if(pSwViewOption->IsReadonly())
{
pDrawView->SetBufferedOverlayAllowed(false);
}
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index e2f3c70..4988770 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -1296,9 +1296,6 @@ BOOL ViewShell::SmoothScroll( long lXDiff, long lYDiff, const Rectangle *pRect )
if(!Imp()->bStopSmooth)
{
- static bool bDoItOnPixels(true);
- if(bDoItOnPixels)
- {
// start paint on logic base
const Rectangle aTargetLogic(Imp()->aSmoothRect.SVRect());
DLPrePaint2(Region(aTargetLogic));
@@ -1316,21 +1313,6 @@ BOOL ViewShell::SmoothScroll( long lXDiff, long lYDiff, const Rectangle *pRect )
rTargetDevice.EnableMapMode(false);
pVout->EnableMapMode(false);
- // copy content
- static bool bTestDirectToWindowPaint(false);
- if(bTestDirectToWindowPaint)
- {
- const bool bMapModeWasEnabledWin(GetWin()->IsMapModeEnabled());
- GetWin()->EnableMapMode(false);
-
- GetWin()->DrawOutDev(
- aTargetPixel.TopLeft(), aTargetPixel.GetSize(), // dest
- aSourceTopLeft, aTargetPixel.GetSize(), // source
- *pVout);
-
- GetWin()->EnableMapMode(bMapModeWasEnabledWin);
- }
-
rTargetDevice.DrawOutDev(
aTargetPixel.TopLeft(), aTargetPixel.GetSize(), // dest
aSourceTopLeft, aTargetPixel.GetSize(), // source
@@ -1342,34 +1324,6 @@ BOOL ViewShell::SmoothScroll( long lXDiff, long lYDiff, const Rectangle *pRect )
// end paint on logoc base
DLPostPaint2(true);
- }
- else
- {
- Rectangle aRectangle(Imp()->aSmoothRect.SVRect());
- aRectangle.Left() -= aPixSz.Width();
- aRectangle.Right() += aPixSz.Width();
- aRectangle.Top() -= aPixSz.Height();
- aRectangle.Bottom() += aPixSz.Height();
- const Point aUpdateTopLeft(aRectangle.TopLeft());
- const Size aUpdateSize(aRectangle.GetSize());
-
- // #i75172# the part getting visible needs to be handled like a repaint.
- // For that, start with DLPrePaint2 and the correct Rectangle
- DLPrePaint2(Region(aRectangle));
-
- static bool bTestDirectToWindowPaint(false);
- if(bTestDirectToWindowPaint)
- {
- GetWin()->DrawOutDev(aUpdateTopLeft, aUpdateSize, aUpdateTopLeft, aUpdateSize, *pVout);
- }
-
- mpTargetPaintWindow->GetTargetOutputDevice().DrawOutDev(aUpdateTopLeft, aUpdateSize, aUpdateTopLeft, aUpdateSize, *pVout);
-
- // #i75172# Corret repaint end
- // Note: This also correcty creates the overlay, thus smooth scroll will
- // also be allowed now wth selection (see big IF above)
- DLPostPaint2(true);
- }
}
else
--nLockPaint;
More information about the Libreoffice-commits
mailing list