[Libreoffice-commits] core.git: 2 commits - cui/inc cui/source cui/uiconfig sd/source

Mike Kaganski mike.kaganski at collabora.com
Tue Mar 20 16:48:05 UTC 2018


 cui/inc/pch/precompiled_cui.hxx     |    1 
 cui/source/customize/cfg.cxx        |   35 ++----------
 cui/source/inc/cfg.hxx              |   11 +---
 cui/uiconfig/ui/iconchangedialog.ui |   97 ++++++++++++------------------------
 sd/source/core/drawdoc3.cxx         |   16 ++---
 5 files changed, 51 insertions(+), 109 deletions(-)

New commits:
commit b39cd7d5bd451c1498282025ecd650874ce77b62
Author: Mike Kaganski <mike.kaganski at collabora.com>
Date:   Tue Mar 20 15:04:37 2018 +0100

    Exclude a redundant variable
    
    Change-Id: I0a7d6a7068155259313408e8d8e61f72af705cc6
    Reviewed-on: https://gerrit.libreoffice.org/51647
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index 03575d4778d9..9bc68bc98710 100644
--- a/sd/source/core/drawdoc3.cxx
+++ b/sd/source/core/drawdoc3.cxx
@@ -81,12 +81,10 @@ void InsertBookmarkAsPage_FindDuplicateLayouts::operator()( SdDrawDocument& rDoc
 {
     // now check for duplicate masterpage and layout names
 
-    OUString aFullNameLayout( pBMMPage->GetLayoutName() );
-    sal_Int32 nIndex = aFullNameLayout.indexOf( SD_LT_SEPARATOR );
+    OUString aLayout( pBMMPage->GetLayoutName() );
+    sal_Int32 nIndex = aLayout.indexOf( SD_LT_SEPARATOR );
     if( nIndex != -1 )
-        aFullNameLayout = aFullNameLayout.copy(0, nIndex);
-
-    OUString aLayout(aFullNameLayout);
+        aLayout = aLayout.copy(0, nIndex);
 
     std::vector<OUString>::const_iterator pIter =
             find(mrLayoutsToTransfer.begin(),mrLayoutsToTransfer.end(),aLayout);
@@ -98,12 +96,10 @@ void InsertBookmarkAsPage_FindDuplicateLayouts::operator()( SdDrawDocument& rDoc
     {
         // Do the layouts already exist within the document?
         SdPage* pTestPage = static_cast<SdPage*>( rDoc.GetMasterPage(nMPage) );
-        OUString aFullTest(pTestPage->GetLayoutName());
-        sal_Int32 nIndex2 = aFullTest.indexOf( SD_LT_SEPARATOR );
+        OUString aTest(pTestPage->GetLayoutName());
+        sal_Int32 nIndex2 = aTest.indexOf( SD_LT_SEPARATOR );
         if( nIndex2 != -1 )
-            aFullTest = aFullTest.copy(0, nIndex2);
-
-        OUString aTest(aFullTest);
+            aTest = aTest.copy(0, nIndex2);
 
         if (aTest == aLayout && pBMMPage->GetPageKind() == pTestPage->GetPageKind())
         {
commit 5163c4850dd7768826eaa22947c403d187c3edd3
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Mar 20 15:01:21 2018 +0000

    weld SvxIconChangeDialog warning dialog
    
    Change-Id: If90c8dc0e66678cec6b197e3f0c659e85484f5af
    Reviewed-on: https://gerrit.libreoffice.org/51650
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/cui/inc/pch/precompiled_cui.hxx b/cui/inc/pch/precompiled_cui.hxx
index 6df4a6862268..ac869daac6b8 100644
--- a/cui/inc/pch/precompiled_cui.hxx
+++ b/cui/inc/pch/precompiled_cui.hxx
@@ -159,7 +159,6 @@
 #include <vcl/metaact.hxx>
 #include <vcl/metaactiontypes.hxx>
 #include <vcl/metric.hxx>
-#include <vcl/msgbox.hxx>
 #include <vcl/notebookbar.hxx>
 #include <vcl/outdev.hxx>
 #include <vcl/outdevmap.hxx>
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index 0d3c9fbe69bc..429e8302eb31 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -3315,8 +3315,8 @@ void SvxIconSelectorDialog::ImportGraphics(
             message += fPath + rejected[i] + "\n";
         }
 
-        ScopedVclPtrInstance< SvxIconChangeDialog > aDialog(this, message);
-        aDialog->Execute();
+        SvxIconChangeDialog aDialog(GetFrameWeld(), message);
+        aDialog.run();
     }
 }
 
@@ -3402,32 +3402,13 @@ bool SvxIconSelectorDialog::ImportGraphic( const OUString& aURL )
 * The SvxIconChangeDialog class added for issue83555
 *
 *******************************************************************************/
-SvxIconChangeDialog::SvxIconChangeDialog(
-    vcl::Window *pWindow, const OUString& aMessage)
-    :ModalDialog(pWindow, "IconChange", "cui/ui/iconchangedialog.ui")
+SvxIconChangeDialog::SvxIconChangeDialog(weld::Window *pWindow, const OUString& rMessage)
+    : MessageDialogController(pWindow, "cui/ui/iconchangedialog.ui", "IconChange", "grid")
+    , m_xLineEditDescription(m_xBuilder->weld_text_view("addrTextview"))
 {
-    get(pFImageInfo, "infoImage");
-    get(pLineEditDescription, "addrTextview");
-
-    Size aSize(LogicToPixel(Size(140, 83), MapMode(MapUnit::MapAppFont)));
-    pLineEditDescription->set_width_request(aSize.Width());
-    pLineEditDescription->set_height_request(aSize.Height());
-
-    pFImageInfo->SetImage(GetStandardInfoBoxImage());
-    pLineEditDescription->SetControlBackground( GetSettings().GetStyleSettings().GetDialogColor() );
-    pLineEditDescription->SetText(aMessage);
-}
-
-SvxIconChangeDialog::~SvxIconChangeDialog()
-{
-    disposeOnce();
-}
-
-void SvxIconChangeDialog::dispose()
-{
-    pFImageInfo.clear();
-    pLineEditDescription.clear();
-    ModalDialog::dispose();
+    m_xLineEditDescription->set_size_request(m_xLineEditDescription->get_approximate_digit_width() * 48,
+                                             m_xLineEditDescription->get_text_height() * 8);
+    m_xLineEditDescription->set_text(rMessage);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/inc/cfg.hxx b/cui/source/inc/cfg.hxx
index 00e2dcc4b27c..51165c9e1d45 100644
--- a/cui/source/inc/cfg.hxx
+++ b/cui/source/inc/cfg.hxx
@@ -25,6 +25,7 @@
 #include <vcl/lstbox.hxx>
 #include <vcl/menubtn.hxx>
 #include <vcl/toolbox.hxx>
+#include <vcl/weld.hxx>
 #include <svtools/imgdef.hxx>
 #include <svtools/miscopt.hxx>
 #include <svtools/treelistbox.hxx>
@@ -51,7 +52,6 @@
 #include <sfx2/tabdlg.hxx>
 #include <memory>
 #include <vector>
-#include <vcl/msgbox.hxx>
 
 #include "cfgutil.hxx"
 #include "CommandCategoryListBox.hxx"
@@ -637,15 +637,12 @@ public:
 };
 
 //added for issue83555
-class SvxIconChangeDialog : public ModalDialog
+class SvxIconChangeDialog : public weld::MessageDialogController
 {
 private:
-    VclPtr<FixedImage>         pFImageInfo;
-    VclPtr<VclMultiLineEdit>   pLineEditDescription;
+    std::unique_ptr<weld::TextView> m_xLineEditDescription;
 public:
-    SvxIconChangeDialog(vcl::Window *pWindow, const OUString& aMessage);
-    virtual ~SvxIconChangeDialog() override;
-    virtual void dispose() override;
+    SvxIconChangeDialog(weld::Window *pWindow, const OUString& rMessage);
 };
 
 #endif // INCLUDED_CUI_SOURCE_INC_CFG_HXX
diff --git a/cui/uiconfig/ui/iconchangedialog.ui b/cui/uiconfig/ui/iconchangedialog.ui
index 44c423949e54..fa1665d2c942 100644
--- a/cui/uiconfig/ui/iconchangedialog.ui
+++ b/cui/uiconfig/ui/iconchangedialog.ui
@@ -1,114 +1,83 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.3 -->
+<!-- Generated with glade 3.20.2 -->
 <interface domain="cui">
   <requires lib="gtk+" version="3.18"/>
-  <object class="GtkDialog" id="IconChange">
+  <object class="GtkMessageDialog" id="IconChange">
     <property name="can_focus">False</property>
-    <property name="hexpand">True</property>
-    <property name="vexpand">True</property>
-    <property name="border_width">6</property>
-    <property name="title" translatable="yes" context="iconchangedialog|IconChange">%PRODUCTNAME %PRODUCTVERSION</property>
-    <property name="resizable">False</property>
+    <property name="modal">True</property>
     <property name="type_hint">dialog</property>
+    <property name="buttons">ok</property>
     <child internal-child="vbox">
-      <object class="GtkBox" id="dialog-vbox1">
+      <object class="GtkBox">
         <property name="can_focus">False</property>
-        <property name="hexpand">True</property>
-        <property name="vexpand">True</property>
         <property name="orientation">vertical</property>
-        <property name="spacing">12</property>
+        <property name="spacing">2</property>
         <child internal-child="action_area">
-          <object class="GtkButtonBox" id="dialog-action_area1">
+          <object class="GtkButtonBox">
             <property name="can_focus">False</property>
-            <property name="layout_style">end</property>
-            <child>
-              <object class="GtkButton" id="ok">
-                <property name="label">gtk-ok</property>
-                <property name="use_action_appearance">False</property>
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="has_default">True</property>
-                <property name="receives_default">True</property>
-                <property name="use_stock">True</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">0</property>
-              </packing>
-            </child>
+            <property name="homogeneous">True</property>
           </object>
           <packing>
             <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="pack_type">end</property>
+            <property name="fill">False</property>
             <property name="position">0</property>
           </packing>
         </child>
         <child>
-          <object class="GtkGrid" id="grid1">
+          <object class="GtkGrid" id="grid">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <property name="hexpand">True</property>
             <property name="vexpand">True</property>
             <property name="row_spacing">6</property>
-            <property name="column_spacing">6</property>
             <child>
-              <object class="GtkImage" id="infoImage">
+              <object class="GtkScrolledWindow">
                 <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="stock">gtk-missing-image</property>
+                <property name="can_focus">True</property>
+                <property name="hexpand">True</property>
+                <property name="vexpand">True</property>
+                <property name="shadow_type">in</property>
+                <child>
+                  <object class="GtkTextView" id="addrTextview">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="hexpand">True</property>
+                    <property name="vexpand">True</property>
+                    <property name="editable">False</property>
+                    <property name="wrap_mode">word</property>
+                    <property name="cursor_visible">False</property>
+                  </object>
+                </child>
               </object>
               <packing>
                 <property name="left_attach">0</property>
-                <property name="top_attach">0</property>
+                <property name="top_attach">1</property>
               </packing>
             </child>
             <child>
               <object class="GtkLabel" id="label1">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
-                <property name="halign">start</property>
-                <property name="xalign">0</property>
-                <property name="yalign">0</property>
                 <property name="label" translatable="yes" context="iconchangedialog|label1">The files listed below could not be imported.
 The file format could not be interpreted.</property>
+                <property name="xalign">0</property>
               </object>
               <packing>
-                <property name="left_attach">1</property>
+                <property name="left_attach">0</property>
                 <property name="top_attach">0</property>
               </packing>
             </child>
-            <child>
-              <object class="GtkTextView" id="addrTextview:border">
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="hexpand">True</property>
-                <property name="vexpand">True</property>
-                <property name="editable">False</property>
-                <property name="wrap_mode">word</property>
-                <property name="cursor_visible">False</property>
-              </object>
-              <packing>
-                <property name="left_attach">1</property>
-                <property name="top_attach">1</property>
-              </packing>
-            </child>
-            <child>
-              <placeholder/>
-            </child>
           </object>
           <packing>
             <property name="expand">False</property>
             <property name="fill">True</property>
-            <property name="position">1</property>
+            <property name="position">2</property>
           </packing>
         </child>
       </object>
     </child>
-    <action-widgets>
-      <action-widget response="-5">ok</action-widget>
-    </action-widgets>
+    <child>
+      <placeholder/>
+    </child>
   </object>
 </interface>


More information about the Libreoffice-commits mailing list