summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-03-16 15:43:35 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-03-17 10:28:09 +0000
commitce66911720b3245b21fb14bb83619c42610e5ac6 (patch)
tree5218fadfce07d451f3c5d514d9068bfe8a9eeb16 /svtools
parent07da25064f75cdf7163669f9bf860a9ee2f8b33c (diff)
loplugin:constantparam in svtools
Change-Id: I1a3c4a36e29a6712c589ffd3aaada593880d978d Reviewed-on: https://gerrit.libreoffice.org/23304 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/brwbox/brwbox1.cxx12
-rw-r--r--svtools/source/brwbox/brwbox2.cxx2
-rw-r--r--svtools/source/contnr/svimpbox.cxx2
-rw-r--r--svtools/source/contnr/treelistbox.cxx54
-rw-r--r--svtools/source/control/asynclink.cxx24
-rw-r--r--svtools/source/control/calendar.cxx91
-rw-r--r--svtools/source/control/fmtfield.cxx4
-rw-r--r--svtools/source/control/headbar.cxx2
-rw-r--r--svtools/source/control/ruler.cxx55
-rw-r--r--svtools/source/control/toolbarmenu.cxx39
-rw-r--r--svtools/source/control/valueset.cxx8
-rw-r--r--svtools/source/graphic/grfmgr2.cxx4
-rw-r--r--svtools/source/java/javacontext.cxx5
-rw-r--r--svtools/source/misc/transfer.cxx4
-rw-r--r--svtools/source/svhtml/parhtml.cxx68
-rw-r--r--svtools/source/uno/contextmenuhelper.cxx5
16 files changed, 122 insertions, 257 deletions
diff --git a/svtools/source/brwbox/brwbox1.cxx b/svtools/source/brwbox/brwbox1.cxx
index 385eb089303f..1f23ddc3ec20 100644
--- a/svtools/source/brwbox/brwbox1.cxx
+++ b/svtools/source/brwbox/brwbox1.cxx
@@ -1899,15 +1899,13 @@ bool BrowseBox::IsColumnSelected( sal_uInt16 nColumnId ) const
void BrowseBox::MakeFieldVisible
(
long nRow, // line number of the field (starting with 0)
- sal_uInt16 nColId, // column ID of the field
- bool bComplete // (== false), true => make visible in its entirety
+ sal_uInt16 nColId // column ID of the field
)
/* [Description]
Makes visible the field described in 'nRow' and 'nColId' by scrolling
- accordingly. If 'bComplete' is set, the field should become visible in its
- entirety.
+ accordingly.
*/
@@ -1919,7 +1917,7 @@ void BrowseBox::MakeFieldVisible
return;
// is it visible already?
- bool bVisible = IsFieldVisible( nRow, nColId, bComplete );
+ bool bVisible = IsFieldVisible( nRow, nColId, true/*bComplete*/ );
if ( bVisible )
return;
@@ -1934,9 +1932,7 @@ void BrowseBox::MakeFieldVisible
ScrollColumns( nColPos - nFirstCol );
// while outside on the right
- while ( aDataRect.Right() < ( bComplete
- ? aFieldRect.Right()
- : aFieldRect.Left()+aFieldRect.GetWidth()/2 ) )
+ while ( aDataRect.Right() < aFieldRect.Right() )
{
// => scroll to the left
if ( ScrollColumns( 1 ) != 1 )
diff --git a/svtools/source/brwbox/brwbox2.cxx b/svtools/source/brwbox/brwbox2.cxx
index e178fb02918f..e6d2b1ac08ba 100644
--- a/svtools/source/brwbox/brwbox2.cxx
+++ b/svtools/source/brwbox/brwbox2.cxx
@@ -1915,7 +1915,7 @@ void BrowseBox::Dispatch( sal_uInt16 nId )
{
SetColumnPos( nColId, nNewPos );
ColumnMoved( nColId );
- MakeFieldVisible(GetCurRow(), nColId, true);
+ MakeFieldVisible(GetCurRow(), nColId);
if ( bColumnSelected )
SelectColumnId(nColId);
}
diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx
index 8d72e3105eaf..d151d45a7a0b 100644
--- a/svtools/source/contnr/svimpbox.cxx
+++ b/svtools/source/contnr/svimpbox.cxx
@@ -940,7 +940,7 @@ void SvImpLBox::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect
for(sal_uInt16 n=0; n< nCount && pEntry; n++)
{
/*long nMaxRight=*/
- pView->PaintEntry1(*pEntry, nY, rRenderContext, SvLBoxTabFlags::ALL, true );
+ pView->PaintEntry1(*pEntry, nY, rRenderContext );
nY += nEntryHeight;
pEntry = pView->NextVisible(pEntry);
}
diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx
index 833810ac3780..a20724e64550 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -930,7 +930,7 @@ void SvTreeListBox::InitViewData( SvViewDataEntry* pData, SvTreeListEntry* pEntr
}
}
-void SvTreeListBox::EnableSelectionAsDropTarget( bool bEnable, bool bWithChildren )
+void SvTreeListBox::EnableSelectionAsDropTarget( bool bEnable )
{
sal_uInt16 nRefDepth;
SvTreeListEntry* pTemp;
@@ -941,29 +941,23 @@ void SvTreeListBox::EnableSelectionAsDropTarget( bool bEnable, bool bWithChildre
if ( !bEnable )
{
pSelEntry->nEntryFlags |= SvTLEntryFlags::DISABLE_DROP;
- if ( bWithChildren )
+ nRefDepth = pModel->GetDepth( pSelEntry );
+ pTemp = Next( pSelEntry );
+ while( pTemp && pModel->GetDepth( pTemp ) > nRefDepth )
{
- nRefDepth = pModel->GetDepth( pSelEntry );
- pTemp = Next( pSelEntry );
- while( pTemp && pModel->GetDepth( pTemp ) > nRefDepth )
- {
- pTemp->nEntryFlags |= SvTLEntryFlags::DISABLE_DROP;
- pTemp = Next( pTemp );
- }
+ pTemp->nEntryFlags |= SvTLEntryFlags::DISABLE_DROP;
+ pTemp = Next( pTemp );
}
}
else
{
pSelEntry->nEntryFlags &= (~SvTLEntryFlags::DISABLE_DROP);
- if ( bWithChildren )
+ nRefDepth = pModel->GetDepth( pSelEntry );
+ pTemp = Next( pSelEntry );
+ while( pTemp && pModel->GetDepth( pTemp ) > nRefDepth )
{
- nRefDepth = pModel->GetDepth( pSelEntry );
- pTemp = Next( pSelEntry );
- while( pTemp && pModel->GetDepth( pTemp ) > nRefDepth )
- {
- pTemp->nEntryFlags &= (~SvTLEntryFlags::DISABLE_DROP);
- pTemp = Next( pTemp );
- }
+ pTemp->nEntryFlags &= (~SvTLEntryFlags::DISABLE_DROP);
+ pTemp = Next( pTemp );
}
}
pSelEntry = NextSelected( pSelEntry );
@@ -2817,7 +2811,7 @@ void SvTreeListBox::InvalidateEntry(SvTreeListEntry* pEntry)
}
void SvTreeListBox::PaintEntry1(SvTreeListEntry& rEntry, long nLine, vcl::RenderContext& rRenderContext,
- SvLBoxTabFlags nTabFlags, bool bHasClipRegion)
+ SvLBoxTabFlags nTabFlags)
{
Rectangle aRect; // multi purpose
@@ -2850,7 +2844,7 @@ void SvTreeListBox::PaintEntry1(SvTreeListEntry& rEntry, long nLine, vcl::Render
bool bInUse = rEntry.HasInUseEmphasis();
// if a ClipRegion was set from outside, we don't have to reset it
const WinBits nWindowStyle = GetStyle();
- const bool bResetClipRegion = !bHasClipRegion;
+ const bool bResetClipRegion = false;
const bool bHideSelection = (nWindowStyle & WB_HIDESELECTION) !=0 && !HasFocus();
const StyleSettings& rSettings = rRenderContext.GetSettings().GetStyleSettings();
@@ -2860,12 +2854,6 @@ void SvTreeListBox::PaintEntry1(SvTreeListEntry& rEntry, long nLine, vcl::Render
Size aRectSize(0, nTempEntryHeight);
- if (!bHasClipRegion && nWindowStyle & WB_HSCROLL)
- {
- rRenderContext.SetClipRegion(vcl::Region(pImp->GetClipRegionRect()));
- bHasClipRegion = true;
- }
-
SvViewDataEntry* pViewDataEntry = GetViewDataEntry( &rEntry );
sal_uInt16 nTabCount = aTabs.size();
@@ -2903,11 +2891,6 @@ void SvTreeListBox::PaintEntry1(SvTreeListEntry& rEntry, long nLine, vcl::Render
if (nFlags & nTabFlags)
{
- if (!bHasClipRegion && nX + aSize.Width() >= nMaxRight)
- {
- rRenderContext.SetClipRegion(vcl::Region(pImp->GetClipRegionRect()));
- bHasClipRegion = true;
- }
aEntryPos.X() = nX;
aEntryPos.Y() = nLine;
@@ -3134,7 +3117,7 @@ void SvTreeListBox::PaintEntry1(SvTreeListEntry& rEntry, long nLine, vcl::Render
}
}
- if (bHasClipRegion && bResetClipRegion)
+ if (bResetClipRegion)
rRenderContext.SetClipRegion();
}
@@ -3251,7 +3234,7 @@ sal_IntPtr SvTreeListBox::GetTabPos( SvTreeListEntry* pEntry, SvLBoxTab* pTab)
}
SvLBoxItem* SvTreeListBox::GetItem_Impl( SvTreeListEntry* pEntry, long nX,
- SvLBoxTab** ppTab, sal_uInt16 nEmptyWidth )
+ SvLBoxTab** ppTab )
{
SvLBoxItem* pItemClicked = nullptr;
sal_uInt16 nTabCount = aTabs.size();
@@ -3288,9 +3271,6 @@ SvLBoxItem* SvTreeListBox::GetItem_Impl( SvTreeListEntry* pEntry, long nX,
nLen = nTabWidth;
}
- if( !nLen )
- nLen = nEmptyWidth;
-
if( nX >= nStart && nX < (nStart+nLen ) )
{
pItemClicked = pItem;
@@ -3391,13 +3371,13 @@ void SvTreeListBox::SetAlternatingRowColors( bool bEnable )
SvLBoxItem* SvTreeListBox::GetItem(SvTreeListEntry* pEntry,long nX,SvLBoxTab** ppTab)
{
- return GetItem_Impl( pEntry, nX, ppTab, 0 );
+ return GetItem_Impl( pEntry, nX, ppTab );
}
SvLBoxItem* SvTreeListBox::GetItem(SvTreeListEntry* pEntry,long nX )
{
SvLBoxTab* pDummyTab;
- return GetItem_Impl( pEntry, nX, &pDummyTab, 0 );
+ return GetItem_Impl( pEntry, nX, &pDummyTab );
}
void SvTreeListBox::AddTab(long nTabPos, SvLBoxTabFlags nFlags, void* pUserData )
diff --git a/svtools/source/control/asynclink.cxx b/svtools/source/control/asynclink.cxx
index c2803024c0aa..0c6f05370e35 100644
--- a/svtools/source/control/asynclink.cxx
+++ b/svtools/source/control/asynclink.cxx
@@ -33,10 +33,10 @@ void AsynchronLink::CreateMutex()
if( !_pMutex ) _pMutex = new osl::Mutex;
}
-void AsynchronLink::Call( void* pObj, bool bAllowDoubles, bool bUseTimer )
+void AsynchronLink::Call( void* pObj, bool bAllowDoubles )
{
#ifdef DBG_UTIL
- if ( bUseTimer || !_bInCall )
+ if ( !_bInCall )
SAL_INFO( "svtools", "Recursives Call. Eher ueber Timer. TLX Fragen" );
#endif
if( _aLink.IsSet() )
@@ -46,23 +46,9 @@ void AsynchronLink::Call( void* pObj, bool bAllowDoubles, bool bUseTimer )
( !_nEventId && ( !_pIdle || !_pIdle->IsActive() ) ),
"Schon ein Call unterwegs" );
ClearPendingCall();
- if( bUseTimer )
- {
- if( !_pIdle )
- {
- _pIdle = new Idle;
- _pIdle->SetPriority( SchedulerPriority::HIGHEST );
- _pIdle->SetIdleHdl( LINK(
- this, AsynchronLink, HandleCall_Idle) );
- }
- _pIdle->Start();
- }
- else
- {
- if( _pMutex ) _pMutex->acquire();
- _nEventId = Application::PostUserEvent( LINK( this, AsynchronLink, HandleCall_PostUserEvent) );
- if( _pMutex ) _pMutex->release();
- }
+ if( _pMutex ) _pMutex->acquire();
+ _nEventId = Application::PostUserEvent( LINK( this, AsynchronLink, HandleCall_PostUserEvent) );
+ if( _pMutex ) _pMutex->release();
}
}
diff --git a/svtools/source/control/calendar.cxx b/svtools/source/control/calendar.cxx
index 3f2437520ca4..56ab8f54dd48 100644
--- a/svtools/source/control/calendar.cxx
+++ b/svtools/source/control/calendar.cxx
@@ -764,7 +764,7 @@ void Calendar::ImplDrawDate(vcl::RenderContext& rRenderContext,
ImplInvertDropPos();
}
-void Calendar::ImplDraw(vcl::RenderContext& rRenderContext, bool bPaint)
+void Calendar::ImplDraw(vcl::RenderContext& rRenderContext)
{
ImplFormat();
@@ -793,36 +793,21 @@ void Calendar::ImplDraw(vcl::RenderContext& rRenderContext, bool bPaint)
rRenderContext.SetLineColor();
rRenderContext.SetFillColor(rStyleSettings.GetFaceColor());
Rectangle aTitleRect(0, nY, aOutSize.Width() - 1, nY + mnDayHeight - DAY_OFFY + TITLE_BORDERY * 2);
- if (!bPaint)
- {
- Rectangle aTempRect(1, aTitleRect.Top() + TITLE_BORDERY,
- aOutSize.Width() - 2,
- aTitleRect.Bottom() - TITLE_BORDERY);
- if (!i)
- {
- aTempRect.Left() = maPrevRect.Right() + 1;
- aTempRect.Right() = maNextRect.Left() - 1;
- }
- rRenderContext.DrawRect(aTempRect);
- }
- else
- {
- rRenderContext.DrawRect(aTitleRect);
- Point aTopLeft1(aTitleRect.Left(), aTitleRect.Top());
- Point aTopLeft2(aTitleRect.Left(), aTitleRect.Top() + 1);
- Point aBottomRight1(aTitleRect.Right(), aTitleRect.Bottom());
- Point aBottomRight2(aTitleRect.Right(), aTitleRect.Bottom() - 1);
- rRenderContext.SetLineColor(rStyleSettings.GetDarkShadowColor());
- rRenderContext.DrawLine(aTopLeft1, Point(aBottomRight1.X(), aTopLeft1.Y()));
- rRenderContext.SetLineColor(rStyleSettings.GetLightColor() );
- rRenderContext.DrawLine(aTopLeft2, Point(aBottomRight2.X(), aTopLeft2.Y()));
- rRenderContext.DrawLine(aTopLeft2, Point(aTopLeft2.X(), aBottomRight2.Y()));
- rRenderContext.SetLineColor(rStyleSettings.GetShadowColor() );
- rRenderContext.DrawLine(Point(aTopLeft2.X(), aBottomRight2.Y()), aBottomRight2);
- rRenderContext.DrawLine(Point(aBottomRight2.X(), aTopLeft2.Y()), aBottomRight2);
- rRenderContext.SetLineColor(rStyleSettings.GetDarkShadowColor());
- rRenderContext.DrawLine(Point(aTopLeft1.X(), aBottomRight1.Y()), aBottomRight1);
- }
+ rRenderContext.DrawRect(aTitleRect);
+ Point aTopLeft1(aTitleRect.Left(), aTitleRect.Top());
+ Point aTopLeft2(aTitleRect.Left(), aTitleRect.Top() + 1);
+ Point aBottomRight1(aTitleRect.Right(), aTitleRect.Bottom());
+ Point aBottomRight2(aTitleRect.Right(), aTitleRect.Bottom() - 1);
+ rRenderContext.SetLineColor(rStyleSettings.GetDarkShadowColor());
+ rRenderContext.DrawLine(aTopLeft1, Point(aBottomRight1.X(), aTopLeft1.Y()));
+ rRenderContext.SetLineColor(rStyleSettings.GetLightColor() );
+ rRenderContext.DrawLine(aTopLeft2, Point(aBottomRight2.X(), aTopLeft2.Y()));
+ rRenderContext.DrawLine(aTopLeft2, Point(aTopLeft2.X(), aBottomRight2.Y()));
+ rRenderContext.SetLineColor(rStyleSettings.GetShadowColor() );
+ rRenderContext.DrawLine(Point(aTopLeft2.X(), aBottomRight2.Y()), aBottomRight2);
+ rRenderContext.DrawLine(Point(aBottomRight2.X(), aTopLeft2.Y()), aBottomRight2);
+ rRenderContext.SetLineColor(rStyleSettings.GetDarkShadowColor());
+ rRenderContext.DrawLine(Point(aTopLeft1.X(), aBottomRight1.Y()), aBottomRight1);
Point aSepPos1(0, aTitleRect.Top() + TITLE_BORDERY);
Point aSepPos2(0, aTitleRect.Bottom() - TITLE_BORDERY);
for (j = 0; j < mnMonthPerLine-1; j++)
@@ -883,18 +868,15 @@ void Calendar::ImplDraw(vcl::RenderContext& rRenderContext, bool bPaint)
rRenderContext.SetTextColor(rStyleSettings.GetWindowTextColor());
// display week bar
- if (bPaint)
- {
- nDayX = nX + mnDaysOffX;
- nDayY = nY + mnWeekDayOffY;
- nDeltaY = nDayY + mnDayHeight;
- rRenderContext.SetLineColor(rStyleSettings.GetWindowTextColor());
- Point aStartPos(nDayX, nDeltaY);
- if (mnWinStyle & WB_WEEKNUMBER)
- aStartPos.X() -= WEEKNUMBER_OFFX - 2;
- rRenderContext.DrawLine(aStartPos, Point(nDayX + (7 * mnDayWidth), nDeltaY));
- rRenderContext.DrawTextArray(Point(nDayX + mnDayOfWeekAry[0], nDayY), maDayOfWeekText, &(mnDayOfWeekAry[1]));
- }
+ nDayX = nX + mnDaysOffX;
+ nDayY = nY + mnWeekDayOffY;
+ nDeltaY = nDayY + mnDayHeight;
+ rRenderContext.SetLineColor(rStyleSettings.GetWindowTextColor());
+ Point aStartPos(nDayX, nDeltaY);
+ if (mnWinStyle & WB_WEEKNUMBER)
+ aStartPos.X() -= WEEKNUMBER_OFFX - 2;
+ rRenderContext.DrawLine(aStartPos, Point(nDayX + (7 * mnDayWidth), nDeltaY));
+ rRenderContext.DrawTextArray(Point(nDayX + mnDayOfWeekAry[0], nDayY), maDayOfWeekText, &(mnDayOfWeekAry[1]));
// display weeknumbers
if (mnWinStyle & WB_WEEKNUMBER)
@@ -903,16 +885,8 @@ void Calendar::ImplDraw(vcl::RenderContext& rRenderContext, bool bPaint)
nDayY = nY + mnWeekDayOffY;
nDeltaY = nDayY + mnDayHeight;
long nMonthHeight = mnDayHeight * 6;
- if (bPaint)
- {
- rRenderContext.DrawLine(Point(nDayX - WEEKNUMBER_OFFX + 2, nDeltaY),
- Point(nDayX - WEEKNUMBER_OFFX + 2, nDeltaY + nMonthHeight));
- }
- else
- {
- rRenderContext.Erase(Rectangle(nDayX - mnWeekWidth - WEEKNUMBER_OFFX, nDeltaY,
- nDayX - WEEKNUMBER_OFFX - 1, nDeltaY + nMonthHeight));
- }
+ rRenderContext.DrawLine(Point(nDayX - WEEKNUMBER_OFFX + 2, nDeltaY),
+ Point(nDayX - WEEKNUMBER_OFFX + 2, nDeltaY + nMonthHeight));
vcl::Font aOldFont = rRenderContext.GetFont();
vcl::Font aTempFont = aOldFont;
ImplGetWeekFont(aTempFont);
@@ -937,12 +911,6 @@ void Calendar::ImplDraw(vcl::RenderContext& rRenderContext, bool bPaint)
sal_uInt16 nDaysInMonth = aDate.GetDaysInMonth();
nDayX = nX + mnDaysOffX;
nDayY = nY + mnDaysOffY;
- if (!bPaint)
- {
- Rectangle aClearRect(nDayX, nDayY,
- nDayX + (7 * mnDayWidth) - 1, nDayY + (6 * mnDayHeight) - 1);
- rRenderContext.Erase(aClearRect);
- }
sal_uInt16 nDayIndex = (sal_uInt16) aDate.GetDayOfWeek();
nDayIndex = (nDayIndex + (7 - (sal_uInt16)eStartDay)) % 7;
if (i == 0 && j == 0)
@@ -1003,8 +971,7 @@ void Calendar::ImplDraw(vcl::RenderContext& rRenderContext, bool bPaint)
}
// draw spin buttons
- if (bPaint)
- ImplDrawSpin(rRenderContext);
+ ImplDrawSpin(rRenderContext);
}
void Calendar::ImplUpdateDate( const Date& rDate )
@@ -1553,7 +1520,7 @@ void Calendar::KeyInput( const KeyEvent& rKEvt )
void Calendar::Paint( vcl::RenderContext& rRenderContext, const Rectangle& )
{
- ImplDraw(rRenderContext, true);
+ ImplDraw(rRenderContext);
}
void Calendar::GetFocus()
diff --git a/svtools/source/control/fmtfield.cxx b/svtools/source/control/fmtfield.cxx
index 31aa1c8e5844..b92e52d171dc 100644
--- a/svtools/source/control/fmtfield.cxx
+++ b/svtools/source/control/fmtfield.cxx
@@ -296,7 +296,7 @@ FormattedField::StaticFormatter::~StaticFormatter()
}
-FormattedField::FormattedField(vcl::Window* pParent, WinBits nStyle, SvNumberFormatter* pInitialFormatter, sal_Int32 nFormatKey)
+FormattedField::FormattedField(vcl::Window* pParent, WinBits nStyle, SvNumberFormatter* pInitialFormatter)
:SpinField(pParent, nStyle)
,m_aLastSelection(0,0)
,m_dMinValue(0)
@@ -323,7 +323,7 @@ FormattedField::FormattedField(vcl::Window* pParent, WinBits nStyle, SvNumberFor
if (pInitialFormatter)
{
m_pFormatter = pInitialFormatter;
- m_nFormatKey = nFormatKey;
+ m_nFormatKey = 0;
}
}
diff --git a/svtools/source/control/headbar.cxx b/svtools/source/control/headbar.cxx
index b0d6192d115b..99e0d5c7b25d 100644
--- a/svtools/source/control/headbar.cxx
+++ b/svtools/source/control/headbar.cxx
@@ -622,7 +622,7 @@ void HeaderBar::ImplDrawItem(vcl::RenderContext& rRenderContext, sal_uInt16 nPos
ImplDrawItem(rRenderContext, nPos, bHigh, bDrag, aRect, pRect, DrawFlags::NONE );
}
-void HeaderBar::ImplUpdate(sal_uInt16 nPos, bool bEnd, bool /*bDirect*/)
+void HeaderBar::ImplUpdate(sal_uInt16 nPos, bool bEnd)
{
if (IsVisible() && IsUpdateMode())
{
diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx
index 7491da7f4427..5af99b7f18bb 100644
--- a/svtools/source/control/ruler.cxx
+++ b/svtools/source/control/ruler.cxx
@@ -403,7 +403,7 @@ void Ruler::ImplVDrawText(vcl::RenderContext& rRenderContext, long nX, long nY,
}
}
-void Ruler::ImplInvertLines(vcl::RenderContext& rRenderContext, bool bErase)
+void Ruler::ImplInvertLines(vcl::RenderContext& rRenderContext)
{
// Position lines
if (!mpData->pLines.empty() && mbActive && !mbDrag && !mbFormat && !(mnUpdateFlags & RULER_UPDATE_LINES) )
@@ -436,29 +436,26 @@ void Ruler::ImplInvertLines(vcl::RenderContext& rRenderContext, bool bErase)
aRect.Top() = n;
aRect.Bottom() = n;
}
- if (bErase)
- {
- Rectangle aTempRect = aRect;
+ Rectangle aTempRect = aRect;
- if (mnWinStyle & WB_HORZ)
- aTempRect.Bottom() = RULER_OFF - 1;
- else
- aTempRect.Right() = RULER_OFF - 1;
+ if (mnWinStyle & WB_HORZ)
+ aTempRect.Bottom() = RULER_OFF - 1;
+ else
+ aTempRect.Right() = RULER_OFF - 1;
- rRenderContext.Erase(aTempRect);
+ rRenderContext.Erase(aTempRect);
- if (mnWinStyle & WB_HORZ)
- {
- aTempRect.Bottom() = aRect.Bottom();
- aTempRect.Top() = aTempRect.Bottom() - RULER_OFF + 1;
- }
- else
- {
- aTempRect.Right() = aRect.Right();
- aTempRect.Left() = aTempRect.Right() - RULER_OFF + 1;
- }
- rRenderContext.Erase(aTempRect);
+ if (mnWinStyle & WB_HORZ)
+ {
+ aTempRect.Bottom() = aRect.Bottom();
+ aTempRect.Top() = aTempRect.Bottom() - RULER_OFF + 1;
}
+ else
+ {
+ aTempRect.Right() = aRect.Right();
+ aTempRect.Left() = aTempRect.Right() - RULER_OFF + 1;
+ }
+ rRenderContext.Erase(aTempRect);
Invert(aRect);
}
}
@@ -1395,11 +1392,11 @@ void Ruler::ImplDraw(vcl::RenderContext& rRenderContext)
rRenderContext.DrawOutDev(aOffPos, aVirDevSize, Point(), aVirDevSize, *maVirDev.get());
// redraw positionlines
- ImplInvertLines(rRenderContext, true);
+ ImplInvertLines(rRenderContext);
}
}
-void Ruler::ImplDrawExtra(vcl::RenderContext& rRenderContext, bool bPaint)
+void Ruler::ImplDrawExtra(vcl::RenderContext& rRenderContext)
{
const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
Rectangle aRect = maExtraRect;
@@ -1410,19 +1407,11 @@ void Ruler::ImplDrawExtra(vcl::RenderContext& rRenderContext, bool bPaint)
aRect.Right() -= 2;
aRect.Bottom() -= 2;
- if (!bPaint && !(mnExtraStyle & RULER_STYLE_HIGHLIGHT))
+ if (mnExtraStyle & RULER_STYLE_HIGHLIGHT)
{
- rRenderContext.SetFillColor(rStyleSettings.GetWorkspaceColor());
+ rRenderContext.SetFillColor(rStyleSettings.GetCheckedColor());
bEraseRect = true;
}
- else
- {
- if (mnExtraStyle & RULER_STYLE_HIGHLIGHT)
- {
- rRenderContext.SetFillColor(rStyleSettings.GetCheckedColor());
- bEraseRect = true;
- }
- }
if (bEraseRect)
{
@@ -2145,7 +2134,7 @@ void Ruler::Paint(vcl::RenderContext& rRenderContext, const Rectangle&)
// consider extra field
if (mnWinStyle & WB_EXTRAFIELD)
- ImplDrawExtra(rRenderContext, true);
+ ImplDrawExtra(rRenderContext);
}
void Ruler::Resize()
diff --git a/svtools/source/control/toolbarmenu.cxx b/svtools/source/control/toolbarmenu.cxx
index 4cac6fe225fb..67a0843f7235 100644
--- a/svtools/source/control/toolbarmenu.cxx
+++ b/svtools/source/control/toolbarmenu.cxx
@@ -800,7 +800,7 @@ ToolbarMenuEntry* ToolbarMenu::implSearchEntry( int nEntryId ) const
}
-void ToolbarMenu::implHighlightEntry(vcl::RenderContext& rRenderContext, int nHighlightEntry, bool bHighlight)
+void ToolbarMenu::implHighlightEntry(vcl::RenderContext& rRenderContext, int nHighlightEntry)
{
Size aSz(GetOutputSizePixel());
long nX = 0;
@@ -816,14 +816,6 @@ void ToolbarMenu::implHighlightEntry(vcl::RenderContext& rRenderContext, int nHi
// no highlights for controls only items
if (pEntry->mpControl)
{
- if (!bHighlight)
- {
- ValueSet* pValueSet = dynamic_cast<ValueSet*>(pEntry->mpControl.get());
- if (pValueSet)
- {
- pValueSet->SetNoSelection();
- }
- }
break;
}
@@ -846,45 +838,38 @@ void ToolbarMenu::implHighlightEntry(vcl::RenderContext& rRenderContext, int nHi
Rectangle aCtrlRect(Point(nX, 0), Size(aPxSize.Width() - nX, aPxSize.Height()));
rRenderContext.DrawNativeControl(CTRL_MENU_POPUP, PART_ENTIRE_CONTROL, aCtrlRect,
ControlState::ENABLED, ImplControlValue(), OUString());
- if (bHighlight && rRenderContext.IsNativeControlSupported(CTRL_MENU_POPUP, PART_MENU_ITEM))
+ if (rRenderContext.IsNativeControlSupported(CTRL_MENU_POPUP, PART_MENU_ITEM))
{
bDrawItemRect = false;
ControlState eState = ControlState::SELECTED | (pEntry->mbEnabled ? ControlState::ENABLED : ControlState::NONE);
if (!rRenderContext.DrawNativeControl(CTRL_MENU_POPUP, PART_MENU_ITEM, aItemRect,
eState, ImplControlValue(), OUString()))
{
- bDrawItemRect = bHighlight;
+ bDrawItemRect = true;
}
}
else
{
- bDrawItemRect = bHighlight;
+ bDrawItemRect = true;
}
rRenderContext.Pop();
}
if (bDrawItemRect)
{
- if (bHighlight)
+ if (pEntry->mbEnabled)
{
- if (pEntry->mbEnabled)
- {
- rRenderContext.SetFillColor(rRenderContext.GetSettings().GetStyleSettings().GetMenuHighlightColor());
- }
- else
- {
- rRenderContext.SetFillColor();
- oldLineColor = rRenderContext.GetLineColor();
- rRenderContext.SetLineColor(rRenderContext.GetSettings().GetStyleSettings().GetMenuHighlightColor());
- bRestoreLineColor = true;
- }
+ rRenderContext.SetFillColor(rRenderContext.GetSettings().GetStyleSettings().GetMenuHighlightColor());
}
else
{
- rRenderContext.SetFillColor(rRenderContext.GetSettings().GetStyleSettings().GetMenuColor());
+ rRenderContext.SetFillColor();
+ oldLineColor = rRenderContext.GetLineColor();
+ rRenderContext.SetLineColor(rRenderContext.GetSettings().GetStyleSettings().GetMenuHighlightColor());
+ bRestoreLineColor = true;
}
rRenderContext.DrawRect(aItemRect);
}
- implPaint(rRenderContext, pEntry, bHighlight);
+ implPaint(rRenderContext, pEntry, true/*bHighlight*/);
if (bRestoreLineColor)
rRenderContext.SetLineColor(oldLineColor);
break;
@@ -1410,7 +1395,7 @@ void ToolbarMenu::Paint(vcl::RenderContext& rRenderContext, const Rectangle&)
implPaint(rRenderContext);
if (mpImpl->mnHighlightedEntry != -1)
- implHighlightEntry(rRenderContext, mpImpl->mnHighlightedEntry, true);
+ implHighlightEntry(rRenderContext, mpImpl->mnHighlightedEntry);
}
diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx
index 556089bb1cf9..f827dbfa2264 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -95,13 +95,13 @@ void ValueSet::ImplInit()
ImplInitSettings( true, true, true );
}
-ValueSet::ValueSet( vcl::Window* pParent, WinBits nWinStyle, bool bDisableTransientChildren ) :
+ValueSet::ValueSet( vcl::Window* pParent, WinBits nWinStyle ) :
Control( pParent, nWinStyle ),
maVirDev( VclPtr<VirtualDevice>::Create(*this) ),
maColor( COL_TRANSPARENT )
{
ImplInit();
- mbIsTransientChildrenDisabled = bDisableTransientChildren;
+ mbIsTransientChildrenDisabled = false;
}
VCL_BUILDER_DECL_FACTORY(ValueSet)
@@ -115,13 +115,13 @@ VCL_BUILDER_DECL_FACTORY(ValueSet)
rRet = VclPtr<ValueSet>::Create(pParent, nWinBits);
}
-ValueSet::ValueSet( vcl::Window* pParent, const ResId& rResId, bool bDisableTransientChildren ) :
+ValueSet::ValueSet( vcl::Window* pParent, const ResId& rResId ) :
Control( pParent, rResId ),
maVirDev( VclPtr<VirtualDevice>::Create(*this) ),
maColor( COL_TRANSPARENT )
{
ImplInit();
- mbIsTransientChildrenDisabled = bDisableTransientChildren;
+ mbIsTransientChildrenDisabled = false;
}
ValueSet::~ValueSet()
diff --git a/svtools/source/graphic/grfmgr2.cxx b/svtools/source/graphic/grfmgr2.cxx
index b71c56bff751..b0f0ea0384ef 100644
--- a/svtools/source/graphic/grfmgr2.cxx
+++ b/svtools/source/graphic/grfmgr2.cxx
@@ -65,9 +65,9 @@ sal_uLong GraphicManager::GetMaxCacheSize() const
return mpCache->GetMaxDisplayCacheSize();
}
-void GraphicManager::SetMaxObjCacheSize( sal_uLong nNewMaxObjSize, bool bDestroyGreaterCached )
+void GraphicManager::SetMaxObjCacheSize( sal_uLong nNewMaxObjSize )
{
- mpCache->SetMaxObjDisplayCacheSize( nNewMaxObjSize, bDestroyGreaterCached );
+ mpCache->SetMaxObjDisplayCacheSize( nNewMaxObjSize, true/*bDestroyGreaterCached*/ );
}
void GraphicManager::SetCacheTimeout( sal_uLong nTimeoutSeconds )
diff --git a/svtools/source/java/javacontext.cxx b/svtools/source/java/javacontext.cxx
index 3830ee557555..d4cf64805994 100644
--- a/svtools/source/java/javacontext.cxx
+++ b/svtools/source/java/javacontext.cxx
@@ -28,11 +28,10 @@ using namespace com::sun::star::task;
namespace svt
{
-JavaContext::JavaContext( const Reference< XCurrentContext > & ctx,
- bool bShowErrorsOnce)
+JavaContext::JavaContext( const Reference< XCurrentContext > & ctx)
: m_aRefCount(0),
m_xNextContext( ctx ),
- m_bShowErrorsOnce(bShowErrorsOnce)
+ m_bShowErrorsOnce(true)
{
}
diff --git a/svtools/source/misc/transfer.cxx b/svtools/source/misc/transfer.cxx
index 81dd5dc34ee0..49b8e067ab46 100644
--- a/svtools/source/misc/transfer.cxx
+++ b/svtools/source/misc/transfer.cxx
@@ -977,7 +977,7 @@ void TransferableHelper::CopyToSelection( vcl::Window *pWindow ) const
void TransferableHelper::StartDrag( vcl::Window* pWindow, sal_Int8 nDnDSourceActions,
- sal_Int32 nDnDPointer, sal_Int32 nDnDImage )
+ sal_Int32 nDnDPointer )
{
DBG_ASSERT( pWindow, "Window pointer is NULL" );
@@ -1010,7 +1010,7 @@ void TransferableHelper::StartDrag( vcl::Window* pWindow, sal_Int8 nDnDSourceAct
aEvt.DragOriginY = aPt.Y();
aEvt.DragSource = xDragSource;
- xDragSource->startDrag( aEvt, nDnDSourceActions, nDnDPointer, nDnDImage, this, this );
+ xDragSource->startDrag( aEvt, nDnDSourceActions, nDnDPointer, DND_IMAGE_NONE, this, this );
}
catch( const css::uno::Exception& )
{
diff --git a/svtools/source/svhtml/parhtml.cxx b/svtools/source/svhtml/parhtml.cxx
index b2e309f0e7fb..e227dce6f1f4 100644
--- a/svtools/source/svhtml/parhtml.cxx
+++ b/svtools/source/svhtml/parhtml.cxx
@@ -159,69 +159,33 @@ sal_Int32 HTMLOption::GetSNumber() const
return aTmp.toInt32();
}
-void HTMLOption::GetNumbers( std::vector<sal_uInt32> &rNumbers, bool bSpaceDelim ) const
+void HTMLOption::GetNumbers( std::vector<sal_uInt32> &rNumbers ) const
{
rNumbers.clear();
- if( bSpaceDelim )
+ // This is a very simplified scanner: it only searches all
+ // numerals in the string.
+ bool bInNum = false;
+ sal_uLong nNum = 0;
+ for( sal_Int32 i=0; i<aValue.getLength(); i++ )
{
- // This is a very simplified scanner: it only searches all
- // numerals in the string.
- bool bInNum = false;
- sal_uLong nNum = 0;
- for( sal_Int32 i=0; i<aValue.getLength(); i++ )
+ sal_Unicode c = aValue[ i ];
+ if( c>='0' && c<='9' )
{
- sal_Unicode c = aValue[ i ];
- if( c>='0' && c<='9' )
- {
- nNum *= 10;
- nNum += (c - '0');
- bInNum = true;
- }
- else if( bInNum )
- {
- rNumbers.push_back( nNum );
- bInNum = false;
- nNum = 0;
- }
+ nNum *= 10;
+ nNum += (c - '0');
+ bInNum = true;
}
- if( bInNum )
+ else if( bInNum )
{
rNumbers.push_back( nNum );
+ bInNum = false;
+ nNum = 0;
}
}
- else
+ if( bInNum )
{
- // Check whether numbers are separated by ',' and
- // insert 0 if necessary
- sal_Int32 nPos = 0;
- while( nPos < aValue.getLength() )
- {
- sal_Unicode c;
- while( nPos < aValue.getLength() &&
- ((c=aValue[nPos]) == ' ' || c == '\t' ||
- c == '\n' || c== '\r' ) )
- nPos++;
-
- if( nPos==aValue.getLength() )
- rNumbers.push_back(0);
- else
- {
- sal_Int32 nEnd = aValue.indexOf( (sal_Unicode)',', nPos );
- if( -1 == nEnd )
- {
- sal_Int32 nTmp = aValue.copy(nPos).toInt32();
- rNumbers.push_back( nTmp >= 0 ? (sal_uInt32)nTmp : 0 );
- nPos = aValue.getLength();
- }
- else
- {
- sal_Int32 nTmp = aValue.copy(nPos,nEnd-nPos).toInt32();
- rNumbers.push_back( nTmp >= 0 ? (sal_uInt32)nTmp : 0 );
- nPos = nEnd+1;
- }
- }
- }
+ rNumbers.push_back( nNum );
}
}
diff --git a/svtools/source/uno/contextmenuhelper.cxx b/svtools/source/uno/contextmenuhelper.cxx
index 6c74a1be305f..dac728362090 100644
--- a/svtools/source/uno/contextmenuhelper.cxx
+++ b/svtools/source/uno/contextmenuhelper.cxx
@@ -251,11 +251,10 @@ static OUString lcl_GetItemCommandRecursive( const PopupMenu* pPopupMenu, sal_uI
/*************************************************************************/
ContextMenuHelper::ContextMenuHelper(
- const uno::Reference< frame::XFrame >& xFrame,
- bool bAutoRefresh ) :
+ const uno::Reference< frame::XFrame >& xFrame ) :
m_xWeakFrame( xFrame ),
m_aSelf( "_self" ),
- m_bAutoRefresh( bAutoRefresh ),
+ m_bAutoRefresh( true ),
m_bUICfgMgrAssociated( false )
{
}