[Libreoffice-commits] core.git: include/vcl sc/inc sc/source sc/uiconfig sc/UIConfig_scalc.mk vcl/inc vcl/source

Caolán McNamara caolanm at redhat.com
Mon Feb 26 21:15:05 UTC 2018


 include/vcl/msgbox.hxx                      |    9 ---
 sc/UIConfig_scalc.mk                        |    2 
 sc/inc/globstr.hrc                          |    1 
 sc/inc/helpids.h                            |    4 -
 sc/inc/strings.hrc                          |    1 
 sc/source/ui/docshell/docsh.cxx             |   28 ++++++++---
 sc/source/ui/docshell/impex.cxx             |    5 +-
 sc/source/ui/inc/warnbox.hxx                |   14 ++++-
 sc/source/ui/miscdlgs/warnbox.cxx           |   34 +++++++++----
 sc/source/ui/view/viewfun3.cxx              |   15 +++---
 sc/uiconfig/scalc/ui/checkwarningdialog.ui  |   49 +++++++++++++++++++
 sc/uiconfig/scalc/ui/sharedwarningdialog.ui |   48 +++++++++++++++++++
 vcl/inc/strings.hrc                         |    2 
 vcl/source/window/msgbox.cxx                |   69 ----------------------------
 14 files changed, 167 insertions(+), 114 deletions(-)

New commits:
commit 28488c94d697f169baaf4c67bf2c71287b503c43
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Feb 25 17:26:42 2018 +0000

    convert corner case warningboxes with checkboxes
    
    Change-Id: Ic8b58b792236a733b6687148eac5c06bbf734acf
    Reviewed-on: https://gerrit.libreoffice.org/50325
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/include/vcl/msgbox.hxx b/include/vcl/msgbox.hxx
index 5df7a5f81437..16fa979015b7 100644
--- a/include/vcl/msgbox.hxx
+++ b/include/vcl/msgbox.hxx
@@ -57,13 +57,10 @@ class VCL_DLLPUBLIC MessBox : public ButtonDialog
     VclPtr<FixedImage>         mpFixedImage;
     Image                      maImage;
     bool                       mbHelpBtn;
-    bool                       mbCheck;
     MessBoxStyle               mnMessBoxStyle;
 
 protected:
     OUString                   maMessText;
-    VclPtr<CheckBox>           mpCheckBox;
-    OUString                   maCheckBoxText;
 
     SAL_DLLPRIVATE void ImplInitButtons();
     SAL_DLLPRIVATE void ImplPosControls();
@@ -81,10 +78,6 @@ public:
 
     void                SetImage( const Image& rImage ) { maImage = rImage; }
 
-    void                SetCheckBoxText( const OUString& rText ) { maCheckBoxText = rText;}
-    void                SetCheckBoxState( bool bCheck );
-    bool                GetCheckBoxState() const;
-
     virtual Size        GetOptimalSize() const override;
 };
 
@@ -99,8 +92,6 @@ public:
                         WarningBox( vcl::Window* pParent, MessBoxStyle nStyle, WinBits n,
                                     const OUString& rMessage );
 
-    void                SetDefaultCheckBoxText();
-
     static Image const & GetStandardImage();
     static OUString     GetStandardText();
 };
diff --git a/sc/UIConfig_scalc.mk b/sc/UIConfig_scalc.mk
index 78a0674eab40..bfbf46305226 100644
--- a/sc/UIConfig_scalc.mk
+++ b/sc/UIConfig_scalc.mk
@@ -92,6 +92,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\
 	sc/uiconfig/scalc/ui/cellprotectionpage \
 	sc/uiconfig/scalc/ui/changesourcedialog \
 	sc/uiconfig/scalc/ui/chardialog \
+	sc/uiconfig/scalc/ui/checkwarningdialog \
 	sc/uiconfig/scalc/ui/chisquaretestdialog \
 	sc/uiconfig/scalc/ui/colorrowdialog \
 	sc/uiconfig/scalc/ui/colwidthdialog \
@@ -200,6 +201,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\
 	sc/uiconfig/scalc/ui/sharedocumentdlg \
 	sc/uiconfig/scalc/ui/sharedfooterdialog \
 	sc/uiconfig/scalc/ui/sharedheaderdialog \
+	sc/uiconfig/scalc/ui/sharedwarningdialog \
 	sc/uiconfig/scalc/ui/showchangesdialog \
 	sc/uiconfig/scalc/ui/showdetaildialog \
 	sc/uiconfig/scalc/ui/showsheetdialog \
diff --git a/sc/inc/globstr.hrc b/sc/inc/globstr.hrc
index cf29d865364f..89f3150fa8d0 100644
--- a/sc/inc/globstr.hrc
+++ b/sc/inc/globstr.hrc
@@ -392,7 +392,6 @@
 #define STR_DOC_WILLNOTBESAVED                  NC_("STR_DOC_WILLNOTBESAVED", "Already resolved merge conflicts will be lost and your changes to the shared spreadsheet will not be saved.\n\nDo you want to continue?")
 #define STR_DOC_DISABLESHARED                   NC_("STR_DOC_DISABLESHARED", "Disabling shared mode of a spreadsheet hinders all other users of the shared spreadsheet to merge back their work.\n\nDo you want to continue?")
 #define STR_DOC_NOLONGERSHARED                  NC_("STR_DOC_NOLONGERSHARED", "This spreadsheet is no longer in shared mode.\n\nSave your spreadsheet to a separate file and merge your changes to the shared spreadsheet manually.")
-#define STR_SHARED_DOC_WARNING                  NC_("STR_SHARED_DOC_WARNING", "The spreadsheet is in shared mode. This allows multiple users to access and edit the spreadsheet at the same time.\n\nChanges to formatting attributes like fonts, colors, and number formats will not be saved and some functionalities like editing charts and drawing objects are not available in shared mode. Turn off shared mode to get exclusive access needed for those changes and functionalities.")
 #define STR_FILE_LOCKED_TRY_LATER               NC_("STR_FILE_LOCKED_TRY_LATER", "The shared spreadsheet file is locked due to a merge in progress by user: '%1'\n\nSharing mode of a locked file cannot be disabled. Try again later.")
 #define STR_FILE_LOCKED_SAVE_LATER              NC_("STR_FILE_LOCKED_SAVE_LATER", "The shared spreadsheet file is locked due to a merge in progress by user: '%1'\n\nTry again later to save your changes.")
 #define STR_UNKNOWN_USER                        NC_("STR_UNKNOWN_USER", "Unknown User")
diff --git a/sc/inc/helpids.h b/sc/inc/helpids.h
index 4f285dc45881..6d8606c8a246 100644
--- a/sc/inc/helpids.h
+++ b/sc/inc/helpids.h
@@ -66,10 +66,6 @@
 
 // Other help IDs (max.70) ---------------------------------------------------
 #define HID_SELECTTABLES                                        "SC_HID_SELECTTABLES"
-#define HID_SC_REPLCELLSWARN                                    "SC_HID_SC_REPLCELLSWARN"
-
-
-
 
 
 // Analysis Addin Functions (max.120) ----------------------------------------
diff --git a/sc/inc/strings.hrc b/sc/inc/strings.hrc
index 7aaf4fa723fb..c46331886c8f 100644
--- a/sc/inc/strings.hrc
+++ b/sc/inc/strings.hrc
@@ -77,7 +77,6 @@
 #define STR_DLG_SELECTTABLES_TITLE                  NC_("STR_DLG_SELECTTABLES_TITLE", "Select Sheets")
 // Select tables dialog listbox
 #define STR_DLG_SELECTTABLES_LBNAME                 NC_("STR_DLG_SELECTTABLES_LBNAME", "~Selected sheets")
-#define STR_REPLCELLSWARN                           NC_("STR_REPLCELLSWARN", "You are pasting data into cells that already contain data.\nDo you really want to overwrite the existing data?")
 #define STR_ACC_CSVRULER_NAME                       NC_("STR_ACC_CSVRULER_NAME", "Ruler")
 #define STR_ACC_CSVRULER_DESCR                      NC_("STR_ACC_CSVRULER_DESCR", "This ruler manages objects at fixed positions.")
 #define STR_ACC_CSVGRID_NAME                        NC_("STR_ACC_CSVGRID_NAME", "Preview")
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 767d5a502827..c8bbd5c93dd3 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -724,12 +724,28 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
                         ScAppOptions aAppOptions = SC_MOD()->GetAppOptions();
                         if ( aAppOptions.GetShowSharedDocumentWarning() )
                         {
-                            ScopedVclPtrInstance<WarningBox> aBox( GetActiveDialogParent(), MessBoxStyle::Ok,
-                                ScGlobal::GetRscString( STR_SHARED_DOC_WARNING ) );
-                            aBox->SetDefaultCheckBoxText();
-                            aBox->Execute();
-                            bool bChecked = aBox->GetCheckBoxState();
-                            if ( bChecked )
+                            vcl::Window* pWin = ScDocShell::GetActiveDialogParent();
+
+                            std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(pWin ? pWin->GetFrameWeld() : nullptr,
+                                        "modules/scalc/ui/sharedwarningdialog.ui"));
+                            std::unique_ptr<weld::MessageDialog> xWarningBox(xBuilder->weld_message_dialog("SharedWarningDialog"));
+                            std::unique_ptr<weld::CheckButton> xWarningOnBox(xBuilder->weld_check_button("ask"));
+
+                            //fdo#75121, a bit tricky because the widgets we want to align with
+                            //don't actually exist in the ui description, they're implied
+                            std::unique_ptr<weld::Container> xOrigParent(xWarningOnBox->weld_parent());
+                            std::unique_ptr<weld::Container> xContentArea(xWarningBox->weld_message_area());
+                            xOrigParent->remove(xWarningOnBox.get());
+                            xContentArea->add(xWarningOnBox.get());
+
+                            xWarningBox->run();
+
+                            //put them back as they were
+                            xContentArea->remove(xWarningOnBox.get());
+                            xOrigParent->add(xWarningOnBox.get());
+
+                            bool bChecked = xWarningOnBox->get_active();
+                            if (bChecked)
                             {
                                 aAppOptions.SetShowSharedDocumentWarning( !bChecked );
                                 SC_MOD()->SetAppOptions( aAppOptions );
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index e39abc0dc479..11c3e29103ad 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -1476,8 +1476,9 @@ bool ScImportExport::ExtText2Doc( SvStream& rStrm )
             if ( !mbApi && nStartCol != nEndCol &&
                  !pDoc->IsBlockEmpty( nTab, nStartCol + 1, nStartRow, nEndCol, nRow ) )
             {
-                ScopedVclPtrInstance< ScReplaceWarnBox > aBox( ScDocShell::GetActiveDialogParent() );
-                if ( aBox->Execute() != RET_YES )
+                vcl::Window* pWin = ScDocShell::GetActiveDialogParent();
+                ScReplaceWarnBox aBox(pWin ? pWin->GetFrameWeld() : nullptr);
+                if (aBox.run() != RET_YES)
                 {
                     return false;
                 }
diff --git a/sc/source/ui/inc/warnbox.hxx b/sc/source/ui/inc/warnbox.hxx
index c211a466665c..d4a17d69b94f 100644
--- a/sc/source/ui/inc/warnbox.hxx
+++ b/sc/source/ui/inc/warnbox.hxx
@@ -20,19 +20,25 @@
 #ifndef INCLUDED_SC_SOURCE_UI_INC_WARNBOX_HXX
 #define INCLUDED_SC_SOURCE_UI_INC_WARNBOX_HXX
 
-#include <vcl/msgbox.hxx>
+#include <vcl/weld.hxx>
 
 /** Warning box for "Replace cell contents?".
     With warning image and "Do not show again" checkbox. */
-class ScReplaceWarnBox : public WarningBox
+class ScReplaceWarnBox
 {
+    std::unique_ptr<weld::Builder> m_xBuilder;
+    std::unique_ptr<weld::MessageDialog> m_xDialog;
+    std::unique_ptr<weld::CheckButton> m_xWarningOnBox;
+    std::unique_ptr<weld::Container> m_xOrigParent;
+    std::unique_ptr<weld::Container> m_xContentArea;
 public:
-                                ScReplaceWarnBox( vcl::Window* pParent );
+    ScReplaceWarnBox(weld::Window* pParent);
+    ~ScReplaceWarnBox();
 
     /** Opens dialog if IsDialogEnabled() returns true.
         @descr  If after executing the dialog the checkbox "Do not show again" is set,
                 the method DisableDialog() will be called. */
-    virtual sal_Int16           Execute() override;
+    short run();
 };
 
 #endif
diff --git a/sc/source/ui/miscdlgs/warnbox.cxx b/sc/source/ui/miscdlgs/warnbox.cxx
index 9e74563d6452..dbe87229c6f9 100644
--- a/sc/source/ui/miscdlgs/warnbox.cxx
+++ b/sc/source/ui/miscdlgs/warnbox.cxx
@@ -25,23 +25,37 @@
 #include <strings.hrc>
 #include <helpids.h>
 
-ScReplaceWarnBox::ScReplaceWarnBox( vcl::Window* pParent ) :
-    WarningBox( pParent, MessBoxStyle::YesNo | MessBoxStyle::DefaultYes, ScResId( STR_REPLCELLSWARN ) )
-{
+ScReplaceWarnBox::ScReplaceWarnBox(weld::Window* pParent)
+    : m_xBuilder(Application::CreateBuilder(pParent, "modules/scalc/ui/checkwarningdialog.ui"))
+    , m_xDialog(m_xBuilder->weld_message_dialog("CheckWarningDialog"))
     // By default, the check box is ON, and the user needs to un-check it to
     // disable all future warnings.
-    SetCheckBoxState(true);
-    SetCheckBoxText(ScResId(SCSTR_WARN_ME_IN_FUTURE_CHECK));
-    SetHelpId( HID_SC_REPLCELLSWARN );
+    , m_xWarningOnBox(m_xBuilder->weld_check_button("ask"))
+    , m_xOrigParent(m_xWarningOnBox->weld_parent())
+    , m_xContentArea(m_xDialog->weld_message_area())
+{
+    m_xDialog->set_default_response(RET_YES);
+
+    //fdo#75121, a bit tricky because the widgets we want to align with
+    //don't actually exist in the ui description, they're implied
+    m_xOrigParent->remove(m_xWarningOnBox.get());
+    m_xContentArea->add(m_xWarningOnBox.get());
+}
+
+ScReplaceWarnBox::~ScReplaceWarnBox()
+{
+    //put them back as they were
+    m_xContentArea->remove(m_xWarningOnBox.get());
+    m_xOrigParent->add(m_xWarningOnBox.get());
 }
 
-sal_Int16 ScReplaceWarnBox::Execute()
+short ScReplaceWarnBox::run()
 {
-    sal_Int16 nRet = RET_YES;
+    short nRet = RET_YES;
     if( SC_MOD()->GetInputOptions().GetReplaceCellsWarn() )
     {
-        nRet = WarningBox::Execute();
-        if (!GetCheckBoxState())
+        nRet = m_xDialog->run();
+        if (!m_xWarningOnBox->get_active())
         {
             ScModule* pScMod = SC_MOD();
             ScInputOptions aInputOpt( pScMod->GetInputOptions() );
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index 623966231e62..ae15097d2720 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -822,7 +822,7 @@ static bool lcl_SelHasAttrib( const ScDocument* pDoc, SCCOL nCol1, SCROW nRow1,
 
 namespace {
 
-bool checkDestRangeForOverwrite(const ScRangeList& rDestRanges, const ScDocument* pDoc, const ScMarkData& rMark, vcl::Window* pParentWnd)
+bool checkDestRangeForOverwrite(const ScRangeList& rDestRanges, const ScDocument* pDoc, const ScMarkData& rMark, weld::Window* pParentWnd)
 {
     bool bIsEmpty = true;
     ScMarkData::const_iterator itrTab = rMark.begin(), itrTabEnd = rMark.end();
@@ -840,8 +840,8 @@ bool checkDestRangeForOverwrite(const ScRangeList& rDestRanges, const ScDocument
 
     if (!bIsEmpty)
     {
-        ScopedVclPtrInstance< ScReplaceWarnBox > aBox(pParentWnd);
-        if (aBox->Execute() != RET_YES)
+        ScReplaceWarnBox aBox(pParentWnd);
+        if (aBox.run() != RET_YES)
         {
             //  changing the configuration is within the ScReplaceWarnBox
             return false;
@@ -1143,7 +1143,8 @@ bool ScViewFunc::PasteFromClip( InsertDeleteFlags nFlags, ScDocument* pClipDoc,
         {
             ScRangeList aTestRanges;
             aTestRanges.Append(aUserRange);
-            if (!checkDestRangeForOverwrite(aTestRanges, pDoc, aFilteredMark, GetViewData().GetDialogParent()))
+            vcl::Window* pWin = GetViewData().GetDialogParent();
+            if (!checkDestRangeForOverwrite(aTestRanges, pDoc, aFilteredMark, pWin ? pWin->GetFrameWeld() : nullptr))
                 return false;
         }
     }
@@ -1511,7 +1512,8 @@ bool ScViewFunc::PasteMultiRangesFromClip(
     {
         ScRangeList aTestRanges;
         aTestRanges.Append(aMarkedRange);
-        if (!checkDestRangeForOverwrite(aTestRanges, pDoc, aMark, rViewData.GetDialogParent()))
+        vcl::Window* pWin = GetViewData().GetDialogParent();
+        if (!checkDestRangeForOverwrite(aTestRanges, pDoc, aMark, pWin ? pWin->GetFrameWeld() : nullptr))
             return false;
     }
 
@@ -1673,7 +1675,8 @@ bool ScViewFunc::PasteFromClipToMultiRanges(
 
     if (bAskIfNotEmpty)
     {
-        if (!checkDestRangeForOverwrite(aRanges, pDoc, aMark, rViewData.GetDialogParent()))
+        vcl::Window* pWin = GetViewData().GetDialogParent();
+        if (!checkDestRangeForOverwrite(aRanges, pDoc, aMark, pWin ? pWin->GetFrameWeld() : nullptr))
             return false;
     }
 
diff --git a/sc/uiconfig/scalc/ui/checkwarningdialog.ui b/sc/uiconfig/scalc/ui/checkwarningdialog.ui
new file mode 100644
index 000000000000..addb933cfaa9
--- /dev/null
+++ b/sc/uiconfig/scalc/ui/checkwarningdialog.ui
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.20.2 -->
+<interface domain="sc">
+  <requires lib="gtk+" version="3.20"/>
+  <object class="GtkMessageDialog" id="CheckWarningDialog">
+    <property name="can_focus">False</property>
+    <property name="type_hint">dialog</property>
+    <property name="message_type">warning</property>
+    <property name="buttons">ok</property>
+    <property name="text" translatable="yes" context="checkwarningdialog|CheckWarningDialog">You are pasting data into cells that already contain data.</property>
+    <property name="secondary_text" translatable="yes" context="checkwarningdialog|CheckWarningDialog">Do you really want to overwrite the existing data?</property>
+    <child internal-child="vbox">
+      <object class="GtkBox">
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <property name="spacing">2</property>
+        <child internal-child="action_area">
+          <object class="GtkButtonBox">
+            <property name="can_focus">False</property>
+            <property name="homogeneous">True</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkCheckButton" id="ask">
+            <property name="label" translatable="yes" context="checkwarningdialog|ask">Warn me about this in the future.</property>
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">False</property>
+            <property name="active">True</property>
+            <property name="draw_indicator">True</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">2</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+    <child>
+      <placeholder/>
+    </child>
+  </object>
+</interface>
diff --git a/sc/uiconfig/scalc/ui/sharedwarningdialog.ui b/sc/uiconfig/scalc/ui/sharedwarningdialog.ui
new file mode 100644
index 000000000000..bf894eaaa3e1
--- /dev/null
+++ b/sc/uiconfig/scalc/ui/sharedwarningdialog.ui
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.20.2 -->
+<interface domain="sc">
+  <requires lib="gtk+" version="3.20"/>
+  <object class="GtkMessageDialog" id="SharedWarningDialog">
+    <property name="can_focus">False</property>
+    <property name="type_hint">dialog</property>
+    <property name="message_type">warning</property>
+    <property name="buttons">ok</property>
+    <property name="text" translatable="yes" context="sharedwarningdialog|SharedWarningDialog">The spreadsheet is in shared mode. This allows multiple users to access and edit the spreadsheet at the same time.</property>
+    <property name="secondary_text" translatable="yes" context="sharedwarningdialog|SharedWarningDialog">Changes to formatting attributes like fonts, colors, and number formats will not be saved and some functionalities like editing charts and drawing objects are not available in shared mode. Turn off shared mode to get exclusive access needed for those changes and functionalities.</property>
+    <child internal-child="vbox">
+      <object class="GtkBox">
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <property name="spacing">2</property>
+        <child internal-child="action_area">
+          <object class="GtkButtonBox">
+            <property name="can_focus">False</property>
+            <property name="homogeneous">True</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkCheckButton" id="ask">
+            <property name="label" translatable="yes" context="sharedwarningdialog|ask">Do not show warning again.</property>
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">False</property>
+            <property name="draw_indicator">True</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">2</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+    <child>
+      <placeholder/>
+    </child>
+  </object>
+</interface>
diff --git a/vcl/inc/strings.hrc b/vcl/inc/strings.hrc
index 99bcd8c79bbe..1475e2a65ceb 100644
--- a/vcl/inc/strings.hrc
+++ b/vcl/inc/strings.hrc
@@ -83,8 +83,6 @@
 
 #define SV_STDTEXT_SERVICENOTAVAILABLE               NC_("SV_STDTEXT_SERVICENOTAVAILABLE", "The component (%s) could not be loaded.\nPlease start setup with the repair option.")
 
-#define SV_STDTEXT_DONTWARNAGAIN                     NC_("SV_STDTEXT_DONTWARNAGAIN", "Do not show warning again.")
-
 #define SV_STDTEXT_ABOUT                             NC_("SV_STDTEXT_ABOUT", "About %PRODUCTNAME")
 #define SV_STDTEXT_PREFERENCES                       NC_("SV_STDTEXT_PREFERENCES", "Preferences...")
 #define SV_STDTEXT_ALLFILETYPES                      NC_("SV_STDTEXT_ALLFILETYPES", "Any type")
diff --git a/vcl/source/window/msgbox.cxx b/vcl/source/window/msgbox.cxx
index 52d0bfdbdf97..2e85b5e7679f 100644
--- a/vcl/source/window/msgbox.cxx
+++ b/vcl/source/window/msgbox.cxx
@@ -126,7 +126,6 @@ MessBox::MessBox(vcl::Window* pParent, MessBoxStyle nMessBoxStyle, WinBits nWinB
                  const OUString& rTitle, const OUString& rMessage) :
     ButtonDialog( WindowType::MESSBOX ),
     mbHelpBtn( false ),
-    mbCheck( false ),
     mnMessBoxStyle( nMessBoxStyle ),
     maMessText( rMessage )
 {
@@ -147,7 +146,6 @@ void MessBox::dispose()
 {
     mpVCLMultiLineEdit.disposeAndClear();
     mpFixedImage.disposeAndClear();
-    mpCheckBox.disposeAndClear();
     ButtonDialog::dispose();
 }
 
@@ -187,11 +185,6 @@ void MessBox::ImplPosControls()
 
     mpVCLMultiLineEdit.disposeAndClear();
     mpFixedImage.disposeAndClear();
-    if ( mpCheckBox )
-    {
-        mbCheck = mpCheckBox->IsChecked();
-        mpCheckBox.disposeAndClear();
-    }
 
     // Clean up message text with tabs
     OUString aMessText(maMessText.replaceAll("\t", "    "));
@@ -286,52 +279,6 @@ void MessBox::ImplPosControls()
     if ( aPageSize.Width() < nTitleWidth )
         aPageSize.setWidth( nTitleWidth );
 
-    if ( !maCheckBoxText.isEmpty() )
-    {
-        Size aMinCheckboxSize ( aMEditSize );
-        if ( aPageSize.Width() < IMPL_MINSIZE_MSGBOX_WIDTH+80 )
-        {
-            aPageSize.setWidth( IMPL_MINSIZE_MSGBOX_WIDTH+80 );
-            aMinCheckboxSize.AdjustWidth(80 );
-        }
-
-        // #104492# auto mnemonics for CJK strings may increase the length, so measure the
-        // checkbox length including a temporary mnemonic, the correct auto mnemonic will be
-        // generated later in the dialog (see init_show)
-
-        OUString aMnemonicString( maCheckBoxText );
-        if( GetSettings().GetStyleSettings().GetAutoMnemonic() )
-        {
-            if( aMnemonicString == GetNonMnemonicString( maCheckBoxText ) )
-            {
-                // no mnemonic found -> create one
-                MnemonicGenerator aMnemonicGenerator;
-                aMnemonicString = aMnemonicGenerator.CreateMnemonic( aMnemonicString );
-            }
-        }
-
-        mpCheckBox = VclPtr<CheckBox>::Create( this );
-        mpCheckBox->Check( mbCheck );
-        mpCheckBox->SetText( aMnemonicString );
-        mpCheckBox->SetStyle( mpCheckBox->GetStyle() | WB_WORDBREAK );
-        mpCheckBox->SetHelpId( GetHelpId() );   // DR: Check box and dialog have same HID
-
-        // align checkbox with message text
-        Size aSize = mpCheckBox->CalcMinimumSize( aMinCheckboxSize.Width() );
-
-        // now set the original non-mnemonic string
-        mpCheckBox->SetText( maCheckBoxText );
-
-        Point aPos( aTextPos );
-        aPos.AdjustY(aMEditSize.Height() + (IMPL_DIALOG_OFFSET)+(IMPL_MSGBOX_OFFSET_EXTRA_Y*2) );
-
-        // increase messagebox
-        aPageSize.AdjustHeight(aSize.Height() + (IMPL_DIALOG_OFFSET*2)+(IMPL_MSGBOX_OFFSET_EXTRA_Y*2) );
-
-        mpCheckBox->SetPosSizePixel( aPos, aSize );
-        mpCheckBox->Show();
-    }
-
     mpVCLMultiLineEdit = VclPtr<VclMultiLineEdit>::Create( this, nWinStyle );
     mpVCLMultiLineEdit->SetText( aMessText );
     mpVCLMultiLineEdit->SetPosSizePixel( aTextPos, aMEditSize );
@@ -350,17 +297,6 @@ void MessBox::StateChanged( StateChangedType nType )
     ButtonDialog::StateChanged( nType );
 }
 
-bool MessBox::GetCheckBoxState() const
-{
-    return mpCheckBox ? mpCheckBox->IsChecked() : mbCheck;
-}
-
-void MessBox::SetCheckBoxState( bool bCheck )
-{
-    if( mpCheckBox ) mpCheckBox->Check( bCheck );
-    mbCheck = bCheck;
-}
-
 Size MessBox::GetOptimalSize() const
 {
     // FIXME: base me on the font size ?
@@ -395,11 +331,6 @@ WarningBox::WarningBox( vcl::Window* pParent, MessBoxStyle nStyle, WinBits nWinB
     SetImage( WarningBox::GetStandardImage() );
 }
 
-void WarningBox::SetDefaultCheckBoxText()
-{
-    maCheckBoxText = VclResId(SV_STDTEXT_DONTWARNAGAIN);
-}
-
 Image const & WarningBox::GetStandardImage()
 {
     ImplInitMsgBoxImageList();


More information about the Libreoffice-commits mailing list