[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - cui/source cui/uiconfig svx/source

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Thu Dec 17 15:51:43 UTC 2020


 cui/source/dialogs/sdrcelldlg.cxx    |    7 +++++
 cui/source/inc/sdrcelldlg.hxx        |    2 +
 cui/uiconfig/ui/formatcellsdialog.ui |   48 +++++++++++++++++++++++++++++++++++
 svx/source/table/tablecontroller.cxx |   12 ++++++++
 4 files changed, 69 insertions(+)

New commits:
commit 14363dd0dad9a4d3f7c64b9e6bcec559251a125b
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Mon Dec 14 12:15:09 2020 +0100
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Thu Dec 17 16:51:09 2020 +0100

    tdf#129961 cui: start UI for table shadow as direct format
    
    It reads from the doc model and shows it, but doesn't write it back yet.
    
    (cherry picked from commit 74ba28fe238b7f15d1fb7d119e4cef3a7b544e0b)
    
    Change-Id: I6611229e71d0a49f09576ca452b901958c33db58
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107879
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

diff --git a/cui/source/dialogs/sdrcelldlg.cxx b/cui/source/dialogs/sdrcelldlg.cxx
index 3c745692f7ea..fda8b4ce1385 100644
--- a/cui/source/dialogs/sdrcelldlg.cxx
+++ b/cui/source/dialogs/sdrcelldlg.cxx
@@ -27,6 +27,7 @@ SvxFormatCellsDialog::SvxFormatCellsDialog(weld::Window* pParent, const SfxItemS
     : SfxTabDialogController(pParent, "cui/ui/formatcellsdialog.ui", "FormatCellsDialog", pAttr)
     , mrOutAttrs(*pAttr)
     , mpColorTab(rModel.GetColorList())
+    , mnColorTabState ( ChangeType::NONE )
     , mpGradientList(rModel.GetGradientList())
     , mpHatchingList(rModel.GetHatchList())
     , mpBitmapList(rModel.GetBitmapList())
@@ -36,6 +37,7 @@ SvxFormatCellsDialog::SvxFormatCellsDialog(weld::Window* pParent, const SfxItemS
     AddTabPage("effects", RID_SVXPAGE_CHAR_EFFECTS);
     AddTabPage("border", RID_SVXPAGE_BORDER );
     AddTabPage("area", RID_SVXPAGE_AREA);
+    AddTabPage("shadow", SvxShadowTabPage::Create, nullptr);
 }
 
 void SvxFormatCellsDialog::PageCreated(const OString& rId, SfxTabPage &rPage)
@@ -55,6 +57,11 @@ void SvxFormatCellsDialog::PageCreated(const OString& rId, SfxTabPage &rPage)
         SvxBorderTabPage& rBorderPage = static_cast<SvxBorderTabPage&>(rPage);
         rBorderPage.SetTableMode();
     }
+    else if (rId == "shadow")
+    {
+        static_cast<SvxShadowTabPage&>(rPage).SetColorList( mpColorTab );
+        static_cast<SvxShadowTabPage&>(rPage).SetColorChgd( &mnColorTabState );
+    }
     else
         SfxTabDialogController::PageCreated(rId, rPage);
 }
diff --git a/cui/source/inc/sdrcelldlg.hxx b/cui/source/inc/sdrcelldlg.hxx
index 50ab4b39ac70..9f068d552393 100644
--- a/cui/source/inc/sdrcelldlg.hxx
+++ b/cui/source/inc/sdrcelldlg.hxx
@@ -23,6 +23,7 @@
 
 #include <sfx2/tabdlg.hxx>
 #include <svx/xtable.hxx>
+#include <svx/tabarea.hxx>
 
 class SdrModel;
 class SvxFormatCellsDialog : public SfxTabDialogController
@@ -31,6 +32,7 @@ private:
     const SfxItemSet&   mrOutAttrs;
 
     XColorListRef       mpColorTab;
+    ChangeType          mnColorTabState;
     XGradientListRef    mpGradientList;
     XHatchListRef       mpHatchingList;
     XBitmapListRef      mpBitmapList;
diff --git a/cui/uiconfig/ui/formatcellsdialog.ui b/cui/uiconfig/ui/formatcellsdialog.ui
index 82243f0bad10..49dfc705483c 100644
--- a/cui/uiconfig/ui/formatcellsdialog.ui
+++ b/cui/uiconfig/ui/formatcellsdialog.ui
@@ -281,6 +281,54 @@
                 <property name="tab_fill">False</property>
               </packing>
             </child>
+            <child>
+              <!-- n-columns=1 n-rows=1 -->
+              <object class="GtkGrid">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+                <child>
+                  <placeholder/>
+                </child>
+              </object>
+              <packing>
+                <property name="position">4</property>
+              </packing>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="shadow">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes" context="formatcellsdialog|shadow">Shadow</property>
+              </object>
+              <packing>
+                <property name="position">5</property>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
           </object>
           <packing>
             <property name="expand">False</property>
diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx
index 232ed782414a..07fb110756b0 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -920,6 +920,18 @@ void SvxTableController::onFormatTable(const SfxRequest& rReq)
         aNewAttr.Put( aBoxItem );
         aNewAttr.Put( aBoxInfoItem );
 
+        // Fill in shadow properties.
+        const SfxItemSet& rTableItemSet = rTableObj.GetMergedItemSet();
+        for (sal_uInt16 nWhich = SDRATTR_SHADOW_FIRST; nWhich <= SDRATTR_SHADOW_LAST; ++nWhich)
+        {
+            if (rTableItemSet.GetItemState(nWhich, false) != SfxItemState::SET)
+            {
+                continue;
+            }
+
+            aNewAttr.Put(rTableItemSet.Get(nWhich));
+        }
+
         SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
         std::shared_ptr<AbstractTabController> xDlg( pFact->CreateSvxFormatCellsDialog(
             rReq.GetFrameWeld(),


More information about the Libreoffice-commits mailing list