[Libreoffice-commits] core.git: extras/source sd/Library_sd.mk sd/source sd/uiconfig sd/UIConfig_simpress.mk

Szymon Kłos eszkadev at gmail.com
Mon Jul 11 13:14:58 UTC 2016


 extras/source/glade/libreoffice-catalog.xml.in        |    3 
 sd/Library_sd.mk                                      |    1 
 sd/UIConfig_simpress.mk                               |    1 
 sd/source/ui/table/TableDesignBox.cxx                 |   80 ++++++++++
 sd/source/ui/table/TableDesignPane.cxx                |    2 
 sd/source/ui/table/TableDesignPane.hxx                |    6 
 sd/uiconfig/simpress/ui/notebookbar.ui                |   25 +++
 sd/uiconfig/simpress/ui/tabledesignpanelhorizontal.ui |  142 ++++++++++++++++++
 8 files changed, 258 insertions(+), 2 deletions(-)

New commits:
commit 4f71b88ad0ee71aead9ef20bb6efa58c5e1753b9
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Fri Jul 8 00:03:43 2016 +0200

    GSoC notebookbar: impress table tab
    
    Change-Id: I50338e2f5405171785ea610a9febc3d4f5df96e5
    Reviewed-on: https://gerrit.libreoffice.org/27052
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>

diff --git a/extras/source/glade/libreoffice-catalog.xml.in b/extras/source/glade/libreoffice-catalog.xml.in
index b92d24b..71305a0 100644
--- a/extras/source/glade/libreoffice-catalog.xml.in
+++ b/extras/source/glade/libreoffice-catalog.xml.in
@@ -830,5 +830,8 @@
     <glade-widget-class title="Horizontal box hiding childs depending on its priorities" name="sfxlo-PriorityHBox"
                         generic-name="PriorityHBox" parent="GtkBox"
                         icon-name="widget-gtk-box"/>
+    <glade-widget-class title="Table Design Control" name="sdlo-TableDesignBox"
+                        generic-name="TableDesignBox" parent="GtkImage"
+                        icon-name="widget-gtk-image"/>
   </glade-widget-classes>
 </glade-catalog>
diff --git a/sd/Library_sd.mk b/sd/Library_sd.mk
index 72ea43e..8bed9f6 100644
--- a/sd/Library_sd.mk
+++ b/sd/Library_sd.mk
@@ -400,6 +400,7 @@ $(eval $(call gb_Library_add_exception_objects,sd,\
 	sd/source/ui/slidesorter/view/SlsTheme \
 	sd/source/ui/slidesorter/view/SlsToolTip \
 	sd/source/ui/slidesorter/view/SlsViewCacheContext \
+	sd/source/ui/table/TableDesignBox \
 	sd/source/ui/table/TableDesignPane \
 	sd/source/ui/table/tablefunction \
 	sd/source/ui/table/tableobjectbar \
diff --git a/sd/UIConfig_simpress.mk b/sd/UIConfig_simpress.mk
index a5351dc..dad22b214 100644
--- a/sd/UIConfig_simpress.mk
+++ b/sd/UIConfig_simpress.mk
@@ -133,6 +133,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/simpress,\
 	sd/uiconfig/simpress/ui/slidetransitionspanel \
 	sd/uiconfig/simpress/ui/slidetransitionspanelhorizontal \
 	sd/uiconfig/simpress/ui/tabledesignpanel \
+	sd/uiconfig/simpress/ui/tabledesignpanelhorizontal \
 	sd/uiconfig/simpress/ui/templatedialog \
 ))
 
diff --git a/sd/source/ui/table/TableDesignBox.cxx b/sd/source/ui/table/TableDesignBox.cxx
new file mode 100644
index 0000000..981a9dc
--- /dev/null
+++ b/sd/source/ui/table/TableDesignBox.cxx
@@ -0,0 +1,80 @@
+/* -*- 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 .
+ */
+
+#include "ViewShellBase.hxx"
+#include <sfx2/viewfrm.hxx>
+#include "TableDesignPane.hxx"
+#include <vcl/builderfactory.hxx>
+#include <vcl/layout.hxx>
+
+namespace sd
+{
+
+class TableDesignBox : public VclVBox
+{
+    VclPtr<TableDesignPane> m_pPane;
+    bool m_bIsInitialized;
+
+public:
+    TableDesignBox(vcl::Window* pParent);
+    ~TableDesignBox() override;
+
+    virtual void dispose() override;
+    virtual void StateChanged(StateChangedType nStateChange) override;
+};
+
+VCL_BUILDER_FACTORY(TableDesignBox);
+
+TableDesignBox::TableDesignBox(vcl::Window* pParent)
+    : VclVBox(pParent)
+    , m_bIsInitialized(false)
+{
+}
+
+TableDesignBox::~TableDesignBox()
+{
+    disposeOnce();
+}
+
+void TableDesignBox::dispose()
+{
+    m_pPane.disposeAndClear();
+    VclVBox::dispose();
+}
+
+void TableDesignBox::StateChanged(StateChangedType nStateChange)
+{
+    if(SfxViewFrame::Current() && !m_bIsInitialized)
+    {
+        ViewShellBase* pBase = ViewShellBase::GetViewShellBase(SfxViewFrame::Current());
+
+        if(pBase)
+        {
+            m_pPane = VclPtr<TableDesignPane>::Create(this, *pBase, false);
+            m_pPane->Show();
+            m_pPane->SetSizePixel(GetSizePixel());
+            m_bIsInitialized = true;
+        }
+    }
+    VclVBox::StateChanged(nStateChange);
+}
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/table/TableDesignPane.cxx b/sd/source/ui/table/TableDesignPane.cxx
index 8487389..f1eb9e8 100644
--- a/sd/source/ui/table/TableDesignPane.cxx
+++ b/sd/source/ui/table/TableDesignPane.cxx
@@ -317,7 +317,6 @@ void TableValueSet::Resize()
         Image aImage = GetItemImage(GetItemId(0));
         Size aItemSize = aImage.GetSizePixel();
 
-        aItemSize.Width() += 10;
         aItemSize.Height() += 10;
         int nColumnCount = (aValueSetSize.Width() - GetScrollWidth()) / aItemSize.Width();
         if (nColumnCount < 1)
@@ -783,6 +782,7 @@ void TableDesignWidget::FillDesignPreviewControl()
         aSize.Height() += (10 * nRows);
         m_pValueSet->set_width_request(aSize.Width());
         m_pValueSet->set_height_request(aSize.Height());
+        m_pValueSet->Resize();
     }
     catch( Exception& )
     {
diff --git a/sd/source/ui/table/TableDesignPane.hxx b/sd/source/ui/table/TableDesignPane.hxx
index 886848b..13b45af 100644
--- a/sd/source/ui/table/TableDesignPane.hxx
+++ b/sd/source/ui/table/TableDesignPane.hxx
@@ -115,6 +115,12 @@ public:
         , aImpl(this, rBase, false)
     {
     }
+    TableDesignPane( vcl::Window* pParent, ViewShellBase& rBase, bool )
+        : PanelLayout(pParent, "TableDesignPanel",
+        "modules/simpress/ui/tabledesignpanelhorizontal.ui", css::uno::Reference<css::frame::XFrame>())
+        , aImpl(this, rBase, false)
+    {
+    }
 };
 
 class TableDesignDialog : public ModalDialog
diff --git a/sd/uiconfig/simpress/ui/notebookbar.ui b/sd/uiconfig/simpress/ui/notebookbar.ui
index 7ef837e..677c484 100644
--- a/sd/uiconfig/simpress/ui/notebookbar.ui
+++ b/sd/uiconfig/simpress/ui/notebookbar.ui
@@ -227,7 +227,7 @@
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
                         <child>
-                          <object class="sdlo-SmallButton" id="Paste">
+                          <object class="vcllo-SmallButton" id="Paste">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="receives_default">True</property>
@@ -2571,6 +2571,29 @@
                 <property name="tab_fill">False</property>
               </packing>
             </child>
+            <child>
+              <object class="sdlo-TableDesignBox" id="TableDesignBox">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+              </object>
+              <packing>
+                <property name="position">8</property>
+              </packing>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="TableLabel">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Table</property>
+                <style>
+                  <class name="context-Table"/>
+                </style>
+              </object>
+              <packing>
+                <property name="position">9</property>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
           </object>
           <packing>
             <property name="expand">False</property>
diff --git a/sd/uiconfig/simpress/ui/tabledesignpanelhorizontal.ui b/sd/uiconfig/simpress/ui/tabledesignpanelhorizontal.ui
new file mode 100644
index 0000000..72847b2
--- /dev/null
+++ b/sd/uiconfig/simpress/ui/tabledesignpanelhorizontal.ui
@@ -0,0 +1,142 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.18.3 -->
+<interface>
+  <requires lib="gtk+" version="3.0"/>
+  <requires lib="LibreOffice" version="1.0"/>
+  <object class="GtkBox" id="TableDesignPanel">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="hexpand">True</property>
+    <property name="orientation">vertical</property>
+    <property name="spacing">12</property>
+    <child>
+      <object class="GtkBox" id="box1">
+        <property name="height_request">70</property>
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <child>
+          <object class="sdlo-TableValueSet" id="previews:border">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="hexpand">True</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkGrid" id="grid1">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="hexpand">True</property>
+            <property name="row_spacing">6</property>
+            <property name="column_spacing">6</property>
+            <property name="row_homogeneous">True</property>
+            <child>
+              <object class="GtkCheckButton" id="UseFirstRowStyle">
+                <property name="label" translatable="yes">_Header row</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">False</property>
+                <property name="use_underline">True</property>
+                <property name="xalign">0</property>
+                <property name="draw_indicator">True</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkCheckButton" id="UseLastRowStyle">
+                <property name="label" translatable="yes">Tot_al row</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">False</property>
+                <property name="use_underline">True</property>
+                <property name="xalign">0</property>
+                <property name="draw_indicator">True</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkCheckButton" id="UseBandingRowStyle">
+                <property name="label" translatable="yes">_Banded rows</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">False</property>
+                <property name="use_underline">True</property>
+                <property name="xalign">0</property>
+                <property name="draw_indicator">True</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="top_attach">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkCheckButton" id="UseBandingColumnStyle">
+                <property name="label" translatable="yes">Ba_nded columns</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">False</property>
+                <property name="use_underline">True</property>
+                <property name="xalign">0</property>
+                <property name="draw_indicator">True</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="top_attach">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkCheckButton" id="UseFirstColumnStyle">
+                <property name="label" translatable="yes">Fi_rst column</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">False</property>
+                <property name="use_underline">True</property>
+                <property name="xalign">0</property>
+                <property name="draw_indicator">True</property>
+              </object>
+              <packing>
+                <property name="left_attach">2</property>
+                <property name="top_attach">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkCheckButton" id="UseLastColumnStyle">
+                <property name="label" translatable="yes">_Last column</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">False</property>
+                <property name="use_underline">True</property>
+                <property name="xalign">0</property>
+                <property name="draw_indicator">True</property>
+              </object>
+              <packing>
+                <property name="left_attach">2</property>
+                <property name="top_attach">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="fill">True</property>
+        <property name="position">0</property>
+      </packing>
+    </child>
+  </object>
+</interface>


More information about the Libreoffice-commits mailing list