[Libreoffice-commits] .: Branch 'integration/dev300_m101' - sc/source

Kohei Yoshida kohei at kemper.freedesktop.org
Mon Mar 14 13:44:01 PDT 2011


 sc/source/ui/Accessibility/AccessibleDataPilotControl.cxx |  106 +++++++-------
 sc/source/ui/dbgui/fieldwnd.cxx                           |   72 ++-------
 2 files changed, 70 insertions(+), 108 deletions(-)

New commits:
commit 0ae6b0350c9380f7aae22c24eedc89f8f9a3329e
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Mon Mar 14 16:40:08 2011 -0400

    More build fixes in sc.
    
    The breakages mostly caused by *non-conflicting* code changes from
    Oracle.  Meaningless variable renaming to reflect datapilot to
    pivot table naming change, etc.

diff --git a/sc/source/ui/Accessibility/AccessibleDataPilotControl.cxx b/sc/source/ui/Accessibility/AccessibleDataPilotControl.cxx
index b3657a6..3ac939b 100644
--- a/sc/source/ui/Accessibility/AccessibleDataPilotControl.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDataPilotControl.cxx
@@ -156,10 +156,10 @@ ScAccessibleDataPilotControl::ScAccessibleDataPilotControl(
         ScDPFieldControlBase* pDPFieldWindow)
         :
     ScAccessibleContextBase(rxParent, AccessibleRole::GROUP_BOX),
-    mpFieldWindow(pFieldWindow)
+    mpDPFieldWindow(pDPFieldWindow)
 {
-    if (mpFieldWindow)
-        maChildren.resize(mpFieldWindow->GetFieldCount());
+    if (mpDPFieldWindow)
+        maChildren.resize(mpDPFieldWindow->GetFieldCount());
 }
 
 ScAccessibleDataPilotControl::~ScAccessibleDataPilotControl(void)
@@ -187,13 +187,13 @@ void SAL_CALL ScAccessibleDataPilotControl::disposing()
 
 void ScAccessibleDataPilotControl::AddField(sal_Int32 nNewIndex)
 {
-    sal_Bool bAdded(false);
-    if (static_cast<size_t>(nNewIndex) == maChildren.size())
+    sal_Bool bAdded(sal_False);
+    if (static_cast<sal_uInt32>(nNewIndex) == maChildren.size())
     {
         maChildren.push_back(AccessibleWeak());
         bAdded = sal_True;
     }
-    else if (static_cast<size_t>(nNewIndex) < maChildren.size())
+    else if (static_cast<sal_uInt32>(nNewIndex) < maChildren.size())
     {
         ::std::vector < AccessibleWeak >::iterator aItr = maChildren.begin() + nNewIndex;
         maChildren.insert(aItr, AccessibleWeak());
@@ -230,10 +230,10 @@ void ScAccessibleDataPilotControl::AddField(sal_Int32 nNewIndex)
 
 void ScAccessibleDataPilotControl::RemoveField(sal_Int32 nOldIndex)
 {
-    sal_Bool bRemoved(false);
+    sal_Bool bRemoved(sal_False);
     uno::Reference< XAccessible > xTempAcc;
     ScAccessibleDataPilotButton* pField = NULL;
-    if (static_cast<size_t>(nOldIndex) < maChildren.size())
+    if (static_cast<sal_uInt32>(nOldIndex) < maChildren.size())
     {
         xTempAcc = getAccessibleChild(nOldIndex);
         pField = maChildren[nOldIndex].pAcc;
@@ -274,8 +274,8 @@ void ScAccessibleDataPilotControl::RemoveField(sal_Int32 nOldIndex)
 
 void ScAccessibleDataPilotControl::FieldFocusChange(sal_Int32 nOldIndex, sal_Int32 nNewIndex)
 {
-    DBG_ASSERT(static_cast<size_t>(nOldIndex) < maChildren.size() &&
-                static_cast<size_t>(nNewIndex) < maChildren.size(), "did not recognize a child count change");
+    DBG_ASSERT(static_cast<sal_uInt32>(nOldIndex) < maChildren.size() &&
+                static_cast<sal_uInt32>(nNewIndex) < maChildren.size(), "did not recognize a child count change");
 
     uno::Reference < XAccessible > xTempAcc = maChildren[nOldIndex].xWeakAcc;
     if (xTempAcc.is() && maChildren[nOldIndex].pAcc)
@@ -288,7 +288,7 @@ void ScAccessibleDataPilotControl::FieldFocusChange(sal_Int32 nOldIndex, sal_Int
 
 void ScAccessibleDataPilotControl::FieldNameChange(sal_Int32 nIndex)
 {
-    DBG_ASSERT(static_cast<size_t>(nIndex) < maChildren.size(), "did not recognize a child count change");
+    DBG_ASSERT(static_cast<sal_uInt32>(nIndex) < maChildren.size(), "did not recognize a child count change");
 
     uno::Reference < XAccessible > xTempAcc = maChildren[nIndex].xWeakAcc;
     if (xTempAcc.is() && maChildren[nIndex].pAcc)
@@ -297,11 +297,11 @@ void ScAccessibleDataPilotControl::FieldNameChange(sal_Int32 nIndex)
 
 void ScAccessibleDataPilotControl::GotFocus()
 {
-    if (mpFieldWindow)
+    if (mpDPFieldWindow)
     {
-        DBG_ASSERT(mpFieldWindow->GetFieldCount() == maChildren.size(), "did not recognize a child count change");
+        DBG_ASSERT(static_cast<sal_uInt32>(mpDPFieldWindow->GetFieldCount()) == maChildren.size(), "did not recognize a child count change");
 
-        sal_Int32 nIndex(mpFieldWindow->GetSelectedIndex());
+        sal_Int32 nIndex(mpDPFieldWindow->GetSelectedField());
         uno::Reference < XAccessible > xTempAcc = maChildren[nIndex].xWeakAcc;
         if (xTempAcc.is() && maChildren[nIndex].pAcc)
             maChildren[nIndex].pAcc->SetFocused();
@@ -310,11 +310,11 @@ void ScAccessibleDataPilotControl::GotFocus()
 
 void ScAccessibleDataPilotControl::LostFocus()
 {
-    if (mpFieldWindow)
+    if (mpDPFieldWindow)
     {
-        DBG_ASSERT(mpFieldWindow->GetFieldCount() == maChildren.size(), "did not recognize a child count change");
+        DBG_ASSERT(static_cast<sal_uInt32>(mpDPFieldWindow->GetFieldCount()) == maChildren.size(), "did not recognize a child count change");
 
-        sal_Int32 nIndex(mpFieldWindow->GetSelectedIndex());
+        sal_Int32 nIndex(mpDPFieldWindow->GetSelectedField());
         uno::Reference < XAccessible > xTempAcc = maChildren[nIndex].xWeakAcc;
         if (xTempAcc.is() && maChildren[nIndex].pAcc)
             maChildren[nIndex].pAcc->ResetFocused();
@@ -332,13 +332,13 @@ uno::Reference< XAccessible > SAL_CALL ScAccessibleDataPilotControl::getAccessib
     {
         SolarMutexGuard aGuard;
         IsObjectValid();
-        if (mpFieldWindow)
+        if (mpDPFieldWindow)
         {
             Point aAbsPoint(VCLPoint(rPoint));
             Point aControlEdge(GetBoundingBoxOnScreen().TopLeft());
             Point aRelPoint(aAbsPoint - aControlEdge);
-            size_t nChildIndex = mpFieldWindow->GetFieldIndex( aRelPoint );
-            if( nChildIndex != PIVOTFIELD_INVALID )
+            size_t nChildIndex(0);
+            if (mpDPFieldWindow->GetFieldIndex(aRelPoint, nChildIndex))
                 xAcc = getAccessibleChild(static_cast< long >( nChildIndex ));
         }
     }
@@ -356,8 +356,8 @@ void SAL_CALL ScAccessibleDataPilotControl::grabFocus(  )
 {
     SolarMutexGuard aGuard;
     IsObjectValid();
-    if (mpFieldWindow)
-        mpFieldWindow->GrabFocus();
+    if (mpDPFieldWindow)
+        mpDPFieldWindow->GrabFocus();
 }
 
 sal_Int32 SAL_CALL ScAccessibleDataPilotControl::getForeground(  )
@@ -366,9 +366,9 @@ sal_Int32 SAL_CALL ScAccessibleDataPilotControl::getForeground(  )
     SolarMutexGuard aGuard;
     IsObjectValid();
     sal_Int32 nColor(0);
-    if (mpFieldWindow)
+    if (mpDPFieldWindow)
     {
-        nColor = mpFieldWindow->GetSettings().GetStyleSettings().GetWindowTextColor().GetColor();
+        nColor = mpDPFieldWindow->GetSettings().GetStyleSettings().GetWindowTextColor().GetColor();
     }
     return nColor;
 }
@@ -379,7 +379,7 @@ sal_Int32 SAL_CALL ScAccessibleDataPilotControl::getBackground(  )
     SolarMutexGuard aGuard;
     IsObjectValid();
     sal_Int32 nColor(0);
-    if (mpFieldWindow)
+    if (mpDPFieldWindow)
     {
         if (mpDPFieldWindow->GetFieldType() == TYPE_SELECT)
         {
@@ -400,8 +400,8 @@ sal_Int32 SAL_CALL ScAccessibleDataPilotControl::getAccessibleChildCount(void)
 {
     SolarMutexGuard aGuard;
     IsObjectValid();
-    if (mpFieldWindow)
-        return mpFieldWindow->GetFieldCount();
+    if (mpDPFieldWindow)
+        return mpDPFieldWindow->GetFieldCount();
     else
         return 0;
 }
@@ -412,17 +412,17 @@ uno::Reference< XAccessible> SAL_CALL ScAccessibleDataPilotControl::getAccessibl
     SolarMutexGuard aGuard;
     IsObjectValid();
     uno::Reference<XAccessible> xAcc;
-    if (mpFieldWindow)
+    if (mpDPFieldWindow)
     {
-        if (nIndex < 0 || static_cast< size_t >( nIndex ) >= mpFieldWindow->GetFieldCount())
+        if (nIndex < 0 || static_cast< size_t >( nIndex ) >= mpDPFieldWindow->GetFieldCount())
             throw lang::IndexOutOfBoundsException();
 
-        DBG_ASSERT(mpFieldWindow->GetFieldCount() == maChildren.size(), "did not recognize a child count change");
+        DBG_ASSERT(static_cast<sal_uInt32>(mpDPFieldWindow->GetFieldCount()) == maChildren.size(), "did not recognize a child count change");
 
         uno::Reference < XAccessible > xTempAcc = maChildren[nIndex].xWeakAcc;
         if (!xTempAcc.is())
         {
-            maChildren[nIndex].pAcc = new ScAccessibleDataPilotButton(this, mpFieldWindow, nIndex);
+            maChildren[nIndex].pAcc = new ScAccessibleDataPilotButton(this, mpDPFieldWindow, nIndex);
             xTempAcc = maChildren[nIndex].pAcc;
             maChildren[nIndex].xWeakAcc = xTempAcc;
         }
@@ -486,8 +486,8 @@ uno::Sequence<sal_Int8> SAL_CALL ScAccessibleDataPilotControl::getImplementation
 {
     SolarMutexGuard aGuard;
     IsObjectValid();
-    if (mpFieldWindow)
-        return mpFieldWindow->GetDescription();
+    if (mpDPFieldWindow)
+        return mpDPFieldWindow->GetDescription();
 
     return rtl::OUString();
 }
@@ -497,8 +497,8 @@ uno::Sequence<sal_Int8> SAL_CALL ScAccessibleDataPilotControl::getImplementation
 {
     SolarMutexGuard aGuard;
     IsObjectValid();
-    if (mpFieldWindow)
-        return mpFieldWindow->GetName();
+    if (mpDPFieldWindow)
+        return mpDPFieldWindow->GetName();
 
     return rtl::OUString();
 }
@@ -506,8 +506,8 @@ uno::Sequence<sal_Int8> SAL_CALL ScAccessibleDataPilotControl::getImplementation
 Rectangle ScAccessibleDataPilotControl::GetBoundingBoxOnScreen(void) const
         throw (uno::RuntimeException)
 {
-    if (mpFieldWindow)
-        return mpFieldWindow->GetWindowExtentsRelative(NULL);
+    if (mpDPFieldWindow)
+        return mpDPFieldWindow->GetWindowExtentsRelative(NULL);
     else
         return Rectangle();
 }
@@ -515,8 +515,8 @@ Rectangle ScAccessibleDataPilotControl::GetBoundingBoxOnScreen(void) const
 Rectangle ScAccessibleDataPilotControl::GetBoundingBox(void) const
         throw (uno::RuntimeException)
 {
-    if (mpFieldWindow)
-        return mpFieldWindow->GetWindowExtentsRelative(mpFieldWindow->GetAccessibleParentWindow());
+    if (mpDPFieldWindow)
+        return mpDPFieldWindow->GetWindowExtentsRelative(mpDPFieldWindow->GetAccessibleParentWindow());
     else
         return Rectangle();
 }
@@ -530,7 +530,7 @@ ScAccessibleDataPilotButton::ScAccessibleDataPilotButton(
         ScDPFieldControlBase* pDPFieldWindow,
         sal_Int32 nIndex)
     : ScAccessibleContextBase(rxParent, AccessibleRole::PUSH_BUTTON),
-    mpFieldWindow(pFieldWindow),
+    mpDPFieldWindow(pDPFieldWindow),
     mnIndex(nIndex)
 {
 }
@@ -588,9 +588,9 @@ void SAL_CALL ScAccessibleDataPilotButton::grabFocus(  )
 {
     SolarMutexGuard aGuard;
     IsObjectValid();
-    if (mpFieldWindow)
+    if (mpDPFieldWindow)
     {
-        mpFieldWindow->GrabFocusAndSelect(getAccessibleIndexInParent());
+        mpDPFieldWindow->GrabFocusWithSel(getAccessibleIndexInParent());
     }
 }
 
@@ -600,9 +600,9 @@ throw (uno::RuntimeException)
     SolarMutexGuard aGuard;
     IsObjectValid();
     sal_Int32 nColor(0);
-    if (mpFieldWindow)
+    if (mpDPFieldWindow)
     {
-        nColor = mpFieldWindow->GetSettings().GetStyleSettings().GetButtonTextColor().GetColor();
+        nColor = mpDPFieldWindow->GetSettings().GetStyleSettings().GetButtonTextColor().GetColor();
     }
     return nColor;
 }
@@ -613,9 +613,9 @@ throw (uno::RuntimeException)
     SolarMutexGuard aGuard;
     IsObjectValid();
     sal_Int32 nColor(0);
-    if (mpFieldWindow)
+    if (mpDPFieldWindow)
     {
-        nColor = mpFieldWindow->GetSettings().GetStyleSettings().GetFaceColor().GetColor();
+        nColor = mpDPFieldWindow->GetSettings().GetStyleSettings().GetFaceColor().GetColor();
     }
     return nColor;
 }
@@ -658,7 +658,7 @@ uno::Reference<XAccessibleStateSet> SAL_CALL ScAccessibleDataPilotButton::getAcc
         pStateSet->AddState(AccessibleStateType::ENABLED);
         pStateSet->AddState(AccessibleStateType::OPAQUE);
         pStateSet->AddState(AccessibleStateType::FOCUSABLE);
-        if (mpFieldWindow && (sal::static_int_cast<sal_Int32>(mpFieldWindow->GetSelectedIndex()) == mnIndex))
+        if (mpDPFieldWindow && (sal::static_int_cast<sal_Int32>(mpDPFieldWindow->GetSelectedField()) == mnIndex))
             pStateSet->AddState(AccessibleStateType::FOCUSED);
         if (isShowing())
             pStateSet->AddState(AccessibleStateType::SHOWING);
@@ -704,8 +704,8 @@ uno::Sequence<sal_Int8> SAL_CALL ScAccessibleDataPilotButton::getImplementationI
 {
     SolarMutexGuard aGuard;
     IsObjectValid();
-    if (mpFieldWindow)
-        return mpFieldWindow->GetFieldText(getAccessibleIndexInParent());
+    if (mpDPFieldWindow)
+        return mpDPFieldWindow->GetFieldText(getAccessibleIndexInParent());
 
     return rtl::OUString();
 }
@@ -715,9 +715,9 @@ Rectangle ScAccessibleDataPilotButton::GetBoundingBoxOnScreen(void) const
 {
     Rectangle aRect(GetBoundingBox());
 
-    if (mpFieldWindow)
+    if (mpDPFieldWindow)
     {
-        Point aParentPos(mpFieldWindow->GetWindowExtentsRelative(NULL).TopLeft());
+        Point aParentPos(mpDPFieldWindow->GetWindowExtentsRelative(NULL).TopLeft());
         aRect.Move(aParentPos.getX(), aParentPos.getY());
     }
 
@@ -727,8 +727,8 @@ Rectangle ScAccessibleDataPilotButton::GetBoundingBoxOnScreen(void) const
 Rectangle ScAccessibleDataPilotButton::GetBoundingBox(void) const
         throw (::com::sun::star::uno::RuntimeException)
 {
-    if (mpFieldWindow)
-        return Rectangle (mpFieldWindow->GetFieldPosition(const_cast<ScAccessibleDataPilotButton*> (this)->getAccessibleIndexInParent()), mpFieldWindow->GetFieldSize());
+    if (mpDPFieldWindow)
+        return Rectangle (mpDPFieldWindow->GetFieldPosition(const_cast<ScAccessibleDataPilotButton*> (this)->getAccessibleIndexInParent()), mpDPFieldWindow->GetFieldSize());
     else
         return Rectangle();
 }
diff --git a/sc/source/ui/dbgui/fieldwnd.cxx b/sc/source/ui/dbgui/fieldwnd.cxx
index d185be3..474c487 100644
--- a/sc/source/ui/dbgui/fieldwnd.cxx
+++ b/sc/source/ui/dbgui/fieldwnd.cxx
@@ -29,14 +29,14 @@
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_sc.hxx"
 
-#include "fieldwnd.hxx"
-
-#include <tools/debug.hxx>
+#include <vcl/virdev.hxx>
 #include <vcl/decoview.hxx>
-#include <vcl/help.hxx>
 #include <vcl/svapp.hxx>
-#include <vcl/virdev.hxx>
+#include <vcl/mnemonic.hxx>
+#include <vcl/help.hxx>
+#include <tools/debug.hxx>
 
+#include "fieldwnd.hxx"
 #include "pvlaydlg.hxx"
 #include "dpuiglobal.hxx"
 #include "AccessibleDataPilotControl.hxx"
@@ -231,7 +231,6 @@ void ScDPFieldControlBase::SetFieldText( const String& rText, size_t nIndex )
                 pAccessible = NULL;
         }
     }
-    return PIVOTFIELD_INVALID;
 }
 
 const String& ScDPFieldControlBase::GetFieldText( size_t nIndex ) const
@@ -305,9 +304,10 @@ void ScDPFieldControlBase::MouseButtonDown( const MouseEvent& rMEvt )
 {
     if( rMEvt.IsLeft() )
     {
-        --mnAutoScrollDelay;
-        return;
-    }
+        size_t nIndex = 0;
+        if( GetFieldIndex( rMEvt.GetPosPixel(), nIndex ) && IsExistingIndex( nIndex ) )
+        {
+            GrabFocusWithSel( nIndex );
 
             if( rMEvt.GetClicks() == 1 )
             {
@@ -323,9 +323,7 @@ void ScDPFieldControlBase::MouseButtonDown( const MouseEvent& rMEvt )
 
 void ScDPFieldControlBase::MouseButtonUp( const MouseEvent& rMEvt )
 {
-    if( eEndType != ENDTRACKING_DROP )
-        mnFirstVisIndex = mnOldFirstVisIndex;
-    if( eEndType != ENDTRACKING_SUSPEND )
+    if( rMEvt.IsLeft() )
     {
         if( rMEvt.GetClicks() == 1 )
         {
@@ -336,54 +334,23 @@ void ScDPFieldControlBase::MouseButtonUp( const MouseEvent& rMEvt )
         if( IsMouseCaptured() )
             ReleaseMouse();
     }
-    mnInsCursorIndex = PIVOTFIELD_INVALID;
-    Invalidate();
 }
 
 void ScDPFieldControlBase::MouseMove( const MouseEvent& rMEvt )
 {
-    // prepare a virtual device for buffered painting
-    VirtualDevice aVirDev;
-    // #i97623# VirtualDevice is always LTR on construction while other windows derive direction from parent
-    aVirDev.EnableRTL( IsRTLEnabled() );
-    aVirDev.SetMapMode( MAP_PIXEL );
-    aVirDev.SetOutputSizePixel( GetSizePixel() );
-    Font aFont = GetFont();
-    aFont.SetTransparent( true );
-    aVirDev.SetFont( aFont );
-
-    // draw the background and all fields
-    DrawBackground( aVirDev );
-    for( size_t nFieldIndex = mnFirstVisIndex, nEndIndex = mnFirstVisIndex + mnPageSize; nFieldIndex < nEndIndex; ++nFieldIndex )
-        DrawField( aVirDev, nFieldIndex );
-    DrawInsertionCursor( aVirDev );
-    DrawBitmap( Point( 0, 0 ), aVirDev.GetBitmap( Point( 0, 0 ), GetSizePixel() ) );
-
-    // draw field text focus
-    if( HasFocus() && (mnSelectIndex < maFields.size()) && (mnFirstVisIndex <= mnSelectIndex) && (mnSelectIndex < mnFirstVisIndex + mnPageSize) )
+    if( IsMouseCaptured() )
     {
         PointerStyle ePtr = mpDlg->NotifyMouseMove( OutputToScreenPixel( rMEvt.GetPosPixel() ) );
         SetPointer( Pointer( ePtr ) );
     }
-
-    // update scrollbar
-    size_t nFieldCount = maFields.size();
-    /*  Already show the scrollbar if window is full but no fields are hidden
-        (yet). This gives the user the hint that it is now possible to add more
-        fields to the window. */
-    mrScrollBar.Show( nFieldCount >= mnPageSize );
-    mrScrollBar.Enable( nFieldCount > mnPageSize );
-    if( mrScrollBar.IsVisible() )
+    size_t nIndex = 0;
+    if( GetFieldIndex( rMEvt.GetPosPixel(), nIndex ) && IsShortenedText( nIndex ) )
     {
-        mrScrollBar.SetRange( Range( 0, static_cast< long >( (nFieldCount - 1) / mnLineSize + 1 ) ) );
-        mrScrollBar.SetThumbPos( static_cast< long >( mnFirstVisIndex / mnLineSize ) );
+        Point aPos = OutputToScreenPixel( rMEvt.GetPosPixel() );
+        Rectangle   aRect( aPos, GetSizePixel() );
+        String aHelpText = GetFieldText(nIndex);
+        Help::ShowQuickHelp( this, aRect, aHelpText );
     }
-
-    /*  Exclude empty fields from tab chain, but do not disable them. They need
-        to be enabled because they still act as target for field movement via
-        keyboard shortcuts. */
-    WinBits nMask = ~(WB_TABSTOP | WB_NOTABSTOP);
-    SetStyle( (GetStyle() & nMask) | (IsEmpty() ? WB_NOTABSTOP : WB_TABSTOP) );
 }
 
 void ScDPFieldControlBase::KeyInput( const KeyEvent& rKEvt )
@@ -1128,11 +1095,6 @@ void ScDPRowFieldControl::Redraw()
             bool bFocus = HasFocus() && (nField == GetSelectedField());
             DrawField(aVirDev, Rectangle(aFldPt, aFldSize), *itr, bFocus);
         }
-
-        // draw the button text
-        Point aLabelOffset( (maFieldSize.Width() - nLabelWidth) / 2, ::std::max< long >( (maFieldSize.Height() - rDev.GetTextHeight()) / 2, 3 ) );
-        rDev.SetTextColor( GetSettings().GetStyleSettings().GetButtonTextColor() );
-        rDev.DrawText( aFieldPos + aLabelOffset, aClippedText );
     }
 
     // Create a bitmap from the virtual device, and place that bitmap onto


More information about the Libreoffice-commits mailing list