[Libreoffice-commits] core.git: 3 commits - compilerplugins/clang sc/qa sc/source

Jan Holesovsky kendy at collabora.com
Fri Dec 11 01:43:37 PST 2015


 compilerplugins/clang/mergeclasses.results |    1 
 sc/qa/unit/ucalc_formula.cxx               |    4 
 sc/source/ui/app/inputwin.cxx              |  374 ++++++++---------------------
 sc/source/ui/inc/inputwin.hxx              |   93 +++----
 4 files changed, 154 insertions(+), 318 deletions(-)

New commits:
commit 007543f9672b69de4dcf1dba1ccca0fc9d165897
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Fri Dec 11 10:24:28 2015 +0100

    sc: Merge ScMultiTextWnd into ScTextWnd.
    
    Change-Id: I21ed0e37feec0e7c078c2e284b7f4169f0cff432

diff --git a/compilerplugins/clang/mergeclasses.results b/compilerplugins/clang/mergeclasses.results
index c07eb0d..b5752a4 100644
--- a/compilerplugins/clang/mergeclasses.results
+++ b/compilerplugins/clang/mergeclasses.results
@@ -104,7 +104,6 @@ merge ScRefHandlerCaller with ScTPValidationValue
 merge ScRefHandlerHelper with ScValidationDlg
 merge ScSimpleEditSourceHelper with ScEditEngineTextObj
 merge ScTabView with ScViewFunc
-merge ScTextWnd with ScMultiTextWnd
 merge ScVbaControlContainer with ScVbaButtonContainer
 merge ScVbaObjectContainer with ScVbaControlContainer
 merge ScViewFunc with ScDBFunc
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index f63884f..e35e1d4 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -878,7 +878,7 @@ void ScInputWindow::MouseButtonUp( const MouseEvent& rMEvt )
 
 ScInputBarGroup::ScInputBarGroup(vcl::Window* pParent, ScTabViewShell* pViewSh)
     : ScTextWndBase(pParent, WinBits(WB_HIDE | WB_TABSTOP)),
-      maTextWnd(VclPtr<ScMultiTextWnd>::Create(this, pViewSh)),
+      maTextWnd(VclPtr<ScTextWnd>::Create(this, pViewSh)),
       maButton(VclPtr<ImageButton>::Create(this, WB_TABSTOP | WB_RECTSTYLE | WB_SMALLSTYLE)),
       maScrollbar(VclPtr<ScrollBar>::Create(this, WB_TABSTOP | WB_VERT | WB_DRAG)),
       mnVertOffset(0)
@@ -1125,23 +1125,7 @@ void ScInputBarGroup::TextGrabFocus()
     maTextWnd->TextGrabFocus();
 }
 
-ScMultiTextWnd::ScMultiTextWnd( ScInputBarGroup* pParen, ScTabViewShell* pViewSh )
-    : ScTextWnd( pParen, pViewSh ),
-      mrGroupBar(* pParen ),
-      mnLines( 1 ),
-      mnLastExpandedLines( INPUTWIN_MULTILINES ),
-      mbInvalidate( false )
-{
-    Size aBorder;
-    aBorder = CalcWindowSize(aBorder);
-    mnBorderHeight = aBorder.Height();
-}
-
-ScMultiTextWnd::~ScMultiTextWnd()
-{
-}
-
-void ScMultiTextWnd::Paint( vcl::RenderContext& rRenderContext, const Rectangle& rRect )
+void ScTextWnd::Paint( vcl::RenderContext& rRenderContext, const Rectangle& rRect )
 {
     EditView* pView = GetEditView();
     if (pView)
@@ -1155,20 +1139,20 @@ void ScMultiTextWnd::Paint( vcl::RenderContext& rRenderContext, const Rectangle&
     }
 }
 
-EditView* ScMultiTextWnd::GetEditView()
+EditView* ScTextWnd::GetEditView()
 {
     if ( !pEditView )
         InitEditEngine();
     return pEditView;
 }
 
-long ScMultiTextWnd::GetPixelHeightForLines( long nLines )
+long ScTextWnd::GetPixelHeightForLines(long nLines)
 {
     // add padding ( for the borders of the window )
     return ( nLines * LogicToPixel( Size( 0, GetTextHeight() ) ).Height() ) + mnBorderHeight;
 }
 
-void ScMultiTextWnd::SetNumLines( long nLines )
+void ScTextWnd::SetNumLines(long nLines)
 {
     mnLines = nLines;
     if ( nLines > 1 )
@@ -1178,7 +1162,7 @@ void ScMultiTextWnd::SetNumLines( long nLines )
     }
 }
 
-void ScMultiTextWnd::Resize()
+void ScTextWnd::Resize()
 {
     // Only Height is recalculated here, Width is applied from
     // parent/container window
@@ -1187,7 +1171,7 @@ void ScMultiTextWnd::Resize()
     aTextBoxSize.Height() = GetPixelHeightForLines( mnLines );
     SetSizePixel( aTextBoxSize );
 
-    if(pEditView)
+    if (pEditView)
     {
         Size aOutputSize = GetOutputSizePixel();
         Rectangle aOutputArea = PixelToLogic( Rectangle( Point(), aOutputSize ));
@@ -1206,29 +1190,12 @@ void ScMultiTextWnd::Resize()
     SetScrollBarRange();
 }
 
-IMPL_LINK_NOARG_TYPED(ScMultiTextWnd, ModifyHdl, LinkParamNone*, void)
-{
-    ScTextWnd::NotifyHdl(nullptr);
-}
-
-IMPL_LINK_TYPED(ScMultiTextWnd, NotifyHdl, EENotify&, rNotify, void)
-{
-    // need to process EE_NOTIFY_TEXTVIEWSCROLLED here
-    // sometimes we don't seem to get EE_NOTIFY_TEXTVIEWSCROLLED e.g. when
-    // we insert text at the beginning of the text so the cursor never moves
-    // down to generate a scroll event
-
-    if ( rNotify.eNotificationType == EE_NOTIFY_TEXTVIEWSCROLLED
-         || rNotify.eNotificationType == EE_NOTIFY_TEXTHEIGHTCHANGED )
-        SetScrollBarRange();
-}
-
-long ScMultiTextWnd::GetEditEngTxtHeight()
+long ScTextWnd::GetEditEngTxtHeight()
 {
     return pEditView ? pEditView->GetEditEngine()->GetTextHeight() : 0;
 }
 
-void ScMultiTextWnd::SetScrollBarRange()
+void ScTextWnd::SetScrollBarRange()
 {
     if ( pEditView )
     {
@@ -1239,8 +1206,7 @@ void ScMultiTextWnd::SetScrollBarRange()
     }
 }
 
-void
-ScMultiTextWnd::DoScroll()
+void ScTextWnd::DoScroll()
 {
     if ( pEditView )
     {
@@ -1253,7 +1219,7 @@ ScMultiTextWnd::DoScroll()
     }
 }
 
-void ScMultiTextWnd::StartEditEngine()
+void ScTextWnd::StartEditEngine()
 {
     // Don't activate if we're a modal dialog ourselves (Doc-modal dialog)
     SfxObjectShell* pObjSh = SfxObjectShell::Current();
@@ -1316,7 +1282,7 @@ static void lcl_ModifyRTLVisArea( EditView* pEditView )
     pEditView->SetVisArea(aVisArea);
 }
 
-void ScMultiTextWnd::InitEditEngine()
+void ScTextWnd::InitEditEngine()
 {
     ScFieldEditEngine* pNew;
     ScTabViewShell* pViewSh = GetViewShell();
@@ -1380,8 +1346,8 @@ void ScMultiTextWnd::InitEditEngine()
     if ( bIsRTL )
         lcl_ModifyRTLVisArea( pEditView );
 
-    pEditEngine->SetModifyHdl(LINK(this, ScMultiTextWnd, ModifyHdl));
-    pEditEngine->SetNotifyHdl(LINK(this, ScMultiTextWnd, NotifyHdl));
+    pEditEngine->SetModifyHdl(LINK(this, ScTextWnd, ModifyHdl));
+    pEditEngine->SetNotifyHdl(LINK(this, ScTextWnd, NotifyHdl));
 
     if (!maAccTextDatas.empty())
         maAccTextDatas.back()->StartEdit();
@@ -1397,27 +1363,7 @@ void ScMultiTextWnd::InitEditEngine()
     }
 }
 
-void ScMultiTextWnd::StopEditEngine( bool bAll )
-{
-    if ( pEditEngine )
-        pEditEngine->SetNotifyHdl(Link<EENotify&,void>());
-    ScTextWnd::StopEditEngine( bAll );
-}
-
-void ScMultiTextWnd::SetTextString( const OUString& rNewString )
-{
-    // Ideally it would be best to create on demand the EditEngine/EditView here, but... for
-    // the initialisation scenario where a cell is first clicked on we end up with the text in the
-    // inputbar window scrolled to the bottom if we do that here ( because the tableview and topview
-    // are synced I guess ).
-    // should fix that I suppose :-/ need to look a bit further into that
-    mbInvalidate = true; // ensure next Paint ( that uses editengine ) call will call Invalidate first
-    ScTextWnd::SetTextString( rNewString );
-    SetScrollBarRange();
-    DoScroll();
-}
-
-ScTextWnd::ScTextWnd( vcl::Window* pParent, ScTabViewShell* pViewSh )
+ScTextWnd::ScTextWnd(ScInputBarGroup* pParent, ScTabViewShell* pViewSh)
     :   ScTextWndBase(pParent, WinBits(WB_HIDE | WB_BORDER)),
         DragSourceHelper(this),
         pEditEngine  (nullptr),
@@ -1425,7 +1371,11 @@ ScTextWnd::ScTextWnd( vcl::Window* pParent, ScTabViewShell* pViewSh )
         bIsInsertMode(true),
         bFormulaMode (false),
         bInputMode   (false),
-        mpViewShell(pViewSh)
+        mpViewShell(pViewSh),
+        mrGroupBar(*pParent),
+        mnLines(1),
+        mnLastExpandedLines(INPUTWIN_MULTILINES),
+        mbInvalidate(false)
 {
     EnableRTL(false); // EditEngine can't be used with VCL EnableRTL
 
@@ -1457,6 +1407,10 @@ ScTextWnd::ScTextWnd( vcl::Window* pParent, ScTabViewShell* pViewSh )
     SetMapMode(MAP_TWIP);
     SetPointer(PointerStyle::Text);
     SetFont(aTextFont);
+
+    Size aBorder;
+    aBorder = CalcWindowSize(aBorder);
+    mnBorderHeight = aBorder.Height();
 }
 
 ScTextWnd::~ScTextWnd()
@@ -1477,43 +1431,6 @@ void ScTextWnd::dispose()
     ScTextWndBase::dispose();
 }
 
-void ScTextWnd::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect)
-{
-    if (pEditView)
-    {
-        Size aSize(GetOutputSizePixel());
-        long nDiff = aSize.Height() - rRenderContext.LogicToPixel(Size(0, rRenderContext.GetTextHeight())).Height();
-        pEditView->SetOutputArea(rRenderContext.PixelToLogic(Rectangle(Point(0, (nDiff > 0) ? nDiff / 2 : 1), aSize)));
-
-        pEditView->Paint(rRect, &rRenderContext);
-    }
-    else
-    {
-        Size aSize = GetOutputSizePixel();
-        SetFont(aTextFont);
-
-        long nDiff = aSize.Height() - rRenderContext.LogicToPixel(Size(0, rRenderContext.GetTextHeight())).Height();
-
-//      if (nDiff<2) nDiff=2;       // At least 1 pixel
-
-        long nStartPos = 0;
-        if (bIsRTL)
-        {
-            //  right-align
-            nStartPos += aSize.Width() - rRenderContext.LogicToPixel(Size(rRenderContext.GetTextWidth(aString), 0)).Width();
-
-            //  LayoutMode isn't changed as long as ModifyRTLDefaults doesn't include SvxFrameDirectionItem
-        }
-        rRenderContext.DrawText(rRenderContext.PixelToLogic(Point(nStartPos, nDiff / 2)), aString);
-    }
-    rRenderContext.Pop();
-}
-
-void ScTextWnd::Resize()
-{
-    Invalidate();
-}
-
 void ScTextWnd::MouseMove( const MouseEvent& rMEvt )
 {
     if (pEditView)
@@ -1690,100 +1607,19 @@ void ScTextWnd::UpdateAutoCorrFlag()
     }
 }
 
-void ScTextWnd::StartEditEngine()
+IMPL_LINK_TYPED(ScTextWnd, NotifyHdl, EENotify&, rNotify, void)
 {
-    // Don't activate if we're a modal ourselves (Doc modal Dialog)
-    SfxObjectShell* pObjSh = SfxObjectShell::Current();
-    if ( pObjSh && pObjSh->IsInModalMode() )
-        return;
-
-    if ( !pEditView || !pEditEngine )
-    {
-        ScFieldEditEngine* pNew;
-        ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell();
-        if ( pViewSh )
-        {
-            ScDocument* pDoc = pViewSh->GetViewData().GetDocument();
-            pNew = new ScFieldEditEngine(pDoc, pDoc->GetEnginePool(), pDoc->GetEditPool());
-        }
-        else
-            pNew = new ScFieldEditEngine(nullptr, EditEngine::CreatePool(), nullptr, true);
-        pNew->SetExecuteURL( false );
-        pEditEngine = pNew;
-
-        pEditEngine->SetUpdateMode( false );
-        pEditEngine->SetPaperSize( Size( bIsRTL ? USHRT_MAX : THESIZE, 300 ) );
-        pEditEngine->SetWordDelimiters(
-                        ScEditUtil::ModifyDelimiters( pEditEngine->GetWordDelimiters() ) );
-
-        UpdateAutoCorrFlag();
-
-        {
-            SfxItemSet* pSet = new SfxItemSet( pEditEngine->GetEmptyItemSet() );
-            EditEngine::SetFontInfoInItemSet( *pSet, aTextFont );
-            lcl_ExtendEditFontAttribs( *pSet );
-
-            // turn off script spacing to match DrawText output
-            pSet->Put( SvxScriptSpaceItem( false, EE_PARA_ASIANCJKSPACING ) );
-            if ( bIsRTL )
-                lcl_ModifyRTLDefaults( *pSet );
-            pEditEngine->SetDefaults( pSet );
-        }
-
-        // If the Cell contains URLFields, they need to be taken over into the entry row,
-        // or else the position is not correct anymore
-        bool bFilled = false;
-        ScInputHandler* pHdl = SC_MOD()->GetInputHdl();
-        if ( pHdl ) //! Check if it's the right InputHdl?
-            bFilled = pHdl->GetTextAndFields( *pEditEngine );
-
-        pEditEngine->SetUpdateMode( true );
-
-        //  aString is the truth...
-        if (bFilled && pEditEngine->GetText() == aString)
-            Invalidate(); // Repaint for (filled) Fields
-        else
-            pEditEngine->SetText(aString); // At least the right text then
-
-        pEditView = new EditView( pEditEngine, this );
-        pEditView->SetInsertMode(bIsInsertMode);
-
-        // The text from the Clipboard is taken over as ASCII in a single row
-        EVControlBits n = pEditView->GetControlWord();
-        pEditView->SetControlWord( n | EVControlBits::SINGLELINEPASTE );
-
-        pEditEngine->InsertView( pEditView, EE_APPEND );
-
-        Resize();
-
-        if ( bIsRTL )
-            lcl_ModifyRTLVisArea( pEditView );
-
-        pEditEngine->SetModifyHdl(LINK(this, ScTextWnd, NotifyHdl));
-
-        if (!maAccTextDatas.empty())
-            maAccTextDatas.back()->StartEdit();
-
-        //  as long as EditEngine and DrawText sometimes differ for CTL text,
-        //  repaint now to have the EditEngine's version visible
-//        SfxObjectShell* pObjSh = SfxObjectShell::Current();
-        if ( pObjSh && dynamic_cast<const ScDocShell*>( pObjSh) !=  nullptr )
-        {
-            ScDocument& rDoc = static_cast<ScDocShell*>(pObjSh)->GetDocument();    // any document
-            SvtScriptType nScript = rDoc.GetStringScriptType( aString );
-            if ( nScript & SvtScriptType::COMPLEX )
-                Invalidate();
-        }
-    }
-
-    SC_MOD()->SetInputMode( SC_INPUT_TOP );
+    // need to process EE_NOTIFY_TEXTVIEWSCROLLED here
+    // sometimes we don't seem to get EE_NOTIFY_TEXTVIEWSCROLLED e.g. when
+    // we insert text at the beginning of the text so the cursor never moves
+    // down to generate a scroll event
 
-    SfxViewFrame* pViewFrm = SfxViewFrame::Current();
-    if (pViewFrm)
-        pViewFrm->GetBindings().Invalidate( SID_ATTR_INSERT );
+    if ( rNotify.eNotificationType == EE_NOTIFY_TEXTVIEWSCROLLED
+         || rNotify.eNotificationType == EE_NOTIFY_TEXTHEIGHTCHANGED )
+        SetScrollBarRange();
 }
 
-IMPL_LINK_NOARG_TYPED(ScTextWnd, NotifyHdl, LinkParamNone*, void)
+IMPL_LINK_NOARG_TYPED(ScTextWnd, ModifyHdl, LinkParamNone*, void)
 {
     if (pEditView && !bInputMode)
     {
@@ -1799,6 +1635,9 @@ IMPL_LINK_NOARG_TYPED(ScTextWnd, NotifyHdl, LinkParamNone*, void)
 
 void ScTextWnd::StopEditEngine( bool bAll )
 {
+    if (pEditEngine)
+        pEditEngine->SetNotifyHdl(Link<EENotify&, void>());
+
     if (pEditView)
     {
         if (!maAccTextDatas.empty())
@@ -1848,6 +1687,13 @@ static sal_Int32 findFirstNonMatchingChar(const OUString& rStr1, const OUString&
 
 void ScTextWnd::SetTextString( const OUString& rNewString )
 {
+    // Ideally it would be best to create on demand the EditEngine/EditView here, but... for
+    // the initialisation scenario where a cell is first clicked on we end up with the text in the
+    // inputbar window scrolled to the bottom if we do that here ( because the tableview and topview
+    // are synced I guess ).
+    // should fix that I suppose :-/ need to look a bit further into that
+    mbInvalidate = true; // ensure next Paint ( that uses editengine ) call will call Invalidate first
+
     if ( rNewString != aString )
     {
         bInputMode = true;
@@ -1920,6 +1766,9 @@ void ScTextWnd::SetTextString( const OUString& rNewString )
 
         bInputMode = false;
     }
+
+    SetScrollBarRange();
+    DoScroll();
 }
 
 const OUString& ScTextWnd::GetTextString() const
@@ -1932,11 +1781,6 @@ bool ScTextWnd::IsInputActive()
     return HasFocus();
 }
 
-EditView* ScTextWnd::GetEditView()
-{
-    return pEditView;
-}
-
 void ScTextWnd::MakeDialogEditView()
 {
     if ( pEditView ) return;
diff --git a/sc/source/ui/inc/inputwin.hxx b/sc/source/ui/inc/inputwin.hxx
index bb94592..1b84501 100644
--- a/sc/source/ui/inc/inputwin.hxx
+++ b/sc/source/ui/inc/inputwin.hxx
@@ -30,15 +30,16 @@
 #include <vcl/window.hxx>
 #include <svtools/transfer.hxx>
 
-class ScEditEngineDefaulter;
+class Accelerator;
 class EditView;
-struct ESelection;
-class ScInputHandler;
 class ScAccessibleEditLineTextData;
-struct EENotify;
+class ScEditEngineDefaulter;
+class ScInputBarGroup;
+class ScInputHandler;
 class ScRangeList;
 class ScTabViewShell;
-class Accelerator;
+struct EENotify;
+struct ESelection;
 
 class ScTextWndBase : public vcl::Window
 {
@@ -60,14 +61,14 @@ public:
 class ScTextWnd : public ScTextWndBase, public DragSourceHelper     // edit window
 {
 public:
-                    ScTextWnd( vcl::Window* pParent, ScTabViewShell* pViewSh );
+    ScTextWnd(ScInputBarGroup* pParent, ScTabViewShell* pViewSh);
     virtual         ~ScTextWnd();
     virtual void    dispose() override;
 
     virtual void            SetTextString( const OUString& rString ) override;
     virtual const OUString& GetTextString() const override;
 
-    bool                     IsInputActive() override;
+    bool                    IsInputActive() override;
     virtual EditView*       GetEditView() override;
 
                         // for function autopilots
@@ -78,7 +79,7 @@ public:
 
     virtual void            TextGrabFocus() override;
 
-    virtual void             DataChanged( const DataChangedEvent& rDCEvt ) override;
+    virtual void            DataChanged(const DataChangedEvent& rDCEvt) override;
 
     virtual void            SetFormulaMode( bool bSet ) override;
 
@@ -87,11 +88,22 @@ public:
     virtual void            InsertAccessibleTextData( ScAccessibleEditLineTextData& rTextData ) override;
     virtual void            RemoveAccessibleTextData( ScAccessibleEditLineTextData& rTextData ) override;
 
-    DECL_LINK_TYPED( NotifyHdl, LinkParamNone*, void );
+    virtual void            Resize() override;
+
+    long GetPixelHeightForLines(long nLines);
+    long GetEditEngTxtHeight();
+
+    long GetNumLines() { return mnLines; }
+    void SetNumLines(long nLines);
+    long GetLastNumExpandedLines() { return mnLastExpandedLines; }
+
+    void DoScroll();
+
+    DECL_LINK_TYPED(NotifyHdl, EENotify&, void);
+    DECL_LINK_TYPED(ModifyHdl, LinkParamNone*, void);
 
 protected:
     virtual void    Paint( vcl::RenderContext& rRenderContext, const Rectangle& rRect ) override;
-    virtual void    Resize() override;
 
     virtual void    MouseMove( const MouseEvent& rMEvt ) override;
     virtual void    MouseButtonDown( const MouseEvent& rMEvt ) override;
@@ -108,6 +120,10 @@ protected:
     void            ImplInitSettings();
     void            UpdateAutoCorrFlag();
 
+    void SetScrollBarRange();
+
+    void InitEditEngine();
+
     ScTabViewShell* GetViewShell() { return mpViewShell;}
 
     typedef ::std::vector< ScAccessibleEditLineTextData* > AccTextDataVector;
@@ -127,6 +143,11 @@ protected:
 
 private:
     ScTabViewShell* mpViewShell;
+    ScInputBarGroup& mrGroupBar;
+    long mnLines;
+    long mnLastExpandedLines;
+    long mnBorderHeight;
+    bool mbInvalidate;
 };
 
 class ScPosWnd : public ComboBox, public SfxListener        // Display position
@@ -162,40 +183,6 @@ private:
     void            ReleaseFocus_Impl();
 };
 
-class ScInputBarGroup;
-
-class ScMultiTextWnd : public ScTextWnd
-{
-public:
-    ScMultiTextWnd( ScInputBarGroup* pParent, ScTabViewShell* pViewSh );
-    virtual ~ScMultiTextWnd();
-    virtual void StartEditEngine() override;
-    virtual void StopEditEngine( bool bAll ) override;
-    virtual void Resize() override;
-    virtual EditView*  GetEditView() override;
-    long GetPixelHeightForLines( long nLines );
-    long GetEditEngTxtHeight();
-
-    void DoScroll();
-    virtual void SetTextString( const OUString& rString ) override;
-    void SetNumLines( long nLines );
-    long GetNumLines() { return mnLines; }
-    long GetLastNumExpandedLines() { return mnLastExpandedLines; }
-protected:
-    void SetScrollBarRange();
-    void InitEditEngine();
-
-    virtual void Paint( vcl::RenderContext& rRenderContext, const Rectangle& rRect ) override;
-    DECL_LINK_TYPED( NotifyHdl, EENotify&, void );
-    DECL_LINK_TYPED( ModifyHdl, LinkParamNone*, void );
-private:
-    ScInputBarGroup& mrGroupBar;
-    long mnLines;
-    long mnLastExpandedLines;
-    long mnBorderHeight;
-    bool mbInvalidate;
-};
-
 class ScInputBarGroup : public ScTextWndBase
 {
 
@@ -220,15 +207,17 @@ public:
     void            DecrementVerticalSize();
     long            GetNumLines() { return maTextWnd->GetNumLines(); }
     long            GetVertOffset() { return  mnVertOffset; }
+
 private:
     void            TriggerToolboxLayout();
-    VclPtr<ScMultiTextWnd>  maTextWnd;
-    VclPtr<ImageButton>     maButton;
-    VclPtr<ScrollBar>       maScrollbar;
+
+    VclPtr<ScTextWnd> maTextWnd;
+    VclPtr<ImageButton> maButton;
+    VclPtr<ScrollBar> maScrollbar;
     long            mnVertOffset;
+
     DECL_LINK_TYPED( ClickHdl, Button*, void );
     DECL_LINK_TYPED( Impl_ScrollHdl, ScrollBar*, void );
-
 };
 
 class ScInputWindow : public ToolBox                        // Parent toolbox
commit 5639a769fbcf672b1f32638764b4492674b894e6
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Fri Dec 11 09:21:46 2015 +0100

    sc: Prefix members of ScInputBarGroup.
    
    Change-Id: I72e4fdacb326a966b2717e235a58de856189a6cf

diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 8fe0dc7..f63884f 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -877,27 +877,27 @@ void ScInputWindow::MouseButtonUp( const MouseEvent& rMEvt )
 }
 
 ScInputBarGroup::ScInputBarGroup(vcl::Window* pParent, ScTabViewShell* pViewSh)
-    :   ScTextWndBase        ( pParent, WinBits(WB_HIDE |  WB_TABSTOP ) ),
-        aMultiTextWnd        ( VclPtr<ScMultiTextWnd>::Create(this, pViewSh) ),
-        aButton              ( VclPtr<ImageButton>::Create(this, WB_TABSTOP | WB_RECTSTYLE | WB_SMALLSTYLE) ),
-        aScrollBar           ( VclPtr<ScrollBar>::Create(this, WB_TABSTOP | WB_VERT | WB_DRAG) ),
-        nVertOffset          ( 0 )
+    : ScTextWndBase(pParent, WinBits(WB_HIDE | WB_TABSTOP)),
+      maTextWnd(VclPtr<ScMultiTextWnd>::Create(this, pViewSh)),
+      maButton(VclPtr<ImageButton>::Create(this, WB_TABSTOP | WB_RECTSTYLE | WB_SMALLSTYLE)),
+      maScrollbar(VclPtr<ScrollBar>::Create(this, WB_TABSTOP | WB_VERT | WB_DRAG)),
+      mnVertOffset(0)
 {
-    aMultiTextWnd->Show();
-    aMultiTextWnd->SetQuickHelpText(ScResId(SCSTR_QHELP_INPUTWND));
-    aMultiTextWnd->SetHelpId(HID_INSWIN_INPUT);
+    maTextWnd->Show();
+    maTextWnd->SetQuickHelpText(ScResId(SCSTR_QHELP_INPUTWND));
+    maTextWnd->SetHelpId(HID_INSWIN_INPUT);
 
-    Size aSize(GetSettings().GetStyleSettings().GetScrollBarSize(), aMultiTextWnd->GetPixelHeightForLines(1));
+    Size aSize(GetSettings().GetStyleSettings().GetScrollBarSize(), maTextWnd->GetPixelHeightForLines(1));
 
-    aButton->SetClickHdl(LINK(this, ScInputBarGroup, ClickHdl));
-    aButton->SetSizePixel(aSize);
-    aButton->Enable();
-    aButton->SetSymbol(SymbolType::SPIN_DOWN);
-    aButton->SetQuickHelpText(ScResId(SCSTR_QHELP_EXPAND_FORMULA));
-    aButton->Show();
+    maButton->SetClickHdl(LINK(this, ScInputBarGroup, ClickHdl));
+    maButton->SetSizePixel(aSize);
+    maButton->Enable();
+    maButton->SetSymbol(SymbolType::SPIN_DOWN);
+    maButton->SetQuickHelpText(ScResId(SCSTR_QHELP_EXPAND_FORMULA));
+    maButton->Show();
 
-    aScrollBar->SetSizePixel(aSize);
-    aScrollBar->SetScrollHdl(LINK(this, ScInputBarGroup, Impl_ScrollHdl));
+    maScrollbar->SetSizePixel(aSize);
+    maScrollbar->SetScrollHdl(LINK(this, ScInputBarGroup, Impl_ScrollHdl));
 }
 
 ScInputBarGroup::~ScInputBarGroup()
@@ -907,30 +907,30 @@ ScInputBarGroup::~ScInputBarGroup()
 
 void ScInputBarGroup::dispose()
 {
-    aMultiTextWnd.disposeAndClear();
-    aButton.disposeAndClear();
-    aScrollBar.disposeAndClear();
+    maTextWnd.disposeAndClear();
+    maButton.disposeAndClear();
+    maScrollbar.disposeAndClear();
     ScTextWndBase::dispose();
 }
 
 void ScInputBarGroup::InsertAccessibleTextData( ScAccessibleEditLineTextData& rTextData )
 {
-    aMultiTextWnd->InsertAccessibleTextData( rTextData );
+    maTextWnd->InsertAccessibleTextData( rTextData );
 }
 
 void ScInputBarGroup::RemoveAccessibleTextData( ScAccessibleEditLineTextData& rTextData )
 {
-    aMultiTextWnd->RemoveAccessibleTextData( rTextData );
+    maTextWnd->RemoveAccessibleTextData( rTextData );
 }
 
 const OUString& ScInputBarGroup::GetTextString() const
 {
-    return aMultiTextWnd->GetTextString();
+    return maTextWnd->GetTextString();
 }
 
 void ScInputBarGroup::SetTextString( const OUString& rString )
 {
-    aMultiTextWnd->SetTextString(rString);
+    maTextWnd->SetTextString(rString);
 }
 
 void ScInputBarGroup::Resize()
@@ -951,89 +951,89 @@ void ScInputBarGroup::Resize()
     Size aSize  = GetSizePixel();
     aSize.Width() = std::max(long(nWidth - nLeft - LEFT_OFFSET), long(0));
 
-    aScrollBar->SetPosPixel(Point( aSize.Width() - aButton->GetSizePixel().Width(), aButton->GetSizePixel().Height() ) );
+    maScrollbar->SetPosPixel(Point( aSize.Width() - maButton->GetSizePixel().Width(), maButton->GetSizePixel().Height() ) );
 
     Size aTmpSize( aSize );
-    aTmpSize.Width() = aTmpSize.Width() - aButton->GetSizePixel().Width() - BUTTON_OFFSET;
-    aMultiTextWnd->SetSizePixel(aTmpSize);
+    aTmpSize.Width() = aTmpSize.Width() - maButton->GetSizePixel().Width() - BUTTON_OFFSET;
+    maTextWnd->SetSizePixel(aTmpSize);
 
-    aMultiTextWnd->Resize();
+    maTextWnd->Resize();
 
-    aSize.Height() = aMultiTextWnd->GetSizePixel().Height();
+    aSize.Height() = maTextWnd->GetSizePixel().Height();
 
     SetSizePixel(aSize);
 
-    if (aMultiTextWnd->GetNumLines() > 1)
+    if (maTextWnd->GetNumLines() > 1)
     {
-        aButton->SetSymbol( SymbolType::SPIN_UP  );
-        aButton->SetQuickHelpText( ScResId( SCSTR_QHELP_COLLAPSE_FORMULA ) );
-        Size scrollSize = aButton->GetSizePixel();
-        scrollSize.Height() = aMultiTextWnd->GetSizePixel().Height() - aButton->GetSizePixel().Height();
-        aScrollBar->SetSizePixel( scrollSize );
+        maButton->SetSymbol( SymbolType::SPIN_UP  );
+        maButton->SetQuickHelpText( ScResId( SCSTR_QHELP_COLLAPSE_FORMULA ) );
+        Size scrollSize = maButton->GetSizePixel();
+        scrollSize.Height() = maTextWnd->GetSizePixel().Height() - maButton->GetSizePixel().Height();
+        maScrollbar->SetSizePixel( scrollSize );
 
-        Size aOutSz = aMultiTextWnd->GetOutputSize();
+        Size aOutSz = maTextWnd->GetOutputSize();
 
-        aScrollBar->SetVisibleSize( aOutSz.Height() );
-        aScrollBar->SetPageSize( aOutSz.Height() );
-        aScrollBar->SetLineSize( aMultiTextWnd->GetTextHeight() );
-        aScrollBar->SetRange( Range( 0, aMultiTextWnd->GetEditEngTxtHeight() ) );
+        maScrollbar->SetVisibleSize( aOutSz.Height() );
+        maScrollbar->SetPageSize( aOutSz.Height() );
+        maScrollbar->SetLineSize( maTextWnd->GetTextHeight() );
+        maScrollbar->SetRange( Range( 0, maTextWnd->GetEditEngTxtHeight() ) );
 
-        aScrollBar->Resize();
-        aScrollBar->Show();
+        maScrollbar->Resize();
+        maScrollbar->Show();
     }
     else
     {
-        aButton->SetSymbol( SymbolType::SPIN_DOWN  );
-        aButton->SetQuickHelpText( ScResId( SCSTR_QHELP_EXPAND_FORMULA ) );
-        aScrollBar->Hide();
+        maButton->SetSymbol( SymbolType::SPIN_DOWN  );
+        maButton->SetQuickHelpText( ScResId( SCSTR_QHELP_EXPAND_FORMULA ) );
+        maScrollbar->Hide();
     }
 
-    aButton->SetPosPixel(Point(aSize.Width() - aButton->GetSizePixel().Width(), 0));
+    maButton->SetPosPixel(Point(aSize.Width() - maButton->GetSizePixel().Width(), 0));
 
     Invalidate();
 }
 
 void ScInputBarGroup::StopEditEngine( bool bAll )
 {
-    aMultiTextWnd->StopEditEngine( bAll );
+    maTextWnd->StopEditEngine( bAll );
 }
 
 void ScInputBarGroup::StartEditEngine()
 {
-    aMultiTextWnd->StartEditEngine();
+    maTextWnd->StartEditEngine();
 }
 
 void ScInputBarGroup::MakeDialogEditView()
 {
-    aMultiTextWnd->MakeDialogEditView();
+    maTextWnd->MakeDialogEditView();
 }
 
 EditView* ScInputBarGroup::GetEditView()
 {
-    return aMultiTextWnd->GetEditView();
+    return maTextWnd->GetEditView();
 }
 
 bool ScInputBarGroup::IsInputActive()
 {
-    return aMultiTextWnd->IsInputActive();
+    return maTextWnd->IsInputActive();
 }
 
 void ScInputBarGroup::SetFormulaMode(bool bSet)
 {
-    aMultiTextWnd->SetFormulaMode(bSet);
+    maTextWnd->SetFormulaMode(bSet);
 }
 
 void ScInputBarGroup::IncrementVerticalSize()
 {
-    aMultiTextWnd->SetNumLines( aMultiTextWnd->GetNumLines() + 1 );
+    maTextWnd->SetNumLines( maTextWnd->GetNumLines() + 1 );
     TriggerToolboxLayout();
 }
 
 void ScInputBarGroup::DecrementVerticalSize()
 {
-    if ( aMultiTextWnd->GetNumLines() > 1 )
+    if ( maTextWnd->GetNumLines() > 1 )
     {
-        aMultiTextWnd->SetNumLines( aMultiTextWnd->GetNumLines() - 1 );
+        maTextWnd->SetNumLines( maTextWnd->GetNumLines() - 1 );
         TriggerToolboxLayout();
     }
 }
@@ -1049,19 +1049,19 @@ IMPL_LINK_NOARG_TYPED(ScInputBarGroup, ClickHdl, Button*, void)
         OSL_FAIL("The parent window pointer pParent is null");
         return;
     }
-    if (aMultiTextWnd->GetNumLines() > 1)
+    if (maTextWnd->GetNumLines() > 1)
     {
-        aMultiTextWnd->SetNumLines(1);
+        maTextWnd->SetNumLines(1);
     }
     else
     {
-        aMultiTextWnd->SetNumLines(aMultiTextWnd->GetLastNumExpandedLines());
+        maTextWnd->SetNumLines(maTextWnd->GetLastNumExpandedLines());
     }
     TriggerToolboxLayout();
 
     // Restore focus to input line(s) if necessary
     if (  SC_MOD()->GetInputHdl()->IsTopMode() )
-        aMultiTextWnd->GrabFocus();
+        maTextWnd->GrabFocus();
 }
 
 void ScInputBarGroup::TriggerToolboxLayout()
@@ -1073,8 +1073,8 @@ void ScInputBarGroup::TriggerToolboxLayout()
     // Capture the vertical position of this window in the toolbar, when we increase
     // the size of the toolbar to accommodate expanded line input we need to take this
     // into account
-    if ( !nVertOffset )
-        nVertOffset = rParent.GetItemPosRect( rParent.GetItemCount() - 1 ).Top();
+    if ( !mnVertOffset )
+        mnVertOffset = rParent.GetItemPosRect( rParent.GetItemCount() - 1 ).Top();
 
     if ( pViewFrm )
     {
@@ -1089,7 +1089,7 @@ void ScInputBarGroup::TriggerToolboxLayout()
 
         if ( xLayoutManager.is() )
         {
-            if ( aMultiTextWnd->GetNumLines() > 1)
+            if ( maTextWnd->GetNumLines() > 1)
                 rParent.SetToolbarLayoutMode( TBX_LAYOUT_LOCKVERT );
             else
                 rParent.SetToolbarLayoutMode( TBX_LAYOUT_NORMAL );
@@ -1117,12 +1117,12 @@ void ScInputBarGroup::TriggerToolboxLayout()
 
 IMPL_LINK_NOARG_TYPED(ScInputBarGroup, Impl_ScrollHdl, ScrollBar*, void)
 {
-    aMultiTextWnd->DoScroll();
+    maTextWnd->DoScroll();
 }
 
 void ScInputBarGroup::TextGrabFocus()
 {
-    aMultiTextWnd->TextGrabFocus();
+    maTextWnd->TextGrabFocus();
 }
 
 ScMultiTextWnd::ScMultiTextWnd( ScInputBarGroup* pParen, ScTabViewShell* pViewSh )
diff --git a/sc/source/ui/inc/inputwin.hxx b/sc/source/ui/inc/inputwin.hxx
index ddd6866..bb94592 100644
--- a/sc/source/ui/inc/inputwin.hxx
+++ b/sc/source/ui/inc/inputwin.hxx
@@ -215,17 +215,17 @@ public:
     void            SetFormulaMode( bool bSet ) override;
     void            MakeDialogEditView() override;
     bool            IsInputActive() override;
-    ScrollBar&      GetScrollBar() { return *aScrollBar.get(); }
+    ScrollBar&      GetScrollBar() { return *maScrollbar.get(); }
     void            IncrementVerticalSize();
     void            DecrementVerticalSize();
-    long            GetNumLines() { return aMultiTextWnd->GetNumLines(); }
-    long            GetVertOffset() { return  nVertOffset; }
+    long            GetNumLines() { return maTextWnd->GetNumLines(); }
+    long            GetVertOffset() { return  mnVertOffset; }
 private:
     void            TriggerToolboxLayout();
-    VclPtr<ScMultiTextWnd>  aMultiTextWnd;
-    VclPtr<ImageButton>     aButton;
-    VclPtr<ScrollBar>       aScrollBar;
-    long            nVertOffset;
+    VclPtr<ScMultiTextWnd>  maTextWnd;
+    VclPtr<ImageButton>     maButton;
+    VclPtr<ScrollBar>       maScrollbar;
+    long            mnVertOffset;
     DECL_LINK_TYPED( ClickHdl, Button*, void );
     DECL_LINK_TYPED( Impl_ScrollHdl, ScrollBar*, void );
 
commit b562c31d250dfb6cbf68711c0cbbbbb9eca3b62d
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Fri Dec 11 00:08:19 2015 +0100

    sc interpreter: Force OpenCL off when testing the s/w interpreter.
    
    Change-Id: I2a459605021ee31b67b4bfbfd1f2e17ccbd22aeb

diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx
index 69b46bb..841ae60 100644
--- a/sc/qa/unit/ucalc_formula.cxx
+++ b/sc/qa/unit/ucalc_formula.cxx
@@ -803,11 +803,14 @@ void Test::testFormulaHashAndTag()
     };
 
     bool bSwInterpreter = officecfg::Office::Common::Misc::UseSwInterpreter::get();
+    bool bOpenCL = officecfg::Office::Common::Misc::UseOpenCL::get();
 
     for (bool bForceSwInterpreter : { false, true })
     {
         std::shared_ptr< comphelper::ConfigurationChanges > xBatch(comphelper::ConfigurationChanges::create());
         officecfg::Office::Common::Misc::UseSwInterpreter::set(bForceSwInterpreter, xBatch);
+        if (bForceSwInterpreter)
+            officecfg::Office::Common::Misc::UseOpenCL::set(false, xBatch);
         xBatch->commit();
 
         for (size_t i = 0; i < SAL_N_ELEMENTS(aVectorTests); ++i)
@@ -828,6 +831,7 @@ void Test::testFormulaHashAndTag()
 
     std::shared_ptr< comphelper::ConfigurationChanges > xBatch(comphelper::ConfigurationChanges::create());
     officecfg::Office::Common::Misc::UseSwInterpreter::set(bSwInterpreter, xBatch);
+    officecfg::Office::Common::Misc::UseOpenCL::set(bOpenCL, xBatch);
     xBatch->commit();
 
     m_pDoc->DeleteTab(0);


More information about the Libreoffice-commits mailing list