[Libreoffice-commits] core.git: 4 commits - include/svtools include/tools sc/source svtools/source vcl/source

Tomaž Vajngerl tomaz.vajngerl at collabora.com
Fri Apr 18 12:07:35 PDT 2014


 include/svtools/valueset.hxx        |   17 
 include/tools/gen.hxx               |    2 
 sc/source/ui/docshell/impex.cxx     |   93 +----
 svtools/source/control/valueset.cxx |  652 +++++++++++++-----------------------
 vcl/source/filter/wmf/winwmf.cxx    |    8 
 5 files changed, 286 insertions(+), 486 deletions(-)

New commits:
commit fa632a57b7fcbc0a790fc6615174f25b7f640713
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date:   Fri Apr 18 20:57:27 2014 +0200

    fdo#77088 WMF - replace 32-bit min/max assumption with const
    
    Added RECT_MIN and RECT_MAX which represent the minimum and
    maximum value a Rectangle object can hold. In WMF we used a 32-bit
    assumption what the min and max value could be (0x7fffffff,
    0x80000000) which causes problems on 64-bit systems.
    
    Change-Id: Ic62daebbc2708cdeb7b0cf7b694bd9940eb98313

diff --git a/include/tools/gen.hxx b/include/tools/gen.hxx
index 6007f12..c1cffcb 100644
--- a/include/tools/gen.hxx
+++ b/include/tools/gen.hxx
@@ -356,6 +356,8 @@ inline std::basic_ostream<charT, traits> & operator <<(
 // Rectangle
 
 #define RECT_EMPTY  ((short)-32767)
+#define RECT_MAX    LONG_MAX
+#define RECT_MIN    LONG_MIN
 
 class TOOLS_DLLPUBLIC SAL_WARN_UNUSED Rectangle
 {
diff --git a/vcl/source/filter/wmf/winwmf.cxx b/vcl/source/filter/wmf/winwmf.cxx
index fff2f9d..ef39c9c 100644
--- a/vcl/source/filter/wmf/winwmf.cxx
+++ b/vcl/source/filter/wmf/winwmf.cxx
@@ -1291,10 +1291,10 @@ bool WMFReader::GetPlaceableBound( Rectangle& rPlaceableBound, SvStream* pStm )
 {
     bool bRet = true;
 
-    rPlaceableBound.Left()   = (sal_Int32)0x7fffffff;
-    rPlaceableBound.Top()    = (sal_Int32)0x7fffffff;
-    rPlaceableBound.Right()  = (sal_Int32)0x80000000;
-    rPlaceableBound.Bottom() = (sal_Int32)0x80000000;
+    rPlaceableBound.Left()   = RECT_MAX;
+    rPlaceableBound.Top()    = RECT_MAX;
+    rPlaceableBound.Right()  = RECT_MIN;
+    rPlaceableBound.Bottom() = RECT_MIN;
 
     sal_uInt32 nPos = pStm->Tell();
     sal_uInt32 nEnd = pStm->Seek( STREAM_SEEK_TO_END );
commit 9ea483e8a90ad377a7e1146647da3466a78c4c18
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date:   Thu Apr 17 11:03:17 2014 +0200

    svtools: valueset.cxx - use scoped_ptr and clean-up
    
    Change-Id: I91528f55af39faccfe1bf95999ac29669ead0aad

diff --git a/include/svtools/valueset.hxx b/include/svtools/valueset.hxx
index 2c4bcbc..47ff77c 100644
--- a/include/svtools/valueset.hxx
+++ b/include/svtools/valueset.hxx
@@ -26,6 +26,7 @@
 #include <vcl/virdev.hxx>
 #include <vcl/timer.hxx>
 #include <vector>
+#include <boost/scoped_ptr.hpp>
 
 class MouseEvent;
 class TrackingEvent;
@@ -35,7 +36,6 @@ class DataChangedEvent;
 class ScrollBar;
 
 struct ValueSetItem;
-typedef ::std::vector< ValueSetItem* > ValueItemList;
 
 class ValueSetAcc;
 class ValueItemAcc;
@@ -176,10 +176,11 @@ to be set (before Show) with SetStyle().
 
 *************************************************************************/
 
+typedef std::vector<ValueSetItem*> ValueItemList;
+typedef boost::scoped_ptr<ScrollBar> ScrollBarPtr;
+typedef boost::scoped_ptr<ValueSetItem> ValueSetItemPtr;
 
 // - ValueSet types -
-
-
 #define WB_RADIOSEL             ((WinBits)0x00008000)
 #define WB_ITEMBORDER           ((WinBits)0x00010000)
 #define WB_DOUBLEBORDER         ((WinBits)0x00020000)
@@ -190,9 +191,6 @@ to be set (before Show) with SetStyle().
 #define WB_MENUSTYLEVALUESET    ((WinBits)0x08000000)
 
 
-// - ValueSet -
-
-
 #define VALUESET_APPEND         ((size_t)-1)
 #define VALUESET_ITEM_NOTFOUND  ((size_t)-1)
 
@@ -203,8 +201,8 @@ private:
     VirtualDevice   maVirDev;
     Timer           maTimer;
     ValueItemList   mItemList;
-    ValueSetItem*   mpNoneItem;
-    ScrollBar*      mpScrBar;
+    ValueSetItemPtr mpNoneItem;
+    ScrollBarPtr    mpScrollBar;
     Rectangle       maNoneItemRect;
     Rectangle       maItemListRect;
     long            mnItemWidth;
@@ -244,6 +242,7 @@ private:
 
     friend class ValueSetAcc;
     friend class ValueItemAcc;
+
     using Control::ImplInitSettings;
     using Window::ImplInit;
     SVT_DLLPRIVATE void         ImplInit();
@@ -282,7 +281,7 @@ protected:
 
 protected:
 
-    virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible() SAL_OVERRIDE;
+    virtual css::uno::Reference<css::accessibility::XAccessible> CreateAccessible() SAL_OVERRIDE;
 
 public:
                     ValueSet( Window* pParent, WinBits nWinStyle, bool bDisableTransientChildren = false );
diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx
index c0f9f7b..d99f1d7 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -34,10 +34,15 @@
 
 #include <svtools/valueset.hxx>
 
+using namespace css::uno;
+using namespace css::lang;
+using namespace css::accessibility;
+
 namespace
 {
 
-enum {
+enum
+{
     ITEM_OFFSET = 4,
     ITEM_OFFSET_DOUBLE = 6,
     NAME_LINE_OFF_X = 2,
@@ -52,8 +57,9 @@ enum {
 
 void ValueSet::ImplInit()
 {
-    mpNoneItem          = NULL;
-    mpScrBar            = NULL;
+    mpNoneItem.reset(NULL);
+    mpScrollBar.reset(NULL);
+
     mnItemWidth         = 0;
     mnItemHeight        = 0;
     mnTextOffset        = 0;
@@ -119,13 +125,9 @@ ValueSet::ValueSet( Window* pParent, const ResId& rResId, bool bDisableTransient
 
 ValueSet::~ValueSet()
 {
-    css::uno::Reference<css::lang::XComponent>
-          xComponent (GetAccessible(false), css::uno::UNO_QUERY);
+    Reference<XComponent> xComponent(GetAccessible(false), UNO_QUERY);
     if (xComponent.is())
-        xComponent->dispose ();
-
-    delete mpScrBar;
-    delete mpNoneItem;
+        xComponent->dispose();
 
     ImplDeleteItems();
 }
@@ -139,10 +141,11 @@ void ValueSet::ImplDeleteItems()
         ValueSetItem* pItem = mItemList[i];
         if ( pItem->mbVisible && ImplHasAccessibleListeners() )
         {
-            css::uno::Any aOldAny, aNewAny;
+            Any aOldAny;
+            Any aNewAny;
 
             aOldAny <<= pItem->GetAccessible( mbIsTransientChildrenDisabled );
-            ImplFireAccessibleEvent( css::accessibility::AccessibleEventId::CHILD, aOldAny, aNewAny );
+            ImplFireAccessibleEvent(AccessibleEventId::CHILD, aOldAny, aNewAny);
         }
 
         delete pItem;
@@ -194,16 +197,16 @@ void ValueSet::ImplInitScrollBar()
 {
     if ( GetStyle() & WB_VSCROLL )
     {
-        if ( !mpScrBar )
+        if ( !mpScrollBar.get() )
         {
-            mpScrBar = new ScrollBar( this, WB_VSCROLL | WB_DRAG );
-            mpScrBar->SetScrollHdl( LINK( this, ValueSet, ImplScrollHdl ) );
+            mpScrollBar.reset(new ScrollBar( this, WB_VSCROLL | WB_DRAG ));
+            mpScrollBar->SetScrollHdl( LINK( this, ValueSet, ImplScrollHdl ) );
         }
         else
         {
             // adapt the width because of the changed settings
             long nScrBarWidth = GetSettings().GetStyleSettings().GetScrollBarSize();
-            mpScrBar->setPosSizePixel( 0, 0, nScrBarWidth, 0, WINDOW_POSSIZE_WIDTH );
+            mpScrollBar->setPosSizePixel( 0, 0, nScrBarWidth, 0, WINDOW_POSSIZE_WIDTH );
         }
     }
 }
@@ -213,26 +216,19 @@ void ValueSet::ImplFormatItem( ValueSetItem* pItem, Rectangle aRect )
     WinBits nStyle = GetStyle();
     if ( nStyle & WB_ITEMBORDER )
     {
-        aRect.Left()++;
-        aRect.Top()++;
-        aRect.Right()--;
-        aRect.Bottom()--;
+        aRect.Left()   += 1;
+        aRect.Top()    += 1;
+        aRect.Right()  -= 1;
+        aRect.Bottom() -= 1;
+
         if ( nStyle & WB_FLATVALUESET )
         {
-            if ( nStyle  & WB_DOUBLEBORDER )
-            {
-                aRect.Left()    += 2;
-                aRect.Top()     += 2;
-                aRect.Right()   -= 2;
-                aRect.Bottom()  -= 2;
-            }
-            else
-            {
-                aRect.Left()++;
-                aRect.Top()++;
-                aRect.Right()--;
-                aRect.Bottom()--;
-            }
+            sal_Int32 nBorder = (nStyle & WB_DOUBLEBORDER) ? 2 : 1;
+
+            aRect.Left()   += nBorder;
+            aRect.Top()    += nBorder;
+            aRect.Right()  -= nBorder;
+            aRect.Bottom() -= nBorder;
         }
         else
         {
@@ -241,14 +237,14 @@ void ValueSet::ImplFormatItem( ValueSetItem* pItem, Rectangle aRect )
         }
     }
 
-    if ( pItem == mpNoneItem )
+    if ( pItem == mpNoneItem.get() )
         pItem->maText = GetText();
 
     if ( (aRect.GetHeight() > 0) && (aRect.GetWidth() > 0) )
     {
         const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
 
-        if ( pItem == mpNoneItem )
+        if ( pItem == mpNoneItem.get() )
         {
             maVirDev.SetFont( GetFont() );
             maVirDev.SetTextColor( ( nStyle & WB_MENUSTYLEVALUESET ) ? rStyleSettings.GetMenuTextColor() : rStyleSettings.GetWindowTextColor() );
@@ -334,7 +330,7 @@ void ValueSet::ImplFormatItem( ValueSetItem* pItem, Rectangle aRect )
     }
 }
 
-css::uno::Reference<css::accessibility::XAccessible > ValueSet::CreateAccessible()
+Reference<XAccessible> ValueSet::CreateAccessible()
 {
     return new ValueSetAcc( this, mbIsTransientChildrenDisabled );
 }
@@ -348,18 +344,17 @@ void ValueSet::Format()
     long        nOff;
     long        nNoneHeight;
     long        nNoneSpace;
-    ScrollBar*  pDelScrBar = NULL;
+    ScrollBarPtr pDeletedScrollBar(NULL);
 
     // consider the scrolling
     if ( nStyle & WB_VSCROLL )
         ImplInitScrollBar();
     else
     {
-        if ( mpScrBar )
+        if ( mpScrollBar.get() )
         {
             // delete ScrollBar not until later, to prevent recursive calls
-            pDelScrBar = mpScrBar;
-            mpScrBar = NULL;
+            pDeletedScrollBar.swap(mpScrollBar);
         }
     }
 
@@ -375,12 +370,12 @@ void ValueSet::Format()
         nOff = 0;
 
     // consider size, if NameField does exist
-    if ( nStyle & WB_NAMEFIELD )
+    if (nStyle & WB_NAMEFIELD)
     {
         mnTextOffset = aWinSize.Height() - nTxtHeight - NAME_OFFSET;
         aWinSize.Height() -= nTxtHeight + NAME_OFFSET;
 
-        if ( !(nStyle & WB_FLATVALUESET) )
+        if (!(nStyle & WB_FLATVALUESET))
         {
             mnTextOffset -= NAME_LINE_HEIGHT + NAME_LINE_OFF_Y;
             aWinSize.Height() -= NAME_LINE_HEIGHT + NAME_LINE_OFF_Y;
@@ -402,55 +397,65 @@ void ValueSet::Format()
         nNoneHeight = 0;
         nNoneSpace = 0;
 
-        if ( mpNoneItem )
-        {
-            delete mpNoneItem;
-            mpNoneItem = NULL;
-        }
+        if (mpNoneItem.get())
+            mpNoneItem.reset(NULL);
     }
 
     // calculate ScrollBar width
     long nScrBarWidth = 0;
-    if ( mpScrBar )
-        nScrBarWidth = mpScrBar->GetSizePixel().Width()+SCRBAR_OFFSET;
+    if (mpScrollBar.get())
+        nScrBarWidth = mpScrollBar->GetSizePixel().Width()+SCRBAR_OFFSET;
 
     // calculate number of columns
-    if ( !mnUserCols )
+    if (!mnUserCols)
     {
-        if ( mnUserItemWidth )
+        if (mnUserItemWidth)
         {
             mnCols = (sal_uInt16) ((aWinSize.Width() - nScrBarWidth + mnSpacing) / (mnUserItemWidth + mnSpacing));
-            if ( !mnCols )
+            if (mnCols <= 0)
                 mnCols = 1;
         }
         else
+        {
             mnCols = 1;
+        }
     }
     else
+    {
         mnCols = mnUserCols;
+    }
 
     // calculate number of rows
     mbScroll = false;
+
     // Floor( (M+N-1)/N )==Ceiling( M/N )
     mnLines = (static_cast<long>(nItemCount) + mnCols - 1) / mnCols;
-    if ( !mnLines )
+    if (mnLines <= 0)
         mnLines = 1;
 
     long nCalcHeight = aWinSize.Height() - nNoneHeight;
-    if ( mnUserVisLines )
+    if (mnUserVisLines)
+    {
         mnVisLines = mnUserVisLines;
-    else if ( mnUserItemHeight )
+    }
+    else if (mnUserItemHeight)
     {
         mnVisLines = (nCalcHeight - nNoneSpace + mnSpacing) / (mnUserItemHeight + mnSpacing);
         if ( !mnVisLines )
             mnVisLines = 1;
     }
     else
+    {
         mnVisLines = mnLines;
+    }
+
     if ( mnLines > mnVisLines )
         mbScroll = true;
+
     if ( mnLines <= mnVisLines )
+    {
         mnFirstLine = 0;
+    }
     else
     {
         if ( mnFirstLine > (sal_uInt16)(mnLines - mnVisLines) )
@@ -494,7 +499,7 @@ void ValueSet::Format()
 
         if ( nStyle & WB_NONEFIELD )
         {
-            if ( mpNoneItem )
+            if (mpNoneItem.get())
             {
                 mpNoneItem->mbVisible = false;
                 mpNoneItem->maText = GetText();
@@ -506,8 +511,8 @@ void ValueSet::Format()
             mItemList[i]->mbVisible = false;
         }
 
-        if ( mpScrBar )
-            mpScrBar->Hide();
+        if ( mpScrollBar.get() )
+            mpScrollBar->Hide();
     }
     else
     {
@@ -561,10 +566,10 @@ void ValueSet::Format()
         long y = nStartY;
 
         // create NoSelection field and show it
-        if ( nStyle & WB_NONEFIELD )
+        if (nStyle & WB_NONEFIELD)
         {
-            if ( !mpNoneItem )
-                mpNoneItem = new ValueSetItem( *this );
+            if (mpNoneItem.get() == NULL)
+                mpNoneItem.reset(new ValueSetItem(*this));
 
             mpNoneItem->mnId            = 0;
             mpNoneItem->meType          = VALUESETITEM_NONE;
@@ -574,7 +579,7 @@ void ValueSet::Format()
             maNoneItemRect.Right()      = maNoneItemRect.Left() + aWinSize.Width() - x - 1;
             maNoneItemRect.Bottom()     = y+nNoneHeight - 1;
 
-            ImplFormatItem( mpNoneItem, maNoneItemRect );
+            ImplFormatItem(mpNoneItem.get(), maNoneItemRect);
 
             y += nNoneHeight+nNoneSpace;
         }
@@ -605,10 +610,11 @@ void ValueSet::Format()
             {
                 if( !pItem->mbVisible && ImplHasAccessibleListeners() )
                 {
-                    css::uno::Any aOldAny, aNewAny;
+                    Any aOldAny;
+                    Any aNewAny;
 
                     aNewAny <<= pItem->GetAccessible( mbIsTransientChildrenDisabled );
-                    ImplFireAccessibleEvent( css::accessibility::AccessibleEventId::CHILD, aOldAny, aNewAny );
+                    ImplFireAccessibleEvent(AccessibleEventId::CHILD, aOldAny, aNewAny);
                 }
 
                 pItem->mbVisible = true;
@@ -626,10 +632,11 @@ void ValueSet::Format()
             {
                 if( pItem->mbVisible && ImplHasAccessibleListeners() )
                 {
-                    css::uno::Any aOldAny, aNewAny;
+                    Any aOldAny;
+                    Any aNewAny;
 
                     aOldAny <<= pItem->GetAccessible( mbIsTransientChildrenDisabled );
-                    ImplFireAccessibleEvent( css::accessibility::AccessibleEventId::CHILD, aOldAny, aNewAny );
+                    ImplFireAccessibleEvent(AccessibleEventId::CHILD, aOldAny, aNewAny);
                 }
 
                 pItem->mbVisible = false;
@@ -637,7 +644,7 @@ void ValueSet::Format()
         }
 
         // arrange ScrollBar, set values and show it
-        if ( mpScrBar )
+        if ( mpScrollBar.get() )
         {
             Point   aPos( aWinSize.Width() - nScrBarWidth + SCRBAR_OFFSET, 0 );
             Size    aSize( nScrBarWidth - SCRBAR_OFFSET, aWinSize.Height() );
@@ -647,23 +654,20 @@ void ValueSet::Format()
                 aPos.Y() = nStartY + nNoneHeight + 1;
                 aSize.Height() = ((mnItemHeight + mnSpacing) * mnVisLines) - 2 - mnSpacing;
             }
-            mpScrBar->SetPosSizePixel( aPos, aSize );
-            mpScrBar->SetRangeMax( mnLines );
-            mpScrBar->SetVisibleSize( mnVisLines );
-            mpScrBar->SetThumbPos( (long)mnFirstLine );
+            mpScrollBar->SetPosSizePixel( aPos, aSize );
+            mpScrollBar->SetRangeMax( mnLines );
+            mpScrollBar->SetVisibleSize( mnVisLines );
+            mpScrollBar->SetThumbPos( (long)mnFirstLine );
             long nPageSize = mnVisLines;
             if ( nPageSize < 1 )
                 nPageSize = 1;
-            mpScrBar->SetPageSize( nPageSize );
-            mpScrBar->Show();
+            mpScrollBar->SetPageSize( nPageSize );
+            mpScrollBar->Show();
         }
     }
 
     // waiting for the next since the formatting is finished
     mbFormat = false;
-
-    // delete ScrollBar
-    delete pDelScrBar;
 }
 
 void ValueSet::ImplDrawItemText(const OUString& rText)
@@ -717,27 +721,27 @@ void ValueSet::ImplDrawSelect( sal_uInt16 nItemId, const bool bFocus, const bool
 {
     ValueSetItem* pItem;
     Rectangle aRect;
-    if ( nItemId )
+    if (nItemId)
     {
         const size_t nPos = GetItemPos( nItemId );
         pItem = mItemList[ nPos ];
         aRect = ImplGetItemRect( nPos );
     }
-    else if ( mpNoneItem )
+    else if (mpNoneItem.get())
     {
-        pItem = mpNoneItem;
+        pItem = mpNoneItem.get();
         aRect = maNoneItemRect;
     }
-    else if ( bFocus && (pItem = ImplGetFirstItem()) )
+    else if (bFocus && (pItem = ImplGetFirstItem()))
     {
-        aRect = ImplGetItemRect( 0 );
+        aRect = ImplGetItemRect(0);
     }
     else
     {
         return;
     }
 
-    if ( pItem->mbVisible )
+    if (pItem->mbVisible)
     {
         // draw selection
         const StyleSettings&    rStyleSettings = GetSettings().GetStyleSettings();
@@ -887,7 +891,7 @@ void ValueSet::ImplHideSelect( sal_uInt16 nItemId )
     }
     else
     {
-        if ( !mpNoneItem )
+        if (mpNoneItem.get() == NULL)
         {
             return;
         }
@@ -929,10 +933,10 @@ void ValueSet::ImplDraw()
     Point   aDefPos;
     Size    aSize = maVirDev.GetOutputSizePixel();
 
-    if ( mpScrBar && mpScrBar->IsVisible() )
+    if ( mpScrollBar.get() && mpScrollBar->IsVisible() )
     {
-        Point   aScrPos = mpScrBar->GetPosPixel();
-        Size    aScrSize = mpScrBar->GetSizePixel();
+        Point   aScrPos = mpScrollBar->GetPosPixel();
+        Size    aScrSize = mpScrollBar->GetSizePixel();
         Point   aTempPos( 0, aScrPos.Y() );
         Size    aTempSize( aSize.Width(), aScrPos.Y() );
 
@@ -1009,17 +1013,17 @@ bool ValueSet::ImplScroll( const Point& rPos )
 
 size_t ValueSet::ImplGetItem( const Point& rPos, bool bMove ) const
 {
-    if ( !mbHasVisibleItems )
+    if (!mbHasVisibleItems)
     {
         return VALUESET_ITEM_NOTFOUND;
     }
 
-    if ( mpNoneItem && maNoneItemRect.IsInside( rPos ) )
+    if (mpNoneItem.get() && maNoneItemRect.IsInside(rPos))
     {
         return VALUESET_ITEM_NONEITEM;
     }
 
-    if ( maItemListRect.IsInside( rPos ) )
+    if (maItemListRect.IsInside(rPos))
     {
         const int xc = rPos.X() - maItemListRect.Left();
         const int yc = rPos.Y() - maItemListRect.Top();
@@ -1030,7 +1034,7 @@ size_t ValueSet::ImplGetItem( const Point& rPos, bool bMove ) const
         const int row = yc / (mnItemHeight + mnSpacing);
         const int y = yc % (mnItemHeight + mnSpacing);
 
-        if (x<mnItemWidth && y<mnItemHeight)
+        if (x < mnItemWidth && y < mnItemHeight)
         {
             // the point is inside item rect and not inside spacing
             const size_t item = (mnFirstLine + row) * mnCols + col;
@@ -1042,7 +1046,7 @@ size_t ValueSet::ImplGetItem( const Point& rPos, bool bMove ) const
 
         // return the previously selected item if spacing is set and
         // the mouse hasn't left the window yet
-        if ( bMove && mnSpacing && mnHighItemId )
+        if (bMove && mnSpacing && mnHighItemId)
         {
             return GetItemPos( mnHighItemId );
         }
@@ -1053,10 +1057,10 @@ size_t ValueSet::ImplGetItem( const Point& rPos, bool bMove ) const
 
 ValueSetItem* ValueSet::ImplGetItem( size_t nPos )
 {
-    if ( nPos == VALUESET_ITEM_NONEITEM )
-        return mpNoneItem;
+    if (nPos == VALUESET_ITEM_NONEITEM)
+        return mpNoneItem.get();
     else
-        return ( nPos < mItemList.size() ) ? mItemList[nPos] : NULL;
+        return (nPos < mItemList.size()) ? mItemList[nPos] : NULL;
 }
 
 ValueSetItem* ValueSet::ImplGetFirstItem()
@@ -1078,7 +1082,7 @@ sal_uInt16 ValueSet::ImplGetVisibleItemCount() const
     return nRet;
 }
 
-void ValueSet::ImplFireAccessibleEvent( short nEventId, const css::uno::Any& rOldValue, const css::uno::Any& rNewValue )
+void ValueSet::ImplFireAccessibleEvent( short nEventId, const Any& rOldValue, const Any& rNewValue )
 {
     ValueSetAcc* pAcc = ValueSetAcc::getImplementation( GetAccessible( false ) );
 
@@ -1248,15 +1252,16 @@ void ValueSet::KeyInput( const KeyEvent& rKeyEvent )
         Format();
 
     --nLastItem;
-    const size_t nCurPos = mnSelItemId ? GetItemPos( mnSelItemId )
-                                       : mpNoneItem ? VALUESET_ITEM_NONEITEM : 0;
+
+    const size_t nCurPos = mnSelItemId ? GetItemPos(mnSelItemId)
+                                       : (mpNoneItem.get() ? VALUESET_ITEM_NONEITEM : 0);
     size_t nItemPos = VALUESET_ITEM_NOTFOUND;
     size_t nVStep = mnCols;
 
-    switch ( rKeyEvent.GetKeyCode().GetCode() )
+    switch (rKeyEvent.GetKeyCode().GetCode())
     {
         case KEY_HOME:
-            nItemPos = mpNoneItem ? VALUESET_ITEM_NONEITEM : 0;
+            nItemPos = mpNoneItem.get() ? VALUESET_ITEM_NONEITEM : 0;
             break;
 
         case KEY_END:
@@ -1270,7 +1275,7 @@ void ValueSet::KeyInput( const KeyEvent& rKeyEvent )
                 {
                     nItemPos = nCurPos-1;
                 }
-                else if (mpNoneItem)
+                else if (mpNoneItem.get())
                 {
                     nItemPos = VALUESET_ITEM_NONEITEM;
                 }
@@ -1316,7 +1321,7 @@ void ValueSet::KeyInput( const KeyEvent& rKeyEvent )
                     // Go up of a whole page
                     nItemPos = nCurPos-nVStep;
                 }
-                else if (mpNoneItem)
+                else if (mpNoneItem.get())
                 {
                     nItemPos = VALUESET_ITEM_NONEITEM;
                 }
@@ -1397,7 +1402,7 @@ void ValueSet::Command( const CommandEvent& rCommandEvent )
          rCommandEvent.GetCommand() == COMMAND_STARTAUTOSCROLL ||
          rCommandEvent.GetCommand() == COMMAND_AUTOSCROLL )
     {
-        if ( HandleScrollCommand( rCommandEvent, NULL, mpScrBar ) )
+        if ( HandleScrollCommand( rCommandEvent, NULL, mpScrollBar.get() ) )
             return;
     }
 
@@ -1493,9 +1498,9 @@ void ValueSet::StateChanged( StateChangedType nType )
     }
     else if ( nType == STATE_CHANGE_TEXT )
     {
-        if ( mpNoneItem && !mbFormat && IsReallyVisible() && IsUpdateMode() )
+        if ( mpNoneItem.get() && !mbFormat && IsReallyVisible() && IsUpdateMode() )
         {
-            ImplFormatItem( mpNoneItem, maNoneItemRect );
+            ImplFormatItem(mpNoneItem.get(), maNoneItemRect);
             Invalidate( maNoneItemRect );
         }
     }
@@ -1859,17 +1864,17 @@ void ValueSet::SelectItem( sal_uInt16 nItemId )
 
                     if( pItemAcc )
                     {
-                        css::uno::Any aOldAny, aNewAny;
+                        Any aOldAny;
+                        Any aNewAny;
                         if( !mbIsTransientChildrenDisabled )
                         {
-                            aOldAny <<= css::uno::Reference< css::uno::XInterface >(
-                                static_cast< cppu::OWeakObject* >( pItemAcc ));
-                            ImplFireAccessibleEvent (css::accessibility::AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, aOldAny, aNewAny );
+                            aOldAny <<= Reference<XInterface>(static_cast<cppu::OWeakObject*>(pItemAcc));
+                            ImplFireAccessibleEvent(AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, aOldAny, aNewAny );
                         }
                         else
                         {
-                            aOldAny <<= css::accessibility::AccessibleStateType::FOCUSED;
-                            pItemAcc->FireAccessibleEvent( css::accessibility::AccessibleEventId::STATE_CHANGED, aOldAny, aNewAny );
+                            aOldAny <<= AccessibleStateType::FOCUSED;
+                            pItemAcc->FireAccessibleEvent(AccessibleEventId::STATE_CHANGED, aOldAny, aNewAny);
                         }
                     }
                 }
@@ -1882,7 +1887,7 @@ void ValueSet::SelectItem( sal_uInt16 nItemId )
             if( nPos != VALUESET_ITEM_NOTFOUND )
                 pItem = mItemList[nPos];
             else
-                pItem = mpNoneItem;
+                pItem = mpNoneItem.get();
 
             ValueItemAcc* pItemAcc = NULL;
             if (pItem != NULL)
@@ -1890,23 +1895,24 @@ void ValueSet::SelectItem( sal_uInt16 nItemId )
 
             if( pItemAcc )
             {
-                css::uno::Any aOldAny, aNewAny;
+                Any aOldAny;
+                Any aNewAny;
                 if( !mbIsTransientChildrenDisabled )
                 {
-                    aNewAny <<= css::uno::Reference< css::uno::XInterface >(
-                        static_cast< cppu::OWeakObject* >( pItemAcc ));
-                    ImplFireAccessibleEvent( css::accessibility::AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, aOldAny, aNewAny );
+                    aNewAny <<= Reference<XInterface>(static_cast<cppu::OWeakObject*>(pItemAcc));
+                    ImplFireAccessibleEvent(AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, aOldAny, aNewAny);
                 }
                 else
                 {
-                    aNewAny <<= css::accessibility::AccessibleStateType::FOCUSED;
-                    pItemAcc->FireAccessibleEvent( css::accessibility::AccessibleEventId::STATE_CHANGED, aOldAny, aNewAny );
+                    aNewAny <<= AccessibleStateType::FOCUSED;
+                    pItemAcc->FireAccessibleEvent(AccessibleEventId::STATE_CHANGED, aOldAny, aNewAny);
                 }
             }
 
             // selection event
-            css::uno::Any aOldAny, aNewAny;
-            ImplFireAccessibleEvent( css::accessibility::AccessibleEventId::SELECTION_CHANGED, aOldAny, aNewAny );
+            Any aOldAny;
+            Any aNewAny;
+            ImplFireAccessibleEvent(AccessibleEventId::SELECTION_CHANGED, aOldAny, aNewAny);
         }
         maHighlightHdl.Call(this);
     }
@@ -2028,7 +2034,8 @@ void ValueSet::SetItemText(sal_uInt16 nItemId, const OUString& rText)
     ValueSetItem* pItem = mItemList[nPos];
 
     // Remember old and new name for accessibility event.
-    css::uno::Any aOldName, aNewName;
+    Any aOldName;
+    Any aNewName;
     OUString sString (pItem->maText);
     aOldName <<= sString;
     sString = rText;
@@ -2049,12 +2056,9 @@ void ValueSet::SetItemText(sal_uInt16 nItemId, const OUString& rText)
 
     if (ImplHasAccessibleListeners())
     {
-        css::uno::Reference<
-              css::accessibility::XAccessible> xAccessible (
-                  pItem->GetAccessible( mbIsTransientChildrenDisabled ) );
-        static_cast<ValueItemAcc*>(xAccessible.get())->FireAccessibleEvent (
-            css::accessibility::AccessibleEventId::NAME_CHANGED,
-            aOldName, aNewName);
+        Reference<XAccessible> xAccessible(pItem->GetAccessible( mbIsTransientChildrenDisabled));
+        ValueItemAcc* pValueItemAcc = static_cast<ValueItemAcc*>(xAccessible.get());
+        pValueItemAcc->FireAccessibleEvent(AccessibleEventId::NAME_CHANGED, aOldName, aNewName);
     }
 }
 
@@ -2179,7 +2183,7 @@ Size ValueSet::CalcWindowSizePixel( const Size& rItemSize, sal_uInt16 nDesireCol
         }
     }
 
-    Size        aSize( rItemSize.Width()*nCalcCols, rItemSize.Height()*nCalcLines );
+    Size        aSize( rItemSize.Width() * nCalcCols, rItemSize.Height() * nCalcLines );
     WinBits     nStyle = GetStyle();
     long        nTxtHeight = GetTextHeight();
     long        n;
@@ -2256,8 +2260,8 @@ long ValueSet::GetScrollWidth() const
 {
     if ( GetStyle() & WB_VSCROLL )
     {
-        ((ValueSet*)this)->ImplInitScrollBar();
-        return mpScrBar->GetSizePixel().Width()+SCRBAR_OFFSET;
+        const_cast<ValueSet*>(this)->ImplInitScrollBar();
+        return mpScrollBar->GetSizePixel().Width() + SCRBAR_OFFSET;
     }
     else
         return 0;
commit 6b6bf85661ccf80a6166585e02d36e42e2613955
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date:   Thu Apr 17 00:04:26 2014 +0200

    Cleanup valueset.cxx
    
    Change-Id: Ib0a27d8d3a3e974f73e7873ad8baae4721f6fb87

diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx
index b649278..c0f9f7b 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -50,10 +50,6 @@ enum {
 
 }
 
-
-// - ValueSet -
-
-
 void ValueSet::ImplInit()
 {
     mpNoneItem          = NULL;
@@ -92,8 +88,6 @@ void ValueSet::ImplInit()
     ImplInitSettings( true, true, true );
 }
 
-
-
 ValueSet::ValueSet( Window* pParent, WinBits nWinStyle, bool bDisableTransientChildren ) :
     Control( pParent, nWinStyle ),
     maVirDev( *this ),
@@ -114,8 +108,6 @@ extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeValueSet(Window *pParent, V
     return new ValueSet(pParent, nWinBits);
 }
 
-
-
 ValueSet::ValueSet( Window* pParent, const ResId& rResId, bool bDisableTransientChildren ) :
     Control( pParent, rResId ),
     maVirDev( *this ),
@@ -125,12 +117,10 @@ ValueSet::ValueSet( Window* pParent, const ResId& rResId, bool bDisableTransient
     mbIsTransientChildrenDisabled = bDisableTransientChildren;
 }
 
-
-
 ValueSet::~ValueSet()
 {
-    ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent>
-          xComponent (GetAccessible(false), ::com::sun::star::uno::UNO_QUERY);
+    css::uno::Reference<css::lang::XComponent>
+          xComponent (GetAccessible(false), css::uno::UNO_QUERY);
     if (xComponent.is())
         xComponent->dispose ();
 
@@ -140,21 +130,19 @@ ValueSet::~ValueSet()
     ImplDeleteItems();
 }
 
-
-
 void ValueSet::ImplDeleteItems()
 {
     const size_t n = mItemList.size();
 
     for ( size_t i = 0; i < n; ++i )
     {
-        ValueSetItem *const pItem = mItemList[i];
+        ValueSetItem* pItem = mItemList[i];
         if ( pItem->mbVisible && ImplHasAccessibleListeners() )
         {
-            ::com::sun::star::uno::Any aOldAny, aNewAny;
+            css::uno::Any aOldAny, aNewAny;
 
             aOldAny <<= pItem->GetAccessible( mbIsTransientChildrenDisabled );
-            ImplFireAccessibleEvent( ::com::sun::star::accessibility::AccessibleEventId::CHILD, aOldAny, aNewAny );
+            ImplFireAccessibleEvent( css::accessibility::AccessibleEventId::CHILD, aOldAny, aNewAny );
         }
 
         delete pItem;
@@ -163,8 +151,6 @@ void ValueSet::ImplDeleteItems()
     mItemList.clear();
 }
 
-
-
 void ValueSet::ImplInitSettings( bool bFont, bool bForeground, bool bBackground )
 {
     const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
@@ -204,8 +190,6 @@ void ValueSet::ImplInitSettings( bool bFont, bool bForeground, bool bBackground
     }
 }
 
-
-
 void ValueSet::ImplInitScrollBar()
 {
     if ( GetStyle() & WB_VSCROLL )
@@ -224,8 +208,6 @@ void ValueSet::ImplInitScrollBar()
     }
 }
 
-
-
 void ValueSet::ImplFormatItem( ValueSetItem* pItem, Rectangle aRect )
 {
     WinBits nStyle = GetStyle();
@@ -273,7 +255,7 @@ void ValueSet::ImplFormatItem( ValueSetItem* pItem, Rectangle aRect )
             maVirDev.SetTextFillColor();
             maVirDev.SetFillColor( ( nStyle & WB_MENUSTYLEVALUESET ) ? rStyleSettings.GetMenuColor() : rStyleSettings.GetWindowColor() );
             maVirDev.DrawRect( aRect );
-            Point   aTxtPos( aRect.Left()+2, aRect.Top() );
+            Point   aTxtPos( aRect.Left() + 2, aRect.Top() );
             long    nTxtWidth = GetTextWidth( pItem->maText );
             if ( nStyle & WB_RADIOSEL )
             {
@@ -316,15 +298,15 @@ void ValueSet::ImplFormatItem( ValueSetItem* pItem, Rectangle aRect )
                 Size    aImageSize = pItem->maImage.GetSizePixel();
                 Size    aRectSize = aRect.GetSize();
                 Point   aPos( aRect.Left(), aRect.Top() );
-                aPos.X() += (aRectSize.Width()-aImageSize.Width())/2;
-                aPos.Y() += (aRectSize.Height()-aImageSize.Height())/2;
+                aPos.X() += (aRectSize.Width() - aImageSize.Width()) / 2;
+                aPos.Y() += (aRectSize.Height() - aImageSize.Height()) / 2;
 
                 sal_uInt16  nImageStyle  = 0;
                 if( !IsEnabled() )
                     nImageStyle  |= IMAGE_DRAW_DISABLE;
 
-                if ( (aImageSize.Width()  > aRectSize.Width()) ||
-                     (aImageSize.Height() > aRectSize.Height()) )
+                if ( aImageSize.Width()  > aRectSize.Width() ||
+                     aImageSize.Height() > aRectSize.Height() )
                 {
                     maVirDev.SetClipRegion( Region( aRect ) );
                     maVirDev.DrawImage( aPos, pItem->maImage, nImageStyle);
@@ -352,15 +334,11 @@ void ValueSet::ImplFormatItem( ValueSetItem* pItem, Rectangle aRect )
     }
 }
 
-
-
-::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > ValueSet::CreateAccessible()
+css::uno::Reference<css::accessibility::XAccessible > ValueSet::CreateAccessible()
 {
     return new ValueSetAcc( this, mbIsTransientChildrenDisabled );
 }
 
-
-
 void ValueSet::Format()
 {
     Size        aWinSize = GetOutputSizePixel();
@@ -399,13 +377,13 @@ void ValueSet::Format()
     // consider size, if NameField does exist
     if ( nStyle & WB_NAMEFIELD )
     {
-        mnTextOffset = aWinSize.Height()-nTxtHeight-NAME_OFFSET;
-        aWinSize.Height() -= nTxtHeight+NAME_OFFSET;
+        mnTextOffset = aWinSize.Height() - nTxtHeight - NAME_OFFSET;
+        aWinSize.Height() -= nTxtHeight + NAME_OFFSET;
 
         if ( !(nStyle & WB_FLATVALUESET) )
         {
-            mnTextOffset -= NAME_LINE_HEIGHT+NAME_LINE_OFF_Y;
-            aWinSize.Height() -= NAME_LINE_HEIGHT+NAME_LINE_OFF_Y;
+            mnTextOffset -= NAME_LINE_HEIGHT + NAME_LINE_OFF_Y;
+            aWinSize.Height() -= NAME_LINE_HEIGHT + NAME_LINE_OFF_Y;
         }
     }
     else
@@ -414,7 +392,7 @@ void ValueSet::Format()
     // consider offset and size, if NoneField does exist
     if ( nStyle & WB_NONEFIELD )
     {
-        nNoneHeight = nTxtHeight+nOff;
+        nNoneHeight = nTxtHeight + nOff;
         nNoneSpace = mnSpacing;
         if ( nStyle & WB_RADIOSEL )
             nNoneHeight += 8;
@@ -441,7 +419,7 @@ void ValueSet::Format()
     {
         if ( mnUserItemWidth )
         {
-            mnCols = (sal_uInt16)((aWinSize.Width()-nScrBarWidth+mnSpacing) / (mnUserItemWidth+mnSpacing));
+            mnCols = (sal_uInt16) ((aWinSize.Width() - nScrBarWidth + mnSpacing) / (mnUserItemWidth + mnSpacing));
             if ( !mnCols )
                 mnCols = 1;
         }
@@ -454,16 +432,16 @@ void ValueSet::Format()
     // calculate number of rows
     mbScroll = false;
     // Floor( (M+N-1)/N )==Ceiling( M/N )
-    mnLines = (static_cast<long>(nItemCount)+mnCols-1) / mnCols;
+    mnLines = (static_cast<long>(nItemCount) + mnCols - 1) / mnCols;
     if ( !mnLines )
         mnLines = 1;
 
-    long nCalcHeight = aWinSize.Height()-nNoneHeight;
+    long nCalcHeight = aWinSize.Height() - nNoneHeight;
     if ( mnUserVisLines )
         mnVisLines = mnUserVisLines;
     else if ( mnUserItemHeight )
     {
-        mnVisLines = (nCalcHeight-nNoneSpace+mnSpacing) / (mnUserItemHeight+mnSpacing);
+        mnVisLines = (nCalcHeight - nNoneSpace + mnSpacing) / (mnUserItemHeight + mnSpacing);
         if ( !mnVisLines )
             mnVisLines = 1;
     }
@@ -475,26 +453,26 @@ void ValueSet::Format()
         mnFirstLine = 0;
     else
     {
-        if ( mnFirstLine > (sal_uInt16)(mnLines-mnVisLines) )
-            mnFirstLine = (sal_uInt16)(mnLines-mnVisLines);
+        if ( mnFirstLine > (sal_uInt16)(mnLines - mnVisLines) )
+            mnFirstLine = (sal_uInt16)(mnLines - mnVisLines);
     }
 
     // calculate item size
-    const long nColSpace  = (mnCols-1)*mnSpacing;
-    const long nLineSpace = ((mnVisLines-1)*mnSpacing)+nNoneSpace;
+    const long nColSpace  = (mnCols - 1) * mnSpacing;
+    const long nLineSpace = ((mnVisLines - 1) * mnSpacing) + nNoneSpace;
     if ( mnUserItemWidth && !mnUserCols )
     {
         mnItemWidth = mnUserItemWidth;
-        if ( mnItemWidth > aWinSize.Width()-nScrBarWidth-nColSpace )
-            mnItemWidth = aWinSize.Width()-nScrBarWidth-nColSpace;
+        if ( mnItemWidth > aWinSize.Width() - nScrBarWidth-nColSpace )
+            mnItemWidth = aWinSize.Width() - nScrBarWidth-nColSpace;
     }
     else
-        mnItemWidth = (aWinSize.Width()-nScrBarWidth-nColSpace) / mnCols;
+        mnItemWidth = (aWinSize.Width() - nScrBarWidth-nColSpace) / mnCols;
     if ( mnUserItemHeight && !mnUserVisLines )
     {
         mnItemHeight = mnUserItemHeight;
-        if ( mnItemHeight > nCalcHeight-nNoneSpace )
-            mnItemHeight = nCalcHeight-nNoneSpace;
+        if ( mnItemHeight > nCalcHeight - nNoneSpace )
+            mnItemHeight = nCalcHeight - nNoneSpace;
     }
     else
     {
@@ -566,10 +544,10 @@ void ValueSet::Format()
         long nStartY;
         if ( mbFullMode )
         {
-            long nAllItemWidth = (mnItemWidth*mnCols)+nColSpace;
-            long nAllItemHeight = (mnItemHeight*mnVisLines)+nNoneHeight+nLineSpace;
-            nStartX = (aWinSize.Width()-nScrBarWidth-nAllItemWidth)/2;
-            nStartY = (aWinSize.Height()-nAllItemHeight)/2;
+            long nAllItemWidth = (mnItemWidth * mnCols) + nColSpace;
+            long nAllItemHeight = (mnItemHeight * mnVisLines) + nNoneHeight + nLineSpace;
+            nStartX = (aWinSize.Width() - nScrBarWidth - nAllItemWidth) / 2;
+            nStartY = (aWinSize.Height() - nAllItemHeight) / 2;
         }
         else
         {
@@ -593,8 +571,8 @@ void ValueSet::Format()
             mpNoneItem->mbVisible       = true;
             maNoneItemRect.Left()       = x;
             maNoneItemRect.Top()        = y;
-            maNoneItemRect.Right()      = maNoneItemRect.Left()+aWinSize.Width()-x-1;
-            maNoneItemRect.Bottom()     = y+nNoneHeight-1;
+            maNoneItemRect.Right()      = maNoneItemRect.Left() + aWinSize.Width() - x - 1;
+            maNoneItemRect.Bottom()     = y+nNoneHeight - 1;
 
             ImplFormatItem( mpNoneItem, maNoneItemRect );
 
@@ -607,36 +585,36 @@ void ValueSet::Format()
 
         maItemListRect.Left() = x;
         maItemListRect.Top() = y;
-        maItemListRect.Right() = x + mnCols*(mnItemWidth+mnSpacing) - mnSpacing - 1;
-        maItemListRect.Bottom() = y + mnVisLines*(mnItemHeight+mnSpacing) - mnSpacing - 1;
+        maItemListRect.Right() = x + mnCols * (mnItemWidth + mnSpacing) - mnSpacing - 1;
+        maItemListRect.Bottom() = y + mnVisLines * (mnItemHeight + mnSpacing) - mnSpacing - 1;
 
         if ( !mbFullMode )
         {
             // If want also draw parts of items in the last line,
             // then we add one more line if parts of these line are
             // visible
-            if ( y+(mnVisLines*(mnItemHeight+mnSpacing)) < aWinSize.Height() )
+            if ( y + (mnVisLines * (mnItemHeight + mnSpacing)) < aWinSize.Height() )
                 nLastItem += mnCols;
             maItemListRect.Bottom() = aWinSize.Height() - y;
         }
         for ( size_t i = 0; i < nItemCount; i++ )
         {
-            ValueSetItem *const pItem = mItemList[i];
+            ValueSetItem* pItem = mItemList[i];
 
             if ( (i >= nFirstItem) && (i < nLastItem) )
             {
                 if( !pItem->mbVisible && ImplHasAccessibleListeners() )
                 {
-                    ::com::sun::star::uno::Any aOldAny, aNewAny;
+                    css::uno::Any aOldAny, aNewAny;
 
                     aNewAny <<= pItem->GetAccessible( mbIsTransientChildrenDisabled );
-                    ImplFireAccessibleEvent( ::com::sun::star::accessibility::AccessibleEventId::CHILD, aOldAny, aNewAny );
+                    ImplFireAccessibleEvent( css::accessibility::AccessibleEventId::CHILD, aOldAny, aNewAny );
                 }
 
                 pItem->mbVisible = true;
-                ImplFormatItem( pItem, Rectangle( Point(x,y), Size(mnItemWidth, mnItemHeight) ) );
+                ImplFormatItem( pItem, Rectangle( Point(x, y), Size(mnItemWidth, mnItemHeight) ) );
 
-                if ( !((i+1) % mnCols) )
+                if ( !((i + 1) % mnCols) )
                 {
                     x = nStartX;
                     y += mnItemHeight+mnSpacing;
@@ -648,10 +626,10 @@ void ValueSet::Format()
             {
                 if( pItem->mbVisible && ImplHasAccessibleListeners() )
                 {
-                    ::com::sun::star::uno::Any aOldAny, aNewAny;
+                    css::uno::Any aOldAny, aNewAny;
 
                     aOldAny <<= pItem->GetAccessible( mbIsTransientChildrenDisabled );
-                    ImplFireAccessibleEvent( ::com::sun::star::accessibility::AccessibleEventId::CHILD, aOldAny, aNewAny );
+                    ImplFireAccessibleEvent( css::accessibility::AccessibleEventId::CHILD, aOldAny, aNewAny );
                 }
 
                 pItem->mbVisible = false;
@@ -661,13 +639,13 @@ void ValueSet::Format()
         // arrange ScrollBar, set values and show it
         if ( mpScrBar )
         {
-            Point   aPos( aWinSize.Width()-nScrBarWidth+SCRBAR_OFFSET, 0 );
-            Size    aSize( nScrBarWidth-SCRBAR_OFFSET, aWinSize.Height() );
+            Point   aPos( aWinSize.Width() - nScrBarWidth + SCRBAR_OFFSET, 0 );
+            Size    aSize( nScrBarWidth - SCRBAR_OFFSET, aWinSize.Height() );
             // If a none field is visible, then we center the scrollbar
             if ( nStyle & WB_NONEFIELD )
             {
-                aPos.Y() = nStartY+nNoneHeight+1;
-                aSize.Height() = ((mnItemHeight+mnSpacing)*mnVisLines)-2-mnSpacing;
+                aPos.Y() = nStartY + nNoneHeight + 1;
+                aSize.Height() = ((mnItemHeight + mnSpacing) * mnVisLines) - 2 - mnSpacing;
             }
             mpScrBar->SetPosSizePixel( aPos, aSize );
             mpScrBar->SetRangeMax( mnLines );
@@ -688,8 +666,6 @@ void ValueSet::Format()
     delete pDelScrBar;
 }
 
-
-
 void ValueSet::ImplDrawItemText(const OUString& rText)
 {
     if ( !(GetStyle() & WB_NAMEFIELD) )
@@ -713,11 +689,9 @@ void ValueSet::ImplDrawItemText(const OUString& rText)
         nTxtOffset += NAME_LINE_HEIGHT+NAME_LINE_OFF_Y;
         Erase( Rectangle( Point( 0, nTxtOffset ), Point( aWinSize.Width(), aWinSize.Height() ) ) );
     }
-    DrawText( Point( (aWinSize.Width()-nTxtWidth) / 2, nTxtOffset+(NAME_OFFSET/2) ), rText );
+    DrawText( Point( (aWinSize.Width() - nTxtWidth) / 2, nTxtOffset + (NAME_OFFSET / 2) ), rText );
 }
 
-
-
 void ValueSet::ImplDrawSelect()
 {
     if ( !IsReallyVisible() )
@@ -739,8 +713,6 @@ void ValueSet::ImplDrawSelect()
     }
 }
 
-
-
 void ValueSet::ImplDrawSelect( sal_uInt16 nItemId, const bool bFocus, const bool bDrawSel )
 {
     ValueSetItem* pItem;
@@ -810,10 +782,10 @@ void ValueSet::ImplDrawSelect( sal_uInt16 nItemId, const bool bFocus, const bool
         }
         else if ( nStyle & WB_RADIOSEL )
         {
-            aRect.Left()    += 3;
-            aRect.Top()     += 3;
-            aRect.Right()   -= 3;
-            aRect.Bottom()  -= 3;
+            aRect.Left()   += 3;
+            aRect.Top()    += 3;
+            aRect.Right()  -= 3;
+            aRect.Bottom() -= 3;
             if ( nStyle & WB_DOUBLEBORDER )
             {
                 aRect.Left()++;
@@ -900,8 +872,6 @@ void ValueSet::ImplDrawSelect( sal_uInt16 nItemId, const bool bFocus, const bool
     }
 }
 
-
-
 void ValueSet::ImplHideSelect( sal_uInt16 nItemId )
 {
     Rectangle aRect;
@@ -930,8 +900,6 @@ void ValueSet::ImplHideSelect( sal_uInt16 nItemId )
     DrawOutDev( aPos, aSize, aPos, aSize, maVirDev );
 }
 
-
-
 void ValueSet::ImplHighlightItem( sal_uInt16 nItemId, bool bIsSelection )
 {
     if ( mnHighItemId != nItemId )
@@ -951,8 +919,6 @@ void ValueSet::ImplHighlightItem( sal_uInt16 nItemId, bool bIsSelection )
     }
 }
 
-
-
 void ValueSet::ImplDraw()
 {
     if ( mbFormat )
@@ -971,12 +937,12 @@ void ValueSet::ImplDraw()
         Size    aTempSize( aSize.Width(), aScrPos.Y() );
 
         DrawOutDev( aDefPos, aTempSize, aDefPos, aTempSize, maVirDev );
-        aTempSize.Width()   = aScrPos.X()-1;
+        aTempSize.Width()   = aScrPos.X() - 1;
         aTempSize.Height()  = aScrSize.Height();
         DrawOutDev( aTempPos, aTempSize, aTempPos, aTempSize, maVirDev );
-        aTempPos.Y()        = aScrPos.Y()+aScrSize.Height();
+        aTempPos.Y()        = aScrPos.Y() + aScrSize.Height();
         aTempSize.Width()   = aSize.Width();
-        aTempSize.Height()  = aSize.Height()-aTempPos.Y();
+        aTempSize.Height()  = aSize.Height() - aTempPos.Y();
         DrawOutDev( aTempPos, aTempSize, aTempPos, aTempSize, maVirDev );
     }
     else
@@ -990,7 +956,7 @@ void ValueSet::ImplDraw()
             const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
             Size aWinSize = GetOutputSizePixel();
             Point aPos1( NAME_LINE_OFF_X, mnTextOffset+NAME_LINE_OFF_Y );
-            Point aPos2( aWinSize.Width()-(NAME_LINE_OFF_X*2), mnTextOffset+NAME_LINE_OFF_Y );
+            Point aPos2( aWinSize.Width() - (NAME_LINE_OFF_X * 2), mnTextOffset + NAME_LINE_OFF_Y );
             if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) )
             {
                 SetLineColor( rStyleSettings.GetShadowColor() );
@@ -1008,8 +974,6 @@ void ValueSet::ImplDraw()
     ImplDrawSelect();
 }
 
-
-
 bool ValueSet::ImplScroll( const Point& rPos )
 {
     if ( !mbScroll || !maItemListRect.IsInside(rPos) )
@@ -1043,8 +1007,6 @@ bool ValueSet::ImplScroll( const Point& rPos )
     return true;
 }
 
-
-
 size_t ValueSet::ImplGetItem( const Point& rPos, bool bMove ) const
 {
     if ( !mbHasVisibleItems )
@@ -1059,19 +1021,19 @@ size_t ValueSet::ImplGetItem( const Point& rPos, bool bMove ) const
 
     if ( maItemListRect.IsInside( rPos ) )
     {
-        const int xc = rPos.X()-maItemListRect.Left();
-        const int yc = rPos.Y()-maItemListRect.Top();
+        const int xc = rPos.X() - maItemListRect.Left();
+        const int yc = rPos.Y() - maItemListRect.Top();
         // The point is inside the area of item list,
         // let's find the containing item.
-        const int col = xc/(mnItemWidth+mnSpacing);
-        const int x = xc%(mnItemWidth+mnSpacing);
-        const int row = yc/(mnItemHeight+mnSpacing);
-        const int y = yc%(mnItemHeight+mnSpacing);
+        const int col = xc / (mnItemWidth + mnSpacing);
+        const int x = xc % (mnItemWidth + mnSpacing);
+        const int row = yc / (mnItemHeight + mnSpacing);
+        const int y = yc % (mnItemHeight + mnSpacing);
 
         if (x<mnItemWidth && y<mnItemHeight)
         {
             // the point is inside item rect and not inside spacing
-            const size_t item = (mnFirstLine+row)*mnCols+col;
+            const size_t item = (mnFirstLine + row) * mnCols + col;
             if (item < mItemList.size())
             {
                 return item;
@@ -1089,8 +1051,6 @@ size_t ValueSet::ImplGetItem( const Point& rPos, bool bMove ) const
     return VALUESET_ITEM_NOTFOUND;
 }
 
-
-
 ValueSetItem* ValueSet::ImplGetItem( size_t nPos )
 {
     if ( nPos == VALUESET_ITEM_NONEITEM )
@@ -1099,15 +1059,11 @@ ValueSetItem* ValueSet::ImplGetItem( size_t nPos )
         return ( nPos < mItemList.size() ) ? mItemList[nPos] : NULL;
 }
 
-
-
 ValueSetItem* ValueSet::ImplGetFirstItem()
 {
     return mItemList.size() ? mItemList[0] : NULL;
 }
 
-
-
 sal_uInt16 ValueSet::ImplGetVisibleItemCount() const
 {
     sal_uInt16 nRet = 0;
@@ -1122,9 +1078,7 @@ sal_uInt16 ValueSet::ImplGetVisibleItemCount() const
     return nRet;
 }
 
-
-
-void ValueSet::ImplFireAccessibleEvent( short nEventId, const ::com::sun::star::uno::Any& rOldValue, const ::com::sun::star::uno::Any& rNewValue )
+void ValueSet::ImplFireAccessibleEvent( short nEventId, const css::uno::Any& rOldValue, const css::uno::Any& rNewValue )
 {
     ValueSetAcc* pAcc = ValueSetAcc::getImplementation( GetAccessible( false ) );
 
@@ -1132,16 +1086,12 @@ void ValueSet::ImplFireAccessibleEvent( short nEventId, const ::com::sun::star::
         pAcc->FireAccessibleEvent( nEventId, rOldValue, rNewValue );
 }
 
-
-
 bool ValueSet::ImplHasAccessibleListeners()
 {
     ValueSetAcc* pAcc = ValueSetAcc::getImplementation( GetAccessible( false ) );
     return( pAcc && pAcc->HasAccessibleListeners() );
 }
 
-
-
 IMPL_LINK( ValueSet,ImplScrollHdl, ScrollBar*, pScrollBar )
 {
     sal_uInt16 nNewFirstLine = (sal_uInt16)pScrollBar->GetThumbPos();
@@ -1154,16 +1104,12 @@ IMPL_LINK( ValueSet,ImplScrollHdl, ScrollBar*, pScrollBar )
     return 0;
 }
 
-
-
 IMPL_LINK_NOARG(ValueSet, ImplTimerHdl)
 {
     ImplTracking( GetPointerPosPixel(), true );
     return 0;
 }
 
-
-
 void ValueSet::ImplTracking( const Point& rPos, bool bRepeat )
 {
     if ( bRepeat || mbSelection )
@@ -1196,8 +1142,6 @@ void ValueSet::ImplTracking( const Point& rPos, bool bRepeat )
     }
 }
 
-
-
 void ValueSet::ImplEndTracking( const Point& rPos, bool bCancel )
 {
     ValueSetItem* pItem;
@@ -1225,13 +1169,11 @@ void ValueSet::ImplEndTracking( const Point& rPos, bool bCancel )
     }
 }
 
-
-
-void ValueSet::MouseButtonDown( const MouseEvent& rMEvt )
+void ValueSet::MouseButtonDown( const MouseEvent& rMouseEvent )
 {
-    if ( rMEvt.IsLeft() )
+    if ( rMouseEvent.IsLeft() )
     {
-        ValueSetItem* pItem = ImplGetItem( ImplGetItem( rMEvt.GetPosPixel() ) );
+        ValueSetItem* pItem = ImplGetItem( ImplGetItem( rMouseEvent.GetPosPixel() ) );
         if ( mbSelection )
         {
             mbHighlight = true;
@@ -1245,16 +1187,16 @@ void ValueSet::MouseButtonDown( const MouseEvent& rMEvt )
         }
         else
         {
-            if ( pItem && !rMEvt.IsMod2() )
+            if ( pItem && !rMouseEvent.IsMod2() )
             {
-                if ( rMEvt.GetClicks() == 1 )
+                if ( rMouseEvent.GetClicks() == 1 )
                 {
                     mbHighlight  = true;
                     mnHighItemId = mnSelItemId;
                     ImplHighlightItem( pItem->mnId );
                     StartTracking( STARTTRACK_SCROLLREPEAT );
                 }
-                else if ( rMEvt.GetClicks() == 2 )
+                else if ( rMouseEvent.GetClicks() == 2 )
                     DoubleClick();
 
                 return;
@@ -1262,51 +1204,43 @@ void ValueSet::MouseButtonDown( const MouseEvent& rMEvt )
         }
     }
 
-    Control::MouseButtonDown( rMEvt );
+    Control::MouseButtonDown( rMouseEvent );
 }
 
-
-
-void ValueSet::MouseButtonUp( const MouseEvent& rMEvt )
+void ValueSet::MouseButtonUp( const MouseEvent& rMouseEvent )
 {
     // because of SelectionMode
-    if ( rMEvt.IsLeft() && mbSelection )
-        ImplEndTracking( rMEvt.GetPosPixel(), false );
+    if ( rMouseEvent.IsLeft() && mbSelection )
+        ImplEndTracking( rMouseEvent.GetPosPixel(), false );
     else
-        Control::MouseButtonUp( rMEvt );
+        Control::MouseButtonUp( rMouseEvent );
 }
 
-
-
-void ValueSet::MouseMove( const MouseEvent& rMEvt )
+void ValueSet::MouseMove( const MouseEvent& rMouseEvent )
 {
     // because of SelectionMode
     if ( mbSelection || (GetStyle() & WB_MENUSTYLEVALUESET) )
-        ImplTracking( rMEvt.GetPosPixel(), false );
-    Control::MouseMove( rMEvt );
+        ImplTracking( rMouseEvent.GetPosPixel(), false );
+    Control::MouseMove( rMouseEvent );
 }
 
-
-
-void ValueSet::Tracking( const TrackingEvent& rTEvt )
+void ValueSet::Tracking( const TrackingEvent& rTrackingEvent )
 {
-    Point aMousePos = rTEvt.GetMouseEvent().GetPosPixel();
+    Point aMousePos = rTrackingEvent.GetMouseEvent().GetPosPixel();
 
-    if ( rTEvt.IsTrackingEnded() )
-        ImplEndTracking( aMousePos, rTEvt.IsTrackingCanceled() );
+    if ( rTrackingEvent.IsTrackingEnded() )
+        ImplEndTracking( aMousePos, rTrackingEvent.IsTrackingCanceled() );
     else
-        ImplTracking( aMousePos, rTEvt.IsTrackingRepeat() );
+        ImplTracking( aMousePos, rTrackingEvent.IsTrackingRepeat() );
 }
 
-
-
-void ValueSet::KeyInput( const KeyEvent& rKEvt )
+void ValueSet::KeyInput( const KeyEvent& rKeyEvent )
 {
     size_t nLastItem = mItemList.size();
 
     if ( !nLastItem || !ImplGetFirstItem() )
     {
-        Control::KeyInput( rKEvt );
+        Control::KeyInput( rKeyEvent );
         return;
     }
 
@@ -1319,7 +1253,7 @@ void ValueSet::KeyInput( const KeyEvent& rKEvt )
     size_t nItemPos = VALUESET_ITEM_NOTFOUND;
     size_t nVStep = mnCols;
 
-    switch ( rKEvt.GetKeyCode().GetCode() )
+    switch ( rKeyEvent.GetKeyCode().GetCode() )
     {
         case KEY_HOME:
             nItemPos = mpNoneItem ? VALUESET_ITEM_NONEITEM : 0;
@@ -1358,9 +1292,9 @@ void ValueSet::KeyInput( const KeyEvent& rKEvt )
             break;
 
         case KEY_PAGEUP:
-            if (rKEvt.GetKeyCode().IsShift() || rKEvt.GetKeyCode().IsMod1() || rKEvt.GetKeyCode().IsMod2())
+            if (rKeyEvent.GetKeyCode().IsShift() || rKeyEvent.GetKeyCode().IsMod1() || rKeyEvent.GetKeyCode().IsMod2())
             {
-                Control::KeyInput( rKEvt );
+                Control::KeyInput( rKeyEvent );
                 return;
             }
             nVStep *= mnVisLines;
@@ -1395,9 +1329,9 @@ void ValueSet::KeyInput( const KeyEvent& rKEvt )
             break;
 
         case KEY_PAGEDOWN:
-            if (rKEvt.GetKeyCode().IsShift() || rKEvt.GetKeyCode().IsMod1() || rKEvt.GetKeyCode().IsMod2())
+            if (rKeyEvent.GetKeyCode().IsShift() || rKeyEvent.GetKeyCode().IsMod1() || rKeyEvent.GetKeyCode().IsMod2())
             {
-                Control::KeyInput( rKEvt );
+                Control::KeyInput( rKeyEvent );
                 return;
             }
             nVStep *= mnVisLines;
@@ -1428,7 +1362,7 @@ void ValueSet::KeyInput( const KeyEvent& rKEvt )
             }
             // intentional fall-through
         default:
-            Control::KeyInput( rKEvt );
+            Control::KeyInput( rKeyEvent );
             return;
     }
 
@@ -1457,23 +1391,19 @@ void ValueSet::KeyInput( const KeyEvent& rKEvt )
     }
 }
 
-
-
-void ValueSet::Command( const CommandEvent& rCEvt )
+void ValueSet::Command( const CommandEvent& rCommandEvent )
 {
-    if ( (rCEvt.GetCommand() == COMMAND_WHEEL) ||
-         (rCEvt.GetCommand() == COMMAND_STARTAUTOSCROLL) ||
-         (rCEvt.GetCommand() == COMMAND_AUTOSCROLL) )
+    if ( rCommandEvent.GetCommand() == COMMAND_WHEEL ||
+         rCommandEvent.GetCommand() == COMMAND_STARTAUTOSCROLL ||
+         rCommandEvent.GetCommand() == COMMAND_AUTOSCROLL )
     {
-        if ( HandleScrollCommand( rCEvt, NULL, mpScrBar ) )
+        if ( HandleScrollCommand( rCommandEvent, NULL, mpScrBar ) )
             return;
     }
 
-    Control::Command( rCEvt );
+    Control::Command( rCommandEvent );
 }
 
-
-
 void ValueSet::Paint( const Rectangle& )
 {
     if ( GetStyle() & WB_FLATVALUESET )
@@ -1489,8 +1419,6 @@ void ValueSet::Paint( const Rectangle& )
     ImplDraw();
 }
 
-
-
 void ValueSet::GetFocus()
 {
     OSL_TRACE ("value set getting focus");
@@ -1503,8 +1431,6 @@ void ValueSet::GetFocus()
         pAcc->GetFocus();
 }
 
-
-
 void ValueSet::LoseFocus()
 {
     OSL_TRACE ("value set losing focus");
@@ -1520,8 +1446,6 @@ void ValueSet::LoseFocus()
         pAcc->LoseFocus();
 }
 
-
-
 void ValueSet::Resize()
 {
     mbFormat = true;
@@ -1530,13 +1454,11 @@ void ValueSet::Resize()
     Control::Resize();
 }
 
-
-
-void ValueSet::RequestHelp( const HelpEvent& rHEvt )
+void ValueSet::RequestHelp( const HelpEvent& rHelpEvent )
 {
-    if ( (rHEvt.GetMode() & (HELPMODE_QUICK | HELPMODE_BALLOON)) == HELPMODE_QUICK )
+    if ( (rHelpEvent.GetMode() & (HELPMODE_QUICK | HELPMODE_BALLOON)) == HELPMODE_QUICK )
     {
-        Point aPos = ScreenToOutputPixel( rHEvt.GetMousePosPixel() );
+        Point aPos = ScreenToOutputPixel( rHelpEvent.GetMousePosPixel() );
         size_t nItemPos = ImplGetItem( aPos );
         if ( nItemPos != VALUESET_ITEM_NOTFOUND )
         {
@@ -1552,11 +1474,9 @@ void ValueSet::RequestHelp( const HelpEvent& rHEvt )
         }
     }
 
-    Control::RequestHelp( rHEvt );
+    Control::RequestHelp( rHelpEvent );
 }
 
-
-
 void ValueSet::StateChanged( StateChangedType nType )
 {
     Control::StateChanged( nType );
@@ -1603,17 +1523,15 @@ void ValueSet::StateChanged( StateChangedType nType )
     }
 }
 
-
-
-void ValueSet::DataChanged( const DataChangedEvent& rDCEvt )
+void ValueSet::DataChanged( const DataChangedEvent& rDataChangedEvent )
 {
-    Control::DataChanged( rDCEvt );
+    Control::DataChanged( rDataChangedEvent );
 
-    if ( (rDCEvt.GetType() == DATACHANGED_FONTS) ||
-         (rDCEvt.GetType() == DATACHANGED_DISPLAY) ||
-         (rDCEvt.GetType() == DATACHANGED_FONTSUBSTITUTION) ||
-         ((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
-          (rDCEvt.GetFlags() & SETTINGS_STYLE)) )
+    if ( rDataChangedEvent.GetType() == DATACHANGED_FONTS ||
+         rDataChangedEvent.GetType() == DATACHANGED_DISPLAY ||
+         rDataChangedEvent.GetType() == DATACHANGED_FONTSUBSTITUTION ||
+         (rDataChangedEvent.GetType() == DATACHANGED_SETTINGS &&
+          rDataChangedEvent.GetFlags() & SETTINGS_STYLE) )
     {
         mbFormat = true;
         ImplInitSettings( true, true, true );
@@ -1621,28 +1539,20 @@ void ValueSet::DataChanged( const DataChangedEvent& rDCEvt )
     }
 }
 
-
-
 void ValueSet::Select()
 {
     maSelectHdl.Call( this );
 }
 
-
-
 void ValueSet::DoubleClick()
 {
     maDoubleClickHdl.Call( this );
 }
 
-
-
 void ValueSet::UserDraw( const UserDrawEvent& )
 {
 }
 
-
-
 void ValueSet::InsertItem( sal_uInt16 nItemId, const Image& rImage, size_t nPos )
 {
     ValueSetItem* pItem = new ValueSetItem( *this );
@@ -1652,8 +1562,6 @@ void ValueSet::InsertItem( sal_uInt16 nItemId, const Image& rImage, size_t nPos
     ImplInsertItem( pItem, nPos );
 }
 
-
-
 void ValueSet::InsertItem( sal_uInt16 nItemId, const Color& rColor, size_t nPos )
 {
     ValueSetItem* pItem = new ValueSetItem( *this );
@@ -1663,8 +1571,6 @@ void ValueSet::InsertItem( sal_uInt16 nItemId, const Color& rColor, size_t nPos
     ImplInsertItem( pItem, nPos );
 }
 
-
-
 void ValueSet::InsertItem( sal_uInt16 nItemId, const Image& rImage,
                            const OUString& rText, size_t nPos )
 {
@@ -1676,8 +1582,6 @@ void ValueSet::InsertItem( sal_uInt16 nItemId, const Image& rImage,
     ImplInsertItem( pItem, nPos );
 }
 
-
-
 void ValueSet::InsertItem( sal_uInt16 nItemId, const Color& rColor,
                            const OUString& rText, size_t nPos )
 {
@@ -1689,8 +1593,6 @@ void ValueSet::InsertItem( sal_uInt16 nItemId, const Color& rColor,
     ImplInsertItem( pItem, nPos );
 }
 
-
-
 void ValueSet::InsertItem( sal_uInt16 nItemId, size_t nPos )
 {
     ValueSetItem* pItem = new ValueSetItem( *this );
@@ -1699,8 +1601,6 @@ void ValueSet::InsertItem( sal_uInt16 nItemId, size_t nPos )
     ImplInsertItem( pItem, nPos );
 }
 
-
-
 void ValueSet::ImplInsertItem( ValueSetItem *const pItem, const size_t nPos )
 {
     DBG_ASSERT( pItem->mnId, "ValueSet::InsertItem(): ItemId == 0" );
@@ -1722,8 +1622,6 @@ void ValueSet::ImplInsertItem( ValueSetItem *const pItem, const size_t nPos )
         Invalidate();
 }
 
-
-
 Rectangle ValueSet::ImplGetItemRect( size_t nPos ) const
 {
     const size_t nVisibleBegin = static_cast<size_t>(mnFirstLine)*mnCols;
@@ -1744,8 +1642,6 @@ Rectangle ValueSet::ImplGetItemRect( size_t nPos ) const
     return Rectangle( Point(x, y), Size(mnItemWidth, mnItemHeight) );
 }
 
-
-
 void ValueSet::RemoveItem( sal_uInt16 nItemId )
 {
     size_t nPos = GetItemPos( nItemId );
@@ -1776,8 +1672,6 @@ void ValueSet::RemoveItem( sal_uInt16 nItemId )
         Invalidate();
 }
 
-
-
 void ValueSet::Clear()
 {
     ImplDeleteItems();
@@ -1794,15 +1688,11 @@ void ValueSet::Clear()
         Invalidate();
 }
 
-
-
 size_t ValueSet::GetItemCount() const
 {
     return mItemList.size();
 }
 
-
-
 size_t ValueSet::GetItemPos( sal_uInt16 nItemId ) const
 {
     for ( size_t i = 0, n = mItemList.size(); i < n; ++i ) {
@@ -1813,15 +1703,11 @@ size_t ValueSet::GetItemPos( sal_uInt16 nItemId ) const
     return VALUESET_ITEM_NOTFOUND;
 }
 
-
-
 sal_uInt16 ValueSet::GetItemId( size_t nPos ) const
 {
     return ( nPos < mItemList.size() ) ? mItemList[nPos]->mnId : 0 ;
 }
 
-
-
 sal_uInt16 ValueSet::GetItemId( const Point& rPos ) const
 {
     size_t nItemPos = ImplGetItem( rPos );
@@ -1831,8 +1717,6 @@ sal_uInt16 ValueSet::GetItemId( const Point& rPos ) const
     return 0;
 }
 
-
-
 Rectangle ValueSet::GetItemRect( sal_uInt16 nItemId ) const
 {
     const size_t nPos = GetItemPos( nItemId );
@@ -1843,15 +1727,11 @@ Rectangle ValueSet::GetItemRect( sal_uInt16 nItemId ) const
     return Rectangle();
 }
 
-
-
 void ValueSet::EnableFullItemMode( bool bFullMode )
 {
     mbFullMode = bFullMode;
 }
 
-
-
 void ValueSet::SetColCount( sal_uInt16 nNewCols )
 {
     if ( mnUserCols != nNewCols )
@@ -1864,8 +1744,6 @@ void ValueSet::SetColCount( sal_uInt16 nNewCols )
     }
 }
 
-
-
 void ValueSet::SetLineCount( sal_uInt16 nNewLines )
 {
     if ( mnUserVisLines != nNewLines )
@@ -1878,8 +1756,6 @@ void ValueSet::SetLineCount( sal_uInt16 nNewLines )
     }
 }
 
-
-
 void ValueSet::SetItemWidth( long nNewItemWidth )
 {
     if ( mnUserItemWidth != nNewItemWidth )
@@ -1905,8 +1781,6 @@ void ValueSet::InsertItem( sal_uInt16 nItemId, const OUString& rText, size_t nPo
     ImplInsertItem( pItem, nPos );
 }
 
-
-
 void ValueSet::SetItemHeight( long nNewItemHeight )
 {
     if ( mnUserItemHeight != nNewItemHeight )
@@ -1919,8 +1793,6 @@ void ValueSet::SetItemHeight( long nNewItemHeight )
     }
 }
 
-
-
 void ValueSet::SelectItem( sal_uInt16 nItemId )
 {
     size_t nItemPos = 0;
@@ -1987,17 +1859,17 @@ void ValueSet::SelectItem( sal_uInt16 nItemId )
 
                     if( pItemAcc )
                     {
-                        ::com::sun::star::uno::Any aOldAny, aNewAny;
+                        css::uno::Any aOldAny, aNewAny;
                         if( !mbIsTransientChildrenDisabled )
                         {
-                            aOldAny <<= ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >(
-                                static_cast< ::cppu::OWeakObject* >( pItemAcc ));
-                            ImplFireAccessibleEvent (::com::sun::star::accessibility::AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, aOldAny, aNewAny );
+                            aOldAny <<= css::uno::Reference< css::uno::XInterface >(
+                                static_cast< cppu::OWeakObject* >( pItemAcc ));
+                            ImplFireAccessibleEvent (css::accessibility::AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, aOldAny, aNewAny );
                         }
                         else
                         {
-                            aOldAny <<= ::com::sun::star::accessibility::AccessibleStateType::FOCUSED;
-                            pItemAcc->FireAccessibleEvent( ::com::sun::star::accessibility::AccessibleEventId::STATE_CHANGED, aOldAny, aNewAny );
+                            aOldAny <<= css::accessibility::AccessibleStateType::FOCUSED;
+                            pItemAcc->FireAccessibleEvent( css::accessibility::AccessibleEventId::STATE_CHANGED, aOldAny, aNewAny );
                         }
                     }
                 }
@@ -2018,30 +1890,28 @@ void ValueSet::SelectItem( sal_uInt16 nItemId )
 
             if( pItemAcc )
             {
-                ::com::sun::star::uno::Any aOldAny, aNewAny;
+                css::uno::Any aOldAny, aNewAny;
                 if( !mbIsTransientChildrenDisabled )
                 {
-                    aNewAny <<= ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >(
-                        static_cast< ::cppu::OWeakObject* >( pItemAcc ));
-                    ImplFireAccessibleEvent( ::com::sun::star::accessibility::AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, aOldAny, aNewAny );
+                    aNewAny <<= css::uno::Reference< css::uno::XInterface >(
+                        static_cast< cppu::OWeakObject* >( pItemAcc ));
+                    ImplFireAccessibleEvent( css::accessibility::AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, aOldAny, aNewAny );
                 }
                 else
                 {
-                    aNewAny <<= ::com::sun::star::accessibility::AccessibleStateType::FOCUSED;
-                    pItemAcc->FireAccessibleEvent( ::com::sun::star::accessibility::AccessibleEventId::STATE_CHANGED, aOldAny, aNewAny );
+                    aNewAny <<= css::accessibility::AccessibleStateType::FOCUSED;
+                    pItemAcc->FireAccessibleEvent( css::accessibility::AccessibleEventId::STATE_CHANGED, aOldAny, aNewAny );
                 }
             }
 
             // selection event
-            ::com::sun::star::uno::Any aOldAny, aNewAny;
-            ImplFireAccessibleEvent( ::com::sun::star::accessibility::AccessibleEventId::SELECTION_CHANGED, aOldAny, aNewAny );
+            css::uno::Any aOldAny, aNewAny;
+            ImplFireAccessibleEvent( css::accessibility::AccessibleEventId::SELECTION_CHANGED, aOldAny, aNewAny );
         }
         maHighlightHdl.Call(this);
     }
 }
 
-
-
 void ValueSet::SetNoSelection()
 {
     mbNoSelection   = true;
@@ -2052,8 +1922,6 @@ void ValueSet::SetNoSelection()
         ImplDraw();
 }
 
-
-
 void ValueSet::SetItemImage( sal_uInt16 nItemId, const Image& rImage )
 {
     size_t nPos = GetItemPos( nItemId );
@@ -2075,8 +1943,6 @@ void ValueSet::SetItemImage( sal_uInt16 nItemId, const Image& rImage )
         mbFormat = true;
 }
 
-
-
 Image ValueSet::GetItemImage( sal_uInt16 nItemId ) const
 {
     size_t nPos = GetItemPos( nItemId );
@@ -2087,8 +1953,6 @@ Image ValueSet::GetItemImage( sal_uInt16 nItemId ) const
         return Image();
 }
 
-
-
 void ValueSet::SetItemColor( sal_uInt16 nItemId, const Color& rColor )
 {
     size_t nPos = GetItemPos( nItemId );
@@ -2110,8 +1974,6 @@ void ValueSet::SetItemColor( sal_uInt16 nItemId, const Color& rColor )
         mbFormat = true;
 }
 
-
-
 Color ValueSet::GetItemColor( sal_uInt16 nItemId ) const
 {
     size_t nPos = GetItemPos( nItemId );
@@ -2122,8 +1984,6 @@ Color ValueSet::GetItemColor( sal_uInt16 nItemId ) const
         return Color();
 }
 
-
-
 void ValueSet::SetItemData( sal_uInt16 nItemId, void* pData )
 {
     size_t nPos = GetItemPos( nItemId );
@@ -2147,8 +2007,6 @@ void ValueSet::SetItemData( sal_uInt16 nItemId, void* pData )
     }
 }
 
-
-
 void* ValueSet::GetItemData( sal_uInt16 nItemId ) const
 {
     size_t nPos = GetItemPos( nItemId );
@@ -2159,8 +2017,6 @@ void* ValueSet::GetItemData( sal_uInt16 nItemId ) const
         return NULL;
 }
 
-
-
 void ValueSet::SetItemText(sal_uInt16 nItemId, const OUString& rText)
 {
     size_t nPos = GetItemPos( nItemId );
@@ -2172,7 +2028,7 @@ void ValueSet::SetItemText(sal_uInt16 nItemId, const OUString& rText)
     ValueSetItem* pItem = mItemList[nPos];
 
     // Remember old and new name for accessibility event.
-    ::com::sun::star::uno::Any aOldName, aNewName;
+    css::uno::Any aOldName, aNewName;
     OUString sString (pItem->maText);
     aOldName <<= sString;
     sString = rText;
@@ -2193,17 +2049,15 @@ void ValueSet::SetItemText(sal_uInt16 nItemId, const OUString& rText)
 
     if (ImplHasAccessibleListeners())
     {
-        ::com::sun::star::uno::Reference<
-              ::com::sun::star::accessibility::XAccessible> xAccessible (
+        css::uno::Reference<
+              css::accessibility::XAccessible> xAccessible (
                   pItem->GetAccessible( mbIsTransientChildrenDisabled ) );
         static_cast<ValueItemAcc*>(xAccessible.get())->FireAccessibleEvent (
-            ::com::sun::star::accessibility::AccessibleEventId::NAME_CHANGED,
+            css::accessibility::AccessibleEventId::NAME_CHANGED,
             aOldName, aNewName);
     }
 }
 
-
-
 OUString ValueSet::GetItemText( sal_uInt16 nItemId ) const
 {
     size_t nPos = GetItemPos( nItemId );
@@ -2214,18 +2068,14 @@ OUString ValueSet::GetItemText( sal_uInt16 nItemId ) const
     return OUString();
 }
 
-
-
 void ValueSet::SetColor( const Color& rColor )
 {
-    maColor     = rColor;
-    mbFormat    = true;
+    maColor  = rColor;
+    mbFormat = true;
     if ( IsReallyVisible() && IsUpdateMode() )
         ImplDraw();
 }
 
-
-
 void ValueSet::SetExtraSpacing( sal_uInt16 nNewSpacing )
 {
     if ( GetStyle() & WB_ITEMBORDER )
@@ -2239,17 +2089,13 @@ void ValueSet::SetExtraSpacing( sal_uInt16 nNewSpacing )
     }
 }
 
-
-
 void ValueSet::StartSelection()
 {
-    mbHighlight     = true;
-    mbSelection     = true;
-    mnHighItemId    = mnSelItemId;
+    mbHighlight  = true;
+    mbSelection  = true;
+    mnHighItemId = mnSelItemId;
 }
 
-
-
 void ValueSet::EndSelection()
 {
     if ( mbHighlight )
@@ -2263,11 +2109,9 @@ void ValueSet::EndSelection()
     mbSelection = false;
 }
 
-
-
-bool ValueSet::StartDrag( const CommandEvent& rCEvt, Region& rRegion )
+bool ValueSet::StartDrag( const CommandEvent& rEvent, Region& rRegion )
 {
-    if ( rCEvt.GetCommand() != COMMAND_STARTDRAG )
+    if ( rEvent.GetCommand() != COMMAND_STARTDRAG )
         return false;
 
     // if necessary abort an existing action
@@ -2277,8 +2121,8 @@ bool ValueSet::StartDrag( const CommandEvent& rCEvt, Region& rRegion )
     // case set it as the current item. We only check mouse actions since
     // drag-and-drop can also be triggered by the keyboard
     sal_uInt16 nSelId;
-    if ( rCEvt.IsMouseEvent() )
-        nSelId = GetItemId( rCEvt.GetMousePosPixel() );
+    if ( rEvent.IsMouseEvent() )
+        nSelId = GetItemId( rEvent.GetMousePosPixel() );
     else
         nSelId = mnSelItemId;
 
@@ -2303,8 +2147,6 @@ bool ValueSet::StartDrag( const CommandEvent& rCEvt, Region& rRegion )
     return true;
 }
 
-
-
 Size ValueSet::CalcWindowSizePixel( const Size& rItemSize, sal_uInt16 nDesireCols,
                                     sal_uInt16 nDesireLines ) const
 {
@@ -2349,23 +2191,23 @@ Size ValueSet::CalcWindowSizePixel( const Size& rItemSize, sal_uInt16 nDesireCol
         else
             n = ITEM_OFFSET;
 
-        aSize.Width()  += n*nCalcCols;
-        aSize.Height() += n*nCalcLines;
+        aSize.Width()  += n * nCalcCols;
+        aSize.Height() += n * nCalcLines;
     }
     else
         n = 0;
 
     if ( mnSpacing )
     {
-        aSize.Width()  += mnSpacing*(nCalcCols-1);
-        aSize.Height() += mnSpacing*(nCalcLines-1);
+        aSize.Width()  += mnSpacing * (nCalcCols - 1);
+        aSize.Height() += mnSpacing * (nCalcLines - 1);
     }
 
     if ( nStyle & WB_NAMEFIELD )
     {
         aSize.Height() += nTxtHeight + NAME_OFFSET;
         if ( !(nStyle & WB_FLATVALUESET) )
-            aSize.Height() += NAME_LINE_HEIGHT+NAME_LINE_OFF_Y;
+            aSize.Height() += NAME_LINE_HEIGHT + NAME_LINE_OFF_Y;
     }
 
     if ( nStyle & WB_NONEFIELD )
@@ -2381,8 +2223,6 @@ Size ValueSet::CalcWindowSizePixel( const Size& rItemSize, sal_uInt16 nDesireCol
     return aSize;
 }
 
-
-
 Size ValueSet::CalcItemSizePixel( const Size& rItemSize, bool bOut ) const
 {
     Size aSize = rItemSize;
@@ -2412,8 +2252,6 @@ Size ValueSet::CalcItemSizePixel( const Size& rItemSize, bool bOut ) const
     return aSize;
 }
 
-
-
 long ValueSet::GetScrollWidth() const
 {
     if ( GetStyle() & WB_VSCROLL )
@@ -2425,8 +2263,6 @@ long ValueSet::GetScrollWidth() const
         return 0;
 }
 
-
-
 void ValueSet::SetHighlightHdl( const Link& rLink )
 {
     maHighlightHdl = rLink;
@@ -2456,8 +2292,6 @@ Size ValueSet::GetOptimalSize() const
     return CalcWindowSizePixel(aLargestItemSize);
 }
 
-
-
 void ValueSet::SetEdgeBlending(bool bNew)
 {
     if(mbEdgeBlending != bNew)
commit 7f91f731235c01205e48a49fc0549bb50075380d
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date:   Wed Apr 16 20:41:40 2014 +0200

    ScImportExport clean-up, German comments
    
    Change-Id: Ife16a0e787a03c1225218356572c2fd929a0c63c

diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 773bec5..bb103b5 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -78,10 +78,7 @@ enum SylkVersion
     SYLK_OTHER      // Assume that aliens wrote correct strings.
 };
 
-
-// Gesamtdokument ohne Undo
-
-
+// Whole document without Undo
 ScImportExport::ScImportExport( ScDocument* p )
     : pDocSh( PTR_CAST(ScDocShell,p->GetDocumentShell()) ), pDoc( p ),
       nSizeLimit( 0 ), cSep( '\t' ), cStr( '"' ),
@@ -94,9 +91,7 @@ ScImportExport::ScImportExport( ScDocument* p )
     pExtOptions = NULL;
 }
 
-// Insert am Punkt ohne Bereichschecks
-
-
+// Insert am current cell without range(es)
 ScImportExport::ScImportExport( ScDocument* p, const ScAddress& rPt )
     : pDocSh( PTR_CAST(ScDocShell,p->GetDocumentShell()) ), pDoc( p ),
       aRange( rPt ),
@@ -110,10 +105,8 @@ ScImportExport::ScImportExport( ScDocument* p, const ScAddress& rPt )
     pExtOptions = NULL;
 }
 
-
 //  ctor with a range is only used for export
 //! ctor with a string (and bSingle=true) is also used for DdeSetData
-
 ScImportExport::ScImportExport( ScDocument* p, const ScRange& r )
     : pDocSh( PTR_CAST(ScDocShell,p->GetDocumentShell()) ), pDoc( p ),
       aRange( r ),
@@ -125,14 +118,12 @@ ScImportExport::ScImportExport( ScDocument* p, const ScRange& r )
 {
     pUndoDoc = NULL;
     pExtOptions = NULL;
-    // Zur Zeit nur in einer Tabelle!
+    // Only one sheet (table) supported
     aRange.aEnd.SetTab( aRange.aStart.Tab() );
 }
 
-// String auswerten: Entweder Bereich, Punkt oder Gesamtdoc (bei Fehler)
-// Falls eine View existiert, wird die TabNo der View entnommen!
-
-
+// Evaluate input string - either range, cell or the whole document (when error)
+// If a View exists, the TabNo of the view will be used.
 ScImportExport::ScImportExport( ScDocument* p, const OUString& rPos )
     : pDocSh( PTR_CAST(ScDocShell,p->GetDocumentShell()) ), pDoc( p ),
       nSizeLimit( 0 ), cSep( '\t' ), cStr( '"' ),
@@ -147,9 +138,9 @@ ScImportExport::ScImportExport( ScDocument* p, const OUString& rPos )
     SCTAB nTab = ScDocShell::GetCurTab();
     aRange.aStart.SetTab( nTab );
     OUString aPos( rPos );
-    //  Benannter Bereich?
+    // Named range?
     ScRangeName* pRange = pDoc->GetRangeName();
-    if( pRange )
+    if (pRange)
     {
         const ScRangeData* pData = pRange->findByUpperName(ScGlobal::pCharClass->uppercase(aPos));
         if (pData)
@@ -157,28 +148,28 @@ ScImportExport::ScImportExport( ScDocument* p, const OUString& rPos )
             if( pData->HasType( RT_REFAREA )
                 || pData->HasType( RT_ABSAREA )
                 || pData->HasType( RT_ABSPOS ) )
-                pData->GetSymbol( aPos );                   // mit dem Inhalt weitertesten
+            {
+                pData->GetSymbol(aPos);
+            }
         }
     }
     formula::FormulaGrammar::AddressConvention eConv = pDoc->GetAddressConvention();
-    // Bereich?
-    if( aRange.Parse( aPos, pDoc, eConv ) & SCA_VALID )
+    // Range?
+    if (aRange.Parse(aPos, pDoc, eConv) & SCA_VALID)
         bSingle = false;
-    // Zelle?
-    else if( aRange.aStart.Parse( aPos, pDoc, eConv ) & SCA_VALID )
+    // Cell?
+    else if (aRange.aStart.Parse(aPos, pDoc, eConv) & SCA_VALID)
         aRange.aEnd = aRange.aStart;
     else
         bAll = true;
 }
 
-
 ScImportExport::~ScImportExport()
 {
     delete pUndoDoc;
     delete pExtOptions;
 }
 
-
 void ScImportExport::SetExtOptions( const ScAsciiOptions& rOpt )
 {
     if ( pExtOptions )
@@ -186,13 +177,12 @@ void ScImportExport::SetExtOptions( const ScAsciiOptions& rOpt )
     else
         pExtOptions = new ScAsciiOptions( rOpt );
 
-    //  "normale" Optionen uebernehmen
+    //  "normal" Options
 
     cSep = ScAsciiOptions::GetWeightedFieldSep( rOpt.GetFieldSeps(), false);
     cStr = rOpt.GetTextSep();
 }
 
-
 bool ScImportExport::IsFormatSupported( sal_uLong nFormat )
 {
     return nFormat == FORMAT_STRING
@@ -203,10 +193,7 @@ bool ScImportExport::IsFormatSupported( sal_uLong nFormat )
               || nFormat == SOT_FORMATSTR_ID_DIF;
 }
 
-
-// Vorbereitung fuer Undo: Undo-Dokument erzeugen
-
-
+// Prepare for Undo
 bool ScImportExport::StartPaste()
 {
     if ( !bAll )
@@ -229,9 +216,7 @@ bool ScImportExport::StartPaste()
     return true;
 }
 
-// Nachbereitung Insert: Undo/Redo-Aktionen erzeugen, Invalidate/Repaint
-
-
+// Create Undo/Redo actions, Invalidate/Repaint
 void ScImportExport::EndPaste(bool bAutoRowHeight)
 {
     bool bHeight = bAutoRowHeight && pDocSh && pDocSh->AdjustRowHeight(
@@ -251,7 +236,7 @@ void ScImportExport::EndPaste(bool bAutoRowHeight)
     if( pDocSh )
     {
         if (!bHeight)
-            pDocSh->PostPaint( aRange, PAINT_GRID );    // AdjustRowHeight paintet evtl. selber
+            pDocSh->PostPaint( aRange, PAINT_GRID );
         pDocSh->SetDocumentModified();
     }
     ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell();
@@ -284,7 +269,6 @@ bool ScImportExport::ExportData( const OUString& rMimeType,
     return false;
 }
 
-
 bool ScImportExport::ImportString( const OUString& rText, sal_uLong nFmt )
 {
     switch ( nFmt )
@@ -309,7 +293,6 @@ bool ScImportExport::ImportString( const OUString& rText, sal_uLong nFmt )
     }
 }
 
-
 bool ScImportExport::ExportString( OUString& rText, sal_uLong nFmt )
 {
     OSL_ENSURE( nFmt == FORMAT_STRING, "ScImportExport::ExportString: Unicode not supported for other formats than FORMAT_STRING" );
@@ -341,7 +324,6 @@ bool ScImportExport::ExportString( OUString& rText, sal_uLong nFmt )
     // ExportStream must handle RTL_TEXTENCODING_UNICODE
 }
 
-
 bool ScImportExport::ExportByteString( OString& rText, rtl_TextEncoding eEnc, sal_uLong nFmt )
 {
     OSL_ENSURE( eEnc != RTL_TEXTENCODING_UNICODE, "ScImportExport::ExportByteString: Unicode not supported" );
@@ -359,7 +341,6 @@ bool ScImportExport::ExportByteString( OString& rText, rtl_TextEncoding eEnc, sa
     {
         aStrm.WriteChar( (sal_Char) 0 );
         aStrm.Seek( STREAM_SEEK_TO_END );
-        // Sicherheits-Check:
         if( aStrm.Tell() <= nSizeLimit )
         {
             rText = (const sal_Char*) aStrm.GetData();
@@ -370,12 +351,11 @@ bool ScImportExport::ExportByteString( OString& rText, rtl_TextEncoding eEnc, sa
     return false;
 }
 
-
 bool ScImportExport::ImportStream( SvStream& rStrm, const OUString& rBaseURL, sal_uLong nFmt )
 {
     if( nFmt == FORMAT_STRING )
     {
-        if( ExtText2Doc( rStrm ) )      // pExtOptions auswerten
+        if( ExtText2Doc( rStrm ) )      // evaluate pExtOptions
             return true;
     }
     if( nFmt == SOT_FORMATSTR_ID_SYLK )
@@ -411,7 +391,6 @@ bool ScImportExport::ImportStream( SvStream& rStrm, const OUString& rBaseURL, sa
     return false;
 }
 
-
 bool ScImportExport::ExportStream( SvStream& rStrm, const OUString& rBaseURL, sal_uLong nFmt )
 {
     if( nFmt == FORMAT_STRING )
@@ -486,7 +465,6 @@ bool ScImportExport::ExportStream( SvStream& rStrm, const OUString& rBaseURL, sa
     return false;
 }
 
-
 void ScImportExport::WriteUnicodeOrByteString( SvStream& rStrm, const OUString& rString, bool bZero )
 {
     rtl_TextEncoding eEnc = rStrm.GetStreamCharSet();
@@ -515,7 +493,6 @@ void ScImportExport::WriteUnicodeOrByteString( SvStream& rStrm, const OUString&
     }
 }
 
-
 // This function could be replaced by endlub()
 void ScImportExport::WriteUnicodeOrByteEndl( SvStream& rStrm )
 {
@@ -537,7 +514,6 @@ void ScImportExport::WriteUnicodeOrByteEndl( SvStream& rStrm )
         endl( rStrm );
 }
 
-
 enum QuoteType
 {
     FIELDSTART_QUOTE,
@@ -547,7 +523,6 @@ enum QuoteType
     DONTKNOW_QUOTE
 };
 
-
 /** Determine if *p is a quote that ends a quoted field.
 
     Precondition: we are parsing a quoted field already and *p is a quote.
@@ -571,7 +546,6 @@ static QuoteType lcl_isFieldEndQuote( const sal_Unicode* p, const sal_Unicode* p
     return DONTKNOW_QUOTE;
 }
 
-
 /** Determine if *p is a quote that is escaped by being doubled or ends a
     quoted field.
 
@@ -611,7 +585,6 @@ static QuoteType lcl_isEscapedOrFieldEndQuote( sal_Int32 nQuotes, const sal_Unic
     return lcl_isFieldEndQuote( p, pSeps);
 }
 
-
 /** Append characters of [p1,p2) to rField.
 
     @returns TRUE if ok; FALSE if data overflow, truncated
@@ -631,7 +604,6 @@ static bool lcl_appendLineData( OUString& rField, const sal_Unicode* p1, const s
     }
 }
 
-
 enum DoubledQuoteMode
 {
     DQM_KEEP_ALL,   // both are taken, additionally start and end quote are included in string
@@ -856,7 +828,6 @@ static inline void lcl_WriteSimpleString( SvStream& rStrm, const OUString& rStri
     ScImportExport::WriteUnicodeOrByteString( rStrm, rString );
 }
 
-
 bool ScImportExport::Text2Doc( SvStream& rStrm )
 {
     bool bOk = true;
@@ -949,8 +920,7 @@ bool ScImportExport::Text2Doc( SvStream& rStrm )
     return bOk;
 }
 
-
-        //  erweiterter Ascii-Import
+//  Extended Ascii-Import
 
 static bool lcl_PutString(
     ScDocumentImport& rDocImport, SCCOL nCol, SCROW nRow, SCTAB nTab, const OUString& rStr, sal_uInt8 nColFormat,
@@ -993,22 +963,22 @@ static bool lcl_PutString(
 
     if ( nColFormat == SC_COL_ENGLISH )
     {
-        //! SetString mit Extra-Flag ???
+        //! SetString with Extra-Flag ???
 
         SvNumberFormatter* pDocFormatter = pDoc->GetFormatTable();
         sal_uInt32 nEnglish = pDocFormatter->GetStandardIndex(LANGUAGE_ENGLISH_US);
         double fVal;
         if ( pDocFormatter->IsNumberFormat( rStr, nEnglish, fVal ) )
         {
-            //  Zahlformat wird nicht auf englisch gesetzt
+            // Numberformat will not be set to English
             rDocImport.setNumericCell( ScAddress( nCol, nRow, nTab ), fVal );
             return bMultiLine;
         }
-        //  sonst weiter mit SetString
+        // else, continue with SetString
     }
-    else if ( nColFormat != SC_COL_STANDARD )                   // Datumsformate
+    else if ( nColFormat != SC_COL_STANDARD ) // Datumformats
     {
-        const sal_uInt16 nMaxNumberParts = 7;   // Y-M-D h:m:s.t
+        const sal_uInt16 nMaxNumberParts = 7; // Y-M-D h:m:s.t
         sal_Int32 nLen = rStr.getLength();
         sal_Int32 nStart[nMaxNumberParts];
         sal_Int32 nEnd[nMaxNumberParts];
@@ -1219,7 +1189,6 @@ static bool lcl_PutString(
     return bMultiLine;
 }
 
-
 static OUString lcl_GetFixed( const OUString& rLine, sal_Int32 nStart, sal_Int32 nNext,
                      bool& rbIsQuoted, bool& rbOverflowCell )
 {
@@ -1350,7 +1319,7 @@ bool ScImportExport::ExtText2Doc( SvStream& rStrm )
             sal_Int32 nLineLen = aLine.getLength();
             SCCOL nCol = nStartCol;
             bool bMultiLine = false;
-            if ( bFixed )               //  Feste Satzlaenge
+            if ( bFixed ) //  Fixed line length
             {
                 // Yes, the check is nCol<=MAXCOL+1, +1 because it is only an
                 // overflow if there is really data following to be put behind
@@ -1381,7 +1350,7 @@ bool ScImportExport::ExtText2Doc( SvStream& rStrm )
                     }
                 }
             }
-            else                        //  Nach Trennzeichen suchen
+            else // Search for the separator
             {
                 SCCOL nSourceCol = 0;
                 sal_uInt16 nInfoStart = 0;
@@ -1488,7 +1457,6 @@ bool ScImportExport::ExtText2Doc( SvStream& rStrm )
     return true;
 }
 
-
 void ScImportExport::EmbeddedNullTreatment( OUString & rStr )
 {
     // A nasty workaround for data with embedded NULL characters. As long as we
@@ -1505,7 +1473,6 @@ void ScImportExport::EmbeddedNullTreatment( OUString & rStr )
     }
 }
 
-
 const sal_Unicode* ScImportExport::ScanNextFieldFromString( const sal_Unicode* p,
         OUString& rField, sal_Unicode cStr, const sal_Unicode* pSeps, bool bMergeSeps, bool& rbIsQuoted,
         bool& rbOverflowCell )
@@ -1697,7 +1664,6 @@ bool ScImportExport::Doc2Text( SvStream& rStrm )
     return rStrm.GetError() == SVSTREAM_OK;
 }
 
-
 bool ScImportExport::Sylk2Doc( SvStream& rStrm )
 {
     bool bOk = true;
@@ -1953,7 +1919,6 @@ bool ScImportExport::Sylk2Doc( SvStream& rStrm )
     return bOk;
 }
 
-
 bool ScImportExport::Doc2Sylk( SvStream& rStrm )
 {
     SCCOL nCol;
@@ -2095,7 +2060,6 @@ bool ScImportExport::Doc2Sylk( SvStream& rStrm )
     return rStrm.GetError() == SVSTREAM_OK;
 }
 
-
 bool ScImportExport::Doc2HTML( SvStream& rStrm, const OUString& rBaseURL )
 {
     // rtl_TextEncoding is ignored in ScExportHTML, read from Load/Save HTML options
@@ -2111,7 +2075,6 @@ bool ScImportExport::Doc2RTF( SvStream& rStrm )
     return rStrm.GetError() == SVSTREAM_OK;
 }
 
-
 bool ScImportExport::Doc2Dif( SvStream& rStrm )
 {
     // for DIF in the clipboard, IBM_850 is always used
@@ -2119,7 +2082,6 @@ bool ScImportExport::Doc2Dif( SvStream& rStrm )
     return true;
 }
 
-
 bool ScImportExport::Dif2Doc( SvStream& rStrm )
 {
     SCTAB nTab = aRange.aStart.Tab();
@@ -2153,7 +2115,6 @@ bool ScImportExport::Dif2Doc( SvStream& rStrm )
     return bOk;
 }
 
-
 bool ScImportExport::RTF2Doc( SvStream& rStrm, const OUString& rBaseURL )
 {
     ScEEAbsImport *pImp = ScFormatFilter::Get().CreateRTFImport( pDoc, aRange );


More information about the Libreoffice-commits mailing list