[Libreoffice-commits] .: 10 commits - chart2/source cui/source reportdesign/source sc/source sd/source svtools/inc svtools/source svx/inc sw/source
Matteo Casalin
mcasalin at kemper.freedesktop.org
Fri Feb 17 09:58:06 PST 2012
chart2/source/controller/inc/dlg_ObjectProperties.hxx | 3
cui/source/inc/cuitabarea.hxx | 10
reportdesign/source/ui/dlg/dlgpage.cxx | 1
sc/source/ui/drawfunc/chartsh.cxx | 2
sc/source/ui/drawfunc/drawsh.cxx | 3
sc/source/ui/drawfunc/drformsh.cxx | 2
sc/source/ui/drawfunc/oleobjsh.cxx | 2
sd/source/ui/dlg/dlgpage.cxx | 1
sd/source/ui/func/fuarea.cxx | 1
sd/source/ui/func/futempl.cxx | 2
svtools/inc/svtools/valueset.hxx | 57 +-
svtools/source/control/valueacc.cxx | 2
svtools/source/control/valueimp.hxx | 25
svtools/source/control/valueset.cxx | 486 +++++++-----------
svx/inc/svx/tabarea.hxx | 13
sw/source/ui/shells/drawdlg.cxx | 2
16 files changed, 252 insertions(+), 360 deletions(-)
New commits:
commit 2d5c5177144dc2b9f7b12e84558f6d92af48cbb8
Author: Matteo Casalin <matteo.casalin at gmx.com>
Date: Wed Feb 15 23:12:03 2012 +0100
ValueSet: from #defines to enum, with reduced scope
diff --git a/svtools/source/control/valueimp.hxx b/svtools/source/control/valueimp.hxx
index fbe8b7d..f7cd13f 100644
--- a/svtools/source/control/valueimp.hxx
+++ b/svtools/source/control/valueimp.hxx
@@ -47,15 +47,7 @@
// - Defines -
// -----------
-#define ITEM_OFFSET 4
-#define ITEM_OFFSET_DOUBLE 6
-#define NAME_LINE_OFF_X 2
-#define NAME_LINE_OFF_Y 2
-#define NAME_LINE_HEIGHT 2
-#define NAME_OFFSET 2
-#define SCRBAR_OFFSET 1
#define VALUESET_ITEM_NONEITEM 0xFFFE
-#define VALUESET_SCROLL_OFFSET 4
// --------------------
// - ValueSetItemType -
diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx
index 28caab6..e22ec21 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -42,6 +42,22 @@
#define _SV_VALUESET_CXX
#include <svtools/valueset.hxx>
+namespace
+{
+
+enum {
+ ITEM_OFFSET = 4,
+ ITEM_OFFSET_DOUBLE = 6,
+ NAME_LINE_OFF_X = 2,
+ NAME_LINE_OFF_Y = 2,
+ NAME_LINE_HEIGHT = 2,
+ NAME_OFFSET = 2,
+ SCRBAR_OFFSET = 1,
+ SCROLL_OFFSET = 4
+};
+
+}
+
// ------------
// - ValueSet -
// ------------
@@ -975,9 +991,9 @@ bool ValueSet::ImplScroll( const Point& rPos )
sal_uInt16 nOldLine = mnFirstLine;
const Rectangle& rTopRect = mItemList[ mnFirstLine*mnCols ]->maRect;
if ( rTopRect.GetHeight() <= 16 )
- nScrollOffset = VALUESET_SCROLL_OFFSET/2;
+ nScrollOffset = SCROLL_OFFSET/2;
else
- nScrollOffset = VALUESET_SCROLL_OFFSET;
+ nScrollOffset = SCROLL_OFFSET;
if ( (mnFirstLine > 0) && (rPos.Y() >= 0) )
{
long nTopPos = rTopRect.Top();
commit b3b7a6088b932dc3f6716b24b9382fc049aaf4ff
Author: Matteo Casalin <matteo.casalin at gmx.com>
Date: Tue Feb 14 22:46:15 2012 +0100
ValueSet: use support function to clarify code
diff --git a/svtools/inc/svtools/valueset.hxx b/svtools/inc/svtools/valueset.hxx
index b6e0f2f..2448c7c 100644
--- a/svtools/inc/svtools/valueset.hxx
+++ b/svtools/inc/svtools/valueset.hxx
@@ -257,6 +257,7 @@ private:
SVT_DLLPRIVATE void ImplDeleteItems();
SVT_DLLPRIVATE void ImplFormatItem( ValueSetItem* pItem );
SVT_DLLPRIVATE void ImplDrawItemText( const XubString& rStr );
+ SVT_DLLPRIVATE void ImplDrawSelect( sal_uInt16 nItemId, const bool bFocus, const bool bDrawSel );
SVT_DLLPRIVATE void ImplDrawSelect();
SVT_DLLPRIVATE void ImplHideSelect( sal_uInt16 nItemId );
SVT_DLLPRIVATE void ImplHighlightItem( sal_uInt16 nItemId, bool bIsSelection = true );
diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx
index f655517..28caab6 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -693,36 +693,33 @@ void ValueSet::ImplDrawSelect()
return;
}
- sal_uInt16 nItemId = mnSelItemId;
-
- for( int stage = 0; stage < 2; stage++ )
+ ImplDrawSelect( mnSelItemId, bFocus, bDrawSel );
+ if (mbHighlight)
{
- if( stage == 1 )
- {
- if ( mbHighlight )
- nItemId = mnHighItemId;
- else
- break;
- }
+ ImplDrawSelect( mnHighItemId, bFocus, bDrawSel );
+ }
+}
- ValueSetItem* pItem;
- if ( nItemId )
- pItem = mItemList[ GetItemPos( nItemId ) ];
- else
- {
- if ( mpNoneItem )
- pItem = mpNoneItem;
- else
- {
- pItem = ImplGetFirstItem();
- if ( !bFocus || !pItem )
- continue;
- }
- }
+// -----------------------------------------------------------------------
- if ( pItem->maRect.IsEmpty() )
- continue;
+void ValueSet::ImplDrawSelect( sal_uInt16 nItemId, const bool bFocus, const bool bDrawSel )
+{
+ ValueSetItem* pItem;
+ if ( nItemId )
+ {
+ pItem = mItemList[ GetItemPos( nItemId ) ];
+ }
+ else if ( mpNoneItem )
+ {
+ pItem = mpNoneItem;
+ }
+ else if ( !bFocus || !(pItem = ImplGetFirstItem()) )
+ {
+ return;
+ }
+ if ( !pItem->maRect.IsEmpty() )
+ {
// draw selection
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
Rectangle aRect = pItem->maRect;
@@ -730,7 +727,7 @@ void ValueSet::ImplDrawSelect()
Color aDoubleColor( rStyleSettings.GetHighlightColor() );
Color aSingleColor( rStyleSettings.GetHighlightTextColor() );
- if( ! mbDoubleSel )
+ if( !mbDoubleSel )
{
/*
* #99777# contrast enhancement for thin mode
@@ -761,10 +758,7 @@ void ValueSet::ImplDrawSelect()
if ( bDrawSel )
{
- if ( mbBlackSel )
- SetLineColor( Color( COL_BLACK ) );
- else
- SetLineColor( aDoubleColor );
+ SetLineColor( mbBlackSel ? Color( COL_BLACK ) : aDoubleColor );
DrawRect( aRect );
}
}
@@ -809,10 +803,7 @@ void ValueSet::ImplDrawSelect()
{
if ( bDrawSel )
{
- if ( mbBlackSel )
- SetLineColor( Color( COL_BLACK ) );
- else
- SetLineColor( aDoubleColor );
+ SetLineColor( mbBlackSel ? Color( COL_BLACK ) : aDoubleColor );
DrawRect( aRect );
}
if ( mbDoubleSel )
@@ -847,13 +838,12 @@ void ValueSet::ImplDrawSelect()
if ( bDrawSel )
{
- if ( mbBlackSel )
- SetLineColor( Color( COL_WHITE ) );
- else
- SetLineColor( aSingleColor );
+ SetLineColor( mbBlackSel ? Color( COL_WHITE ) : aSingleColor );
}
else
+ {
SetLineColor( Color( COL_LIGHTGRAY ) );
+ }
DrawRect( aRect2 );
if ( bFocus )
commit e0cdd2d72da6f6c4f1605fc210ba45f5b9a41c35
Author: Matteo Casalin <matteo.casalin at gmx.com>
Date: Mon Feb 13 21:48:44 2012 +0100
ValueSet: factor out duplicated code in InsertItem
diff --git a/svtools/inc/svtools/valueset.hxx b/svtools/inc/svtools/valueset.hxx
index 8cf463c..b6e0f2f 100644
--- a/svtools/inc/svtools/valueset.hxx
+++ b/svtools/inc/svtools/valueset.hxx
@@ -268,6 +268,7 @@ private:
SVT_DLLPRIVATE ValueSetItem* ImplGetFirstItem();
SVT_DLLPRIVATE sal_uInt16 ImplGetVisibleItemCount() const;
SVT_DLLPRIVATE ValueSetItem* ImplGetVisibleItem( sal_uInt16 nVisiblePos );
+ SVT_DLLPRIVATE void ImplInsertItem( ValueSetItem *const pItem, const size_t nPos );
SVT_DLLPRIVATE void ImplFireAccessibleEvent( short nEventId, const ::com::sun::star::uno::Any& rOldValue, const ::com::sun::star::uno::Any& rNewValue );
SVT_DLLPRIVATE bool ImplHasAccessibleListeners();
SVT_DLLPRIVATE void ImplTracking( const Point& rPos, bool bRepeat );
diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx
index decbc99..f655517 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -1655,50 +1655,22 @@ void ValueSet::UserDraw( const UserDrawEvent& )
void ValueSet::InsertItem( sal_uInt16 nItemId, const Image& rImage, size_t nPos )
{
- DBG_ASSERT( nItemId, "ValueSet::InsertItem(): ItemId == 0" );
- DBG_ASSERT( GetItemPos( nItemId ) == VALUESET_ITEM_NOTFOUND,
- "ValueSet::InsertItem(): ItemId already exists" );
-
ValueSetItem* pItem = new ValueSetItem( *this );
pItem->mnId = nItemId;
pItem->meType = VALUESETITEM_IMAGE;
pItem->maImage = rImage;
- if ( nPos < mItemList.size() ) {
- ValueItemList::iterator it = mItemList.begin();
- ::std::advance( it, nPos );
- mItemList.insert( it, pItem );
- } else {
- mItemList.push_back( pItem );
- }
-
- mbFormat = true;
- if ( IsReallyVisible() && IsUpdateMode() )
- Invalidate();
+ ImplInsertItem( pItem, nPos );
}
// -----------------------------------------------------------------------
void ValueSet::InsertItem( sal_uInt16 nItemId, const Color& rColor, size_t nPos )
{
- DBG_ASSERT( nItemId, "ValueSet::InsertItem(): ItemId == 0" );
- DBG_ASSERT( GetItemPos( nItemId ) == VALUESET_ITEM_NOTFOUND,
- "ValueSet::InsertItem(): ItemId already exists" );
-
ValueSetItem* pItem = new ValueSetItem( *this );
pItem->mnId = nItemId;
pItem->meType = VALUESETITEM_COLOR;
pItem->maColor = rColor;
- if ( nPos < mItemList.size() ) {
- ValueItemList::iterator it = mItemList.begin();
- ::std::advance( it, nPos );
- mItemList.insert( it, pItem );
- } else {
- mItemList.push_back( pItem );
- }
-
- mbFormat = true;
- if ( IsReallyVisible() && IsUpdateMode() )
- Invalidate();
+ ImplInsertItem( pItem, nPos );
}
// -----------------------------------------------------------------------
@@ -1706,26 +1678,12 @@ void ValueSet::InsertItem( sal_uInt16 nItemId, const Color& rColor, size_t nPos
void ValueSet::InsertItem( sal_uInt16 nItemId, const Image& rImage,
const XubString& rText, size_t nPos )
{
- DBG_ASSERT( nItemId, "ValueSet::InsertItem(): ItemId == 0" );
- DBG_ASSERT( GetItemPos( nItemId ) == VALUESET_ITEM_NOTFOUND,
- "ValueSet::InsertItem(): ItemId already exists" );
-
ValueSetItem* pItem = new ValueSetItem( *this );
pItem->mnId = nItemId;
pItem->meType = VALUESETITEM_IMAGE;
pItem->maImage = rImage;
pItem->maText = rText;
- if ( nPos < mItemList.size() ) {
- ValueItemList::iterator it = mItemList.begin();
- ::std::advance( it, nPos );
- mItemList.insert( it, pItem );
- } else {
- mItemList.push_back( pItem );
- }
-
- mbFormat = true;
- if ( IsReallyVisible() && IsUpdateMode() )
- Invalidate();
+ ImplInsertItem( pItem, nPos );
}
// -----------------------------------------------------------------------
@@ -1733,39 +1691,32 @@ void ValueSet::InsertItem( sal_uInt16 nItemId, const Image& rImage,
void ValueSet::InsertItem( sal_uInt16 nItemId, const Color& rColor,
const XubString& rText, size_t nPos )
{
- DBG_ASSERT( nItemId, "ValueSet::InsertItem(): ItemId == 0" );
- DBG_ASSERT( GetItemPos( nItemId ) == VALUESET_ITEM_NOTFOUND,
- "ValueSet::InsertItem(): ItemId already exists" );
-
ValueSetItem* pItem = new ValueSetItem( *this );
pItem->mnId = nItemId;
pItem->meType = VALUESETITEM_COLOR;
pItem->maColor = rColor;
pItem->maText = rText;
- if ( nPos < mItemList.size() ) {
- ValueItemList::iterator it = mItemList.begin();
- ::std::advance( it, nPos );
- mItemList.insert( it, pItem );
- } else {
- mItemList.push_back( pItem );
- }
-
- mbFormat = true;
- if ( IsReallyVisible() && IsUpdateMode() )
- Invalidate();
+ ImplInsertItem( pItem, nPos );
}
// -----------------------------------------------------------------------
void ValueSet::InsertItem( sal_uInt16 nItemId, size_t nPos )
{
- DBG_ASSERT( nItemId, "ValueSet::InsertItem(): ItemId == 0" );
- DBG_ASSERT( GetItemPos( nItemId ) == VALUESET_ITEM_NOTFOUND,
- "ValueSet::InsertItem(): ItemId already exists" );
-
ValueSetItem* pItem = new ValueSetItem( *this );
pItem->mnId = nItemId;
pItem->meType = VALUESETITEM_USERDRAW;
+ ImplInsertItem( pItem, nPos );
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::ImplInsertItem( ValueSetItem *const pItem, const size_t nPos )
+{
+ DBG_ASSERT( pItem->mnId, "ValueSet::InsertItem(): ItemId == 0" );
+ DBG_ASSERT( GetItemPos( pItem->mnId ) == VALUESET_ITEM_NOTFOUND,
+ "ValueSet::InsertItem(): ItemId already exists" );
+
if ( nPos < mItemList.size() ) {
ValueItemList::iterator it = mItemList.begin();
::std::advance( it, nPos );
commit ff3ddcfb73188e17a266d123d310b118ce4f4abe
Author: Matteo Casalin <matteo.casalin at gmx.com>
Date: Mon Feb 13 20:36:53 2012 +0100
Cleanup inludes
diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx
index 7bb13e2..0f7c2e5 100644
--- a/cui/source/inc/cuitabarea.hxx
+++ b/cui/source/inc/cuitabarea.hxx
@@ -30,8 +30,18 @@
// include ---------------------------------------------------------------
+#include <svtools/valueset.hxx>
+#include <vcl/button.hxx>
+#include <vcl/fixed.hxx>
+#include <svx/dlgctrl.hxx>
+#include <svx/xsetit.hxx>
+#include <svx/xfillit0.hxx>
+#include <svx/xfillit.hxx>
#include <svx/tabarea.hxx>
+class SdrModel;
+class SdrView;
+
/************************************************************************/
class SvxAreaTabDialog : public SfxTabDialog
diff --git a/svx/inc/svx/tabarea.hxx b/svx/inc/svx/tabarea.hxx
index cbbd2c6..6563e1b 100644
--- a/svx/inc/svx/tabarea.hxx
+++ b/svx/inc/svx/tabarea.hxx
@@ -28,16 +28,6 @@
#ifndef _SVX_TAB_AREA_HXX
#define _SVX_TAB_AREA_HXX
-// include ---------------------------------------------------------------
-
-#include <svtools/valueset.hxx>
-#include <vcl/button.hxx>
-#include <vcl/fixed.hxx>
-#include <svx/dlgctrl.hxx>
-#include <svx/xsetit.hxx>
-#include <svx/xfillit0.hxx>
-#include <svx/xfillit.hxx>
-
// enum ------------------------------------------------------------------
enum ColorModel
@@ -66,9 +56,6 @@ typedef sal_uInt16 ChangeType; // auch in tab_line.hxx (mitpflegen !!!)
#define CT_CHANGED ( (ChangeType) 0x0002 )
#define CT_SAVED ( (ChangeType) 0x0004 )
-class SdrModel;
-class SdrView;
-
#endif // _SVX_TAB_AREA_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 761b6b706e434ab0d03387c9485bdc709dda0e55
Author: Matteo Casalin <matteo.casalin at gmx.com>
Date: Sun Feb 12 19:18:44 2012 +0100
Remove unnecessary header files
diff --git a/chart2/source/controller/inc/dlg_ObjectProperties.hxx b/chart2/source/controller/inc/dlg_ObjectProperties.hxx
index 2f40c7d..fe10b99 100644
--- a/chart2/source/controller/inc/dlg_ObjectProperties.hxx
+++ b/chart2/source/controller/inc/dlg_ObjectProperties.hxx
@@ -30,8 +30,7 @@
#include "ObjectIdentifier.hxx"
#include <sfx2/tabdlg.hxx>
-// header for typedef ChangeType
-#include <svx/tabarea.hxx>
+#include <svx/dlgctrl.hxx>
#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
//.............................................................................
diff --git a/reportdesign/source/ui/dlg/dlgpage.cxx b/reportdesign/source/ui/dlg/dlgpage.cxx
index 7ebb797..651f240 100644
--- a/reportdesign/source/ui/dlg/dlgpage.cxx
+++ b/reportdesign/source/ui/dlg/dlgpage.cxx
@@ -28,7 +28,6 @@
#include <svx/dialogs.hrc>
-#include <svx/tabarea.hxx>
#include <svx/flagsdef.hxx>
#include <svx/svxdlg.hxx>
#include <editeng/svxenum.hxx>
diff --git a/sc/source/ui/drawfunc/chartsh.cxx b/sc/source/ui/drawfunc/chartsh.cxx
index 18a5265..04d6fca 100644
--- a/sc/source/ui/drawfunc/chartsh.cxx
+++ b/sc/source/ui/drawfunc/chartsh.cxx
@@ -33,8 +33,6 @@
#include <editeng/eeitem.hxx>
#include <svx/fontwork.hxx>
#include <svl/srchitem.hxx>
-#include <svx/tabarea.hxx>
-#include <svx/tabline.hxx>
#include <sfx2/app.hxx>
#include <sfx2/objface.hxx>
#include <sfx2/request.hxx>
diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx
index bcdd694..61d20f1 100644
--- a/sc/source/ui/drawfunc/drawsh.cxx
+++ b/sc/source/ui/drawfunc/drawsh.cxx
@@ -35,8 +35,7 @@
#include <editeng/eeitem.hxx>
#include <svx/fontwork.hxx>
#include <svl/srchitem.hxx>
-#include <svx/tabarea.hxx>
-#include <svx/tabline.hxx>
+#include <svx/svdpage.hxx>
#include <sfx2/app.hxx>
#include <sfx2/objface.hxx>
#include <sfx2/objsh.hxx>
diff --git a/sc/source/ui/drawfunc/drformsh.cxx b/sc/source/ui/drawfunc/drformsh.cxx
index 61297fe..fa7ac59 100644
--- a/sc/source/ui/drawfunc/drformsh.cxx
+++ b/sc/source/ui/drawfunc/drformsh.cxx
@@ -34,8 +34,6 @@
#include <editeng/eeitem.hxx>
#include <svx/fontwork.hxx>
#include <svl/srchitem.hxx>
-#include <svx/tabarea.hxx>
-#include <svx/tabline.hxx>
#include <sfx2/app.hxx>
#include <sfx2/objface.hxx>
#include <sfx2/request.hxx>
diff --git a/sc/source/ui/drawfunc/oleobjsh.cxx b/sc/source/ui/drawfunc/oleobjsh.cxx
index dbf604f..1e166b0 100644
--- a/sc/source/ui/drawfunc/oleobjsh.cxx
+++ b/sc/source/ui/drawfunc/oleobjsh.cxx
@@ -34,8 +34,6 @@
#include <editeng/eeitem.hxx>
#include <svx/fontwork.hxx>
#include <svl/srchitem.hxx>
-#include <svx/tabarea.hxx>
-#include <svx/tabline.hxx>
#include <sfx2/app.hxx>
#include <sfx2/objface.hxx>
#include <sfx2/request.hxx>
diff --git a/sd/source/ui/dlg/dlgpage.cxx b/sd/source/ui/dlg/dlgpage.cxx
index abec3b8..af8d7a1 100644
--- a/sd/source/ui/dlg/dlgpage.cxx
+++ b/sd/source/ui/dlg/dlgpage.cxx
@@ -33,7 +33,6 @@
#include <svl/intitem.hxx>
#include <svx/dialogs.hrc>
-#include <svx/tabarea.hxx>
#include <svx/drawitem.hxx>
#include "sdresid.hxx"
diff --git a/sd/source/ui/func/fuarea.cxx b/sd/source/ui/func/fuarea.cxx
index 20758a7..0255f3f 100644
--- a/sd/source/ui/func/fuarea.cxx
+++ b/sd/source/ui/func/fuarea.cxx
@@ -31,7 +31,6 @@
#include "fuarea.hxx"
#include <svx/svxids.hrc>
-#include <svx/tabarea.hxx>
#include <vcl/msgbox.hxx>
#include <svl/intitem.hxx>
#include <svl/stritem.hxx>
diff --git a/sd/source/ui/func/futempl.cxx b/sd/source/ui/func/futempl.cxx
index d6d3ae1..0f0a796 100644
--- a/sd/source/ui/func/futempl.cxx
+++ b/sd/source/ui/func/futempl.cxx
@@ -70,7 +70,7 @@
#include "glob.hrc"
#include "prlayout.hxx" // enum PresentationObjects
#include "prltempl.hrc" // TAB_PRES_LAYOUT_TEMPLATE_x
-#include <svx/tabarea.hxx>
+#include <svx/xfillit.hxx>
#include "sdresid.hxx"
#include "OutlineViewShell.hxx"
#include "strings.hrc"
diff --git a/sw/source/ui/shells/drawdlg.cxx b/sw/source/ui/shells/drawdlg.cxx
index 8f3f420..eed8c88 100644
--- a/sw/source/ui/shells/drawdlg.cxx
+++ b/sw/source/ui/shells/drawdlg.cxx
@@ -33,8 +33,6 @@
#include <sfx2/request.hxx>
#include <sfx2/dispatch.hxx>
#include <svx/svdview.hxx>
-#include <svx/tabarea.hxx>
-#include <svx/tabline.hxx>
#include <svx/drawitem.hxx>
#include <svx/xtable.hxx>
commit 97671937e2a8dfe65166ed04aa7c65d7bc3f477d
Author: Matteo Casalin <matteo.casalin at gmx.com>
Date: Sun Feb 12 18:32:26 2012 +0100
ValueSet: fix a test condition and remove an obsoleted header file
diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx
index 345d3ad..decbc99 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -27,7 +27,6 @@
************************************************************************/
#include <tools/debug.hxx>
-#include <tools/list.hxx>
#include <vcl/decoview.hxx>
#include <vcl/svapp.hxx>
#include <vcl/scrbar.hxx>
@@ -871,8 +870,8 @@ void ValueSet::ImplHideSelect( sal_uInt16 nItemId )
{
Rectangle aRect;
- sal_uInt16 nItemPos = GetItemPos( nItemId );
- if ( nItemPos != sal::static_int_cast<sal_uInt16>(LIST_ENTRY_NOTFOUND) )
+ size_t nItemPos = GetItemPos( nItemId );
+ if ( nItemPos != VALUESET_ITEM_NOTFOUND )
aRect = mItemList[nItemPos]->maRect;
else
{
commit ce2d6331cb672474d048967c36448a978af316c3
Author: Matteo Casalin <matteo.casalin at gmx.com>
Date: Sun Feb 12 14:00:24 2012 +0100
ValueSet: merge almost empty implementation to main class
diff --git a/svtools/inc/svtools/valueset.hxx b/svtools/inc/svtools/valueset.hxx
index 0295c6e..8cf463c 100644
--- a/svtools/inc/svtools/valueset.hxx
+++ b/svtools/inc/svtools/valueset.hxx
@@ -214,7 +214,7 @@ private:
VirtualDevice maVirDev;
Timer maTimer;
- ValueSet_Impl* mpImpl;
+ ValueItemList mItemList;
ValueSetItem* mpNoneItem;
ScrollBar* mpScrBar;
long mnTextOffset;
@@ -240,9 +240,11 @@ private:
bool mbDoubleSel : 1;
bool mbScroll : 1;
bool mbFullMode : 1;
+ bool mbIsTransientChildrenDisabled : 1;
Color maColor;
Link maDoubleClickHdl;
Link maSelectHdl;
+ Link maHighlightHdl;
#ifdef _SV_VALUESET_CXX
friend class ValueSetAcc;
diff --git a/svtools/source/control/valueacc.cxx b/svtools/source/control/valueacc.cxx
index 53bc2db..61aec1a 100644
--- a/svtools/source/control/valueacc.cxx
+++ b/svtools/source/control/valueacc.cxx
@@ -442,7 +442,7 @@ uno::Reference< accessibility::XAccessible > SAL_CALL ValueSetAcc::getAccessible
if( VALUESET_ITEM_NONEITEM != nItemPos )
{
- ValueSetItem* pItem = mpParent->mpImpl->mItemList[ nItemPos ];
+ ValueSetItem *const pItem = mpParent->mItemList[nItemPos];
if( !pItem->maRect.IsEmpty() )
xRet = pItem->GetAccessible( mbIsTransientChildrenDisabled );
diff --git a/svtools/source/control/valueimp.hxx b/svtools/source/control/valueimp.hxx
index d4523ff..fbe8b7d 100644
--- a/svtools/source/control/valueimp.hxx
+++ b/svtools/source/control/valueimp.hxx
@@ -94,21 +94,6 @@ struct ValueSetItem
GetAccessible( bool bIsTransientChildrenDisabled );
};
-typedef ::std::vector< ValueSetItem* > ValueItemList;
-
-// -----------------------------------------------------------------------------
-
-struct ValueSet_Impl
-{
- ValueItemList mItemList;
- bool mbIsTransientChildrenDisabled;
- Link maHighlightHdl;
-
- ValueSet_Impl() : mbIsTransientChildrenDisabled( false )
- {
- }
-};
-
// ---------------
// - ValueSetAcc -
// ---------------
diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx
index d2d1b95..345d3ad 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -49,8 +49,6 @@
void ValueSet::ImplInit()
{
- // Size aWinSize = GetSizePixel();
- mpImpl = new ValueSet_Impl;
mpNoneItem = NULL;
mpScrBar = NULL;
mnTextOffset = 0;
@@ -91,8 +89,7 @@ ValueSet::ValueSet( Window* pParent, WinBits nWinStyle, bool bDisableTransientCh
maColor( COL_TRANSPARENT )
{
ImplInit();
- if( mpImpl )
- mpImpl->mbIsTransientChildrenDisabled = bDisableTransientChildren;
+ mbIsTransientChildrenDisabled = bDisableTransientChildren;
}
// -----------------------------------------------------------------------
@@ -103,8 +100,7 @@ ValueSet::ValueSet( Window* pParent, const ResId& rResId, bool bDisableTransient
maColor( COL_TRANSPARENT )
{
ImplInit();
- if( mpImpl )
- mpImpl->mbIsTransientChildrenDisabled = bDisableTransientChildren;
+ mbIsTransientChildrenDisabled = bDisableTransientChildren;
}
// -----------------------------------------------------------------------
@@ -120,28 +116,27 @@ ValueSet::~ValueSet()
delete mpNoneItem;
ImplDeleteItems();
- delete mpImpl;
}
// -----------------------------------------------------------------------
void ValueSet::ImplDeleteItems()
{
- for ( size_t i = 0, n = mpImpl->mItemList.size(); i < n; ++i )
+ for ( size_t i = 0, n = mItemList.size(); i < n; ++i )
{
- ValueSetItem* pItem = mpImpl->mItemList[ i ];
+ ValueSetItem *const pItem = mItemList[i];
if( !pItem->maRect.IsEmpty() && ImplHasAccessibleListeners() )
{
::com::sun::star::uno::Any aOldAny, aNewAny;
- aOldAny <<= pItem->GetAccessible( mpImpl->mbIsTransientChildrenDisabled );
+ aOldAny <<= pItem->GetAccessible( mbIsTransientChildrenDisabled );
ImplFireAccessibleEvent( ::com::sun::star::accessibility::AccessibleEventId::CHILD, aOldAny, aNewAny );
}
delete pItem;
}
- mpImpl->mItemList.clear();
+ mItemList.clear();
}
// -----------------------------------------------------------------------
@@ -323,7 +318,7 @@ void ValueSet::ImplFormatItem( ValueSetItem* pItem )
::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > ValueSet::CreateAccessible()
{
- return new ValueSetAcc( this, mpImpl->mbIsTransientChildrenDisabled );
+ return new ValueSetAcc( this, mbIsTransientChildrenDisabled );
}
// -----------------------------------------------------------------------
@@ -331,7 +326,7 @@ void ValueSet::ImplFormatItem( ValueSetItem* pItem )
void ValueSet::Format()
{
Size aWinSize = GetOutputSizePixel();
- size_t nItemCount = mpImpl->mItemList.size();
+ size_t nItemCount = mItemList.size();
WinBits nStyle = GetStyle();
long nTxtHeight = GetTextHeight();
long nOff;
@@ -420,8 +415,8 @@ void ValueSet::Format()
// calculate number of rows
mbScroll = false;
- mnLines = (long)mpImpl->mItemList.size() / mnCols;
- if ( mpImpl->mItemList.size() % mnCols )
+ mnLines = (long)mItemList.size() / mnCols;
+ if ( mItemList.size() % mnCols )
mnLines++;
else if ( !mnLines )
mnLines = 1;
@@ -494,8 +489,7 @@ void ValueSet::Format()
for ( size_t i = 0; i < nItemCount; i++ )
{
- ValueSetItem* pItem = mpImpl->mItemList[ i ];
- pItem->maRect.SetEmpty();
+ mItemList[i]->maRect.SetEmpty();
}
if ( mpScrBar )
@@ -582,7 +576,7 @@ void ValueSet::Format()
}
for ( size_t i = 0; i < nItemCount; i++ )
{
- ValueSetItem* pItem = mpImpl->mItemList[ i ];
+ ValueSetItem *const pItem = mItemList[i];
if ( (i >= nFirstItem) && (i < nLastItem) )
{
@@ -597,7 +591,7 @@ void ValueSet::Format()
{
::com::sun::star::uno::Any aOldAny, aNewAny;
- aNewAny <<= pItem->GetAccessible( mpImpl->mbIsTransientChildrenDisabled );
+ aNewAny <<= pItem->GetAccessible( mbIsTransientChildrenDisabled );
ImplFireAccessibleEvent( ::com::sun::star::accessibility::AccessibleEventId::CHILD, aOldAny, aNewAny );
}
@@ -617,7 +611,7 @@ void ValueSet::Format()
{
::com::sun::star::uno::Any aOldAny, aNewAny;
- aOldAny <<= pItem->GetAccessible( mpImpl->mbIsTransientChildrenDisabled );
+ aOldAny <<= pItem->GetAccessible( mbIsTransientChildrenDisabled );
ImplFireAccessibleEvent( ::com::sun::star::accessibility::AccessibleEventId::CHILD, aOldAny, aNewAny );
}
@@ -714,7 +708,7 @@ void ValueSet::ImplDrawSelect()
ValueSetItem* pItem;
if ( nItemId )
- pItem = mpImpl->mItemList[ GetItemPos( nItemId ) ];
+ pItem = mItemList[ GetItemPos( nItemId ) ];
else
{
if ( mpNoneItem )
@@ -879,7 +873,7 @@ void ValueSet::ImplHideSelect( sal_uInt16 nItemId )
sal_uInt16 nItemPos = GetItemPos( nItemId );
if ( nItemPos != sal::static_int_cast<sal_uInt16>(LIST_ENTRY_NOTFOUND) )
- aRect = mpImpl->mItemList[ nItemPos ]->maRect;
+ aRect = mItemList[nItemPos]->maRect;
else
{
if ( mpNoneItem )
@@ -990,7 +984,7 @@ bool ValueSet::ImplScroll( const Point& rPos )
long nScrollOffset;
sal_uInt16 nOldLine = mnFirstLine;
- const Rectangle& rTopRect = mpImpl->mItemList[ mnFirstLine * mnCols ]->maRect;
+ const Rectangle& rTopRect = mItemList[ mnFirstLine*mnCols ]->maRect;
if ( rTopRect.GetHeight() <= 16 )
nScrollOffset = VALUESET_SCROLL_OFFSET/2;
else
@@ -1004,7 +998,7 @@ bool ValueSet::ImplScroll( const Point& rPos )
if ( (mnFirstLine == nOldLine) &&
(mnFirstLine < (sal_uInt16)(mnLines-mnVisLines)) && (rPos.Y() < aOutSize.Height()) )
{
- long nBottomPos = mpImpl->mItemList[ (mnFirstLine+mnVisLines-1)*mnCols ]->maRect.Bottom();
+ const long nBottomPos = mItemList[ (mnFirstLine+mnVisLines-1)*mnCols ]->maRect.Bottom();
if ( (rPos.Y() >= nBottomPos-nScrollOffset) && (rPos.Y() <= nBottomPos) )
mnFirstLine++;
}
@@ -1034,11 +1028,10 @@ size_t ValueSet::ImplGetItem( const Point& rPos, bool bMove ) const
{
// The point is inside the ValueSet window,
// let's find the containing item.
- const size_t nItemCount = mpImpl->mItemList.size();
+ const size_t nItemCount = mItemList.size();
for ( size_t i = 0; i < nItemCount; ++i )
{
- ValueSetItem *const pItem = mpImpl->mItemList[ i ];
- if ( pItem->maRect.IsInside( rPos ) )
+ if ( mItemList[i]->maRect.IsInside( rPos ) )
{
return i;
}
@@ -1062,14 +1055,14 @@ ValueSetItem* ValueSet::ImplGetItem( size_t nPos )
if ( nPos == VALUESET_ITEM_NONEITEM )
return mpNoneItem;
else
- return ( nPos < mpImpl->mItemList.size() ) ? mpImpl->mItemList[ nPos ] : NULL;
+ return ( nPos < mItemList.size() ) ? mItemList[nPos] : NULL;
}
// -----------------------------------------------------------------------
ValueSetItem* ValueSet::ImplGetFirstItem()
{
- return mpImpl->mItemList.size() ? mpImpl->mItemList[ 0 ] : NULL;
+ return mItemList.size() ? mItemList[0] : NULL;
}
// -----------------------------------------------------------------------
@@ -1078,12 +1071,10 @@ sal_uInt16 ValueSet::ImplGetVisibleItemCount() const
{
sal_uInt16 nRet = 0;
- for( size_t n = 0, nItemCount = mpImpl->mItemList.size(); n < nItemCount; n++ )
+ for( size_t n = 0, nItemCount = mItemList.size(); n < nItemCount; ++n )
{
- ValueSetItem* pItem = mpImpl->mItemList[ n ];
-
- if( !pItem->maRect.IsEmpty() )
- nRet++;
+ if( !mItemList[n]->maRect.IsEmpty() )
+ ++nRet;
}
return nRet;
@@ -1096,9 +1087,9 @@ ValueSetItem* ValueSet::ImplGetVisibleItem( sal_uInt16 nVisiblePos )
ValueSetItem* pRet = NULL;
sal_uInt16 nFoundPos = 0;
- for( sal_Int32 n = 0, nItemCount = mpImpl->mItemList.size(); ( n < nItemCount ) && !pRet; n++ )
+ for( sal_Int32 n = 0, nItemCount = mItemList.size(); ( n < nItemCount ) && !pRet; n++ )
{
- ValueSetItem* pItem = mpImpl->mItemList[ n ];
+ ValueSetItem* pItem = mItemList[n];
if( !pItem->maRect.IsEmpty() && ( nVisiblePos == nFoundPos++ ) )
pRet = pItem;
@@ -1301,7 +1292,7 @@ lcl_gotoLastLine(size_t const nLastPos, size_t const nCols, size_t const nCurPos
void ValueSet::KeyInput( const KeyEvent& rKEvt )
{
- size_t nLastItem = mpImpl->mItemList.size();
+ size_t nLastItem = mItemList.size();
size_t nItemPos = VALUESET_ITEM_NOTFOUND;
size_t nCurPos = VALUESET_ITEM_NONEITEM;
size_t nCalcPos;
@@ -1673,12 +1664,12 @@ void ValueSet::InsertItem( sal_uInt16 nItemId, const Image& rImage, size_t nPos
pItem->mnId = nItemId;
pItem->meType = VALUESETITEM_IMAGE;
pItem->maImage = rImage;
- if ( nPos < mpImpl->mItemList.size() ) {
- ValueItemList::iterator it = mpImpl->mItemList.begin();
+ if ( nPos < mItemList.size() ) {
+ ValueItemList::iterator it = mItemList.begin();
::std::advance( it, nPos );
- mpImpl->mItemList.insert( it, pItem );
+ mItemList.insert( it, pItem );
} else {
- mpImpl->mItemList.push_back( pItem );
+ mItemList.push_back( pItem );
}
mbFormat = true;
@@ -1698,12 +1689,12 @@ void ValueSet::InsertItem( sal_uInt16 nItemId, const Color& rColor, size_t nPos
pItem->mnId = nItemId;
pItem->meType = VALUESETITEM_COLOR;
pItem->maColor = rColor;
- if ( nPos < mpImpl->mItemList.size() ) {
- ValueItemList::iterator it = mpImpl->mItemList.begin();
+ if ( nPos < mItemList.size() ) {
+ ValueItemList::iterator it = mItemList.begin();
::std::advance( it, nPos );
- mpImpl->mItemList.insert( it, pItem );
+ mItemList.insert( it, pItem );
} else {
- mpImpl->mItemList.push_back( pItem );
+ mItemList.push_back( pItem );
}
mbFormat = true;
@@ -1725,12 +1716,12 @@ void ValueSet::InsertItem( sal_uInt16 nItemId, const Image& rImage,
pItem->meType = VALUESETITEM_IMAGE;
pItem->maImage = rImage;
pItem->maText = rText;
- if ( nPos < mpImpl->mItemList.size() ) {
- ValueItemList::iterator it = mpImpl->mItemList.begin();
+ if ( nPos < mItemList.size() ) {
+ ValueItemList::iterator it = mItemList.begin();
::std::advance( it, nPos );
- mpImpl->mItemList.insert( it, pItem );
+ mItemList.insert( it, pItem );
} else {
- mpImpl->mItemList.push_back( pItem );
+ mItemList.push_back( pItem );
}
mbFormat = true;
@@ -1752,12 +1743,12 @@ void ValueSet::InsertItem( sal_uInt16 nItemId, const Color& rColor,
pItem->meType = VALUESETITEM_COLOR;
pItem->maColor = rColor;
pItem->maText = rText;
- if ( nPos < mpImpl->mItemList.size() ) {
- ValueItemList::iterator it = mpImpl->mItemList.begin();
+ if ( nPos < mItemList.size() ) {
+ ValueItemList::iterator it = mItemList.begin();
::std::advance( it, nPos );
- mpImpl->mItemList.insert( it, pItem );
+ mItemList.insert( it, pItem );
} else {
- mpImpl->mItemList.push_back( pItem );
+ mItemList.push_back( pItem );
}
mbFormat = true;
@@ -1776,12 +1767,12 @@ void ValueSet::InsertItem( sal_uInt16 nItemId, size_t nPos )
ValueSetItem* pItem = new ValueSetItem( *this );
pItem->mnId = nItemId;
pItem->meType = VALUESETITEM_USERDRAW;
- if ( nPos < mpImpl->mItemList.size() ) {
- ValueItemList::iterator it = mpImpl->mItemList.begin();
+ if ( nPos < mItemList.size() ) {
+ ValueItemList::iterator it = mItemList.begin();
::std::advance( it, nPos );
- mpImpl->mItemList.insert( it, pItem );
+ mItemList.insert( it, pItem );
} else {
- mpImpl->mItemList.push_back( pItem );
+ mItemList.push_back( pItem );
}
mbFormat = true;
@@ -1798,11 +1789,11 @@ void ValueSet::RemoveItem( sal_uInt16 nItemId )
if ( nPos == VALUESET_ITEM_NOTFOUND )
return;
- if ( nPos < mpImpl->mItemList.size() ) {
- ValueItemList::iterator it = mpImpl->mItemList.begin();
+ if ( nPos < mItemList.size() ) {
+ ValueItemList::iterator it = mItemList.begin();
::std::advance( it, nPos );
delete *it;
- mpImpl->mItemList.erase( it );
+ mItemList.erase( it );
}
// reset variables
@@ -1841,16 +1832,15 @@ void ValueSet::Clear()
size_t ValueSet::GetItemCount() const
{
- return mpImpl->mItemList.size();
+ return mItemList.size();
}
// -----------------------------------------------------------------------
size_t ValueSet::GetItemPos( sal_uInt16 nItemId ) const
{
- for ( size_t i = 0, n = mpImpl->mItemList.size(); i < n; ++i ) {
- ValueSetItem* pItem = mpImpl->mItemList[ i ];
- if ( pItem->mnId == nItemId ) {
+ for ( size_t i = 0, n = mItemList.size(); i < n; ++i ) {
+ if ( mItemList[i]->mnId == nItemId ) {
return i;
}
}
@@ -1861,7 +1851,7 @@ size_t ValueSet::GetItemPos( sal_uInt16 nItemId ) const
sal_uInt16 ValueSet::GetItemId( size_t nPos ) const
{
- return ( nPos < mpImpl->mItemList.size() ) ? mpImpl->mItemList[ nPos ]->mnId : 0 ;
+ return ( nPos < mItemList.size() ) ? mItemList[nPos]->mnId : 0 ;
}
// -----------------------------------------------------------------------
@@ -1882,7 +1872,7 @@ Rectangle ValueSet::GetItemRect( sal_uInt16 nItemId ) const
size_t nPos = GetItemPos( nItemId );
if ( nPos != VALUESET_ITEM_NOTFOUND )
- return mpImpl->mItemList[ nPos ]->maRect;
+ return mItemList[nPos]->maRect;
else
return Rectangle();
}
@@ -2010,12 +2000,12 @@ void ValueSet::SelectItem( sal_uInt16 nItemId )
if( nPos != VALUESET_ITEM_NOTFOUND )
{
ValueItemAcc* pItemAcc = ValueItemAcc::getImplementation(
- mpImpl->mItemList[ nPos ]->GetAccessible( mpImpl->mbIsTransientChildrenDisabled ) );
+ mItemList[nPos]->GetAccessible( mbIsTransientChildrenDisabled ) );
if( pItemAcc )
{
::com::sun::star::uno::Any aOldAny, aNewAny;
- if( !mpImpl->mbIsTransientChildrenDisabled)
+ if( !mbIsTransientChildrenDisabled )
{
aOldAny <<= ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >(
static_cast< ::cppu::OWeakObject* >( pItemAcc ));
@@ -2035,18 +2025,18 @@ void ValueSet::SelectItem( sal_uInt16 nItemId )
ValueSetItem* pItem;
if( nPos != VALUESET_ITEM_NOTFOUND )
- pItem = mpImpl->mItemList[ nPos ];
+ pItem = mItemList[nPos];
else
pItem = mpNoneItem;
ValueItemAcc* pItemAcc = NULL;
if (pItem != NULL)
- pItemAcc = ValueItemAcc::getImplementation(pItem->GetAccessible( mpImpl->mbIsTransientChildrenDisabled ) );
+ pItemAcc = ValueItemAcc::getImplementation( pItem->GetAccessible( mbIsTransientChildrenDisabled ) );
if( pItemAcc )
{
::com::sun::star::uno::Any aOldAny, aNewAny;
- if( !mpImpl->mbIsTransientChildrenDisabled)
+ if( !mbIsTransientChildrenDisabled )
{
aNewAny <<= ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >(
static_cast< ::cppu::OWeakObject* >( pItemAcc ));
@@ -2063,7 +2053,7 @@ void ValueSet::SelectItem( sal_uInt16 nItemId )
::com::sun::star::uno::Any aOldAny, aNewAny;
ImplFireAccessibleEvent( ::com::sun::star::accessibility::AccessibleEventId::SELECTION_CHANGED, aOldAny, aNewAny );
}
- mpImpl->maHighlightHdl.Call(this);
+ maHighlightHdl.Call(this);
}
}
@@ -2088,7 +2078,7 @@ void ValueSet::SetItemImage( sal_uInt16 nItemId, const Image& rImage )
if ( nPos == VALUESET_ITEM_NOTFOUND )
return;
- ValueSetItem* pItem = mpImpl->mItemList[ nPos ];
+ ValueSetItem* pItem = mItemList[nPos];
pItem->meType = VALUESETITEM_IMAGE;
pItem->maImage = rImage;
@@ -2108,7 +2098,7 @@ Image ValueSet::GetItemImage( sal_uInt16 nItemId ) const
size_t nPos = GetItemPos( nItemId );
if ( nPos != VALUESET_ITEM_NOTFOUND )
- return mpImpl->mItemList[ nPos ]->maImage;
+ return mItemList[nPos]->maImage;
else
return Image();
}
@@ -2122,7 +2112,7 @@ void ValueSet::SetItemColor( sal_uInt16 nItemId, const Color& rColor )
if ( nPos == VALUESET_ITEM_NOTFOUND )
return;
- ValueSetItem* pItem = mpImpl->mItemList[ nPos ];
+ ValueSetItem* pItem = mItemList[nPos];
pItem->meType = VALUESETITEM_COLOR;
pItem->maColor = rColor;
@@ -2142,7 +2132,7 @@ Color ValueSet::GetItemColor( sal_uInt16 nItemId ) const
size_t nPos = GetItemPos( nItemId );
if ( nPos != VALUESET_ITEM_NOTFOUND )
- return mpImpl->mItemList[ nPos ]->maColor;
+ return mItemList[nPos]->maColor;
else
return Color();
}
@@ -2156,7 +2146,7 @@ void ValueSet::SetItemData( sal_uInt16 nItemId, void* pData )
if ( nPos == VALUESET_ITEM_NOTFOUND )
return;
- ValueSetItem* pItem = mpImpl->mItemList[ nPos ];
+ ValueSetItem* pItem = mItemList[nPos];
pItem->mpData = pData;
if ( pItem->meType == VALUESETITEM_USERDRAW )
@@ -2178,7 +2168,7 @@ void* ValueSet::GetItemData( sal_uInt16 nItemId ) const
size_t nPos = GetItemPos( nItemId );
if ( nPos != VALUESET_ITEM_NOTFOUND )
- return mpImpl->mItemList[ nPos ]->mpData;
+ return mItemList[nPos]->mpData;
else
return NULL;
}
@@ -2193,7 +2183,7 @@ void ValueSet::SetItemText( sal_uInt16 nItemId, const XubString& rText )
return;
- ValueSetItem* pItem = mpImpl->mItemList[ nPos ];
+ ValueSetItem* pItem = mItemList[nPos];
// Remember old and new name for accessibility event.
::com::sun::star::uno::Any aOldName, aNewName;
@@ -2219,7 +2209,7 @@ void ValueSet::SetItemText( sal_uInt16 nItemId, const XubString& rText )
{
::com::sun::star::uno::Reference<
::com::sun::star::accessibility::XAccessible> xAccessible (
- pItem->GetAccessible( mpImpl->mbIsTransientChildrenDisabled ) );
+ pItem->GetAccessible( mbIsTransientChildrenDisabled ) );
static_cast<ValueItemAcc*>(xAccessible.get())->FireAccessibleEvent (
::com::sun::star::accessibility::AccessibleEventId::NAME_CHANGED,
aOldName, aNewName);
@@ -2233,7 +2223,7 @@ XubString ValueSet::GetItemText( sal_uInt16 nItemId ) const
size_t nPos = GetItemPos( nItemId );
if ( nPos != VALUESET_ITEM_NOTFOUND )
- return mpImpl->mItemList[ nPos ]->maText;
+ return mItemList[nPos]->maText;
else
return XubString();
}
@@ -2352,8 +2342,8 @@ Size ValueSet::CalcWindowSizePixel( const Size& rItemSize, sal_uInt16 nDesireCol
nCalcLines = mnUserVisLines;
else
{
- nCalcLines = mpImpl->mItemList.size() / nCalcCols;
- if ( mpImpl->mItemList.size() % nCalcCols )
+ nCalcLines = mItemList.size() / nCalcCols;
+ if ( mItemList.size() % nCalcCols )
nCalcLines++;
else if ( !nCalcLines )
nCalcLines = 1;
@@ -2453,7 +2443,7 @@ long ValueSet::GetScrollWidth() const
void ValueSet::SetHighlightHdl( const Link& rLink )
{
- mpImpl->maHighlightHdl = rLink;
+ maHighlightHdl = rLink;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit c53c541eda3936e462c75c09f2741a4838981474
Author: Matteo Casalin <matteo.casalin at gmx.com>
Date: Sat Feb 11 19:44:16 2012 +0100
ValueSet: removed unused members
diff --git a/svtools/inc/svtools/valueset.hxx b/svtools/inc/svtools/valueset.hxx
index 913ee3b..0295c6e 100644
--- a/svtools/inc/svtools/valueset.hxx
+++ b/svtools/inc/svtools/valueset.hxx
@@ -222,10 +222,8 @@ private:
long mnLines;
long mnUserItemWidth;
long mnUserItemHeight;
- sal_uInt16 mnOldItemId;
sal_uInt16 mnSelItemId;
sal_uInt16 mnHighItemId;
- size_t mnDropPos;
sal_uInt16 mnCols;
sal_uInt16 mnCurCol;
sal_uInt16 mnUserCols;
@@ -241,7 +239,6 @@ private:
bool mbBlackSel : 1;
bool mbDoubleSel : 1;
bool mbScroll : 1;
- bool mbDropPos : 1;
bool mbFullMode : 1;
Color maColor;
Link maDoubleClickHdl;
diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx
index 15ab159..d2d1b95 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -59,10 +59,8 @@ void ValueSet::ImplInit()
mnUserItemWidth = 0;
mnUserItemHeight = 0;
mnFirstLine = 0;
- mnOldItemId = 0;
mnSelItemId = 0;
mnHighItemId = 0;
- mnDropPos = VALUESET_ITEM_NOTFOUND;
mnCols = 0;
mnCurCol = 0;
mnUserCols = 0;
@@ -77,7 +75,6 @@ void ValueSet::ImplInit()
mbBlackSel = false;
mbDoubleSel = false;
mbScroll = false;
- mbDropPos = false;
mbFullMode = true;
// #106446#, #106601# force mirroring of virtual device
@@ -1225,7 +1222,6 @@ void ValueSet::MouseButtonDown( const MouseEvent& rMEvt )
mbHighlight = true;
if ( pItem )
{
- mnOldItemId = mnSelItemId;
mnHighItemId = mnSelItemId;
ImplHighlightItem( pItem->mnId );
}
@@ -1238,7 +1234,6 @@ void ValueSet::MouseButtonDown( const MouseEvent& rMEvt )
{
if ( rMEvt.GetClicks() == 1 )
{
- mnOldItemId = mnSelItemId;
mbHighlight = true;
mnHighItemId = mnSelItemId;
ImplHighlightItem( pItem->mnId );
@@ -1814,7 +1809,6 @@ void ValueSet::RemoveItem( sal_uInt16 nItemId )
if ( (mnHighItemId == nItemId) || (mnSelItemId == nItemId) )
{
mnCurCol = 0;
- mnOldItemId = 0;
mnHighItemId = 0;
mnSelItemId = 0;
mbNoSelection = true;
@@ -1834,7 +1828,6 @@ void ValueSet::Clear()
// reset variables
mnFirstLine = 0;
mnCurCol = 0;
- mnOldItemId = 0;
mnHighItemId = 0;
mnSelItemId = 0;
mbNoSelection = true;
@@ -2273,7 +2266,6 @@ void ValueSet::SetExtraSpacing( sal_uInt16 nNewSpacing )
void ValueSet::StartSelection()
{
- mnOldItemId = mnSelItemId;
mbHighlight = true;
mbSelection = true;
mnHighItemId = mnSelItemId;
commit bbdbab7f249683995994e65c0a0e290bd156eca7
Author: Matteo Casalin <matteo.casalin at gmx.com>
Date: Sat Feb 11 18:17:26 2012 +0100
ValueSet: sal_Bool to bool
diff --git a/svtools/inc/svtools/valueset.hxx b/svtools/inc/svtools/valueset.hxx
index 54e8319..913ee3b 100644
--- a/svtools/inc/svtools/valueset.hxx
+++ b/svtools/inc/svtools/valueset.hxx
@@ -233,16 +233,16 @@ private:
sal_uInt16 mnFirstLine;
sal_uInt16 mnSpacing;
sal_uInt16 mnFrameStyle;
- sal_Bool mbFormat;
- sal_Bool mbHighlight;
- sal_Bool mbSelection;
- sal_Bool mbNoSelection;
- sal_Bool mbDrawSelection;
- sal_Bool mbBlackSel;
- sal_Bool mbDoubleSel;
- sal_Bool mbScroll;
- sal_Bool mbDropPos;
- sal_Bool mbFullMode;
+ bool mbFormat : 1;
+ bool mbHighlight : 1;
+ bool mbSelection : 1;
+ bool mbNoSelection : 1;
+ bool mbDrawSelection : 1;
+ bool mbBlackSel : 1;
+ bool mbDoubleSel : 1;
+ bool mbScroll : 1;
+ bool mbDropPos : 1;
+ bool mbFullMode : 1;
Color maColor;
Link maDoubleClickHdl;
Link maSelectHdl;
@@ -253,26 +253,26 @@ private:
using Control::ImplInitSettings;
using Window::ImplInit;
SVT_DLLPRIVATE void ImplInit();
- SVT_DLLPRIVATE void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
+ SVT_DLLPRIVATE void ImplInitSettings( bool bFont, bool bForeground, bool bBackground );
SVT_DLLPRIVATE void ImplInitScrollBar();
SVT_DLLPRIVATE void ImplDeleteItems();
SVT_DLLPRIVATE void ImplFormatItem( ValueSetItem* pItem );
SVT_DLLPRIVATE void ImplDrawItemText( const XubString& rStr );
SVT_DLLPRIVATE void ImplDrawSelect();
SVT_DLLPRIVATE void ImplHideSelect( sal_uInt16 nItemId );
- SVT_DLLPRIVATE void ImplHighlightItem( sal_uInt16 nItemId, sal_Bool bIsSelection = sal_True );
+ SVT_DLLPRIVATE void ImplHighlightItem( sal_uInt16 nItemId, bool bIsSelection = true );
SVT_DLLPRIVATE void ImplDraw();
using Window::ImplScroll;
- SVT_DLLPRIVATE sal_Bool ImplScroll( const Point& rPos );
- SVT_DLLPRIVATE size_t ImplGetItem( const Point& rPoint, sal_Bool bMove = sal_False ) const;
+ SVT_DLLPRIVATE bool ImplScroll( const Point& rPos );
+ SVT_DLLPRIVATE size_t ImplGetItem( const Point& rPoint, bool bMove = false ) const;
SVT_DLLPRIVATE ValueSetItem* ImplGetItem( size_t nPos );
SVT_DLLPRIVATE ValueSetItem* ImplGetFirstItem();
SVT_DLLPRIVATE sal_uInt16 ImplGetVisibleItemCount() const;
SVT_DLLPRIVATE ValueSetItem* ImplGetVisibleItem( sal_uInt16 nVisiblePos );
SVT_DLLPRIVATE void ImplFireAccessibleEvent( short nEventId, const ::com::sun::star::uno::Any& rOldValue, const ::com::sun::star::uno::Any& rNewValue );
- SVT_DLLPRIVATE sal_Bool ImplHasAccessibleListeners();
- SVT_DLLPRIVATE void ImplTracking( const Point& rPos, sal_Bool bRepeat );
- SVT_DLLPRIVATE void ImplEndTracking( const Point& rPos, sal_Bool bCancel );
+ SVT_DLLPRIVATE bool ImplHasAccessibleListeners();
+ SVT_DLLPRIVATE void ImplTracking( const Point& rPos, bool bRepeat );
+ SVT_DLLPRIVATE void ImplEndTracking( const Point& rPos, bool bCancel );
DECL_DLLPRIVATE_LINK( ImplScrollHdl, ScrollBar* );
DECL_DLLPRIVATE_LINK( ImplTimerHdl, Timer* );
#endif
@@ -283,7 +283,7 @@ private:
protected:
- sal_Bool StartDrag( const CommandEvent& rCEvt, Region& rRegion );
+ bool StartDrag( const CommandEvent& rCEvt, Region& rRegion );
protected:
@@ -334,8 +334,8 @@ public:
sal_uInt16 GetItemId( const Point& rPos ) const;
Rectangle GetItemRect( sal_uInt16 nItemId ) const;
- void EnableFullItemMode( sal_Bool bFullMode = sal_True );
- sal_Bool IsFullItemModeEnabled() const { return mbFullMode; }
+ void EnableFullItemMode( bool bFullMode = true );
+ bool IsFullItemModeEnabled() const { return mbFullMode; }
void SetColCount( sal_uInt16 nNewCols = 1 );
sal_uInt16 GetColCount() const { return mnUserCols; }
void SetLineCount( sal_uInt16 nNewLines = 0 );
@@ -348,10 +348,10 @@ public:
void SelectItem( sal_uInt16 nItemId );
sal_uInt16 GetSelectItemId() const { return mnSelItemId; }
- sal_Bool IsItemSelected( sal_uInt16 nItemId ) const
- { return ((!mbNoSelection && (nItemId == mnSelItemId)) ? sal_True : sal_False); }
+ bool IsItemSelected( sal_uInt16 nItemId ) const
+ { return !mbNoSelection && (nItemId == mnSelItemId); }
void SetNoSelection();
- sal_Bool IsNoSelection() const { return mbNoSelection; }
+ bool IsNoSelection() const { return mbNoSelection; }
void SetItemImage( sal_uInt16 nItemId, const Image& rImage );
Image GetItemImage( sal_uInt16 nItemId ) const;
@@ -364,7 +364,7 @@ public:
void SetColor( const Color& rColor );
void SetColor() { SetColor( Color( COL_TRANSPARENT ) ); }
Color GetColor() const { return maColor; }
- sal_Bool IsColor() const { return maColor.GetTransparency() == 0; }
+ bool IsColor() const { return maColor.GetTransparency() == 0; }
void SetExtraSpacing( sal_uInt16 nNewSpacing );
sal_uInt16 GetExtraSpacing() { return mnSpacing; }
@@ -377,7 +377,7 @@ public:
Size CalcWindowSizePixel( const Size& rItemSize,
sal_uInt16 nCalcCols = 0,
sal_uInt16 nCalcLines = 0 );
- Size CalcItemSizePixel( const Size& rSize, sal_Bool bOut = sal_True ) const;
+ Size CalcItemSizePixel( const Size& rSize, bool bOut = true ) const;
long GetScrollWidth() const;
void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; }
diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx
index 384287d..15ab159 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -69,21 +69,21 @@ void ValueSet::ImplInit()
mnUserVisLines = 0;
mnSpacing = 0;
mnFrameStyle = 0;
- mbFormat = sal_True;
- mbHighlight = sal_False ;
- mbSelection = sal_False;
- mbNoSelection = sal_True;
- mbDrawSelection = sal_True;
- mbBlackSel = sal_False;
- mbDoubleSel = sal_False;
- mbScroll = sal_False;
- mbDropPos = sal_False;
- mbFullMode = sal_True;
+ mbFormat = true;
+ mbHighlight = false;
+ mbSelection = false;
+ mbNoSelection = true;
+ mbDrawSelection = true;
+ mbBlackSel = false;
+ mbDoubleSel = false;
+ mbScroll = false;
+ mbDropPos = false;
+ mbFullMode = true;
// #106446#, #106601# force mirroring of virtual device
maVirDev.EnableRTL( GetParent()->IsRTLEnabled() );
- ImplInitSettings( sal_True, sal_True, sal_True );
+ ImplInitSettings( true, true, true );
}
// -----------------------------------------------------------------------
@@ -149,8 +149,7 @@ void ValueSet::ImplDeleteItems()
// -----------------------------------------------------------------------
-void ValueSet::ImplInitSettings( sal_Bool bFont,
- sal_Bool bForeground, sal_Bool bBackground )
+void ValueSet::ImplInitSettings( bool bFont, bool bForeground, bool bBackground )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
@@ -423,7 +422,7 @@ void ValueSet::Format()
mnCols = mnUserCols;
// calculate number of rows
- mbScroll = sal_False;
+ mbScroll = false;
mnLines = (long)mpImpl->mItemList.size() / mnCols;
if ( mpImpl->mItemList.size() % mnCols )
mnLines++;
@@ -442,7 +441,7 @@ void ValueSet::Format()
else
mnVisLines = mnLines;
if ( mnLines > mnVisLines )
- mbScroll = sal_True;
+ mbScroll = true;
if ( mnLines <= mnVisLines )
mnFirstLine = 0;
else
@@ -522,16 +521,16 @@ void ValueSet::Format()
(aHighColor.GetBlue() > 0x80)) ||
((aHighColor.GetRed() == 0x80) && (aHighColor.GetGreen() == 0x80) &&
(aHighColor.GetBlue() == 0x80)) )
- mbBlackSel = sal_True;
+ mbBlackSel = true;
else
- mbBlackSel = sal_False;
+ mbBlackSel = false;
// draw the selection with double width if the items are bigger
if ( (nStyle & WB_DOUBLEBORDER) &&
((nItemWidth >= 25) && (nItemHeight >= 20)) )
- mbDoubleSel = sal_True;
+ mbDoubleSel = true;
else
- mbDoubleSel = sal_False;
+ mbDoubleSel = false;
// calculate offsets
long nStartX;
@@ -590,7 +589,7 @@ void ValueSet::Format()
if ( (i >= nFirstItem) && (i < nLastItem) )
{
- const sal_Bool bWasEmpty = pItem->maRect.IsEmpty();
+ const bool bWasEmpty = pItem->maRect.IsEmpty();
pItem->maRect.Left() = x;
pItem->maRect.Top() = y;
@@ -653,7 +652,7 @@ void ValueSet::Format()
}
// waiting for the next since the formatting is finished
- mbFormat = sal_False;
+ mbFormat = false;
// delete ScrollBar
delete pDelScrBar;
@@ -901,7 +900,7 @@ void ValueSet::ImplHideSelect( sal_uInt16 nItemId )
// -----------------------------------------------------------------------
-void ValueSet::ImplHighlightItem( sal_uInt16 nItemId, sal_Bool bIsSelection )
+void ValueSet::ImplHighlightItem( sal_uInt16 nItemId, bool bIsSelection )
{
if ( mnHighItemId != nItemId )
{
@@ -911,12 +910,12 @@ void ValueSet::ImplHighlightItem( sal_uInt16 nItemId, sal_Bool bIsSelection )
// don't draw the selection if nothing is selected
if ( !bIsSelection && mbNoSelection )
- mbDrawSelection = sal_False;
+ mbDrawSelection = false;
// remove the old selection and draw the new one
ImplHideSelect( nOldItem );
ImplDrawSelect();
- mbDrawSelection = sal_True;
+ mbDrawSelection = true;
}
}
@@ -979,7 +978,7 @@ void ValueSet::ImplDraw()
// -----------------------------------------------------------------------
-sal_Bool ValueSet::ImplScroll( const Point& rPos )
+bool ValueSet::ImplScroll( const Point& rPos )
{
Size aOutSize = GetOutputSizePixel();
long nScrBarWidth;
@@ -990,7 +989,7 @@ sal_Bool ValueSet::ImplScroll( const Point& rPos )
nScrBarWidth = 0;
if ( !mbScroll || (rPos.X() < 0) || (rPos.X() > aOutSize.Width()-nScrBarWidth) )
- return sal_False;
+ return false;
long nScrollOffset;
sal_uInt16 nOldLine = mnFirstLine;
@@ -1015,17 +1014,17 @@ sal_Bool ValueSet::ImplScroll( const Point& rPos )
if ( mnFirstLine != nOldLine )
{
- mbFormat = sal_True;
+ mbFormat = true;
ImplDraw();
- return sal_True;
+ return true;
}
else
- return sal_False;
+ return false;
}
// -----------------------------------------------------------------------
-size_t ValueSet::ImplGetItem( const Point& rPos, sal_Bool bMove ) const
+size_t ValueSet::ImplGetItem( const Point& rPos, bool bMove ) const
{
if ( mpNoneItem && mpNoneItem->maRect.IsInside( rPos ) )
{
@@ -1123,7 +1122,7 @@ void ValueSet::ImplFireAccessibleEvent( short nEventId, const ::com::sun::star::
// -----------------------------------------------------------------------
-sal_Bool ValueSet::ImplHasAccessibleListeners()
+bool ValueSet::ImplHasAccessibleListeners()
{
ValueSetAcc* pAcc = ValueSetAcc::getImplementation( GetAccessible( sal_False ) );
return( pAcc && pAcc->HasAccessibleListeners() );
@@ -1137,7 +1136,7 @@ IMPL_LINK( ValueSet,ImplScrollHdl, ScrollBar*, pScrollBar )
if ( nNewFirstLine != mnFirstLine )
{
mnFirstLine = nNewFirstLine;
- mbFormat = sal_True;
+ mbFormat = true;
ImplDraw();
}
return 0;
@@ -1147,13 +1146,13 @@ IMPL_LINK( ValueSet,ImplScrollHdl, ScrollBar*, pScrollBar )
IMPL_LINK( ValueSet,ImplTimerHdl, Timer*, EMPTYARG )
{
- ImplTracking( GetPointerPosPixel(), sal_True );
+ ImplTracking( GetPointerPosPixel(), true );
return 0;
}
// -----------------------------------------------------------------------
-void ValueSet::ImplTracking( const Point& rPos, sal_Bool bRepeat )
+void ValueSet::ImplTracking( const Point& rPos, bool bRepeat )
{
if ( bRepeat || mbSelection )
{
@@ -1172,22 +1171,22 @@ void ValueSet::ImplTracking( const Point& rPos, sal_Bool bRepeat )
if ( pItem )
{
if( GetStyle() & WB_MENUSTYLEVALUESET )
- mbHighlight = sal_True;
+ mbHighlight = true;
ImplHighlightItem( pItem->mnId );
}
else
{
if( GetStyle() & WB_MENUSTYLEVALUESET )
- mbHighlight = sal_True;
+ mbHighlight = true;
- ImplHighlightItem( mnSelItemId, sal_False );
+ ImplHighlightItem( mnSelItemId, false );
}
}
// -----------------------------------------------------------------------
-void ValueSet::ImplEndTracking( const Point& rPos, sal_Bool bCancel )
+void ValueSet::ImplEndTracking( const Point& rPos, bool bCancel )
{
ValueSetItem* pItem;
@@ -1202,15 +1201,15 @@ void ValueSet::ImplEndTracking( const Point& rPos, sal_Bool bCancel )
SelectItem( pItem->mnId );
if ( !mbSelection && !(GetStyle() & WB_NOPOINTERFOCUS) )
GrabFocus();
- mbHighlight = sal_False;
- mbSelection = sal_False;
+ mbHighlight = false;
+ mbSelection = false;
Select();
}
else
{
- ImplHighlightItem( mnSelItemId, sal_False );
- mbHighlight = sal_False;
- mbSelection = sal_False;
+ ImplHighlightItem( mnSelItemId, false );
+ mbHighlight = false;
+ mbSelection = false;
}
}
@@ -1223,7 +1222,7 @@ void ValueSet::MouseButtonDown( const MouseEvent& rMEvt )
ValueSetItem* pItem = ImplGetItem( ImplGetItem( rMEvt.GetPosPixel() ) );
if ( mbSelection )
{
- mbHighlight = sal_True;
+ mbHighlight = true;
if ( pItem )
{
mnOldItemId = mnSelItemId;
@@ -1240,7 +1239,7 @@ void ValueSet::MouseButtonDown( const MouseEvent& rMEvt )
if ( rMEvt.GetClicks() == 1 )
{
mnOldItemId = mnSelItemId;
- mbHighlight = sal_True;
+ mbHighlight = true;
mnHighItemId = mnSelItemId;
ImplHighlightItem( pItem->mnId );
StartTracking( STARTTRACK_SCROLLREPEAT );
@@ -1262,7 +1261,7 @@ void ValueSet::MouseButtonUp( const MouseEvent& rMEvt )
{
// because of SelectionMode
if ( rMEvt.IsLeft() && mbSelection )
- ImplEndTracking( rMEvt.GetPosPixel(), sal_False );
+ ImplEndTracking( rMEvt.GetPosPixel(), false );
else
Control::MouseButtonUp( rMEvt );
}
@@ -1273,7 +1272,7 @@ void ValueSet::MouseMove( const MouseEvent& rMEvt )
{
// because of SelectionMode
if ( mbSelection || (GetStyle() & WB_MENUSTYLEVALUESET) )
- ImplTracking( rMEvt.GetPosPixel(), sal_False );
+ ImplTracking( rMEvt.GetPosPixel(), false );
Control::MouseMove( rMEvt );
}
@@ -1325,7 +1324,7 @@ void ValueSet::KeyInput( const KeyEvent& rKEvt )
nCalcPos = nCurPos;
//switch off selection mode if key travelling is used
- sal_Bool bDefault = sal_False;
+ bool bDefault = false;
switch ( rKEvt.GetKeyCode().GetCode() )
{
case KEY_HOME:
@@ -1459,7 +1458,7 @@ void ValueSet::KeyInput( const KeyEvent& rKEvt )
//no break;
default:
Control::KeyInput( rKEvt );
- bDefault = sal_True;
+ bDefault = true;
break;
}
if(!bDefault)
@@ -1549,7 +1548,7 @@ void ValueSet::LoseFocus()
void ValueSet::Resize()
{
- mbFormat = sal_True;
+ mbFormat = true;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
Control::Resize();
@@ -1608,23 +1607,23 @@ void ValueSet::StateChanged( StateChangedType nType )
else if ( (nType == STATE_CHANGE_ZOOM) ||
(nType == STATE_CHANGE_CONTROLFONT) )
{
- ImplInitSettings( sal_True, sal_False, sal_False );
+ ImplInitSettings( true, false, false );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
{
- ImplInitSettings( sal_False, sal_True, sal_False );
+ ImplInitSettings( false, true, false );
Invalidate();
}
else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
{
- ImplInitSettings( sal_False, sal_False, sal_True );
+ ImplInitSettings( false, false, true );
Invalidate();
}
else if ( (nType == STATE_CHANGE_STYLE) || (nType == STATE_CHANGE_ENABLE) )
{
- mbFormat = sal_True;
- ImplInitSettings( sal_False, sal_False, sal_True );
+ mbFormat = true;
+ ImplInitSettings( false, false, true );
Invalidate();
}
}
@@ -1641,8 +1640,8 @@ void ValueSet::DataChanged( const DataChangedEvent& rDCEvt )
((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
(rDCEvt.GetFlags() & SETTINGS_STYLE)) )
{
- mbFormat = sal_True;
- ImplInitSettings( sal_True, sal_True, sal_True );
+ mbFormat = true;
+ ImplInitSettings( true, true, true );
Invalidate();
}
}
@@ -1687,7 +1686,7 @@ void ValueSet::InsertItem( sal_uInt16 nItemId, const Image& rImage, size_t nPos
mpImpl->mItemList.push_back( pItem );
}
- mbFormat = sal_True;
+ mbFormat = true;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
@@ -1712,7 +1711,7 @@ void ValueSet::InsertItem( sal_uInt16 nItemId, const Color& rColor, size_t nPos
mpImpl->mItemList.push_back( pItem );
}
- mbFormat = sal_True;
+ mbFormat = true;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
@@ -1739,7 +1738,7 @@ void ValueSet::InsertItem( sal_uInt16 nItemId, const Image& rImage,
mpImpl->mItemList.push_back( pItem );
}
- mbFormat = sal_True;
+ mbFormat = true;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
@@ -1766,7 +1765,7 @@ void ValueSet::InsertItem( sal_uInt16 nItemId, const Color& rColor,
mpImpl->mItemList.push_back( pItem );
}
- mbFormat = sal_True;
+ mbFormat = true;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
@@ -1790,7 +1789,7 @@ void ValueSet::InsertItem( sal_uInt16 nItemId, size_t nPos )
mpImpl->mItemList.push_back( pItem );
}
- mbFormat = sal_True;
+ mbFormat = true;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
@@ -1818,10 +1817,10 @@ void ValueSet::RemoveItem( sal_uInt16 nItemId )
mnOldItemId = 0;
mnHighItemId = 0;
mnSelItemId = 0;
- mbNoSelection = sal_True;
+ mbNoSelection = true;
}
- mbFormat = sal_True;
+ mbFormat = true;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
@@ -1838,9 +1837,9 @@ void ValueSet::Clear()
mnOldItemId = 0;
mnHighItemId = 0;
mnSelItemId = 0;
- mbNoSelection = sal_True;
+ mbNoSelection = true;
- mbFormat = sal_True;
+ mbFormat = true;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
@@ -1897,7 +1896,7 @@ Rectangle ValueSet::GetItemRect( sal_uInt16 nItemId ) const
// -----------------------------------------------------------------------
-void ValueSet::EnableFullItemMode( sal_Bool bFullMode )
+void ValueSet::EnableFullItemMode( bool bFullMode )
{
mbFullMode = bFullMode;
}
@@ -1909,7 +1908,7 @@ void ValueSet::SetColCount( sal_uInt16 nNewCols )
if ( mnUserCols != nNewCols )
{
mnUserCols = nNewCols;
- mbFormat = sal_True;
+ mbFormat = true;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
@@ -1922,7 +1921,7 @@ void ValueSet::SetLineCount( sal_uInt16 nNewLines )
if ( mnUserVisLines != nNewLines )
{
mnUserVisLines = nNewLines;
- mbFormat = sal_True;
+ mbFormat = true;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
@@ -1935,7 +1934,7 @@ void ValueSet::SetItemWidth( long nNewItemWidth )
if ( mnUserItemWidth != nNewItemWidth )
{
mnUserItemWidth = nNewItemWidth;
- mbFormat = sal_True;
+ mbFormat = true;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
@@ -1948,7 +1947,7 @@ void ValueSet::SetItemHeight( long nNewItemHeight )
if ( mnUserItemHeight != nNewItemHeight )
{
mnUserItemHeight = nNewItemHeight;
- mbFormat = sal_True;
+ mbFormat = true;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
@@ -1971,15 +1970,10 @@ void ValueSet::SelectItem( sal_uInt16 nItemId )
{
sal_uInt16 nOldItem = mnSelItemId ? mnSelItemId : 1;
mnSelItemId = nItemId;
- mbNoSelection = sal_False;
+ mbNoSelection = false;
- sal_Bool bNewOut;
- sal_Bool bNewLine;
- if ( !mbFormat && IsReallyVisible() && IsUpdateMode() )
- bNewOut = sal_True;
- else
- bNewOut = sal_False;
- bNewLine = sal_False;
+ bool bNewOut = !mbFormat && IsReallyVisible() && IsUpdateMode();
+ bool bNewLine = false;
// if necessary scroll to the visible area
if ( mbScroll && nItemId )
@@ -1988,12 +1982,12 @@ void ValueSet::SelectItem( sal_uInt16 nItemId )
if ( nNewLine < mnFirstLine )
{
mnFirstLine = nNewLine;
- bNewLine = sal_True;
+ bNewLine = true;
}
else if ( nNewLine > (sal_uInt16)(mnFirstLine+mnVisLines-1) )
{
mnFirstLine = (sal_uInt16)(nNewLine-mnVisLines+1);
- bNewLine = sal_True;
+ bNewLine = true;
}
}
@@ -2002,7 +1996,7 @@ void ValueSet::SelectItem( sal_uInt16 nItemId )
if ( bNewLine )
{
// redraw everything if the visible area has changed
- mbFormat = sal_True;
+ mbFormat = true;
ImplDraw();
}
else
@@ -2084,9 +2078,9 @@ void ValueSet::SelectItem( sal_uInt16 nItemId )
void ValueSet::SetNoSelection()
{
- mbNoSelection = sal_True;
- mbHighlight = sal_False;
- mbSelection = sal_False;
+ mbNoSelection = true;
+ mbHighlight = false;
+ mbSelection = false;
if ( IsReallyVisible() && IsUpdateMode() )
ImplDraw();
@@ -2111,7 +2105,7 @@ void ValueSet::SetItemImage( sal_uInt16 nItemId, const Image& rImage )
Invalidate( pItem->maRect );
}
else
- mbFormat = sal_True;
+ mbFormat = true;
}
// -----------------------------------------------------------------------
@@ -2145,7 +2139,7 @@ void ValueSet::SetItemColor( sal_uInt16 nItemId, const Color& rColor )
Invalidate( pItem->maRect );
}
else
- mbFormat = sal_True;
+ mbFormat = true;
}
// -----------------------------------------------------------------------
@@ -2180,7 +2174,7 @@ void ValueSet::SetItemData( sal_uInt16 nItemId, void* pData )
Invalidate( pItem->maRect );
}
else
- mbFormat = sal_True;
+ mbFormat = true;
}
}
@@ -2256,7 +2250,7 @@ XubString ValueSet::GetItemText( sal_uInt16 nItemId ) const
void ValueSet::SetColor( const Color& rColor )
{
maColor = rColor;
- mbFormat = sal_True;
+ mbFormat = true;
if ( IsReallyVisible() && IsUpdateMode() )
ImplDraw();
}
@@ -2269,7 +2263,7 @@ void ValueSet::SetExtraSpacing( sal_uInt16 nNewSpacing )
{
mnSpacing = nNewSpacing;
- mbFormat = sal_True;
+ mbFormat = true;
if ( IsReallyVisible() && IsUpdateMode() )
Invalidate();
}
@@ -2280,8 +2274,8 @@ void ValueSet::SetExtraSpacing( sal_uInt16 nNewSpacing )
void ValueSet::StartSelection()
{
mnOldItemId = mnSelItemId;
- mbHighlight = sal_True;
- mbSelection = sal_True;
+ mbHighlight = true;
+ mbSelection = true;
mnHighItemId = mnSelItemId;
}
@@ -2295,17 +2289,17 @@ void ValueSet::EndSelection()
EndTracking( ENDTRACK_CANCEL );
ImplHighlightItem( mnSelItemId );
- mbHighlight = sal_False;
+ mbHighlight = false;
}
- mbSelection = sal_False;
+ mbSelection = false;
}
// -----------------------------------------------------------------------
-sal_Bool ValueSet::StartDrag( const CommandEvent& rCEvt, Region& rRegion )
+bool ValueSet::StartDrag( const CommandEvent& rCEvt, Region& rRegion )
{
if ( rCEvt.GetCommand() != COMMAND_STARTDRAG )
- return sal_False;
+ return false;
// if necessary abort an existing action
EndSelection();
@@ -2321,7 +2315,7 @@ sal_Bool ValueSet::StartDrag( const CommandEvent& rCEvt, Region& rRegion )
// don't activate dragging if no item was clicked on
if ( !nSelId )
- return sal_False;
+ return false;
// Check out if the page was selected. If not set as current page and
// call select.
@@ -2337,7 +2331,7 @@ sal_Bool ValueSet::StartDrag( const CommandEvent& rCEvt, Region& rRegion )
// assign region
rRegion = aRegion;
- return sal_True;
+ return true;
}
// -----------------------------------------------------------------------
@@ -2421,7 +2415,7 @@ Size ValueSet::CalcWindowSizePixel( const Size& rItemSize, sal_uInt16 nDesireCol
// -----------------------------------------------------------------------
-Size ValueSet::CalcItemSizePixel( const Size& rItemSize, sal_Bool bOut ) const
+Size ValueSet::CalcItemSizePixel( const Size& rItemSize, bool bOut ) const
{
Size aSize = rItemSize;
commit 22cc5670bb9dd0889079c4e5e1b45669e1ca050f
Author: Matteo Casalin <matteo.casalin at gmx.com>
Date: Sun Feb 5 23:41:17 2012 +0100
Avoid unnecessary auto_ptr
diff --git a/svtools/source/control/valueacc.cxx b/svtools/source/control/valueacc.cxx
index 73e2dea..53bc2db 100644
--- a/svtools/source/control/valueacc.cxx
+++ b/svtools/source/control/valueacc.cxx
@@ -442,7 +442,7 @@ uno::Reference< accessibility::XAccessible > SAL_CALL ValueSetAcc::getAccessible
if( VALUESET_ITEM_NONEITEM != nItemPos )
{
- ValueSetItem* pItem = (*mpParent->mpImpl->mpItemList)[ nItemPos ];
+ ValueSetItem* pItem = mpParent->mpImpl->mItemList[ nItemPos ];
if( !pItem->maRect.IsEmpty() )
xRet = pItem->GetAccessible( mbIsTransientChildrenDisabled );
diff --git a/svtools/source/control/valueimp.hxx b/svtools/source/control/valueimp.hxx
index e393208..d4523ff 100644
--- a/svtools/source/control/valueimp.hxx
+++ b/svtools/source/control/valueimp.hxx
@@ -41,7 +41,6 @@
#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
-#include <memory>
#include <vector>
// -----------
@@ -101,12 +100,11 @@ typedef ::std::vector< ValueSetItem* > ValueItemList;
struct ValueSet_Impl
{
- ::std::auto_ptr< ValueItemList > mpItemList;
- bool mbIsTransientChildrenDisabled;
- Link maHighlightHdl;
+ ValueItemList mItemList;
+ bool mbIsTransientChildrenDisabled;
+ Link maHighlightHdl;
- ValueSet_Impl() : mpItemList( ::std::auto_ptr< ValueItemList >( new ValueItemList() ) ),
- mbIsTransientChildrenDisabled( false )
+ ValueSet_Impl() : mbIsTransientChildrenDisabled( false )
{
}
};
diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx
index 0c58242..384287d 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -130,9 +130,9 @@ ValueSet::~ValueSet()
void ValueSet::ImplDeleteItems()
{
- for ( size_t i = 0, n = mpImpl->mpItemList->size(); i < n; ++i )
+ for ( size_t i = 0, n = mpImpl->mItemList.size(); i < n; ++i )
{
- ValueSetItem* pItem = (*mpImpl->mpItemList)[ i ];
+ ValueSetItem* pItem = mpImpl->mItemList[ i ];
if( !pItem->maRect.IsEmpty() && ImplHasAccessibleListeners() )
{
::com::sun::star::uno::Any aOldAny, aNewAny;
@@ -144,7 +144,7 @@ void ValueSet::ImplDeleteItems()
delete pItem;
}
- mpImpl->mpItemList->clear();
+ mpImpl->mItemList.clear();
}
// -----------------------------------------------------------------------
@@ -335,7 +335,7 @@ void ValueSet::ImplFormatItem( ValueSetItem* pItem )
void ValueSet::Format()
{
Size aWinSize = GetOutputSizePixel();
- size_t nItemCount = mpImpl->mpItemList->size();
+ size_t nItemCount = mpImpl->mItemList.size();
WinBits nStyle = GetStyle();
long nTxtHeight = GetTextHeight();
long nOff;
@@ -424,8 +424,8 @@ void ValueSet::Format()
// calculate number of rows
mbScroll = sal_False;
- mnLines = (long)mpImpl->mpItemList->size() / mnCols;
- if ( mpImpl->mpItemList->size() % mnCols )
+ mnLines = (long)mpImpl->mItemList.size() / mnCols;
+ if ( mpImpl->mItemList.size() % mnCols )
mnLines++;
else if ( !mnLines )
mnLines = 1;
@@ -498,7 +498,7 @@ void ValueSet::Format()
for ( size_t i = 0; i < nItemCount; i++ )
{
- ValueSetItem* pItem = (*mpImpl->mpItemList)[ i ];
+ ValueSetItem* pItem = mpImpl->mItemList[ i ];
pItem->maRect.SetEmpty();
}
@@ -586,7 +586,7 @@ void ValueSet::Format()
}
for ( size_t i = 0; i < nItemCount; i++ )
{
- ValueSetItem* pItem = (*mpImpl->mpItemList)[ i ];
+ ValueSetItem* pItem = mpImpl->mItemList[ i ];
if ( (i >= nFirstItem) && (i < nLastItem) )
{
@@ -718,7 +718,7 @@ void ValueSet::ImplDrawSelect()
ValueSetItem* pItem;
if ( nItemId )
- pItem = (*mpImpl->mpItemList)[ GetItemPos( nItemId ) ];
+ pItem = mpImpl->mItemList[ GetItemPos( nItemId ) ];
else
{
if ( mpNoneItem )
@@ -883,7 +883,7 @@ void ValueSet::ImplHideSelect( sal_uInt16 nItemId )
sal_uInt16 nItemPos = GetItemPos( nItemId );
if ( nItemPos != sal::static_int_cast<sal_uInt16>(LIST_ENTRY_NOTFOUND) )
- aRect = (*mpImpl->mpItemList)[ nItemPos ]->maRect;
+ aRect = mpImpl->mItemList[ nItemPos ]->maRect;
else
{
if ( mpNoneItem )
@@ -994,7 +994,7 @@ sal_Bool ValueSet::ImplScroll( const Point& rPos )
long nScrollOffset;
sal_uInt16 nOldLine = mnFirstLine;
- const Rectangle& rTopRect = (*mpImpl->mpItemList)[ mnFirstLine * mnCols ]->maRect;
+ const Rectangle& rTopRect = mpImpl->mItemList[ mnFirstLine * mnCols ]->maRect;
if ( rTopRect.GetHeight() <= 16 )
nScrollOffset = VALUESET_SCROLL_OFFSET/2;
else
@@ -1008,7 +1008,7 @@ sal_Bool ValueSet::ImplScroll( const Point& rPos )
if ( (mnFirstLine == nOldLine) &&
(mnFirstLine < (sal_uInt16)(mnLines-mnVisLines)) && (rPos.Y() < aOutSize.Height()) )
{
- long nBottomPos = (*mpImpl->mpItemList)[ (mnFirstLine+mnVisLines-1)*mnCols ]->maRect.Bottom();
+ long nBottomPos = mpImpl->mItemList[ (mnFirstLine+mnVisLines-1)*mnCols ]->maRect.Bottom();
if ( (rPos.Y() >= nBottomPos-nScrollOffset) && (rPos.Y() <= nBottomPos) )
mnFirstLine++;
}
@@ -1038,10 +1038,10 @@ size_t ValueSet::ImplGetItem( const Point& rPos, sal_Bool bMove ) const
{
// The point is inside the ValueSet window,
// let's find the containing item.
- const size_t nItemCount = mpImpl->mpItemList->size();
+ const size_t nItemCount = mpImpl->mItemList.size();
for ( size_t i = 0; i < nItemCount; ++i )
{
- ValueSetItem *const pItem = (*mpImpl->mpItemList)[ i ];
+ ValueSetItem *const pItem = mpImpl->mItemList[ i ];
if ( pItem->maRect.IsInside( rPos ) )
{
return i;
@@ -1066,14 +1066,14 @@ ValueSetItem* ValueSet::ImplGetItem( size_t nPos )
if ( nPos == VALUESET_ITEM_NONEITEM )
return mpNoneItem;
else
- return ( nPos < mpImpl->mpItemList->size() ) ? (*mpImpl->mpItemList)[ nPos ] : NULL;
+ return ( nPos < mpImpl->mItemList.size() ) ? mpImpl->mItemList[ nPos ] : NULL;
}
// -----------------------------------------------------------------------
ValueSetItem* ValueSet::ImplGetFirstItem()
{
- return mpImpl->mpItemList->size() ? (*mpImpl->mpItemList)[ 0 ] : NULL;
+ return mpImpl->mItemList.size() ? mpImpl->mItemList[ 0 ] : NULL;
}
// -----------------------------------------------------------------------
@@ -1082,9 +1082,9 @@ sal_uInt16 ValueSet::ImplGetVisibleItemCount() const
{
sal_uInt16 nRet = 0;
- for( size_t n = 0, nItemCount = mpImpl->mpItemList->size(); n < nItemCount; n++ )
+ for( size_t n = 0, nItemCount = mpImpl->mItemList.size(); n < nItemCount; n++ )
{
- ValueSetItem* pItem = (*mpImpl->mpItemList)[ n ];
+ ValueSetItem* pItem = mpImpl->mItemList[ n ];
if( !pItem->maRect.IsEmpty() )
nRet++;
@@ -1100,9 +1100,9 @@ ValueSetItem* ValueSet::ImplGetVisibleItem( sal_uInt16 nVisiblePos )
ValueSetItem* pRet = NULL;
sal_uInt16 nFoundPos = 0;
- for( sal_Int32 n = 0, nItemCount = mpImpl->mpItemList->size(); ( n < nItemCount ) && !pRet; n++ )
+ for( sal_Int32 n = 0, nItemCount = mpImpl->mItemList.size(); ( n < nItemCount ) && !pRet; n++ )
{
- ValueSetItem* pItem = (*mpImpl->mpItemList)[ n ];
+ ValueSetItem* pItem = mpImpl->mItemList[ n ];
if( !pItem->maRect.IsEmpty() && ( nVisiblePos == nFoundPos++ ) )
pRet = pItem;
@@ -1307,7 +1307,7 @@ lcl_gotoLastLine(size_t const nLastPos, size_t const nCols, size_t const nCurPos
void ValueSet::KeyInput( const KeyEvent& rKEvt )
{
- size_t nLastItem = mpImpl->mpItemList->size();
+ size_t nLastItem = mpImpl->mItemList.size();
size_t nItemPos = VALUESET_ITEM_NOTFOUND;
size_t nCurPos = VALUESET_ITEM_NONEITEM;
size_t nCalcPos;
@@ -1679,12 +1679,12 @@ void ValueSet::InsertItem( sal_uInt16 nItemId, const Image& rImage, size_t nPos
pItem->mnId = nItemId;
pItem->meType = VALUESETITEM_IMAGE;
pItem->maImage = rImage;
- if ( nPos < mpImpl->mpItemList->size() ) {
- ValueItemList::iterator it = mpImpl->mpItemList->begin();
+ if ( nPos < mpImpl->mItemList.size() ) {
+ ValueItemList::iterator it = mpImpl->mItemList.begin();
::std::advance( it, nPos );
- mpImpl->mpItemList->insert( it, pItem );
+ mpImpl->mItemList.insert( it, pItem );
} else {
- mpImpl->mpItemList->push_back( pItem );
+ mpImpl->mItemList.push_back( pItem );
}
mbFormat = sal_True;
@@ -1704,12 +1704,12 @@ void ValueSet::InsertItem( sal_uInt16 nItemId, const Color& rColor, size_t nPos
pItem->mnId = nItemId;
pItem->meType = VALUESETITEM_COLOR;
pItem->maColor = rColor;
- if ( nPos < mpImpl->mpItemList->size() ) {
- ValueItemList::iterator it = mpImpl->mpItemList->begin();
+ if ( nPos < mpImpl->mItemList.size() ) {
+ ValueItemList::iterator it = mpImpl->mItemList.begin();
::std::advance( it, nPos );
- mpImpl->mpItemList->insert( it, pItem );
+ mpImpl->mItemList.insert( it, pItem );
} else {
- mpImpl->mpItemList->push_back( pItem );
+ mpImpl->mItemList.push_back( pItem );
}
mbFormat = sal_True;
@@ -1731,12 +1731,12 @@ void ValueSet::InsertItem( sal_uInt16 nItemId, const Image& rImage,
pItem->meType = VALUESETITEM_IMAGE;
pItem->maImage = rImage;
pItem->maText = rText;
- if ( nPos < mpImpl->mpItemList->size() ) {
- ValueItemList::iterator it = mpImpl->mpItemList->begin();
+ if ( nPos < mpImpl->mItemList.size() ) {
+ ValueItemList::iterator it = mpImpl->mItemList.begin();
::std::advance( it, nPos );
- mpImpl->mpItemList->insert( it, pItem );
+ mpImpl->mItemList.insert( it, pItem );
} else {
- mpImpl->mpItemList->push_back( pItem );
+ mpImpl->mItemList.push_back( pItem );
}
mbFormat = sal_True;
@@ -1758,12 +1758,12 @@ void ValueSet::InsertItem( sal_uInt16 nItemId, const Color& rColor,
pItem->meType = VALUESETITEM_COLOR;
pItem->maColor = rColor;
pItem->maText = rText;
- if ( nPos < mpImpl->mpItemList->size() ) {
- ValueItemList::iterator it = mpImpl->mpItemList->begin();
+ if ( nPos < mpImpl->mItemList.size() ) {
+ ValueItemList::iterator it = mpImpl->mItemList.begin();
::std::advance( it, nPos );
- mpImpl->mpItemList->insert( it, pItem );
+ mpImpl->mItemList.insert( it, pItem );
} else {
- mpImpl->mpItemList->push_back( pItem );
+ mpImpl->mItemList.push_back( pItem );
}
mbFormat = sal_True;
@@ -1782,12 +1782,12 @@ void ValueSet::InsertItem( sal_uInt16 nItemId, size_t nPos )
ValueSetItem* pItem = new ValueSetItem( *this );
pItem->mnId = nItemId;
pItem->meType = VALUESETITEM_USERDRAW;
- if ( nPos < mpImpl->mpItemList->size() ) {
- ValueItemList::iterator it = mpImpl->mpItemList->begin();
+ if ( nPos < mpImpl->mItemList.size() ) {
+ ValueItemList::iterator it = mpImpl->mItemList.begin();
::std::advance( it, nPos );
- mpImpl->mpItemList->insert( it, pItem );
+ mpImpl->mItemList.insert( it, pItem );
} else {
- mpImpl->mpItemList->push_back( pItem );
+ mpImpl->mItemList.push_back( pItem );
}
mbFormat = sal_True;
@@ -1804,11 +1804,11 @@ void ValueSet::RemoveItem( sal_uInt16 nItemId )
if ( nPos == VALUESET_ITEM_NOTFOUND )
return;
- if ( nPos < mpImpl->mpItemList->size() ) {
- ValueItemList::iterator it = mpImpl->mpItemList->begin();
+ if ( nPos < mpImpl->mItemList.size() ) {
+ ValueItemList::iterator it = mpImpl->mItemList.begin();
::std::advance( it, nPos );
delete *it;
- mpImpl->mpItemList->erase( it );
+ mpImpl->mItemList.erase( it );
}
// reset variables
@@ -1849,15 +1849,15 @@ void ValueSet::Clear()
size_t ValueSet::GetItemCount() const
{
- return mpImpl->mpItemList->size();
+ return mpImpl->mItemList.size();
}
// -----------------------------------------------------------------------
size_t ValueSet::GetItemPos( sal_uInt16 nItemId ) const
{
- for ( size_t i = 0, n = mpImpl->mpItemList->size(); i < n; ++i ) {
- ValueSetItem* pItem = (*mpImpl->mpItemList)[ i ];
+ for ( size_t i = 0, n = mpImpl->mItemList.size(); i < n; ++i ) {
+ ValueSetItem* pItem = mpImpl->mItemList[ i ];
if ( pItem->mnId == nItemId ) {
return i;
}
@@ -1869,7 +1869,7 @@ size_t ValueSet::GetItemPos( sal_uInt16 nItemId ) const
sal_uInt16 ValueSet::GetItemId( size_t nPos ) const
{
- return ( nPos < mpImpl->mpItemList->size() ) ? (*mpImpl->mpItemList)[ nPos ]->mnId : 0 ;
+ return ( nPos < mpImpl->mItemList.size() ) ? mpImpl->mItemList[ nPos ]->mnId : 0 ;
}
// -----------------------------------------------------------------------
@@ -1890,7 +1890,7 @@ Rectangle ValueSet::GetItemRect( sal_uInt16 nItemId ) const
size_t nPos = GetItemPos( nItemId );
if ( nPos != VALUESET_ITEM_NOTFOUND )
- return (*mpImpl->mpItemList)[ nPos ]->maRect;
+ return mpImpl->mItemList[ nPos ]->maRect;
else
return Rectangle();
}
@@ -2023,7 +2023,7 @@ void ValueSet::SelectItem( sal_uInt16 nItemId )
if( nPos != VALUESET_ITEM_NOTFOUND )
{
ValueItemAcc* pItemAcc = ValueItemAcc::getImplementation(
- (*mpImpl->mpItemList)[ nPos ]->GetAccessible( mpImpl->mbIsTransientChildrenDisabled ) );
+ mpImpl->mItemList[ nPos ]->GetAccessible( mpImpl->mbIsTransientChildrenDisabled ) );
if( pItemAcc )
{
@@ -2048,7 +2048,7 @@ void ValueSet::SelectItem( sal_uInt16 nItemId )
ValueSetItem* pItem;
if( nPos != VALUESET_ITEM_NOTFOUND )
- pItem = (*mpImpl->mpItemList)[ nPos ];
+ pItem = mpImpl->mItemList[ nPos ];
else
pItem = mpNoneItem;
@@ -2101,7 +2101,7 @@ void ValueSet::SetItemImage( sal_uInt16 nItemId, const Image& rImage )
if ( nPos == VALUESET_ITEM_NOTFOUND )
return;
- ValueSetItem* pItem = (*mpImpl->mpItemList)[ nPos ];
+ ValueSetItem* pItem = mpImpl->mItemList[ nPos ];
pItem->meType = VALUESETITEM_IMAGE;
pItem->maImage = rImage;
@@ -2121,7 +2121,7 @@ Image ValueSet::GetItemImage( sal_uInt16 nItemId ) const
size_t nPos = GetItemPos( nItemId );
if ( nPos != VALUESET_ITEM_NOTFOUND )
- return (*mpImpl->mpItemList)[ nPos ]->maImage;
+ return mpImpl->mItemList[ nPos ]->maImage;
else
return Image();
}
@@ -2135,7 +2135,7 @@ void ValueSet::SetItemColor( sal_uInt16 nItemId, const Color& rColor )
if ( nPos == VALUESET_ITEM_NOTFOUND )
return;
- ValueSetItem* pItem = (*mpImpl->mpItemList)[ nPos ];
+ ValueSetItem* pItem = mpImpl->mItemList[ nPos ];
pItem->meType = VALUESETITEM_COLOR;
pItem->maColor = rColor;
@@ -2155,7 +2155,7 @@ Color ValueSet::GetItemColor( sal_uInt16 nItemId ) const
size_t nPos = GetItemPos( nItemId );
if ( nPos != VALUESET_ITEM_NOTFOUND )
- return (*mpImpl->mpItemList)[ nPos ]->maColor;
+ return mpImpl->mItemList[ nPos ]->maColor;
else
return Color();
}
@@ -2169,7 +2169,7 @@ void ValueSet::SetItemData( sal_uInt16 nItemId, void* pData )
if ( nPos == VALUESET_ITEM_NOTFOUND )
return;
- ValueSetItem* pItem = (*mpImpl->mpItemList)[ nPos ];
+ ValueSetItem* pItem = mpImpl->mItemList[ nPos ];
pItem->mpData = pData;
if ( pItem->meType == VALUESETITEM_USERDRAW )
@@ -2191,7 +2191,7 @@ void* ValueSet::GetItemData( sal_uInt16 nItemId ) const
size_t nPos = GetItemPos( nItemId );
if ( nPos != VALUESET_ITEM_NOTFOUND )
- return (*mpImpl->mpItemList)[ nPos ]->mpData;
+ return mpImpl->mItemList[ nPos ]->mpData;
else
return NULL;
}
@@ -2206,7 +2206,7 @@ void ValueSet::SetItemText( sal_uInt16 nItemId, const XubString& rText )
return;
- ValueSetItem* pItem = (*mpImpl->mpItemList)[ nPos ];
+ ValueSetItem* pItem = mpImpl->mItemList[ nPos ];
// Remember old and new name for accessibility event.
::com::sun::star::uno::Any aOldName, aNewName;
@@ -2246,7 +2246,7 @@ XubString ValueSet::GetItemText( sal_uInt16 nItemId ) const
size_t nPos = GetItemPos( nItemId );
if ( nPos != VALUESET_ITEM_NOTFOUND )
- return (*mpImpl->mpItemList)[ nPos ]->maText;
+ return mpImpl->mItemList[ nPos ]->maText;
else
return XubString();
}
@@ -2366,8 +2366,8 @@ Size ValueSet::CalcWindowSizePixel( const Size& rItemSize, sal_uInt16 nDesireCol
nCalcLines = mnUserVisLines;
else
{
- nCalcLines = mpImpl->mpItemList->size() / nCalcCols;
- if ( mpImpl->mpItemList->size() % nCalcCols )
+ nCalcLines = mpImpl->mItemList.size() / nCalcCols;
+ if ( mpImpl->mItemList.size() % nCalcCols )
nCalcLines++;
else if ( !nCalcLines )
nCalcLines = 1;
More information about the Libreoffice-commits
mailing list