[Libreoffice-commits] core.git: 3 commits - chart2/source chart2/uiconfig svx/source

Markus Mohrhard markus.mohrhard at googlemail.com
Sun Sep 20 12:34:41 PDT 2015


 chart2/source/controller/sidebar/ChartElementsPanel.cxx |   57 +++++++------
 chart2/source/controller/sidebar/ChartElementsPanel.hxx |   17 ++--
 chart2/uiconfig/ui/sidebarelements.ui                   |   66 +++++++---------
 svx/source/sidebar/line/LinePropertyPanelBase.cxx       |    2 
 4 files changed, 72 insertions(+), 70 deletions(-)

New commits:
commit 85eb1e5148ec657c8e582a0faf3ffa75009a4788
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sun Sep 20 21:29:41 2015 +0200

    use localized string for title text, tdf#94294
    
    Change-Id: Id27e5c3794b728ce79d63b6c7d552df0cc1ba239

diff --git a/chart2/source/controller/sidebar/ChartElementsPanel.cxx b/chart2/source/controller/sidebar/ChartElementsPanel.cxx
index 985f997..8d9317a 100644
--- a/chart2/source/controller/sidebar/ChartElementsPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartElementsPanel.cxx
@@ -37,7 +37,6 @@
 #include <comphelper/processfactory.hxx>
 
 #include "LegendHelper.hxx"
-#include "TitleHelper.hxx"
 #include "ChartModelHelper.hxx"
 #include "AxisHelper.hxx"
 #include "DiagramHelper.hxx"
@@ -119,18 +118,6 @@ bool isTitleVisisble(css::uno::Reference<css::frame::XModel> xModel, TitleHelper
     return TitleHelper::getTitle(eTitle, xModel).is();
 }
 
-void setTitleVisible(css::uno::Reference<css::frame::XModel> xModel, TitleHelper::eTitleType eTitle, bool bVisible)
-{
-    if (bVisible)
-    {
-        TitleHelper::createTitle(eTitle, "Title", xModel, comphelper::getProcessComponentContext());
-    }
-    else
-    {
-        TitleHelper::removeTitle(eTitle, xModel);
-    }
-}
-
 bool isGridVisible(css::uno::Reference<css::frame::XModel> xModel, GridType eType)
 {
     Reference< chart2::XDiagram > xDiagram(ChartModelHelper::findDiagram(xModel));
@@ -313,6 +300,12 @@ ChartElementsPanel::ChartElementsPanel(
     get(mpLBLegendPosition, "comboboxtext_legend");
     get(mpBoxLegend, "box_legend");
 
+    get(mpTextTitle, "text_title");
+    get(mpTextSubTitle, "text_subtitle");
+
+    maTextTitle = mpTextTitle->GetText();
+    maTextSubTitle = mpTextSubTitle->GetText();
+
     Initialize();
 }
 
@@ -347,6 +340,9 @@ void ChartElementsPanel::dispose()
     mpLBLegendPosition.clear();
     mpBoxLegend.clear();
 
+    mpTextTitle.clear();
+    mpTextSubTitle.clear();
+
     PanelLayout::dispose();
 }
 
@@ -472,29 +468,29 @@ IMPL_LINK_TYPED(ChartElementsPanel, CheckBoxHdl, Button*, pButton, void)
     CheckBox* pCheckBox = static_cast<CheckBox*>(pButton);
     bool bChecked = pCheckBox->IsChecked();
     if (pCheckBox == mpCBTitle.get())
-        setTitleVisible(mxModel, TitleHelper::MAIN_TITLE, bChecked);
+        setTitleVisible(TitleHelper::MAIN_TITLE, bChecked);
     else if (pCheckBox == mpCBSubtitle.get())
-        setTitleVisible(mxModel, TitleHelper::SUB_TITLE, bChecked);
+        setTitleVisible(TitleHelper::SUB_TITLE, bChecked);
     else if (pCheckBox == mpCBXAxis.get())
         setAxisVisible(mxModel, AxisType::X_MAIN, bChecked);
     else if (pCheckBox == mpCBXAxisTitle.get())
-        setTitleVisible(mxModel, TitleHelper::X_AXIS_TITLE, bChecked);
+        setTitleVisible(TitleHelper::X_AXIS_TITLE, bChecked);
     else if (pCheckBox == mpCBYAxis.get())
         setAxisVisible(mxModel, AxisType::Y_MAIN, bChecked);
     else if (pCheckBox == mpCBYAxisTitle.get())
-        setTitleVisible(mxModel, TitleHelper::Y_AXIS_TITLE, bChecked);
+        setTitleVisible(TitleHelper::Y_AXIS_TITLE, bChecked);
     else if (pCheckBox == mpCBZAxis.get())
         setAxisVisible(mxModel, AxisType::Z_MAIN, bChecked);
     else if (pCheckBox == mpCBZAxisTitle.get())
-        setTitleVisible(mxModel, TitleHelper::Z_AXIS_TITLE, bChecked);
+        setTitleVisible(TitleHelper::Z_AXIS_TITLE, bChecked);
     else if (pCheckBox == mpCB2ndXAxis.get())
         setAxisVisible(mxModel, AxisType::X_SECOND, bChecked);
     else if (pCheckBox == mpCB2ndXAxisTitle.get())
-        setTitleVisible(mxModel, TitleHelper::SECONDARY_X_AXIS_TITLE, bChecked);
+        setTitleVisible(TitleHelper::SECONDARY_X_AXIS_TITLE, bChecked);
     else if (pCheckBox == mpCB2ndYAxis.get())
         setAxisVisible(mxModel, AxisType::Y_SECOND, bChecked);
     else if (pCheckBox == mpCB2ndYAxisTitle.get())
-        setTitleVisible(mxModel, TitleHelper::SECONDARY_Y_AXIS_TITLE, bChecked);
+        setTitleVisible(TitleHelper::SECONDARY_Y_AXIS_TITLE, bChecked);
     else if (pCheckBox == mpCBLegend.get())
     {
         mpBoxLegend->Enable( bChecked );
@@ -517,6 +513,19 @@ IMPL_LINK_NOARG(ChartElementsPanel, LegendPosHdl)
     return 0;
 }
 
+void ChartElementsPanel::setTitleVisible(TitleHelper::eTitleType eTitle, bool bVisible)
+{
+    if (bVisible)
+    {
+        OUString aText = eTitle == TitleHelper::SUB_TITLE ? maTextSubTitle : maTextTitle;
+        TitleHelper::createTitle(eTitle, aText, mxModel, comphelper::getProcessComponentContext());
+    }
+    else
+    {
+        TitleHelper::removeTitle(eTitle, mxModel);
+    }
+}
+
 }} // end of namespace ::chart::sidebar
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/sidebar/ChartElementsPanel.hxx b/chart2/source/controller/sidebar/ChartElementsPanel.hxx
index c5ffae2..39d78d9 100644
--- a/chart2/source/controller/sidebar/ChartElementsPanel.hxx
+++ b/chart2/source/controller/sidebar/ChartElementsPanel.hxx
@@ -25,6 +25,7 @@
 #include <svx/sidebar/PanelLayout.hxx>
 #include <vcl/layout.hxx>
 #include "ChartSidebarModifyListener.hxx"
+#include "TitleHelper.hxx"
 
 #include <com/sun/star/util/XModifyListener.hpp>
 
@@ -89,6 +90,8 @@ private:
     VclPtr<CheckBox> mpCBGridHorizontalMajor;
     VclPtr<CheckBox> mpCBGridVerticalMinor;
     VclPtr<CheckBox> mpCBGridHorizontalMinor;
+    VclPtr<FixedText> mpTextTitle;
+    VclPtr<FixedText> mpTextSubTitle;
 
     VclPtr<ListBox> mpLBLegendPosition;
     VclPtr<VclHBox> mpBoxLegend;
@@ -101,8 +104,13 @@ private:
 
     bool mbModelValid;
 
+    OUString maTextTitle;
+    OUString maTextSubTitle;
+
     void Initialize();
 
+    void setTitleVisible(TitleHelper::eTitleType eTitle, bool bVisible);
+
     DECL_LINK_TYPED(CheckBoxHdl, Button*, void);
     DECL_LINK(LegendPosHdl, void*);
 };
diff --git a/chart2/uiconfig/ui/sidebarelements.ui b/chart2/uiconfig/ui/sidebarelements.ui
index 20d02e2..e844314 100644
--- a/chart2/uiconfig/ui/sidebarelements.ui
+++ b/chart2/uiconfig/ui/sidebarelements.ui
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.16.1 -->
+<!-- Generated with glade 3.18.3 -->
 <interface>
   <requires lib="gtk+" version="3.0"/>
   <object class="GtkGrid" id="ChartElementsPanel">
@@ -42,8 +42,6 @@
                       <packing>
                         <property name="left_attach">1</property>
                         <property name="top_attach">0</property>
-                        <property name="width">1</property>
-                        <property name="height">1</property>
                       </packing>
                     </child>
                     <child>
@@ -58,8 +56,6 @@
                       <packing>
                         <property name="left_attach">0</property>
                         <property name="top_attach">0</property>
-                        <property name="width">1</property>
-                        <property name="height">1</property>
                       </packing>
                     </child>
                   </object>
@@ -211,8 +207,6 @@
                       <packing>
                         <property name="left_attach">0</property>
                         <property name="top_attach">0</property>
-                        <property name="width">1</property>
-                        <property name="height">1</property>
                       </packing>
                     </child>
                     <child>
@@ -227,8 +221,6 @@
                       <packing>
                         <property name="left_attach">1</property>
                         <property name="top_attach">0</property>
-                        <property name="width">1</property>
-                        <property name="height">1</property>
                       </packing>
                     </child>
                     <child>
@@ -243,8 +235,6 @@
                       <packing>
                         <property name="left_attach">0</property>
                         <property name="top_attach">1</property>
-                        <property name="width">1</property>
-                        <property name="height">1</property>
                       </packing>
                     </child>
                     <child>
@@ -259,8 +249,6 @@
                       <packing>
                         <property name="left_attach">1</property>
                         <property name="top_attach">1</property>
-                        <property name="width">1</property>
-                        <property name="height">1</property>
                       </packing>
                     </child>
                     <child>
@@ -275,8 +263,6 @@
                       <packing>
                         <property name="left_attach">0</property>
                         <property name="top_attach">2</property>
-                        <property name="width">1</property>
-                        <property name="height">1</property>
                       </packing>
                     </child>
                     <child>
@@ -291,8 +277,6 @@
                       <packing>
                         <property name="left_attach">1</property>
                         <property name="top_attach">2</property>
-                        <property name="width">1</property>
-                        <property name="height">1</property>
                       </packing>
                     </child>
                     <child>
@@ -306,8 +290,6 @@
                       <packing>
                         <property name="left_attach">0</property>
                         <property name="top_attach">3</property>
-                        <property name="width">1</property>
-                        <property name="height">1</property>
                       </packing>
                     </child>
                     <child>
@@ -321,8 +303,6 @@
                       <packing>
                         <property name="left_attach">1</property>
                         <property name="top_attach">3</property>
-                        <property name="width">1</property>
-                        <property name="height">1</property>
                       </packing>
                     </child>
                     <child>
@@ -336,8 +316,6 @@
                       <packing>
                         <property name="left_attach">0</property>
                         <property name="top_attach">4</property>
-                        <property name="width">1</property>
-                        <property name="height">1</property>
                       </packing>
                     </child>
                     <child>
@@ -351,8 +329,6 @@
                       <packing>
                         <property name="left_attach">1</property>
                         <property name="top_attach">4</property>
-                        <property name="width">1</property>
-                        <property name="height">1</property>
                       </packing>
                     </child>
                   </object>
@@ -406,8 +382,6 @@
                       <packing>
                         <property name="left_attach">0</property>
                         <property name="top_attach">0</property>
-                        <property name="width">1</property>
-                        <property name="height">1</property>
                       </packing>
                     </child>
                     <child>
@@ -422,8 +396,6 @@
                       <packing>
                         <property name="left_attach">0</property>
                         <property name="top_attach">1</property>
-                        <property name="width">1</property>
-                        <property name="height">1</property>
                       </packing>
                     </child>
                     <child>
@@ -438,8 +410,6 @@
                       <packing>
                         <property name="left_attach">1</property>
                         <property name="top_attach">0</property>
-                        <property name="width">1</property>
-                        <property name="height">1</property>
                       </packing>
                     </child>
                     <child>
@@ -454,8 +424,6 @@
                       <packing>
                         <property name="left_attach">1</property>
                         <property name="top_attach">1</property>
-                        <property name="width">1</property>
-                        <property name="height">1</property>
                       </packing>
                     </child>
                   </object>
@@ -479,12 +447,40 @@
             <property name="position">3</property>
           </packing>
         </child>
+        <child>
+          <object class="GtkGrid" id="grid4">
+            <property name="can_focus">False</property>
+            <child>
+              <object class="GtkLabel" id="text_title">
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Title</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="text_subtitle">
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Subtitle</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="top_attach">0</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">4</property>
+          </packing>
+        </child>
       </object>
       <packing>
         <property name="left_attach">0</property>
         <property name="top_attach">1</property>
-        <property name="width">1</property>
-        <property name="height">1</property>
       </packing>
     </child>
     <child>
commit e1afea91e9662424480b8ad9f50842cfa224331e
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sun Sep 20 18:46:06 2015 +0200

    remove unnecessary base class
    
    Change-Id: Iaa1890d11f9bfba7a8b0996b9adf79b781bcd8bf

diff --git a/chart2/source/controller/sidebar/ChartElementsPanel.cxx b/chart2/source/controller/sidebar/ChartElementsPanel.cxx
index 2cbb42c..985f997 100644
--- a/chart2/source/controller/sidebar/ChartElementsPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartElementsPanel.cxx
@@ -446,14 +446,6 @@ void ChartElementsPanel::HandleContextChange(
     updateData();
 }
 
-void ChartElementsPanel::NotifyItemUpdate(
-    sal_uInt16 /*nSID*/,
-    SfxItemState /*eState*/,
-    const SfxPoolItem* /*pState*/,
-    const bool )
-{
-}
-
 void ChartElementsPanel::modelInvalid()
 {
     mbModelValid = false;
diff --git a/chart2/source/controller/sidebar/ChartElementsPanel.hxx b/chart2/source/controller/sidebar/ChartElementsPanel.hxx
index 99553a1..c5ffae2 100644
--- a/chart2/source/controller/sidebar/ChartElementsPanel.hxx
+++ b/chart2/source/controller/sidebar/ChartElementsPanel.hxx
@@ -40,7 +40,6 @@ namespace sidebar {
 
 class ChartElementsPanel : public PanelLayout,
     public ::sfx2::sidebar::IContextChangeReceiver,
-    public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface,
     public sfx2::sidebar::SidebarModelUpdate,
     public ChartSidebarModifyListenerParent
 {
@@ -56,18 +55,14 @@ public:
     virtual void HandleContextChange(
         const ::sfx2::sidebar::EnumContext& rContext) SAL_OVERRIDE;
 
-    virtual void NotifyItemUpdate(
-        const sal_uInt16 nSId,
-        const SfxItemState eState,
-        const SfxPoolItem* pState,
-        const bool bIsEnabled) SAL_OVERRIDE;
-
     // constructor/destuctor
     ChartElementsPanel(
         vcl::Window* pParent,
         const css::uno::Reference<css::frame::XFrame>& rxFrame,
         ChartController* pController);
+
     virtual ~ChartElementsPanel();
+
     virtual void dispose() SAL_OVERRIDE;
 
     virtual void updateData() SAL_OVERRIDE;
commit e93f9b39d3d844f59c7a0256169ef5f0d1dece8d
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Wed Sep 16 18:45:59 2015 +0200

    disable a few more controls when no border is set, tdf#94291
    
    Change-Id: I687616e80685ea4cc462a48e55882c44745e003f

diff --git a/svx/source/sidebar/line/LinePropertyPanelBase.cxx b/svx/source/sidebar/line/LinePropertyPanelBase.cxx
index 59098a9..9f4d20a 100644
--- a/svx/source/sidebar/line/LinePropertyPanelBase.cxx
+++ b/svx/source/sidebar/line/LinePropertyPanelBase.cxx
@@ -850,6 +850,8 @@ void LinePropertyPanelBase::SelectLineStyle()
 
     if(!bSelected)
         mpLBStyle->SelectEntryPos( 0 );
+
+    ActivateControls();
 }
 
 void LinePropertyPanelBase::SelectEndStyle(bool bStart)


More information about the Libreoffice-commits mailing list