sc/source/ui/inc/FilterFloatingWindow.hxx |   37 +++++++++++++++++
 sc/source/ui/inc/FilterListBox.hxx        |   65 ++++++++++++++++++++++++++++++
 sc/source/ui/inc/gridwin.hxx              |    3 -
 sc/source/ui/view/gridwin.cxx             |   63 +----------------------------
 4 files changed, 107 insertions(+), 61 deletions(-)

New commits:
commit 7f849f8cbc2ac6618e8b9cf61570942734318295
Author:     Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk>
AuthorDate: Tue Sep 1 16:29:15 2020 +0200
Commit:     Tomaž Vajngerl <qui...@gmail.com>
CommitDate: Sat Sep 26 21:43:00 2020 +0200

    sc: move FilterFloatingWindow and FilterListBox out of gridwin.cxx
    
    Change-Id: Ic6e4bb2be86f8c89ac1e5386eb78fe17036b4cc5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103404
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <qui...@gmail.com>

diff --git a/sc/source/ui/inc/FilterFloatingWindow.hxx 
b/sc/source/ui/inc/FilterFloatingWindow.hxx
new file mode 100644
index 000000000000..71c13c62c864
--- /dev/null
+++ b/sc/source/ui/inc/FilterFloatingWindow.hxx
@@ -0,0 +1,37 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include <vcl/floatwin.hxx>
+
+class ScFilterFloatingWindow : public FloatingWindow
+{
+private:
+    bool m_bGridHadMouseCaptured;
+
+public:
+    ScFilterFloatingWindow(vcl::Window* pParent);
+    virtual ~ScFilterFloatingWindow() override;
+    virtual void dispose() override;
+
+    bool MouseWasCaptured() const { return m_bGridHadMouseCaptured; }
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/FilterListBox.hxx 
b/sc/source/ui/inc/FilterListBox.hxx
new file mode 100644
index 000000000000..1a4685ff5656
--- /dev/null
+++ b/sc/source/ui/inc/FilterListBox.hxx
@@ -0,0 +1,65 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include <vcl/InterimItemWindow.hxx>
+
+class ScGridWindow;
+
+enum class ScFilterBoxMode
+{
+    DataSelect,
+    Scenario
+};
+
+class ScFilterListBox final : public InterimItemWindow
+{
+private:
+    std::unique_ptr<weld::TreeView> xTreeView;
+    VclPtr<ScGridWindow> pGridWin;
+    SCCOL nCol;
+    SCROW nRow;
+    bool bInit;
+    bool bCancelled;
+    sal_uLong nSel;
+    ScFilterBoxMode eMode;
+    ImplSVEvent* nAsyncSelectHdl;
+
+    DECL_LINK(SelectHdl, weld::TreeView&, bool);
+    DECL_LINK(KeyInputHdl, const KeyEvent&, bool);
+    DECL_LINK(AsyncSelectHdl, void*, void);
+
+public:
+    ScFilterListBox(vcl::Window* pParent, ScGridWindow* pGrid, SCCOL nNewCol, 
SCROW nNewRow,
+                    ScFilterBoxMode eNewMode);
+    virtual ~ScFilterListBox() override;
+    virtual void dispose() override;
+
+    weld::TreeView& get_widget() { return *xTreeView; }
+
+    SCCOL GetCol() const { return nCol; }
+    SCROW GetRow() const { return nRow; }
+    ScFilterBoxMode GetMode() const { return eMode; }
+    void EndInit();
+    bool IsInInit() const { return bInit; }
+    void SetCancelled() { bCancelled = true; }
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx
index 1af32863045c..8a5a0a751f2f 100644
--- a/sc/source/ui/inc/gridwin.hxx
+++ b/sc/source/ui/inc/gridwin.hxx
@@ -31,6 +31,7 @@
 #include <memory>
 #include <vector>
 
+
 namespace editeng {
     struct MisspellRanges;
 }
@@ -46,7 +47,6 @@ struct ScTableInfo;
 class ScDPObject;
 class ScDPFieldButton;
 class ScOutputData;
-class ScFilterListBox;
 class SdrObject;
 class SdrEditView;
 class ScNoteMarker;
@@ -82,6 +82,7 @@ struct SpellCallbackInfo;
 // predefines
 namespace sdr::overlay { class OverlayObjectList; }
 
+class ScFilterListBox;
 class ScFilterFloatingWindow;
 
 class SAL_DLLPUBLIC_RTTI ScGridWindow : public vcl::Window, public 
DropTargetHelper, public DragSourceHelper
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index d0826b1fd45a..d2e6939b3826 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -37,7 +37,6 @@
 #include <sfx2/ipclient.hxx>
 #include <svl/stritem.hxx>
 #include <svl/sharedstringpool.hxx>
-#include <vcl/InterimItemWindow.hxx>
 #include <vcl/canvastools.hxx>
 #include <vcl/commandevent.hxx>
 #include <vcl/cursor.hxx>
@@ -139,19 +138,12 @@
 #include <vector>
 #include <boost/property_tree/json_parser.hpp>
 
+#include <FilterListBox.hxx>
+#include <FilterFloatingWindow.hxx>
+
 using namespace css;
 using namespace css::uno;
 
-namespace {
-
-enum class ScFilterBoxMode
-{
-    DataSelect,
-    Scenario
-};
-
-}
-
 struct ScGridWindow::MouseEventState
 {
     bool mbActivatePart;
@@ -188,39 +180,6 @@ bool ScGridWindow::VisibleRange::set(SCCOL nCol1, SCROW 
nRow1, SCCOL nCol2, SCRO
     return bChanged;
 }
 
-class ScFilterListBox final : public InterimItemWindow
-{
-private:
-    std::unique_ptr<weld::TreeView> xTreeView;
-    VclPtr<ScGridWindow>   pGridWin;
-    SCCOL           nCol;
-    SCROW           nRow;
-    bool            bInit;
-    bool            bCancelled;
-    sal_uLong       nSel;
-    ScFilterBoxMode eMode;
-    ImplSVEvent* nAsyncSelectHdl;
-
-    DECL_LINK(SelectHdl, weld::TreeView&, bool);
-    DECL_LINK(KeyInputHdl, const KeyEvent&, bool);
-    DECL_LINK(AsyncSelectHdl, void*, void);
-
-public:
-    ScFilterListBox( vcl::Window* pParent, ScGridWindow* pGrid,
-                     SCCOL nNewCol, SCROW nNewRow, ScFilterBoxMode eNewMode );
-    virtual ~ScFilterListBox() override;
-    virtual void dispose() override;
-
-    weld::TreeView& get_widget() { return *xTreeView; }
-
-    SCCOL           GetCol() const          { return nCol; }
-    SCROW           GetRow() const          { return nRow; }
-    ScFilterBoxMode GetMode() const         { return eMode; }
-    void            EndInit();
-    bool            IsInInit() const        { return bInit; }
-    void            SetCancelled()          { bCancelled = true; }
-};
-
 //  ListBox in a FloatingWindow (pParent)
 ScFilterListBox::ScFilterListBox( vcl::Window* pParent, ScGridWindow* pGrid,
                                   SCCOL nNewCol, SCROW nNewRow, 
ScFilterBoxMode eNewMode ) :
@@ -316,22 +275,6 @@ IMPL_LINK_NOARG(ScFilterListBox, AsyncSelectHdl, void*, 
void)
     pGridWin->ClickExtern();
 }
 
-// use a System floating window for the above filter listbox
-class ScFilterFloatingWindow : public FloatingWindow
-{
-private:
-    bool m_bGridHadMouseCaptured;
-public:
-    ScFilterFloatingWindow(vcl::Window* pParent);
-    virtual ~ScFilterFloatingWindow() override;
-    virtual void dispose() override;
-
-    bool MouseWasCaptured() const
-    {
-        return m_bGridHadMouseCaptured;
-    }
-};
-
 ScFilterFloatingWindow::ScFilterFloatingWindow(vcl::Window* pParent)
     : FloatingWindow( pParent, WB_BORDER | WB_SYSTEMWINDOW ) // make it a 
system floater
     , m_bGridHadMouseCaptured(pParent->IsMouseCaptured())
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to