Kaydet (Commit) 5c234592 authored tarafından Noel Grandin's avatar Noel Grandin

new loplugin constvars

detect static variables that can be made const.

Thanks to mike kaganski for suggesting this.

Here I introduce a new plugin feature - using markers
in nearby comments to disable the plugin for specific
vars.

Some of this stuff was old debugging code. I removed the stuff
that was older than 5 years.

Change-Id: I6ec7742a7fdadf28fd128b592fcdf6da8257585c
Reviewed-on: https://gerrit.libreoffice.org/68807
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 4a7771ff
......@@ -30,7 +30,7 @@
// #i37443#
#define FACTOR_FOR_UNSHARPEN (1.6)
#ifdef DBG_UTIL
static double fMultFactUnsharpen = FACTOR_FOR_UNSHARPEN;
static const double fMultFactUnsharpen = FACTOR_FOR_UNSHARPEN;
#endif
namespace basegfx
......
......@@ -214,9 +214,8 @@ namespace basegfx
B3DPoint aStart(rLine.getB3DPoint(nA));
B3DPoint aEnd(rLine.getB3DPoint(nB));
const double fZBufferLineAdd(0x00ff);
static bool bForceToPolygon(false);
if(nLineWidth > 1 || bForceToPolygon)
if(nLineWidth > 1)
{
// this is not a hairline anymore, in most cases since it's an oversampled
// hairline to get e.g. AA for Z-Buffering. Create fill geometry.
......
......@@ -331,10 +331,10 @@ public:
// using the decompose result should be the same as before. Test
// with all ranges of values. Translations are not tested since these
// are just the two rightmost values and uncritical
static double fSX(10.0);
static double fSY(12.0);
static double fR(F_PI4);
static double fS(deg2rad(15.0));
static const double fSX(10.0);
static const double fSY(12.0);
static const double fR(F_PI4);
static const double fS(deg2rad(15.0));
// check all possible scaling combinations
CPPUNIT_ASSERT_MESSAGE("decompose: error test A1",
......
......@@ -1802,7 +1802,7 @@ void VCartesianAxis::createShapes()
hideIdenticalScreenValues( aComplexTickInfos );
std::vector<TickmarkProperties> aTickmarkPropertiesList;
static bool bIncludeSpaceBetweenTickAndText = false;
static const bool bIncludeSpaceBetweenTickAndText = false;
sal_Int32 nOffset = static_cast<sal_Int32>(pTickFactory2D->getDistanceAxisTickToText( m_aAxisProperties, false, bIncludeSpaceBetweenTickAndText ).getLength());
sal_Int32 nTextLevelCount = getTextLevelCount();
for( sal_Int32 nTextLevel=0; nTextLevel<nTextLevelCount; nTextLevel++ )
......
This diff is collapsed.
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
/*
* 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/.
*/
#if defined _WIN32 //TODO, see corresponding TODO in compilerplugins/clang/writeonlyvars.cxx
// expected-no-diagnostics
#else
#include <com/sun/star/uno/Any.hxx>
namespace test1
{
int const aFormalArgs[] = { 1, 2 };
// expected-error@+1 {{static var can be const [loplugin:constvars]}}
static sal_uInt16 nMediaArgsCount = SAL_N_ELEMENTS(aFormalArgs);
sal_uInt16 foo()
{
(void)aFormalArgs;
return nMediaArgsCount;
}
};
// no warning expected
namespace test2
{
static char const* ar[] = { "xxxx" };
static const char* lcl_DATA_OTHERS = "localedata_others";
void foo()
{
(void)ar;
(void)lcl_DATA_OTHERS;
}
};
// no warning expected
namespace test3
{
static sal_uInt16 nMediaArgsCount = 1; // loplugin:constvars:ignore
sal_uInt16 foo() { return nMediaArgsCount; }
};
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
......@@ -505,7 +505,7 @@ void Desktop::Init()
// of loading the office configuration initially. To use,
// either set to true and compile, or set a breakpoint
// in debugger and change the local bool
static bool bTryHardOfficeconfigBroken(false);
static bool bTryHardOfficeconfigBroken(false); // loplugin:constvars:ignore
if (bTryHardOfficeconfigBroken)
{
......
......@@ -283,9 +283,7 @@ namespace drawinglayer
if(!getFillGradient().isDefault())
{
static bool bOverlapping(true); // allow to test non-overlapping in the debugger
createFill(rContainer, bOverlapping);
createFill(rContainer, /*bOverlapping*/true);
}
}
......
......@@ -267,10 +267,7 @@ namespace drawinglayer
// to be painted as a single tools::PolyPolygon (XORed as fill rule). Alternatively, a
// melting process may be used here one day.
const basegfx::B2DPolyPolygon aNewPolyPolygon(aAreaPolyPolygon.getB2DPolygon(b));
static bool bTestByUsingRandomColor(false);
const basegfx::BColor aColor(bTestByUsingRandomColor
? basegfx::BColor(getRandomColorRange(), getRandomColorRange(), getRandomColorRange())
: getLineAttribute().getColor());
const basegfx::BColor aColor(getLineAttribute().getColor());
rContainer.push_back(new PolyPolygonColorPrimitive2D(aNewPolyPolygon, aColor));
}
}
......
......@@ -365,7 +365,7 @@ namespace drawinglayer
nOversampleValue ? nRasterHeight * nOversampleValue : nRasterHeight);
// check for parallel execution possibilities
static bool bMultithreadAllowed = true;
static bool bMultithreadAllowed = true; // loplugin:constvars:ignore
sal_Int32 nThreadCount(0);
comphelper::ThreadPool& rThreadPool(comphelper::ThreadPool::getSharedOptimalPool());
......@@ -469,7 +469,7 @@ namespace drawinglayer
rContainer.push_back(new BitmapPrimitive2D(maOldRenderedBitmap, aNew2DTransform));
// test: Allow to add an outline in the debugger when tests are needed
static bool bAddOutlineToCreated3DSceneRepresentation(false);
static bool bAddOutlineToCreated3DSceneRepresentation(false); // loplugin:constvars:ignore
if(bAddOutlineToCreated3DSceneRepresentation)
{
......
......@@ -329,7 +329,7 @@ namespace drawinglayer
const Size aSizePixel(maDestPixel.GetSize());
const bool bWasEnabledDst(mrOutDev.IsMapModeEnabled());
#ifdef DBG_UTIL
static bool bDoSaveForVisualControl(false);
static bool bDoSaveForVisualControl(false); // loplugin:constvars:ignore
#endif
mrOutDev.EnableMapMode(false);
......
......@@ -922,7 +922,7 @@ namespace drawinglayer
{
bool bUsingPDFExtOutDevData(false);
basegfx::B2DVector aTranslate, aScale;
static bool bSuppressPDFExtOutDevDataSupport(false);
static bool bSuppressPDFExtOutDevDataSupport(false); // loplugin:constvars:ignore
if(mpPDFExtOutDevData && !bSuppressPDFExtOutDevDataSupport)
{
......@@ -1247,7 +1247,7 @@ namespace drawinglayer
void VclMetafileProcessor2D::processTextHierarchyParagraphPrimitive2D(const primitive2d::TextHierarchyParagraphPrimitive2D& rParagraphPrimitive)
{
const OString aCommentString("XTEXT_EOP");
static bool bSuppressPDFExtOutDevDataSupport(false);
static bool bSuppressPDFExtOutDevDataSupport(false); // loplugin:constvars:ignore
if(nullptr == mpPDFExtOutDevData || bSuppressPDFExtOutDevDataSupport)
{
......@@ -1995,7 +1995,7 @@ namespace drawinglayer
// try to identify a single PolyPolygonColorPrimitive2D in the
// content part of the transparence primitive
const primitive2d::PolyPolygonColorPrimitive2D* pPoPoColor = nullptr;
static bool bForceToMetafile(false);
static bool bForceToMetafile(false); // loplugin:constvars:ignore
if(!bForceToMetafile && 1 == rContent.size())
{
......@@ -2089,7 +2089,7 @@ namespace drawinglayer
// try to identify a single FillGradientPrimitive2D in the
// transparence part of the primitive
const primitive2d::FillGradientPrimitive2D* pFiGradient = nullptr;
static bool bForceToBigTransparentVDev(false);
static bool bForceToBigTransparentVDev(false); // loplugin:constvars:ignore
if(!bForceToBigTransparentVDev && 1 == rTransparence.size())
{
......
......@@ -516,20 +516,9 @@ namespace drawinglayer
}
case PRIMITIVE3D_ID_HATCHTEXTUREPRIMITIVE3D :
{
// HatchTexturePrimitive3D
static bool bDoHatchDecomposition(false);
if(bDoHatchDecomposition)
{
// let break down
process(rBasePrimitive.get3DDecomposition(getViewInformation3D()));
}
else
{
// hatchTexturePrimitive3D
const primitive3d::HatchTexturePrimitive3D& rPrimitive = static_cast< const primitive3d::HatchTexturePrimitive3D& >(rBasePrimitive);
impRenderHatchTexturePrimitive3D(rPrimitive);
}
// hatchTexturePrimitive3D
const primitive3d::HatchTexturePrimitive3D& rPrimitive = static_cast< const primitive3d::HatchTexturePrimitive3D& >(rBasePrimitive);
impRenderHatchTexturePrimitive3D(rPrimitive);
break;
}
case PRIMITIVE3D_ID_BITMAPTEXTUREPRIMITIVE3D :
......
......@@ -87,7 +87,7 @@ namespace drawinglayer
if(pContentProcessor)
{
#ifdef DBG_UTIL
static bool bDoSaveForVisualControl(false);
static bool bDoSaveForVisualControl(false); // loplugin:constvars:ignore
#endif
// render content
pContentProcessor->process(aSequence);
......
......@@ -1371,7 +1371,7 @@ namespace emfio
}
#ifdef DBG_UTIL
static bool bDoSaveForVisualControl(false);
static bool bDoSaveForVisualControl(false); // loplugin:constvars:ignore
if(bDoSaveForVisualControl)
{
......
......@@ -324,16 +324,15 @@ struct SortByPriority
// All things being equal, sort them alphabetically.
return r1.sType > r2.sType;
}
} objSortByPriority;
};
struct SortByType
{
bool operator() (const FlatDetectionInfo& r1, const FlatDetectionInfo& r2) const
{
return r1.sType > r2.sType;
}
} objSortByType;
};
struct EqualByType
{
......@@ -341,7 +340,7 @@ struct EqualByType
{
return r1.sType == r2.sType;
}
} objEqualByType;
};
class FindByType
{
......@@ -412,8 +411,8 @@ OUString SAL_CALL TypeDetection::queryTypeByDescriptor(css::uno::Sequence< css::
// <- SAFE ----------------------------------
// Properly prioritize all candidate types.
std::stable_sort(lFlatTypes.begin(), lFlatTypes.end(), objSortByPriority);
auto last = std::unique(lFlatTypes.begin(), lFlatTypes.end(), objEqualByType);
std::stable_sort(lFlatTypes.begin(), lFlatTypes.end(), SortByPriority());
auto last = std::unique(lFlatTypes.begin(), lFlatTypes.end(), EqualByType());
lFlatTypes.erase(last, lFlatTypes.end());
OUString sLastChance;
......@@ -843,8 +842,8 @@ void TypeDetection::impl_getAllFormatTypes(
}
// Remove duplicates.
std::stable_sort(rFlatTypes.begin(), rFlatTypes.end(), objSortByType);
auto last = std::unique(rFlatTypes.begin(), rFlatTypes.end(), objEqualByType);
std::stable_sort(rFlatTypes.begin(), rFlatTypes.end(), SortByType());
auto last = std::unique(rFlatTypes.begin(), rFlatTypes.end(), EqualByType());
rFlatTypes.erase(last, rFlatTypes.end());
// Mark pre-selected type (if any) to have it prioritized.
......
......@@ -2619,7 +2619,7 @@ void DffPropertyReader::ApplyAttributes( SvStream& rIn, SfxItemSet& rSet, DffObj
}
if ( bHasShadow )
{
static bool bCheckShadow(false);
static bool bCheckShadow(false); // loplugin:constvars:ignore
// #i124477# Found no reason not to set shadow, esp. since it is applied to evtl. existing text
// and will lead to an error if in PPT someone used text and added the object shadow to the
......
......@@ -779,7 +779,7 @@ static Bcp47CountryEntry const aImplBcp47CountryEntries[] =
{ LANGUAGE_DONTKNOW, "", "", "", k0 } // marks end of table
};
static IsoLanguageCountryEntry aLastResortFallbackEntry =
static const IsoLanguageCountryEntry aLastResortFallbackEntry =
{ LANGUAGE_ENGLISH_US, "en", "US", k0 };
OUString IsoLanguageCountryEntry::getTagString() const
......
......@@ -472,7 +472,7 @@ const sal_Char *natnum1Locales[] = {
"fa",
"cu"
};
sal_Int16 nbOfLocale = SAL_N_ELEMENTS(natnum1Locales);
const sal_Int16 nbOfLocale = SAL_N_ELEMENTS(natnum1Locales);
//! ATTENTION: Do not change order of elements!
//! Number and order must match elements of natnum1Locales!
......
......@@ -44,7 +44,7 @@ OString toByteString(rtl_uString const * str) {
}
static sal_Unicode NULL_WSTRING[1] = { 0 };
static const sal_Unicode NULL_WSTRING[1] = { 0 };
#define BLOP_OFFSET_MAGIC 0
#define BLOP_OFFSET_SIZE (BLOP_OFFSET_MAGIC + sizeof(sal_uInt32))
......
......@@ -563,7 +563,7 @@ struct HashEntry
};
static HashEntry* HashTable[31];
static int HashSize = SAL_N_ELEMENTS(HashTable);
static const int HashSize = SAL_N_ELEMENTS(HashTable);
static pthread_mutex_t HashLock = PTHREAD_MUTEX_INITIALIZER;
......
......@@ -1051,7 +1051,7 @@ template<class Function>
static ScMatrixRef lcl_MatrixCalculation(
const ScMatrix& rMat1, const ScMatrix& rMat2, ScInterpreter* pInterpreter)
{
static Function Op;
static const Function Op;
SCSIZE nC1, nC2, nMinC;
SCSIZE nR1, nR2, nMinR;
......
......@@ -2006,7 +2006,7 @@ public:
void operator() (const MatrixImplType::element_block_node_type& node)
{
using namespace mdds::mtv;
static Op op;
static const Op op;
switch (node.type)
{
......
......@@ -1721,7 +1721,7 @@ size_t HashSingleRef( const ScSingleRefData& rRef )
void ScTokenArray::GenHash()
{
static OUStringHash aHasher;
static const OUStringHash aHasher;
size_t nHash = 1;
OpCode eOp;
......
......@@ -134,8 +134,6 @@ static const sal_uInt16 SidArray[] = {
0 };
static bool bTestText = false;
/**
* base class for text functions
*/
......@@ -1242,8 +1240,7 @@ void FuText::ReceiveRequest(SfxRequest& rReq)
if (nSlotId == SID_TEXTEDIT)
{
// are we currently editing?
if(!bTestText)
mxTextObj.reset( mpView->GetTextEditObject() );
mxTextObj.reset( mpView->GetTextEditObject() );
if (!mxTextObj.is())
{
......
......@@ -2588,7 +2588,7 @@ void SfxHelpWindow_Impl::Resize()
void SfxHelpWindow_Impl::Split()
{
static const long nMinSplitSize = 5;
static long nMaxSplitSize = 99 - nMinSplitSize;
static const long nMaxSplitSize = 99 - nMinSplitSize;
SplitWindow::Split();
......
......@@ -123,7 +123,7 @@ extern "C" {
namespace {
boost::logic::tribool loaded(boost::logic::indeterminate);
boost::logic::tribool loaded(boost::logic::indeterminate); // loplugin:constvars:ignore
oslGenericFunction pInitSystray = disabled_initSystray;
oslGenericFunction pDeInitSystray = disabled_deInitSystray;
......
......@@ -59,7 +59,7 @@ const Color& Paint::GetColor() const
if (meType != ColorPaint)
{
assert(meType==ColorPaint);
static Color aErrorColor;
static const Color aErrorColor;
return aErrorColor;
}
else
......
......@@ -18,6 +18,7 @@ $(eval $(call gb_CompilerTest_add_exception_objects,compilerplugins_clang, \
compilerplugins/clang/test/commaoperator \
$(if $(filter-out WNT,$(OS)),compilerplugins/clang/test/constfields) \
compilerplugins/clang/test/constparams \
compilerplugins/clang/test/constvars \
compilerplugins/clang/test/convertlong \
compilerplugins/clang/test/cppunitassertequals \
compilerplugins/clang/test/cstylecast \
......
......@@ -901,7 +901,7 @@ const ClsId& Storage::GetClassId() const
if ( pEntry )
return pEntry->m_aEntry.GetClassId();
static ClsId aDummyId = {0,0,0,{0,0,0,0,0,0,0,0}};
static const ClsId aDummyId = {0,0,0,{0,0,0,0,0,0,0,0}};
return aDummyId;
}
......
......@@ -79,7 +79,7 @@ namespace
if(pLast)
{
bool bAddGap(true);
static bool bNoGapsForBaselineShift(true);
static bool bNoGapsForBaselineShift(true); // loplugin:constvars:ignore
if(bNoGapsForBaselineShift)
{
......
......@@ -1405,8 +1405,6 @@ void SvxIconChoiceCtrl_Impl::SetUpdateMode( bool bUpdate )
void SvxIconChoiceCtrl_Impl::PaintEmphasis(const tools::Rectangle& rTextRect, bool bSelected,
vcl::RenderContext& rRenderContext)
{
static Color aTransparent(COL_TRANSPARENT);
Color aOldFillColor(rRenderContext.GetFillColor());
bool bSolidTextRect = false;
......@@ -1415,7 +1413,7 @@ void SvxIconChoiceCtrl_Impl::PaintEmphasis(const tools::Rectangle& rTextRect, bo
{
const Color& rFillColor = rRenderContext.GetFont().GetFillColor();
rRenderContext.SetFillColor(rFillColor);
if (rFillColor != aTransparent)
if (rFillColor != COL_TRANSPARENT)
bSolidTextRect = true;
}
......
......@@ -85,15 +85,8 @@ namespace sdr
void ObjectContactOfPageView::PrepareProcessDisplay()
{
if(IsActive())
{
static bool bInvalidateDuringPaint(true);
if(bInvalidateDuringPaint)
{
// there are still non-triggered LazyInvalidate events, trigger these
Invoke();
}
}
// there are still non-triggered LazyInvalidate events, trigger these
Invoke();
}
// From baseclass Timer, the timeout call triggered by the LazyInvalidate mechanism
......
......@@ -101,7 +101,7 @@ ViewObjectContact& ViewContactOfPageShadow::CreateObjectSpecificViewObjectContac
drawinglayer::primitive2d::Primitive2DContainer ViewContactOfPageShadow::createViewIndependentPrimitive2DSequence() const
{
static bool bUseOldPageShadow(false);
static bool bUseOldPageShadow(false); // loplugin:constvars:ignore
const SdrPage& rPage = getPage();
basegfx::B2DHomMatrix aPageMatrix;
aPageMatrix.set(0, 0, static_cast<double>(rPage.GetWidth()));
......
......@@ -128,15 +128,10 @@ namespace sdr
{
// set Property 'ReducedDisplayQuality' to true to allow simpler interaction
// visualisations
static bool bUseReducedDisplayQualityForDrag(true);
if(bUseReducedDisplayQualityForDrag)
{
uno::Sequence< beans::PropertyValue > xProperties(1);
xProperties[0].Name = "ReducedDisplayQuality";
xProperties[0].Value <<= true;
maViewInformation2D = drawinglayer::geometry::ViewInformation2D(xProperties);
}
uno::Sequence< beans::PropertyValue > xProperties(1);
xProperties[0].Name = "ReducedDisplayQuality";
xProperties[0].Value <<= true;
maViewInformation2D = drawinglayer::geometry::ViewInformation2D(xProperties);
}
rtl::Reference<OverlayManager> OverlayManager::create(OutputDevice& rOutputDevice)
......
......@@ -123,18 +123,6 @@ namespace sdr
for(const auto& rRect : aRectangles)
{
#ifdef DBG_UTIL
// #i72754# possible graphical region test only with non-pro
static bool bDoPaintForVisualControl(false);
if(bDoPaintForVisualControl)
{
getOutputDevice().SetLineColor(COL_LIGHTGREEN);
getOutputDevice().SetFillColor();
getOutputDevice().DrawRect(rRect);
}
#endif
// restore the area
const Point aTopLeft(rRect.TopLeft());
const Size aSize(rRect.GetSize());
......
......@@ -71,17 +71,14 @@ namespace drawinglayer
{
// to take care of getSdrLFSTAttribute() later, the same as in SdrGrafPrimitive2D::create2DDecomposition
// should happen. For the moment we only need the OLE itself
// Added complete primitive preparation using getSdrLFSTAttribute() now. To not do stuff which is not needed now, it
// may be suppressed by using a static bool. The paint version only supported text.
static bool bBehaveCompatibleToPaintVersion(false);
// Added complete primitive preparation using getSdrLFSTAttribute() now.
Primitive2DContainer aRetval;
// create unit outline polygon
const basegfx::B2DPolygon& aUnitOutline(basegfx::utils::createUnitPolygon());
// add fill
if(!bBehaveCompatibleToPaintVersion
&& !getSdrLFSTAttribute().getFill().isDefault())
if(!getSdrLFSTAttribute().getFill().isDefault())
{
basegfx::B2DPolyPolygon aTransformed(aUnitOutline);
......@@ -96,8 +93,7 @@ namespace drawinglayer
// add line
// #i97981# condition was inverse to purpose. When being compatible to paint version,
// border needs to be suppressed
if(!bBehaveCompatibleToPaintVersion
&& !getSdrLFSTAttribute().getLine().isDefault())
if(!getSdrLFSTAttribute().getLine().isDefault())
{
// if line width is given, polygon needs to be grown by half of it to make the
// outline to be outside of the bitmap
......@@ -162,8 +158,7 @@ namespace drawinglayer
}
// add shadow
if(!bBehaveCompatibleToPaintVersion
&& !getSdrLFSTAttribute().getShadow().isDefault())
if(!getSdrLFSTAttribute().getShadow().isDefault())
{
aRetval = createEmbeddedShadowPrimitive(
aRetval,
......
......@@ -162,23 +162,6 @@ void SdrPreRenderDevice::OutputPreRenderDevice(const vcl::Region& rExpandedRegio
aTopLeft, aSize,
aTopLeft, aSize,
*mpPreRenderDevice);
#ifdef DBG_UTIL
// #i74769#
static bool bDoPaintForVisualControlRegion(false);
if(bDoPaintForVisualControlRegion)
{
int nR = comphelper::rng::uniform_int_distribution(0, 0x7F-1);
int nG = comphelper::rng::uniform_int_distribution(0, 0x7F-1);
int nB = comphelper::rng::uniform_int_distribution(0, 0x7F-1);
const Color aColor(((((nR|0x80)<<8)|(nG|0x80))<<8)|(nB|0x80));
mpOutputDevice->SetLineColor(aColor);
mpOutputDevice->SetFillColor();
mpOutputDevice->DrawRect(rRect);
}
#endif
}
mpOutputDevice->EnableMapMode(bMapModeWasEnabledDest);
......
......@@ -1089,15 +1089,7 @@ void SdrEditView::MergeMarkedObjects(SdrMergeMode eMode)
case SdrMergeMode::Merge:
{
// merge all contained parts (OR)
static bool bTestXOR(false);
if(bTestXOR)
{
aMergePolyPolygonA = basegfx::utils::solvePolygonOperationXor(aMergePolyPolygonA, aMergePolyPolygonB);
}
else
{
aMergePolyPolygonA = basegfx::utils::solvePolygonOperationOr(aMergePolyPolygonA, aMergePolyPolygonB);
}
aMergePolyPolygonA = basegfx::utils::solvePolygonOperationOr(aMergePolyPolygonA, aMergePolyPolygonB);
break;
}
case SdrMergeMode::Subtract:
......
......@@ -221,9 +221,8 @@ namespace
// prepare DXArray content. To make it independent from font size (and such from
// the text transformation), scale it to unit coordinates
::std::vector< double > aDXArray;
static bool bDisableTextArray(false);
if(!bDisableTextArray && rInfo.mpDXArray && rInfo.mnTextLen)
if(rInfo.mpDXArray && rInfo.mnTextLen)
{
aDXArray.reserve(rInfo.mnTextLen);
......
......@@ -553,37 +553,6 @@ void SdrPaintView::CompleteRedraw(OutputDevice* pOut, const vcl::Region& rReg, s
if(!pWindow->GetPaintRegion().IsEmpty())
{
aOptimizedRepaintRegion.Intersect(pWindow->GetPaintRegion());
#ifdef DBG_UTIL
// #i74769# test-paint repaint region
static bool bDoPaintForVisualControl(false);
if(bDoPaintForVisualControl)
{
RectangleVector aRectangles;
aOptimizedRepaintRegion.GetRegionRectangles(aRectangles);
pWindow->SetLineColor(COL_LIGHTGREEN);
pWindow->SetFillColor();
for(const auto& rRect : aRectangles)
{
pWindow->DrawRect(rRect);
}
//RegionHandle aRegionHandle(aOptimizedRepaintRegion.BeginEnumRects());
//Rectangle aRegionRectangle;
//while(aOptimizedRepaintRegion.GetEnumRects(aRegionHandle, aRegionRectangle))
//{
// pWindow->SetLineCOL_LIGHTGREEN);
// pWindow->SetFillColor();
// pWindow->DrawRect(aRegionRectangle);
//}
//aOptimizedRepaintRegion.EndEnumRects(aRegionHandle);
}
#endif
}
}
}
......
......@@ -21,7 +21,7 @@
#include <pamtyp.hxx>
#include <cshtyp.hxx>
static SwMoveFnCollection aFwrd = {
static const SwMoveFnCollection aFwrd = {
/* fnNd */ &GoNext,
/* fnNds */ &GoNextNds,
/* fnDoc */ &GoEndDoc,
......@@ -32,7 +32,7 @@ static SwMoveFnCollection aFwrd = {
/* fnSection */ &SwNodes::GoStartOfSection
};
static SwMoveFnCollection aBwrd = {
static const SwMoveFnCollection aBwrd = {
/* fnNd */ &GoPrevious,
/* fnNds */ &GoPreviousNds,
/* fnDoc */ &GoStartDoc,
......
......@@ -68,7 +68,7 @@ using namespace com::sun::star;
void sw_DebugRedline( const SwDoc* pDoc )
{