[Libreoffice-commits] core.git: 3 commits - cui/source cui/uiconfig extras/source include/sfx2 include/svx sfx2/source solenv/bin svx/source sw/inc sw/source sw/uiconfig

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Tue Jul 30 07:56:42 UTC 2019


 cui/source/options/optinet2.cxx                |   73 ++---
 cui/source/options/optinet2.hxx                |   23 -
 cui/source/options/optupdt.cxx                 |  172 +++++--------
 cui/source/options/optupdt.hxx                 |   40 +--
 cui/uiconfig/ui/optemailpage.ui                |   41 +--
 cui/uiconfig/ui/optonlineupdatepage.ui         |    8 
 extras/source/glade/libreoffice-catalog.xml.in |    3 
 include/sfx2/dialoghelper.hxx                  |    2 
 include/svx/fntctrl.hxx                        |    2 
 sfx2/source/dialog/dialoghelper.cxx            |    4 
 solenv/bin/native-code.py                      |    1 
 svx/source/dialog/fntctrl.cxx                  |   12 
 sw/inc/strings.hrc                             |    4 
 sw/source/ui/config/optpage.cxx                |  324 +++++++++++--------------
 sw/source/uibase/inc/optpage.hxx               |   61 ++--
 sw/uiconfig/swriter/ui/optredlinepage.ui       |  128 ++++++++-
 16 files changed, 479 insertions(+), 419 deletions(-)

New commits:
commit 6833539b466e21bebb77e247275dc50de1f36c43
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Jul 29 20:47:09 2019 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Jul 30 09:54:26 2019 +0200

    weld SvxOnlineUpdateTabPage
    
    Change-Id: I0043ba0b088f0b9ae8e5716c64e424419993cb96
    Reviewed-on: https://gerrit.libreoffice.org/76568
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/cui/source/options/optupdt.cxx b/cui/source/options/optupdt.cxx
index 63c6a2959189..8477f07fa8f1 100644
--- a/cui/source/options/optupdt.cxx
+++ b/cui/source/options/optupdt.cxx
@@ -45,27 +45,28 @@
 
 using namespace ::css;
 
-SvxOnlineUpdateTabPage::SvxOnlineUpdateTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
-    : SfxTabPage(pParent, "OptOnlineUpdatePage", "cui/ui/optonlineupdatepage.ui", &rSet)
+SvxOnlineUpdateTabPage::SvxOnlineUpdateTabPage(TabPageParent pParent, const SfxItemSet& rSet)
+    : SfxTabPage(pParent, "cui/ui/optonlineupdatepage.ui", "OptOnlineUpdatePage", &rSet)
+    , m_xNeverChecked(m_xBuilder->weld_label("neverchecked"))
+    , m_xAutoCheckCheckBox(m_xBuilder->weld_check_button("autocheck"))
+    , m_xEveryDayButton(m_xBuilder->weld_radio_button("everyday"))
+    , m_xEveryWeekButton(m_xBuilder->weld_radio_button("everyweek"))
+    , m_xEveryMonthButton(m_xBuilder->weld_radio_button("everymonth"))
+    , m_xCheckNowButton(m_xBuilder->weld_button("checknow"))
+    , m_xAutoDownloadCheckBox(m_xBuilder->weld_check_button("autodownload"))
+    , m_xDestPathLabel(m_xBuilder->weld_label("destpathlabel"))
+    , m_xDestPath(m_xBuilder->weld_label("destpath"))
+    , m_xChangePathButton(m_xBuilder->weld_button("changepath"))
+    , m_xLastChecked(m_xBuilder->weld_label("lastchecked"))
+    , m_xExtrasCheckBox(m_xBuilder->weld_check_button("extrabits"))
+    , m_xUserAgentLabel(m_xBuilder->weld_label("useragent"))
 {
-    m_aNeverChecked = get<FixedText>("neverchecked")->GetText();
-    get(m_pAutoCheckCheckBox, "autocheck");
-    get(m_pEveryDayButton, "everyday");
-    get(m_pEveryWeekButton, "everyweek");
-    get(m_pEveryMonthButton, "everymonth");
-    get(m_pCheckNowButton, "checknow");
-    get(m_pAutoDownloadCheckBox, "autodownload");
-    get(m_pDestPathLabel, "destpathlabel");
-    get(m_pDestPath, "destpath");
-    get(m_pChangePathButton, "changepath");
-    get(m_pLastChecked, "lastchecked");
-    get(m_pExtrasCheckBox, "extrabits");
-    get(m_pUserAgentLabel, "useragent");
-
-    m_pAutoCheckCheckBox->SetClickHdl( LINK( this, SvxOnlineUpdateTabPage, AutoCheckHdl_Impl ) );
-    m_pExtrasCheckBox->SetClickHdl( LINK( this, SvxOnlineUpdateTabPage, ExtrasCheckHdl_Impl ) );
-    m_pCheckNowButton->SetClickHdl( LINK( this, SvxOnlineUpdateTabPage, CheckNowHdl_Impl ) );
-    m_pChangePathButton->SetClickHdl( LINK( this, SvxOnlineUpdateTabPage, FileDialogHdl_Impl ) );
+    m_aNeverChecked = m_xNeverChecked->get_label();
+
+    m_xAutoCheckCheckBox->connect_toggled( LINK( this, SvxOnlineUpdateTabPage, AutoCheckHdl_Impl ) );
+    m_xExtrasCheckBox->connect_clicked( LINK( this, SvxOnlineUpdateTabPage, ExtrasCheckHdl_Impl ) );
+    m_xCheckNowButton->connect_clicked( LINK( this, SvxOnlineUpdateTabPage, CheckNowHdl_Impl ) );
+    m_xChangePathButton->connect_clicked( LINK( this, SvxOnlineUpdateTabPage, FileDialogHdl_Impl ) );
 
     uno::Reference < uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
 
@@ -75,16 +76,12 @@ SvxOnlineUpdateTabPage::SvxOnlineUpdateTabPage(vcl::Window* pParent, const SfxIt
     bool bDownloadSupported = false;
     m_xUpdateAccess->getByName( "DownloadSupported" ) >>= bDownloadSupported;
 
-    WinBits nStyle = m_pDestPath->GetStyle();
-    nStyle |= WB_PATHELLIPSIS;
-    m_pDestPath->SetStyle(nStyle);
-
-    m_pAutoDownloadCheckBox->Show(bDownloadSupported);
-    m_pDestPathLabel->Show(bDownloadSupported);
-    m_pDestPath->Show(bDownloadSupported);
-    m_pChangePathButton->Show(bDownloadSupported);
+    m_xAutoDownloadCheckBox->set_visible(bDownloadSupported);
+    m_xDestPathLabel->set_visible(bDownloadSupported);
+    m_xDestPath->set_visible(bDownloadSupported);
+    m_xChangePathButton->set_visible(bDownloadSupported);
 
-    m_aLastCheckedTemplate = m_pLastChecked->GetText();
+    m_aLastCheckedTemplate = m_xLastChecked->get_label();
 
     UpdateLastCheckedText();
     UpdateUserAgent();
@@ -92,25 +89,6 @@ SvxOnlineUpdateTabPage::SvxOnlineUpdateTabPage(vcl::Window* pParent, const SfxIt
 
 SvxOnlineUpdateTabPage::~SvxOnlineUpdateTabPage()
 {
-    disposeOnce();
-}
-
-void SvxOnlineUpdateTabPage::dispose()
-{
-    m_pAutoCheckCheckBox.clear();
-    m_pEveryDayButton.clear();
-    m_pEveryWeekButton.clear();
-    m_pEveryMonthButton.clear();
-    m_pCheckNowButton.clear();
-    m_pAutoDownloadCheckBox.clear();
-    m_pDestPathLabel.clear();
-    m_pDestPath.clear();
-    m_pChangePathButton.clear();
-    m_pLastChecked.clear();
-    m_pExtrasCheckBox.clear();
-    m_pUserAgentLabel.clear();
-
-    SfxTabPage::dispose();
 }
 
 void SvxOnlineUpdateTabPage::UpdateLastCheckedText()
@@ -166,7 +144,7 @@ void SvxOnlineUpdateTabPage::UpdateLastCheckedText()
             aText = aText.replaceAt( nIndex, 6, aTimeStr );
     }
 
-    m_pLastChecked->SetText( aText );
+    m_xLastChecked->set_label(aText);
 }
 
 void SvxOnlineUpdateTabPage::UpdateUserAgent()
@@ -178,7 +156,7 @@ void SvxOnlineUpdateTabPage::UpdateUserAgent()
             css::uno::UNO_QUERY_THROW );
 
         OUString aPseudoURL = "useragent:normal";
-        if( m_pExtrasCheckBox->IsChecked() )
+        if( m_xExtrasCheckBox->get_active() )
             aPseudoURL = "useragent:extended";
         uno::Sequence< beans::StringPair > aHeaders
             = xDav->getUserRequestHeaders( aPseudoURL, ucb::WebDAVHTTPMethod(0) );
@@ -190,7 +168,7 @@ void SvxOnlineUpdateTabPage::UpdateUserAgent()
                 OUString aText = aHeader.Second;
                 aText = aText.replaceAll(";", ";\n");
                 aText = aText.replaceAll("(", "\n(");
-                m_pUserAgentLabel->SetText( aText );
+                m_xUserAgentLabel->set_label(aText);
                 break;
             }
         }
@@ -203,7 +181,7 @@ void SvxOnlineUpdateTabPage::UpdateUserAgent()
 VclPtr<SfxTabPage>
 SvxOnlineUpdateTabPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet )
 {
-    return VclPtr<SvxOnlineUpdateTabPage>::Create( pParent.pParent, *rAttrSet );
+    return VclPtr<SvxOnlineUpdateTabPage>::Create( pParent, *rAttrSet );
 }
 
 bool SvxOnlineUpdateTabPage::FillItemSet( SfxItemSet* )
@@ -213,27 +191,27 @@ bool SvxOnlineUpdateTabPage::FillItemSet( SfxItemSet* )
     bool bValue;
     sal_Int64 nValue;
 
-    if( m_pAutoCheckCheckBox->IsValueChangedFromSaved() )
+    if( m_xAutoCheckCheckBox->get_state_changed_from_saved() )
     {
-        bValue = m_pAutoCheckCheckBox->IsChecked();
+        bValue = m_xAutoCheckCheckBox->get_active();
         m_xUpdateAccess->replaceByName( "AutoCheckEnabled", uno::Any( bValue ) );
         bModified = true;
     }
 
     nValue = 0;
-    if( m_pEveryDayButton->IsChecked() )
+    if( m_xEveryDayButton->get_active() )
     {
-        if( !m_pEveryDayButton->GetSavedValue() )
+        if( !m_xEveryDayButton->get_saved_state() )
             nValue = 86400;
     }
-    else if( m_pEveryWeekButton->IsChecked() )
+    else if( m_xEveryWeekButton->get_active() )
     {
-        if( !m_pEveryWeekButton->GetSavedValue() )
+        if( !m_xEveryWeekButton->get_saved_state() )
             nValue = 604800;
     }
-    else if( m_pEveryMonthButton->IsChecked() )
+    else if( m_xEveryMonthButton->get_active() )
     {
-        if( !m_pEveryMonthButton->GetSavedValue() )
+        if( !m_xEveryMonthButton->get_saved_state() )
             nValue = 2592000;
     }
 
@@ -243,9 +221,9 @@ bool SvxOnlineUpdateTabPage::FillItemSet( SfxItemSet* )
         bModified = true;
     }
 
-    if( m_pAutoDownloadCheckBox->IsValueChangedFromSaved() )
+    if( m_xAutoDownloadCheckBox->get_state_changed_from_saved() )
     {
-        bValue = m_pAutoDownloadCheckBox->IsChecked();
+        bValue = m_xAutoDownloadCheckBox->get_active();
         m_xUpdateAccess->replaceByName( "AutoDownloadEnabled", uno::Any( bValue ) );
         bModified = true;
     }
@@ -253,16 +231,16 @@ bool SvxOnlineUpdateTabPage::FillItemSet( SfxItemSet* )
     OUString sValue, aURL;
     m_xUpdateAccess->getByName( "DownloadDestination" ) >>= sValue;
 
-    if( ( osl::FileBase::E_None == osl::FileBase::getFileURLFromSystemPath(m_pDestPath->GetText(), aURL) ) &&
+    if( ( osl::FileBase::E_None == osl::FileBase::getFileURLFromSystemPath(m_xDestPath->get_label(), aURL) ) &&
         ( aURL != sValue ) )
     {
         m_xUpdateAccess->replaceByName( "DownloadDestination", uno::Any( aURL ) );
         bModified = true;
     }
 
-    if( m_pExtrasCheckBox->IsValueChangedFromSaved() )
+    if( m_xExtrasCheckBox->get_state_changed_from_saved() )
     {
-        bValue = m_pExtrasCheckBox->IsChecked();
+        bValue = m_xExtrasCheckBox->get_active();
         m_xUpdateAccess->replaceByName( "ExtendedUserAgent", uno::Any( bValue ) );
         bModified = true;
     }
@@ -281,83 +259,83 @@ void SvxOnlineUpdateTabPage::Reset( const SfxItemSet* )
     beans::Property aProperty = m_xReadWriteAccess->getPropertyByHierarchicalName("/org.openoffice.Office.Jobs/Jobs/org.openoffice.Office.Jobs:Job['UpdateCheck']/Arguments/AutoCheckEnabled");
     bool bReadOnly = (aProperty.Attributes & beans::PropertyAttribute::READONLY) != 0;
 
-    m_pAutoCheckCheckBox->Check(bValue);
-    m_pAutoCheckCheckBox->Enable(!bReadOnly);
+    m_xAutoCheckCheckBox->set_active(bValue);
+    m_xAutoCheckCheckBox->set_sensitive(!bReadOnly);
 
     sal_Int64 nValue = 0;
     m_xUpdateAccess->getByName( "CheckInterval" ) >>= nValue;
     aProperty = m_xReadWriteAccess->getPropertyByHierarchicalName("/org.openoffice.Office.Jobs/Jobs/org.openoffice.Office.Jobs:Job['UpdateCheck']/Arguments/CheckInterval");
     bool bReadOnly2 = (aProperty.Attributes & beans::PropertyAttribute::READONLY) != 0;
-    m_pEveryDayButton->Enable(bValue && !(bReadOnly || bReadOnly2));
-    m_pEveryWeekButton->Enable(bValue && !(bReadOnly || bReadOnly2));
-    m_pEveryMonthButton->Enable(bValue && !(bReadOnly || bReadOnly2));
+    m_xEveryDayButton->set_sensitive(bValue && !(bReadOnly || bReadOnly2));
+    m_xEveryWeekButton->set_sensitive(bValue && !(bReadOnly || bReadOnly2));
+    m_xEveryMonthButton->set_sensitive(bValue && !(bReadOnly || bReadOnly2));
 
     if( nValue == 86400 )
-        m_pEveryDayButton->Check();
+        m_xEveryDayButton->set_active(true);
     else if( nValue == 604800 )
-        m_pEveryWeekButton->Check();
+        m_xEveryWeekButton->set_active(true);
     else
-        m_pEveryMonthButton->Check();
+        m_xEveryMonthButton->set_active(true);
 
-    m_pAutoCheckCheckBox->SaveValue();
-    m_pEveryDayButton->SaveValue();
-    m_pEveryWeekButton->SaveValue();
-    m_pEveryMonthButton->SaveValue();
+    m_xAutoCheckCheckBox->save_state();
+    m_xEveryDayButton->save_state();
+    m_xEveryWeekButton->save_state();
+    m_xEveryMonthButton->save_state();
 
     m_xUpdateAccess->getByName( "AutoDownloadEnabled" ) >>= bValue;
     aProperty = m_xReadWriteAccess->getPropertyByHierarchicalName("/org.openoffice.Office.Jobs/Jobs/org.openoffice.Office.Jobs:Job['UpdateCheck']/Arguments/AutoDownloadEnabled");
     bReadOnly = (aProperty.Attributes & beans::PropertyAttribute::READONLY) != 0;
-    m_pAutoDownloadCheckBox->Check(bValue);
-    m_pAutoDownloadCheckBox->Enable(!bReadOnly);
-    m_pDestPathLabel->Enable();
-    m_pDestPath->Enable();
+    m_xAutoDownloadCheckBox->set_active(bValue);
+    m_xAutoDownloadCheckBox->set_sensitive(!bReadOnly);
+    m_xDestPathLabel->set_sensitive(true);
+    m_xDestPath->set_sensitive(true);
 
     OUString sValue, aPath;
     m_xUpdateAccess->getByName( "DownloadDestination" ) >>= sValue;
     aProperty = m_xReadWriteAccess->getPropertyByHierarchicalName("/org.openoffice.Office.Jobs/Jobs/org.openoffice.Office.Jobs:Job['UpdateCheck']/Arguments/DownloadDestination");
     bReadOnly = (aProperty.Attributes & beans::PropertyAttribute::READONLY) != 0;
-    m_pChangePathButton->Enable(!bReadOnly);
+    m_xChangePathButton->set_sensitive(!bReadOnly);
 
     if( osl::FileBase::E_None == osl::FileBase::getSystemPathFromFileURL(sValue, aPath) )
-        m_pDestPath->SetText(aPath);
+        m_xDestPath->set_label(aPath);
 
     m_xUpdateAccess->getByName( "ExtendedUserAgent" ) >>= bValue;
     aProperty = m_xReadWriteAccess->getPropertyByHierarchicalName("/org.openoffice.Office.Jobs/Jobs/org.openoffice.Office.Jobs:Job['UpdateCheck']/Arguments/ExtendedUserAgent");
     bReadOnly = (aProperty.Attributes & beans::PropertyAttribute::READONLY) != 0;
-    m_pExtrasCheckBox->Check(bValue);
-    m_pExtrasCheckBox->Enable(!bReadOnly);
-    m_pExtrasCheckBox->SaveValue();
+    m_xExtrasCheckBox->set_active(bValue);
+    m_xExtrasCheckBox->set_sensitive(!bReadOnly);
+    m_xExtrasCheckBox->save_state();
     UpdateUserAgent();
 
-    m_pAutoDownloadCheckBox->SaveValue();
+    m_xAutoDownloadCheckBox->save_state();
 }
 
 void SvxOnlineUpdateTabPage::FillUserData()
 {
 }
 
-IMPL_LINK( SvxOnlineUpdateTabPage, AutoCheckHdl_Impl, Button*, pBox, void )
+IMPL_LINK(SvxOnlineUpdateTabPage, AutoCheckHdl_Impl, weld::ToggleButton&, rBox, void)
 {
-    bool bEnabled = static_cast<CheckBox*>(pBox)->IsChecked();
+    bool bEnabled = rBox.get_active();
     beans::Property aProperty = m_xReadWriteAccess->getPropertyByHierarchicalName("/org.openoffice.Office.Jobs/Jobs/org.openoffice.Office.Jobs:Job['UpdateCheck']/Arguments/CheckInterval");
     bool bReadOnly = (aProperty.Attributes & beans::PropertyAttribute::READONLY) != 0;
-    m_pEveryDayButton->Enable(bEnabled && !bReadOnly);
-    m_pEveryWeekButton->Enable(bEnabled && !bReadOnly);
-    m_pEveryMonthButton->Enable(bEnabled && !bReadOnly);
+    m_xEveryDayButton->set_sensitive(bEnabled && !bReadOnly);
+    m_xEveryWeekButton->set_sensitive(bEnabled && !bReadOnly);
+    m_xEveryMonthButton->set_sensitive(bEnabled && !bReadOnly);
 }
 
-IMPL_LINK( SvxOnlineUpdateTabPage, ExtrasCheckHdl_Impl, Button*, , void )
+IMPL_LINK_NOARG(SvxOnlineUpdateTabPage, ExtrasCheckHdl_Impl, weld::Button&, void)
 {
     UpdateUserAgent();
 }
 
-IMPL_LINK_NOARG(SvxOnlineUpdateTabPage, FileDialogHdl_Impl, Button*, void)
+IMPL_LINK_NOARG(SvxOnlineUpdateTabPage, FileDialogHdl_Impl, weld::Button&, void)
 {
     uno::Reference < uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
     uno::Reference < ui::dialogs::XFolderPicker2 >  xFolderPicker = ui::dialogs::FolderPicker::create(xContext);
 
     OUString aURL;
-    if( osl::FileBase::E_None != osl::FileBase::getFileURLFromSystemPath(m_pDestPath->GetText(), aURL) )
+    if( osl::FileBase::E_None != osl::FileBase::getFileURLFromSystemPath(m_xDestPath->get_label(), aURL) )
         osl::Security().getHomeDir(aURL);
 
     xFolderPicker->setDisplayDirectory( aURL );
@@ -367,11 +345,11 @@ IMPL_LINK_NOARG(SvxOnlineUpdateTabPage, FileDialogHdl_Impl, Button*, void)
     {
         OUString aFolder;
         if( osl::FileBase::E_None == osl::FileBase::getSystemPathFromFileURL(xFolderPicker->getDirectory(), aFolder))
-            m_pDestPath->SetText( aFolder );
+            m_xDestPath->set_label(aFolder);
     }
 }
 
-IMPL_LINK_NOARG(SvxOnlineUpdateTabPage, CheckNowHdl_Impl, Button*, void)
+IMPL_LINK_NOARG(SvxOnlineUpdateTabPage, CheckNowHdl_Impl, weld::Button&, void)
 {
     uno::Reference < uno::XComponentContext> xContext( ::comphelper::getProcessComponentContext() );
 
diff --git a/cui/source/options/optupdt.hxx b/cui/source/options/optupdt.hxx
index b9c844fa82a1..1f6923715f34 100644
--- a/cui/source/options/optupdt.hxx
+++ b/cui/source/options/optupdt.hxx
@@ -31,36 +31,37 @@
 class SvxOnlineUpdateTabPage : public SfxTabPage
 {
 private:
-    VclPtr<CheckBox>           m_pAutoCheckCheckBox;
-    VclPtr<RadioButton>        m_pEveryDayButton;
-    VclPtr<RadioButton>        m_pEveryWeekButton;
-    VclPtr<RadioButton>        m_pEveryMonthButton;
-    VclPtr<PushButton>         m_pCheckNowButton;
-    VclPtr<CheckBox>           m_pAutoDownloadCheckBox;
-    VclPtr<FixedText>          m_pDestPathLabel;
-    VclPtr<FixedText>          m_pDestPath;
-    VclPtr<PushButton>         m_pChangePathButton;
-    VclPtr<FixedText>          m_pLastChecked;
-    VclPtr<CheckBox>           m_pExtrasCheckBox;
-    VclPtr<FixedText>          m_pUserAgentLabel;
     OUString       m_aNeverChecked;
     OUString       m_aLastCheckedTemplate;
 
-    DECL_LINK(FileDialogHdl_Impl, Button*, void);
-    DECL_LINK(CheckNowHdl_Impl, Button*, void);
-    DECL_LINK(AutoCheckHdl_Impl, Button*, void);
-    DECL_LINK(ExtrasCheckHdl_Impl, Button*, void);
-
     css::uno::Reference< css::container::XNameReplace > m_xUpdateAccess;
     css::uno::Reference<css::configuration::XReadWriteAccess> m_xReadWriteAccess;
 
+    std::unique_ptr<weld::Label> m_xNeverChecked;
+    std::unique_ptr<weld::CheckButton> m_xAutoCheckCheckBox;
+    std::unique_ptr<weld::RadioButton> m_xEveryDayButton;
+    std::unique_ptr<weld::RadioButton> m_xEveryWeekButton;
+    std::unique_ptr<weld::RadioButton> m_xEveryMonthButton;
+    std::unique_ptr<weld::Button> m_xCheckNowButton;
+    std::unique_ptr<weld::CheckButton> m_xAutoDownloadCheckBox;
+    std::unique_ptr<weld::Label> m_xDestPathLabel;
+    std::unique_ptr<weld::Label> m_xDestPath;
+    std::unique_ptr<weld::Button> m_xChangePathButton;
+    std::unique_ptr<weld::Label> m_xLastChecked;
+    std::unique_ptr<weld::CheckButton> m_xExtrasCheckBox;
+    std::unique_ptr<weld::Label> m_xUserAgentLabel;
+
+    DECL_LINK(FileDialogHdl_Impl, weld::Button&, void);
+    DECL_LINK(CheckNowHdl_Impl, weld::Button&, void);
+    DECL_LINK(AutoCheckHdl_Impl, weld::ToggleButton&, void);
+    DECL_LINK(ExtrasCheckHdl_Impl, weld::Button&, void);
+
     void                    UpdateLastCheckedText();
     void                    UpdateUserAgent();
 
 public:
-    SvxOnlineUpdateTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
+    SvxOnlineUpdateTabPage(TabPageParent pParent, const SfxItemSet& rSet);
     virtual ~SvxOnlineUpdateTabPage() override;
-    virtual void dispose() override;
 
     static VclPtr<SfxTabPage>      Create( TabPageParent pParent, const SfxItemSet* rSet );
 
@@ -69,7 +70,6 @@ public:
     virtual void            FillUserData() override;
 };
 
-
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/uiconfig/ui/optonlineupdatepage.ui b/cui/uiconfig/ui/optonlineupdatepage.ui
index 3a7c1d1b2f87..22986562451c 100644
--- a/cui/uiconfig/ui/optonlineupdatepage.ui
+++ b/cui/uiconfig/ui/optonlineupdatepage.ui
@@ -195,6 +195,7 @@
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
                         <property name="hexpand">True</property>
+                        <property name="ellipsize">end</property>
                         <property name="xalign">0</property>
                       </object>
                       <packing>
@@ -232,7 +233,7 @@
               </packing>
             </child>
             <child>
-              <object class="GtkHBox" id="hbox">
+              <object class="GtkBox" id="hbox">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <property name="spacing">8</property>
commit 5a6a718d0e99bbd3311fdcd87648420fcec9f5b2
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Jul 29 16:54:23 2019 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Jul 30 09:53:59 2019 +0200

    weld SvxEMailTabPage
    
    Change-Id: I039564a53fe4b9c20f34efcb9e59f57528a1f5da
    Reviewed-on: https://gerrit.libreoffice.org/76561
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx
index e4a16a298cf6..af3c497d44e8 100644
--- a/cui/source/options/optinet2.cxx
+++ b/cui/source/options/optinet2.cxx
@@ -965,46 +965,33 @@ struct SvxEMailTabPage_Impl
     bool bROHideContent;
 };
 
-SvxEMailTabPage::SvxEMailTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
-    : SfxTabPage( pParent, "OptEmailPage", "cui/ui/optemailpage.ui", &rSet)
+SvxEMailTabPage::SvxEMailTabPage(TabPageParent pParent, const SfxItemSet& rSet)
+    : SfxTabPage( pParent, "cui/ui/optemailpage.ui", "OptEmailPage", &rSet)
     , pImpl(new SvxEMailTabPage_Impl)
+    , m_xMailContainer(m_xBuilder->weld_container("program"))
+    , m_xMailerURLFI(m_xBuilder->weld_image("lockemail"))
+    , m_xMailerURLED(m_xBuilder->weld_entry("url"))
+    , m_xMailerURLPB(m_xBuilder->weld_button("browse"))
+    , m_xSuppressHiddenContainer(m_xBuilder->weld_container("suppressHiddenCont"))
+    , m_xSuppressHiddenFI(m_xBuilder->weld_image("lockSuppressHidden"))
+    , m_xSuppressHidden(m_xBuilder->weld_check_button("suppressHidden"))
+    , m_xDefaultFilterFT(m_xBuilder->weld_label("browsetitle"))
 {
-    get(m_pMailContainer, "program");
-    get(m_pMailerURLFI, "lockemail");
-    get(m_pMailerURLED, "url");
-    get(m_pMailerURLPB, "browse");
-    get(m_pSuppressHiddenContainer, "suppressHiddenCont");
-    get(m_pSuppressHiddenFI, "lockSuppressHidden");
-    get(m_pSuppressHidden, "suppressHidden");
-    m_sDefaultFilterName = get<FixedText>("browsetitle")->GetText();
-    m_pMailerURLPB->SetClickHdl( LINK( this, SvxEMailTabPage, FileDialogHdl_Impl ) );
+    m_sDefaultFilterName = m_xDefaultFilterFT->get_label();
+    m_xMailerURLPB->connect_clicked( LINK( this, SvxEMailTabPage, FileDialogHdl_Impl ) );
 }
 
 /* -------------------------------------------------------------------------*/
 
 SvxEMailTabPage::~SvxEMailTabPage()
 {
-    disposeOnce();
-}
-
-void SvxEMailTabPage::dispose()
-{
-    pImpl.reset();
-    m_pMailContainer.clear();
-    m_pMailerURLFI.clear();
-    m_pMailerURLED.clear();
-    m_pMailerURLPB.clear();
-    m_pSuppressHiddenContainer.clear();
-    m_pSuppressHiddenFI.clear();
-    m_pSuppressHidden.clear();
-    SfxTabPage::dispose();
 }
 
 /* -------------------------------------------------------------------------*/
 
 VclPtr<SfxTabPage>  SvxEMailTabPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet )
 {
-    return VclPtr<SvxEMailTabPage>::Create(pParent.pParent, *rAttrSet);
+    return VclPtr<SvxEMailTabPage>::Create(pParent, *rAttrSet);
 }
 
 /* -------------------------------------------------------------------------*/
@@ -1013,16 +1000,16 @@ bool SvxEMailTabPage::FillItemSet( SfxItemSet* )
 {
     std::shared_ptr<comphelper::ConfigurationChanges> batch(
         comphelper::ConfigurationChanges::create());
-    if (!pImpl->bROProgram && m_pMailerURLED->IsValueChangedFromSaved())
+    if (!pImpl->bROProgram && m_xMailerURLED->get_value_changed_from_saved())
     {
-        pImpl->sProgram = m_pMailerURLED->GetText();
+        pImpl->sProgram = m_xMailerURLED->get_text();
         officecfg::Office::Common::ExternalMailer::Program::set(
             pImpl->sProgram, batch);
     }
     if (!pImpl->bROHideContent
-        && pImpl->bHideContent != m_pSuppressHidden->IsChecked())
+        && pImpl->bHideContent != m_xSuppressHidden->get_active())
     {
-        pImpl->bHideContent = m_pSuppressHidden->IsChecked();
+        pImpl->bHideContent = m_xSuppressHidden->get_active();
         officecfg::Office::Security::HiddenContent::RemoveHiddenContent::set(
             pImpl->bHideContent, batch);
     }
@@ -1034,33 +1021,33 @@ bool SvxEMailTabPage::FillItemSet( SfxItemSet* )
 
 void SvxEMailTabPage::Reset( const SfxItemSet* )
 {
-    m_pMailerURLED->Enable();
-    m_pMailerURLPB->Enable();
+    m_xMailerURLED->set_sensitive(true);
+    m_xMailerURLPB->set_sensitive(true);
 
     if (pImpl->bROProgram)
-        m_pMailerURLFI->Show();
+        m_xMailerURLFI->show();
 
-    m_pMailerURLED->SetText(pImpl->sProgram);
-    m_pMailerURLED->SaveValue();
+    m_xMailerURLED->set_text(pImpl->sProgram);
+    m_xMailerURLED->save_value();
 
-    m_pMailContainer->Enable(!pImpl->bROProgram);
+    m_xMailContainer->set_sensitive(!pImpl->bROProgram);
 
     if (pImpl->bROHideContent)
-        m_pSuppressHiddenFI->Show();
+        m_xSuppressHiddenFI->show();
 
-    m_pSuppressHidden->Check(pImpl->bHideContent);
+    m_xSuppressHidden->set_active(pImpl->bHideContent);
 
-    m_pSuppressHiddenContainer->Enable(!pImpl->bROHideContent);
+    m_xSuppressHiddenContainer->set_sensitive(!pImpl->bROHideContent);
 }
 
 /* -------------------------------------------------------------------------*/
 
-IMPL_LINK(  SvxEMailTabPage, FileDialogHdl_Impl, Button*, pButton, void )
+IMPL_LINK_NOARG(SvxEMailTabPage, FileDialogHdl_Impl, weld::Button&, void)
 {
-    if (m_pMailerURLPB == pButton && !pImpl->bROProgram)
+    if (!pImpl->bROProgram)
     {
         FileDialogHelper aHelper(css::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, FileDialogFlags::NONE, GetFrameWeld());
-        OUString sPath = m_pMailerURLED->GetText();
+        OUString sPath = m_xMailerURLED->get_text();
         if ( sPath.isEmpty() )
             sPath = "/usr/bin";
 
@@ -1077,7 +1064,7 @@ IMPL_LINK(  SvxEMailTabPage, FileDialogHdl_Impl, Button*, pButton, void )
             {
                 sPath.clear();
             }
-            m_pMailerURLED->SetText(sPath);
+            m_xMailerURLED->set_text(sPath);
         }
     }
 }
diff --git a/cui/source/options/optinet2.hxx b/cui/source/options/optinet2.hxx
index 9d7c3596c90e..dd75a3920ad0 100644
--- a/cui/source/options/optinet2.hxx
+++ b/cui/source/options/optinet2.hxx
@@ -155,24 +155,24 @@ public:
 struct SvxEMailTabPage_Impl;
 class SvxEMailTabPage : public SfxTabPage
 {
-    VclPtr<VclContainer> m_pMailContainer;
-    VclPtr<FixedImage>   m_pMailerURLFI;
-    VclPtr<Edit>         m_pMailerURLED;
-    VclPtr<PushButton>   m_pMailerURLPB;
-    VclPtr<VclContainer> m_pSuppressHiddenContainer;
-    VclPtr<FixedImage>   m_pSuppressHiddenFI;
-    VclPtr<CheckBox>     m_pSuppressHidden;
-
     OUString      m_sDefaultFilterName;
 
     std::unique_ptr<SvxEMailTabPage_Impl> pImpl;
 
-    DECL_LINK(  FileDialogHdl_Impl, Button*, void );
+    std::unique_ptr<weld::Container> m_xMailContainer;
+    std::unique_ptr<weld::Image> m_xMailerURLFI;
+    std::unique_ptr<weld::Entry> m_xMailerURLED;
+    std::unique_ptr<weld::Button> m_xMailerURLPB;
+    std::unique_ptr<weld::Container> m_xSuppressHiddenContainer;
+    std::unique_ptr<weld::Image> m_xSuppressHiddenFI;
+    std::unique_ptr<weld::CheckButton> m_xSuppressHidden;
+    std::unique_ptr<weld::Label> m_xDefaultFilterFT;
+
+    DECL_LINK(FileDialogHdl_Impl, weld::Button&, void);
 
 public:
-    SvxEMailTabPage( vcl::Window* pParent, const SfxItemSet& rSet );
+    SvxEMailTabPage(TabPageParent pParent, const SfxItemSet& rSet );
     virtual ~SvxEMailTabPage() override;
-    virtual void        dispose() override;
 
     static VclPtr<SfxTabPage>  Create( TabPageParent pParent, const SfxItemSet* rAttrSet );
 
@@ -182,5 +182,4 @@ public:
 
 #endif // INCLUDED_CUI_SOURCE_OPTIONS_OPTINET2_HXX
 
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/uiconfig/ui/optemailpage.ui b/cui/uiconfig/ui/optemailpage.ui
index 497e99a99d92..f2fba43ae7dc 100644
--- a/cui/uiconfig/ui/optemailpage.ui
+++ b/cui/uiconfig/ui/optemailpage.ui
@@ -1,4 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.22.1 -->
 <interface domain="cui">
   <requires lib="gtk+" version="3.18"/>
   <object class="GtkFrame" id="OptEmailPage">
@@ -30,8 +31,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>
@@ -40,13 +39,12 @@
                 <property name="can_focus">True</property>
                 <property name="valign">center</property>
                 <property name="hexpand">True</property>
+                <property name="activates_default">True</property>
                 <property name="width_chars">32</property>
               </object>
               <packing>
                 <property name="left_attach">2</property>
                 <property name="top_attach">0</property>
-                <property name="width">1</property>
-                <property name="height">1</property>
               </packing>
             </child>
             <child>
@@ -60,8 +58,6 @@
               <packing>
                 <property name="left_attach">3</property>
                 <property name="top_attach">0</property>
-                <property name="width">1</property>
-                <property name="height">1</property>
               </packing>
             </child>
             <child>
@@ -70,13 +66,11 @@
                 <property name="no_show_all">True</property>
                 <property name="halign">center</property>
                 <property name="valign">center</property>
-                <property name="pixbuf">res/lock.png</property>
+                <property name="icon_name">res/lock.png</property>
               </object>
               <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>
@@ -89,7 +83,6 @@
                 <property name="left_attach">0</property>
                 <property name="top_attach">1</property>
                 <property name="width">4</property>
-                <property name="height">1</property>
               </packing>
             </child>
           </object>
@@ -109,15 +102,13 @@
               <object class="GtkLabel" id="suppress">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
-                <property name="xalign">0</property>
                 <property name="label" translatable="yes" context="optemailpage|suppress">Suppress hidden elements of documents</property>
                 <property name="use_underline">True</property>
+                <property name="xalign">0</property>
               </object>
               <packing>
                 <property name="left_attach">2</property>
                 <property name="top_attach">2</property>
-                <property name="width">1</property>
-                <property name="height">1</property>
               </packing>
             </child>
             <child>
@@ -132,8 +123,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>
@@ -142,15 +131,31 @@
                 <property name="no_show_all">True</property>
                 <property name="halign">center</property>
                 <property name="valign">center</property>
-                <property name="pixbuf">res/lock.png</property>
+                <property name="icon_name">res/lock.png</property>
               </object>
               <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>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
           </object>
           <packing>
             <property name="expand">False</property>
commit 0871c62fab7effd915d54caf953fd6b7e8de2372
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Jul 29 14:14:51 2019 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Jul 30 09:53:31 2019 +0200

    weld SwRedlineOptionsTabPage
    
    Change-Id: Ic901356d399e8d758747f0fea07d3656fbf89aab
    Reviewed-on: https://gerrit.libreoffice.org/76559
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/cui/uiconfig/ui/optonlineupdatepage.ui b/cui/uiconfig/ui/optonlineupdatepage.ui
index e2fad8215c65..3a7c1d1b2f87 100644
--- a/cui/uiconfig/ui/optonlineupdatepage.ui
+++ b/cui/uiconfig/ui/optonlineupdatepage.ui
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.19.0 -->
+<!-- Generated with glade 3.22.1 -->
 <interface domain="cui">
   <requires lib="gtk+" version="3.18"/>
   <object class="GtkFrame" id="OptOnlineUpdatePage">
@@ -59,7 +59,6 @@
                         <property name="xalign">0</property>
                         <property name="active">True</property>
                         <property name="draw_indicator">True</property>
-                        <property name="group">everyweek</property>
                       </object>
                       <packing>
                         <property name="left_attach">0</property>
@@ -75,7 +74,7 @@
                         <property name="use_underline">True</property>
                         <property name="xalign">0</property>
                         <property name="draw_indicator">True</property>
-                        <property name="group">everymonth</property>
+                        <property name="group">everyday</property>
                       </object>
                       <packing>
                         <property name="left_attach">0</property>
diff --git a/extras/source/glade/libreoffice-catalog.xml.in b/extras/source/glade/libreoffice-catalog.xml.in
index c76f9de0ca50..056862530dab 100644
--- a/extras/source/glade/libreoffice-catalog.xml.in
+++ b/extras/source/glade/libreoffice-catalog.xml.in
@@ -117,9 +117,6 @@
       </properties>
     </glade-widget-class>
 
-    <glade-widget-class title="Mark Preview" name="swuilo-SwMarkPreview"
-                        generic-name="Mark Preview Window" parent="GtkDrawingArea"
-                        icon-name="widget-gtk-drawingarea"/>
     <glade-widget-class title="Document Preview Window" name="sdlo-SdDocPreviewWin"
                         generic-name="Document Preview Window" parent="GtkDrawingArea"
                         icon-name="widget-gtk-drawingarea"/>
diff --git a/include/sfx2/dialoghelper.hxx b/include/sfx2/dialoghelper.hxx
index e60c1293192c..f9c5df9012f4 100644
--- a/include/sfx2/dialoghelper.hxx
+++ b/include/sfx2/dialoghelper.hxx
@@ -30,7 +30,7 @@ Size SFX2_DLLPUBLIC getDrawPreviewOptimalSize(const vcl::Window *pReference);
 
 Size SFX2_DLLPUBLIC getPreviewStripSize(const OutputDevice& rReference);
 
-Size SFX2_DLLPUBLIC getPreviewOptionsSize(const vcl::Window *pReference);
+Size SFX2_DLLPUBLIC getPreviewOptionsSize(const OutputDevice& rReference);
 
 OUString SFX2_DLLPUBLIC getWidestTime(const LocaleDataWrapper& rWrapper);
 
diff --git a/include/svx/fntctrl.hxx b/include/svx/fntctrl.hxx
index 16d585608053..89655ac22559 100644
--- a/include/svx/fntctrl.hxx
+++ b/include/svx/fntctrl.hxx
@@ -86,6 +86,8 @@ public:
     void                SetFont( const SvxFont& rNormalFont, const SvxFont& rCJKFont, const SvxFont& rCTLFont );
     SvxFont&            GetCJKFont();
     SvxFont&            GetCTLFont();
+    void                SetColor( const Color& rColor );
+    void                ResetColor();
     void                SetBackColor( const Color& rColor );
     void                SetTextLineColor(const Color& rColor);
     void                SetOverlineColor(const Color& rColor);
diff --git a/sfx2/source/dialog/dialoghelper.cxx b/sfx2/source/dialog/dialoghelper.cxx
index 524fba9b563f..0af9600960ea 100644
--- a/sfx2/source/dialog/dialoghelper.cxx
+++ b/sfx2/source/dialog/dialoghelper.cxx
@@ -30,9 +30,9 @@ Size getPreviewStripSize(const OutputDevice& rReference)
     return rReference.LogicToPixel(Size(70 , 40), MapMode(MapUnit::MapAppFont));
 }
 
-Size getPreviewOptionsSize(const vcl::Window *pReference)
+Size getPreviewOptionsSize(const OutputDevice& rReference)
 {
-    return pReference->LogicToPixel(Size(70 , 27), MapMode(MapUnit::MapAppFont));
+    return rReference.LogicToPixel(Size(70 , 27), MapMode(MapUnit::MapAppFont));
 }
 
 OUString getWidestTime(const LocaleDataWrapper& rWrapper)
diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index edfbd5a8ec6f..7501d2a65a20 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -512,7 +512,6 @@ custom_widgets = [
     'SvxTextEncodingBox',
     'SvxTextEncodingBox',
     'SwAddressPreview',
-    'SwMarkPreview',
     'SwNavHelpToolBox',
     'TableValueSet',
     'TemplateDefaultView',
diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx
index 319f70e3192a..7e991af52d91 100644
--- a/svx/source/dialog/fntctrl.cxx
+++ b/svx/source/dialog/fntctrl.cxx
@@ -942,6 +942,18 @@ void FontPrevWindow::SetFont( const SvxFont& rNormalOutFont, const SvxFont& rCJK
     Invalidate();
 }
 
+void FontPrevWindow::SetColor(const Color &rColor)
+{
+    pImpl->mpColor.reset(new Color(rColor));
+    Invalidate();
+}
+
+void FontPrevWindow::ResetColor()
+{
+    pImpl->mpColor.reset();
+    Invalidate();
+}
+
 void FontPrevWindow::SetBackColor(const Color &rColor)
 {
     pImpl->mpBackColor.reset(new Color(rColor));
diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc
index 7f9d7e28aeb3..660b87da3111 100644
--- a/sw/inc/strings.hrc
+++ b/sw/inc/strings.hrc
@@ -1355,6 +1355,10 @@
 
 #define STR_MAILCONFIG_DLG_TITLE                NC_("STR_MAILCONFIG_DLG_TITLE", "Email settings")
 
+#define STR_OPT_PREVIEW_INSERTED                NC_("optredlinepage|insertedpreview", "Insert")
+#define STR_OPT_PREVIEW_DELETED                 NC_("optredlinepage|deletedpreview", "Delete")
+#define STR_OPT_PREVIEW_CHANGED                 NC_("optredlinepage|changedpreview", "Attributes")
+
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx
index 8402c24e0930..e21ad734d6ed 100644
--- a/sw/source/ui/config/optpage.cxx
+++ b/sw/source/ui/config/optpage.cxx
@@ -74,7 +74,6 @@
 #include <svx/svxids.hrc>
 
 #include <vcl/settings.hxx>
-#include <vcl/builderfactory.hxx>
 #include <vcl/svapp.hxx>
 
 #include <optload.hxx>
@@ -1417,21 +1416,15 @@ static sal_uInt16 aDeletedAttrMap[] = { 0, 1, 2, 5, 6, 7, 8, 9, 10 };
 static sal_uInt16 aChangedAttrMap[] = { 0, 1, 2, 3, 4, 6, 7, 8, 9, 10 };
 
 // Preview of selection
-SwMarkPreview::SwMarkPreview( vcl::Window *pParent, WinBits nWinBits ) :
-
-    Window(pParent, nWinBits),
-    m_aTransCol( COL_TRANSPARENT ),
-    m_aMarkCol( COL_LIGHTRED ),
-    nMarkPos(0)
+SwMarkPreview::SwMarkPreview()
+    : m_aTransCol(COL_TRANSPARENT)
+    , m_aMarkCol(COL_LIGHTRED)
+    , nMarkPos(0)
 
 {
-    m_aInitialSize = getPreviewOptionsSize(this);
     InitColors();
-    SetMapMode(MapMode(MapUnit::MapPixel));
 }
 
-VCL_BUILDER_FACTORY_ARGS(SwMarkPreview, 0)
-
 SwMarkPreview::~SwMarkPreview()
 {
 }
@@ -1440,7 +1433,7 @@ void SwMarkPreview::InitColors()
 {
     // m_aTransCol and m_aMarkCol are _not_ changed because they are set from outside!
 
-    const StyleSettings& rSettings = GetSettings().GetStyleSettings();
+    const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings();
     m_aBgCol = rSettings.GetWindowColor();
 
     bool bHC = rSettings.GetHighContrastMode();
@@ -1450,14 +1443,6 @@ void SwMarkPreview::InitColors()
     m_aPrintAreaCol = m_aTextCol;
 }
 
-void SwMarkPreview::DataChanged( const DataChangedEvent& rDCEvt )
-{
-    Window::DataChanged( rDCEvt );
-
-    if( rDCEvt.GetType() == DataChangedEventType::SETTINGS && ( rDCEvt.GetFlags() & AllSettingsFlags::STYLE ) )
-        InitColors();
-}
-
 void SwMarkPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle &/*rRect*/)
 {
     const Size aSz(GetOutputSizePixel());
@@ -1558,90 +1543,88 @@ void SwMarkPreview::PaintPage(vcl::RenderContext& rRenderContext, const tools::R
     aTextLine.Move(0, -nStep);
 }
 
-Size SwMarkPreview::GetOptimalSize() const
+void SwMarkPreview::SetDrawingArea(weld::DrawingArea* pDrawingArea)
 {
-    return m_aInitialSize;
+    Size aInitialSize = getPreviewOptionsSize(pDrawingArea->get_ref_device());
+    pDrawingArea->set_size_request(aInitialSize.Width(), aInitialSize.Height());
+    weld::CustomWidgetController::SetDrawingArea(pDrawingArea);
+    SetOutputSizePixel(aInitialSize);
 }
 
 namespace
 {
     void lcl_FillRedlineAttrListBox(
-            ListBox& rLB, const AuthorCharAttr& rAttrToSelect,
+            weld::ComboBox& rLB, const AuthorCharAttr& rAttrToSelect,
             const sal_uInt16* pAttrMap, const size_t nAttrMapSize)
     {
         for (size_t i = 0; i != nAttrMapSize; ++i)
         {
             CharAttr const & rAttr(aRedlineAttr[pAttrMap[i]]);
-            rLB.SetEntryData(i, const_cast<CharAttr*>(&rAttr));
+            rLB.set_id(i, OUString::number(reinterpret_cast<sal_Int64>(&rAttr)));
             if (rAttr.nItemId == rAttrToSelect.m_nItemId &&
                 rAttr.nAttr == rAttrToSelect.m_nAttr)
-                rLB.SelectEntryPos(i);
+                rLB.set_active(i);
         }
     }
 }
 
-SwRedlineOptionsTabPage::SwRedlineOptionsTabPage( vcl::Window* pParent,
-                                                  const SfxItemSet& rSet )
-    : SfxTabPage(pParent, "OptRedLinePage",
-        "modules/swriter/ui/optredlinepage.ui" , &rSet)
-{
-    Size aPreviewSize(getPreviewOptionsSize(this));
-
-    get(m_pInsertLB,"insert");
-    get(m_pInsertColorLB,"insertcolor");
-    m_pInsertColorLB->SetSlotId(SID_AUTHOR_COLOR, true);
-    get(m_pInsertedPreviewWN,"insertedpreview");
-
-    get(m_pDeletedLB,"deleted");
-    get(m_pDeletedColorLB,"deletedcolor");
-    m_pDeletedColorLB->SetSlotId(SID_AUTHOR_COLOR, true);
-    get(m_pDeletedPreviewWN,"deletedpreview");
-
-    get(m_pChangedLB,"changed");
-    get(m_pChangedColorLB,"changedcolor");
-    m_pChangedColorLB->SetSlotId(SID_AUTHOR_COLOR, true);
-    get(m_pChangedPreviewWN,"changedpreview");
-
-    get(m_pMarkPosLB,"markpos");
-    get(m_pMarkColorLB,"markcolor");
-    get(m_pMarkPreviewWN,"markpreview");
-
-    m_pInsertedPreviewWN->set_height_request(aPreviewSize.Height());
-    m_pDeletedPreviewWN->set_height_request(aPreviewSize.Height());
-    m_pChangedPreviewWN->set_height_request(aPreviewSize.Height());
-    m_pMarkPreviewWN->set_height_request(aPreviewSize.Height());
-
-    m_pInsertedPreviewWN->set_width_request(aPreviewSize.Width());
-    m_pDeletedPreviewWN->set_width_request(aPreviewSize.Width());
-    m_pChangedPreviewWN->set_width_request(aPreviewSize.Width());
-    m_pMarkPreviewWN->set_width_request(aPreviewSize.Width());
-
-    for (sal_Int32 i = 0; i < m_pInsertLB->GetEntryCount(); ++i)
-    {
-        const OUString sEntry(m_pInsertLB->GetEntry(i));
-        m_pDeletedLB->InsertEntry(sEntry);
-        m_pChangedLB->InsertEntry(sEntry);
+SwRedlineOptionsTabPage::SwRedlineOptionsTabPage(TabPageParent pParent,
+                                                 const SfxItemSet& rSet)
+    : SfxTabPage(pParent, "modules/swriter/ui/optredlinepage.ui", "OptRedLinePage", &rSet)
+    , m_xInsertLB(m_xBuilder->weld_combo_box("insert"))
+    , m_xInsertColorLB(new ColorListBox(m_xBuilder->weld_menu_button("insertcolor"), pParent.GetFrameWeld()))
+    , m_xInsertedPreviewWN(new FontPrevWindow)
+    , m_xInsertedPreview(new weld::CustomWeld(*m_xBuilder, "insertedpreview", *m_xInsertedPreviewWN))
+    , m_xDeletedLB(m_xBuilder->weld_combo_box("deleted"))
+    , m_xDeletedColorLB(new ColorListBox(m_xBuilder->weld_menu_button("deletedcolor"), pParent.GetFrameWeld()))
+    , m_xDeletedPreviewWN(new FontPrevWindow)
+    , m_xDeletedPreview(new weld::CustomWeld(*m_xBuilder, "deletedpreview", *m_xDeletedPreviewWN))
+    , m_xChangedLB(m_xBuilder->weld_combo_box("changed"))
+    , m_xChangedColorLB(new ColorListBox(m_xBuilder->weld_menu_button("changedcolor"), pParent.GetFrameWeld()))
+    , m_xChangedPreviewWN(new FontPrevWindow)
+    , m_xChangedPreview(new weld::CustomWeld(*m_xBuilder, "changedpreview", *m_xChangedPreviewWN))
+    , m_xMarkPosLB(m_xBuilder->weld_combo_box("markpos"))
+    , m_xMarkColorLB(new ColorListBox(m_xBuilder->weld_menu_button("markcolor"), pParent.GetFrameWeld()))
+    , m_xMarkPreviewWN(new SwMarkPreview)
+    , m_xMarkPreview(new weld::CustomWeld(*m_xBuilder, "markpreview", *m_xMarkPreviewWN))
+{
+    Size aPreviewSize(getPreviewOptionsSize(m_xMarkPreviewWN->GetDrawingArea()->get_ref_device()));
+
+    m_xInsertColorLB->SetSlotId(SID_AUTHOR_COLOR, true);
+    m_xDeletedColorLB->SetSlotId(SID_AUTHOR_COLOR, true);
+    m_xChangedColorLB->SetSlotId(SID_AUTHOR_COLOR, true);
+
+    m_xInsertedPreviewWN->set_size_request(aPreviewSize.Width(), aPreviewSize.Height());
+    m_xDeletedPreviewWN->set_size_request(aPreviewSize.Width(), aPreviewSize.Height());
+    m_xChangedPreviewWN->set_size_request(aPreviewSize.Width(), aPreviewSize.Height());
+    m_xMarkPreviewWN->set_size_request(aPreviewSize.Width(), aPreviewSize.Height());
+
+    for (sal_Int32 i = 0, nEntryCount = m_xInsertLB->get_count(); i < nEntryCount; ++i)
+    {
+        const OUString sEntry(m_xInsertLB->get_text(i));
+        m_xDeletedLB->append_text(sEntry);
+        m_xChangedLB->append_text(sEntry);
     };
 
     // remove strikethrough from insert and change and underline + double
     // underline from delete
-    m_pInsertLB->RemoveEntry(5);
-    m_pChangedLB->RemoveEntry(5);
-    m_pDeletedLB->RemoveEntry(4);
-    m_pDeletedLB->RemoveEntry(3);
+    m_xInsertLB->remove(5);
+    m_xChangedLB->remove(5);
+    m_xDeletedLB->remove(4);
+    m_xDeletedLB->remove(3);
 
-    Link<ListBox&,void> aLk = LINK(this, SwRedlineOptionsTabPage, AttribHdl);
-    m_pInsertLB->SetSelectHdl( aLk );
-    m_pDeletedLB->SetSelectHdl( aLk );
-    m_pChangedLB->SetSelectHdl( aLk );
+    Link<weld::ComboBox&,void> aLk = LINK(this, SwRedlineOptionsTabPage, AttribHdl);
+    m_xInsertLB->connect_changed( aLk );
+    m_xDeletedLB->connect_changed( aLk );
+    m_xChangedLB->connect_changed( aLk );
 
-    Link<SvxColorListBox&,void> aLk2 = LINK(this, SwRedlineOptionsTabPage, ColorHdl);
-    m_pInsertColorLB->SetSelectHdl( aLk2 );
-    m_pDeletedColorLB->SetSelectHdl( aLk2 );
-    m_pChangedColorLB->SetSelectHdl( aLk2 );
+    Link<ColorListBox&,void> aLk2 = LINK(this, SwRedlineOptionsTabPage, ColorHdl);
+    m_xInsertColorLB->SetSelectHdl( aLk2 );
+    m_xDeletedColorLB->SetSelectHdl( aLk2 );
+    m_xChangedColorLB->SetSelectHdl( aLk2 );
 
-    m_pMarkPosLB->SetSelectHdl(LINK(this, SwRedlineOptionsTabPage, ChangedMaskPrevHdl));
-    m_pMarkColorLB->SetSelectHdl(LINK(this, SwRedlineOptionsTabPage, ChangedMaskColorPrevHdl));
+    m_xMarkPosLB->connect_changed(LINK(this, SwRedlineOptionsTabPage, ChangedMaskPrevHdl));
+    m_xMarkColorLB->SetSelectHdl(LINK(this, SwRedlineOptionsTabPage, ChangedMaskColorPrevHdl));
 }
 
 SwRedlineOptionsTabPage::~SwRedlineOptionsTabPage()
@@ -1651,24 +1634,24 @@ SwRedlineOptionsTabPage::~SwRedlineOptionsTabPage()
 
 void SwRedlineOptionsTabPage::dispose()
 {
-    m_pInsertLB.clear();
-    m_pInsertColorLB.clear();
-    m_pInsertedPreviewWN.clear();
-    m_pDeletedLB.clear();
-    m_pDeletedColorLB.clear();
-    m_pDeletedPreviewWN.clear();
-    m_pChangedLB.clear();
-    m_pChangedColorLB.clear();
-    m_pChangedPreviewWN.clear();
-    m_pMarkPosLB.clear();
-    m_pMarkColorLB.clear();
-    m_pMarkPreviewWN.clear();
+    m_xInsertColorLB.reset();
+    m_xInsertedPreview.reset();
+    m_xInsertedPreviewWN.reset();
+    m_xDeletedColorLB.reset();
+    m_xDeletedPreview.reset();
+    m_xDeletedPreviewWN.reset();
+    m_xChangedColorLB.reset();
+    m_xChangedPreview.reset();
+    m_xChangedPreviewWN.reset();
+    m_xMarkColorLB.reset();
+    m_xMarkPreview.reset();
+    m_xMarkPreviewWN.reset();
     SfxTabPage::dispose();
 }
 
 VclPtr<SfxTabPage> SwRedlineOptionsTabPage::Create( TabPageParent pParent, const SfxItemSet* rSet)
 {
-    return VclPtr<SwRedlineOptionsTabPage>::Create( pParent.pParent, *rSet );
+    return VclPtr<SwRedlineOptionsTabPage>::Create( pParent, *rSet );
 }
 
 bool SwRedlineOptionsTabPage::FillItemSet( SfxItemSet* )
@@ -1687,38 +1670,38 @@ bool SwRedlineOptionsTabPage::FillItemSet( SfxItemSet* )
     Color nOldMarkColor = pOpt->GetMarkAlignColor();
     sal_uInt16 nOldMarkMode = pOpt->GetMarkAlignMode();
 
-    sal_Int32 nPos = m_pInsertLB->GetSelectedEntryPos();
-    if (nPos != LISTBOX_ENTRY_NOTFOUND)
+    sal_Int32 nPos = m_xInsertLB->get_active();
+    if (nPos != -1)
     {
-        pAttr = static_cast<CharAttr *>(m_pInsertLB->GetEntryData(nPos));
+        pAttr = reinterpret_cast<CharAttr*>(m_xInsertLB->get_id(nPos).toInt64());
         aInsertedAttr.m_nItemId = pAttr->nItemId;
         aInsertedAttr.m_nAttr = pAttr->nAttr;
-        aInsertedAttr.m_nColor = m_pInsertColorLB->GetSelectEntryColor();
+        aInsertedAttr.m_nColor = m_xInsertColorLB->GetSelectEntryColor();
         pOpt->SetInsertAuthorAttr(aInsertedAttr);
     }
 
-    nPos = m_pDeletedLB->GetSelectedEntryPos();
-    if (nPos != LISTBOX_ENTRY_NOTFOUND)
+    nPos = m_xDeletedLB->get_active();
+    if (nPos != -1)
     {
-        pAttr = static_cast<CharAttr *>(m_pDeletedLB->GetEntryData(nPos));
+        pAttr = reinterpret_cast<CharAttr*>(m_xDeletedLB->get_id(nPos).toInt64());
         aDeletedAttr.m_nItemId = pAttr->nItemId;
         aDeletedAttr.m_nAttr = pAttr->nAttr;
-        aDeletedAttr.m_nColor = m_pDeletedColorLB->GetSelectEntryColor();
+        aDeletedAttr.m_nColor = m_xDeletedColorLB->GetSelectEntryColor();
         pOpt->SetDeletedAuthorAttr(aDeletedAttr);
     }
 
-    nPos = m_pChangedLB->GetSelectedEntryPos();
-    if (nPos != LISTBOX_ENTRY_NOTFOUND)
+    nPos = m_xChangedLB->get_active();
+    if (nPos != -1)
     {
-        pAttr = static_cast<CharAttr *>(m_pChangedLB->GetEntryData(nPos));
+        pAttr = reinterpret_cast<CharAttr*>(m_xChangedLB->get_id(nPos).toInt64());
         aChangedAttr.m_nItemId = pAttr->nItemId;
         aChangedAttr.m_nAttr = pAttr->nAttr;
-        aChangedAttr.m_nColor = m_pChangedColorLB->GetSelectEntryColor();
+        aChangedAttr.m_nColor = m_xChangedColorLB->GetSelectEntryColor();
         pOpt->SetFormatAuthorAttr(aChangedAttr);
     }
 
     nPos = 0;
-    switch (m_pMarkPosLB->GetSelectedEntryPos())
+    switch (m_xMarkPosLB->get_active())
     {
         case 0: nPos = text::HoriOrientation::NONE;       break;
         case 1: nPos = text::HoriOrientation::LEFT;       break;
@@ -1727,7 +1710,7 @@ bool SwRedlineOptionsTabPage::FillItemSet( SfxItemSet* )
         case 4: nPos = text::HoriOrientation::INSIDE;     break;
     }
     pOpt->SetMarkAlignMode(nPos);
-    pOpt->SetMarkAlignColor(m_pMarkColorLB->GetSelectEntryColor());
+    pOpt->SetMarkAlignColor(m_xMarkColorLB->GetSelectEntryColor());
 
     if (!(aInsertedAttr == aOldInsertAttr) ||
         !(aDeletedAttr == aOldDeletedAttr) ||
@@ -1757,28 +1740,28 @@ void SwRedlineOptionsTabPage::Reset( const SfxItemSet*  )
     const AuthorCharAttr &rChangedAttr = pOpt->GetFormatAuthorAttr();
 
     // initialise preview
-    InitFontStyle(*m_pInsertedPreviewWN);
-    InitFontStyle(*m_pDeletedPreviewWN);
-    InitFontStyle(*m_pChangedPreviewWN);
+    InitFontStyle(*m_xInsertedPreviewWN, SwResId(STR_OPT_PREVIEW_INSERTED));
+    InitFontStyle(*m_xDeletedPreviewWN, SwResId(STR_OPT_PREVIEW_DELETED));
+    InitFontStyle(*m_xChangedPreviewWN, SwResId(STR_OPT_PREVIEW_CHANGED));
 
     Color nColor = rInsertAttr.m_nColor;
-    m_pInsertColorLB->SelectEntry(nColor);
+    m_xInsertColorLB->SelectEntry(nColor);
 
     nColor = rDeletedAttr.m_nColor;
-    m_pDeletedColorLB->SelectEntry(nColor);
+    m_xDeletedColorLB->SelectEntry(nColor);
 
     nColor = rChangedAttr.m_nColor;
-    m_pChangedColorLB->SelectEntry(nColor);
+    m_xChangedColorLB->SelectEntry(nColor);
 
-    m_pMarkColorLB->SelectEntry(pOpt->GetMarkAlignColor());
+    m_xMarkColorLB->SelectEntry(pOpt->GetMarkAlignColor());
 
-    m_pInsertLB->SelectEntryPos(0);
-    m_pDeletedLB->SelectEntryPos(0);
-    m_pChangedLB->SelectEntryPos(0);
+    m_xInsertLB->set_active(0);
+    m_xDeletedLB->set_active(0);
+    m_xChangedLB->set_active(0);
 
-    lcl_FillRedlineAttrListBox(*m_pInsertLB, rInsertAttr, aInsertAttrMap, SAL_N_ELEMENTS(aInsertAttrMap));
-    lcl_FillRedlineAttrListBox(*m_pDeletedLB, rDeletedAttr, aDeletedAttrMap, SAL_N_ELEMENTS(aDeletedAttrMap));
-    lcl_FillRedlineAttrListBox(*m_pChangedLB, rChangedAttr, aChangedAttrMap, SAL_N_ELEMENTS(aChangedAttrMap));
+    lcl_FillRedlineAttrListBox(*m_xInsertLB, rInsertAttr, aInsertAttrMap, SAL_N_ELEMENTS(aInsertAttrMap));
+    lcl_FillRedlineAttrListBox(*m_xDeletedLB, rDeletedAttr, aDeletedAttrMap, SAL_N_ELEMENTS(aDeletedAttrMap));
+    lcl_FillRedlineAttrListBox(*m_xChangedLB, rChangedAttr, aChangedAttrMap, SAL_N_ELEMENTS(aChangedAttrMap));
 
     sal_Int32 nPos = 0;
     switch (pOpt->GetMarkAlignMode())
@@ -1789,38 +1772,38 @@ void SwRedlineOptionsTabPage::Reset( const SfxItemSet*  )
         case text::HoriOrientation::OUTSIDE:  nPos = 3;   break;
         case text::HoriOrientation::INSIDE:   nPos = 4;   break;
     }
-    m_pMarkPosLB->SelectEntryPos(nPos);
+    m_xMarkPosLB->set_active(nPos);
 
     // show settings in preview
-    AttribHdl(*m_pInsertLB);
-    ColorHdl(*m_pInsertColorLB);
-    AttribHdl(*m_pDeletedLB);
-    ColorHdl(*m_pInsertColorLB);
-    AttribHdl(*m_pChangedLB);
-    ColorHdl(*m_pChangedColorLB);
+    AttribHdl(*m_xInsertLB);
+    ColorHdl(*m_xInsertColorLB);
+    AttribHdl(*m_xDeletedLB);
+    ColorHdl(*m_xInsertColorLB);
+    AttribHdl(*m_xChangedLB);
+    ColorHdl(*m_xChangedColorLB);
 
     ChangedMaskPrev();
 }
 
-IMPL_LINK( SwRedlineOptionsTabPage, AttribHdl, ListBox&, rLB, void )
+IMPL_LINK( SwRedlineOptionsTabPage, AttribHdl, weld::ComboBox&, rLB, void )
 {
-    SvxFontPrevWindow *pPrev = nullptr;
-    SvxColorListBox *pColorLB;
+    FontPrevWindow *pPrev = nullptr;
+    ColorListBox *pColorLB;
 
-    if (&rLB == m_pInsertLB)
+    if (&rLB == m_xInsertLB.get())
     {
-        pColorLB = m_pInsertColorLB;
-        pPrev = m_pInsertedPreviewWN;
+        pColorLB = m_xInsertColorLB.get();
+        pPrev = m_xInsertedPreviewWN.get();
     }
-    else if (&rLB == m_pDeletedLB)
+    else if (&rLB == m_xDeletedLB.get())
     {
-        pColorLB = m_pDeletedColorLB;
-        pPrev = m_pDeletedPreviewWN;
+        pColorLB = m_xDeletedColorLB.get();
+        pPrev = m_xDeletedPreviewWN.get();
     }
     else
     {
-        pColorLB = m_pChangedColorLB;
-        pPrev = m_pChangedPreviewWN;
+        pColorLB = m_xChangedColorLB.get();
+        pPrev = m_xChangedPreviewWN.get();
     }
 
     SvxFont&    rFont = pPrev->GetFont();
@@ -1855,11 +1838,11 @@ IMPL_LINK( SwRedlineOptionsTabPage, AttribHdl, ListBox&, rLB, void )
         rCJKFont.SetColor(aColor);
     }
 
-    sal_Int32 nPos = rLB.GetSelectedEntryPos();
-    if( nPos == LISTBOX_ENTRY_NOTFOUND )
+    sal_Int32 nPos = rLB.get_active();
+    if( nPos == -1)
         nPos = 0;
 
-    CharAttr*   pAttr = static_cast<CharAttr*>(rLB.GetEntryData( nPos ));
+    CharAttr* pAttr = reinterpret_cast<CharAttr*>(rLB.get_id(nPos).toInt64());
     //switch off preview background color
     pPrev->ResetColor();
     switch (pAttr->nItemId)
@@ -1905,35 +1888,35 @@ IMPL_LINK( SwRedlineOptionsTabPage, AttribHdl, ListBox&, rLB, void )
     pPrev->Invalidate();
 }
 
-IMPL_LINK( SwRedlineOptionsTabPage, ColorHdl, SvxColorListBox&, rListBox, void )
+IMPL_LINK(SwRedlineOptionsTabPage, ColorHdl, ColorListBox&, rListBox, void)
 {
-    SvxColorListBox* pColorLB = &rListBox;
-    SvxFontPrevWindow *pPrev = nullptr;
-    ListBox* pLB;
+    ColorListBox* pColorLB = &rListBox;
+    FontPrevWindow *pPrev = nullptr;
+    weld::ComboBox* pLB;
 
-    if (pColorLB == m_pInsertColorLB)
+    if (pColorLB == m_xInsertColorLB.get())
     {
-        pLB = m_pInsertLB;
-        pPrev = m_pInsertedPreviewWN;
+        pLB = m_xInsertLB.get();
+        pPrev = m_xInsertedPreviewWN.get();
     }
-    else if (pColorLB == m_pDeletedColorLB)
+    else if (pColorLB == m_xDeletedColorLB.get())
     {
-        pLB = m_pDeletedLB;
-        pPrev = m_pDeletedPreviewWN;
+        pLB = m_xDeletedLB.get();
+        pPrev = m_xDeletedPreviewWN.get();
     }
     else
     {
-        pLB = m_pChangedLB;
-        pPrev = m_pChangedPreviewWN;
+        pLB = m_xChangedLB.get();
+        pPrev = m_xChangedPreviewWN.get();
     }
 
     SvxFont&    rFont = pPrev->GetFont();
     SvxFont&    rCJKFont = pPrev->GetCJKFont();
-    sal_Int32      nPos = pLB->GetSelectedEntryPos();
-    if( nPos == LISTBOX_ENTRY_NOTFOUND )
+    sal_Int32      nPos = pLB->get_active();
+    if( nPos == -1)
         nPos = 0;
 
-    CharAttr*   pAttr = static_cast<CharAttr*>(pLB->GetEntryData( nPos ));
+    CharAttr* pAttr = reinterpret_cast<CharAttr*>(pLB->get_id(nPos).toInt64());
 
     if( pAttr->nItemId == SID_ATTR_BRUSH )
     {
@@ -1972,23 +1955,23 @@ IMPL_LINK( SwRedlineOptionsTabPage, ColorHdl, SvxColorListBox&, rListBox, void )
 
 void SwRedlineOptionsTabPage::ChangedMaskPrev()
 {
-    m_pMarkPreviewWN->SetMarkPos(m_pMarkPosLB->GetSelectedEntryPos());
-    m_pMarkPreviewWN->SetColor(m_pMarkColorLB->GetSelectEntryColor());
+    m_xMarkPreviewWN->SetMarkPos(m_xMarkPosLB->get_active());
+    m_xMarkPreviewWN->SetColor(m_xMarkColorLB->GetSelectEntryColor());
 
-    m_pMarkPreviewWN->Invalidate();
+    m_xMarkPreviewWN->Invalidate();
 }
 
-IMPL_LINK_NOARG(SwRedlineOptionsTabPage, ChangedMaskPrevHdl, ListBox&, void)
+IMPL_LINK_NOARG(SwRedlineOptionsTabPage, ChangedMaskPrevHdl, weld::ComboBox&, void)
 {
     ChangedMaskPrev();
 }
 
-IMPL_LINK_NOARG(SwRedlineOptionsTabPage, ChangedMaskColorPrevHdl, SvxColorListBox&, void)
+IMPL_LINK_NOARG(SwRedlineOptionsTabPage, ChangedMaskColorPrevHdl, ColorListBox&, void)
 {
     ChangedMaskPrev();
 }
 
-void SwRedlineOptionsTabPage::InitFontStyle(SvxFontPrevWindow& rExampleWin)
+void SwRedlineOptionsTabPage::InitFontStyle(FontPrevWindow& rExampleWin, const OUString& rText)
 {
     const AllSettings&  rAllSettings = Application::GetSettings();
     LanguageType        eLangType = rAllSettings.GetUILanguageTag().getLanguageType();
@@ -1997,12 +1980,14 @@ void SwRedlineOptionsTabPage::InitFontStyle(SvxFontPrevWindow& rExampleWin)
     SvxFont&            rCJKFont = rExampleWin.GetCJKFont();
     SvxFont&            rCTLFont = rExampleWin.GetCTLFont();
 
+    OutputDevice& rDevice = rExampleWin.GetDrawingArea()->get_ref_device();
+
     vcl::Font           aFont( OutputDevice::GetDefaultFont( DefaultFontType::SERIF, eLangType,
-                                                        GetDefaultFontFlags::OnlyOne, &rExampleWin ) );
+                                                        GetDefaultFontFlags::OnlyOne, &rDevice ) );
     vcl::Font           aCJKFont( OutputDevice::GetDefaultFont( DefaultFontType::CJK_TEXT, eLangType,
-                                                        GetDefaultFontFlags::OnlyOne, &rExampleWin ) );
+                                                        GetDefaultFontFlags::OnlyOne, &rDevice ) );
     vcl::Font           aCTLFont( OutputDevice::GetDefaultFont( DefaultFontType::CTL_TEXT, eLangType,
-                                                        GetDefaultFontFlags::OnlyOne, &rExampleWin ) );
+                                                        GetDefaultFontFlags::OnlyOne, &rDevice ) );
     const Size          aDefSize( 0, 12 );
     aFont.SetFontSize( aDefSize );
     aCJKFont.SetFontSize( aDefSize );
@@ -2020,17 +2005,14 @@ void SwRedlineOptionsTabPage::InitFontStyle(SvxFontPrevWindow& rExampleWin)
     rCJKFont = aCJKFont;
     rCTLFont = aCTLFont;
 
-    const Size          aNewSize( 0, rExampleWin.GetOutputSize().Height() * 2 / 3 );
+    const Size aNewSize( 0, rExampleWin.GetOutputSizePixel().Height() * 2 / 3 );
     rFont.SetFontSize( aNewSize );
     rCJKFont.SetFontSize( aNewSize );
 
     rExampleWin.SetFont( rFont, rCJKFont,rCTLFont );
+    rExampleWin.SetPreviewText(rText);
 
-    rExampleWin.UseResourceText();
-
-    Wallpaper           aWall( aBackCol );
-    rExampleWin.SetBackground( aWall );
-    rExampleWin.Invalidate();
+    rExampleWin.SetBackColor(aBackCol);
 }
 
 SwCompareOptionsTabPage::SwCompareOptionsTabPage(TabPageParent pParent, const SfxItemSet& rSet)
diff --git a/sw/source/uibase/inc/optpage.hxx b/sw/source/uibase/inc/optpage.hxx
index 0a6f191ae32e..97af1974b1ea 100644
--- a/sw/source/uibase/inc/optpage.hxx
+++ b/sw/source/uibase/inc/optpage.hxx
@@ -264,10 +264,8 @@ public:
 };
 
 // mark preview
-class SwMarkPreview : public vcl::Window
+class SwMarkPreview : public weld::CustomWidgetController
 {
-    Size m_aInitialSize;
-
     Color m_aBgCol;    // background
     Color const m_aTransCol; // transparency
     Color m_aMarkCol;  // marks
@@ -282,51 +280,52 @@ class SwMarkPreview : public vcl::Window
 
     sal_uInt16 nMarkPos;
 
-    void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&) override;
+    virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&) override;
     void PaintPage(vcl::RenderContext& rRenderContext, const tools::Rectangle &rRect);
     void InitColors();
 
-protected:
-    virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
-
 public:
-    SwMarkPreview(vcl::Window* pParent, WinBits nWinBits);
+    SwMarkPreview();
+    virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override;
     virtual ~SwMarkPreview() override;
 
     void SetColor(const Color& rCol) { m_aMarkCol = rCol; }
     void SetMarkPos(sal_uInt16 nPos) { nMarkPos = nPos; }
-    virtual Size GetOptimalSize() const override;
 };
 
 // redlining options
 class SwRedlineOptionsTabPage : public SfxTabPage
 {
-    VclPtr<ListBox>             m_pInsertLB;
-    VclPtr<SvxColorListBox>     m_pInsertColorLB;
-    VclPtr<SvxFontPrevWindow>   m_pInsertedPreviewWN;
-
-    VclPtr<ListBox>             m_pDeletedLB;
-    VclPtr<SvxColorListBox>     m_pDeletedColorLB;
-    VclPtr<SvxFontPrevWindow>   m_pDeletedPreviewWN;
-
-    VclPtr<ListBox>             m_pChangedLB;
-    VclPtr<SvxColorListBox>     m_pChangedColorLB;
-    VclPtr<SvxFontPrevWindow>   m_pChangedPreviewWN;
-
-    VclPtr<ListBox>             m_pMarkPosLB;
-    VclPtr<SvxColorListBox>     m_pMarkColorLB;
-    VclPtr<SwMarkPreview>       m_pMarkPreviewWN;
-
-    DECL_LINK(AttribHdl, ListBox&, void);
+    std::unique_ptr<weld::ComboBox> m_xInsertLB;
+    std::unique_ptr<ColorListBox> m_xInsertColorLB;
+    std::unique_ptr<FontPrevWindow> m_xInsertedPreviewWN;
+    std::unique_ptr<weld::CustomWeld> m_xInsertedPreview;
+
+    std::unique_ptr<weld::ComboBox> m_xDeletedLB;
+    std::unique_ptr<ColorListBox> m_xDeletedColorLB;
+    std::unique_ptr<FontPrevWindow> m_xDeletedPreviewWN;
+    std::unique_ptr<weld::CustomWeld> m_xDeletedPreview;
+
+    std::unique_ptr<weld::ComboBox> m_xChangedLB;
+    std::unique_ptr<ColorListBox> m_xChangedColorLB;
+    std::unique_ptr<FontPrevWindow> m_xChangedPreviewWN;
+    std::unique_ptr<weld::CustomWeld> m_xChangedPreview;
+
+    std::unique_ptr<weld::ComboBox> m_xMarkPosLB;
+    std::unique_ptr<ColorListBox> m_xMarkColorLB;
+    std::unique_ptr<SwMarkPreview> m_xMarkPreviewWN;
+    std::unique_ptr<weld::CustomWeld> m_xMarkPreview;
+
+    DECL_LINK(AttribHdl, weld::ComboBox&, void);
     void ChangedMaskPrev();
-    DECL_LINK(ChangedMaskPrevHdl, ListBox&, void);
-    DECL_LINK(ChangedMaskColorPrevHdl, SvxColorListBox&, void);
-    DECL_LINK(ColorHdl, SvxColorListBox&, void);
+    DECL_LINK(ChangedMaskPrevHdl, weld::ComboBox&, void);
+    DECL_LINK(ChangedMaskColorPrevHdl, ColorListBox&, void);
+    DECL_LINK(ColorHdl, ColorListBox&, void);
 
-    static void InitFontStyle(SvxFontPrevWindow& rExampleWin);
+    static void InitFontStyle(FontPrevWindow& rExampleWin, const OUString& rText);
 
 public:
-    SwRedlineOptionsTabPage(vcl::Window* pParent, const SfxItemSet& rSet);
+    SwRedlineOptionsTabPage(TabPageParent pParent, const SfxItemSet& rSet);
     virtual ~SwRedlineOptionsTabPage() override;
     virtual void dispose() override;
 
diff --git a/sw/uiconfig/swriter/ui/optredlinepage.ui b/sw/uiconfig/swriter/ui/optredlinepage.ui
index eecb6ea0c7bb..d3416690fe20 100644
--- a/sw/uiconfig/swriter/ui/optredlinepage.ui
+++ b/sw/uiconfig/swriter/ui/optredlinepage.ui
@@ -2,7 +2,6 @@
 <!-- Generated with glade 3.22.1 -->
 <interface domain="sw">
   <requires lib="gtk+" version="3.18"/>
-  <requires lib="LibreOffice" version="1.0"/>
   <object class="GtkGrid" id="OptRedLinePage">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
@@ -85,10 +84,17 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="svxcorelo-SvxColorListBox" id="insertcolor">
+                  <object class="GtkMenuButton" id="insertcolor">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="valign">center</property>
+                    <property name="receives_default">False</property>
+                    <property name="hexpand">True</property>
+                    <property name="xalign">0</property>
+                    <property name="draw_indicator">True</property>
+                    <property name="label" translatable="no"></property>
+                    <child>
+                      <placeholder/>
+                    </child>
                     <child internal-child="accessible">
                       <object class="AtkObject" id="insertcolor-atkobject">
                         <property name="AtkObject::accessible-name" translatable="yes" context="optredlinepage|insertcolor-atkobject">Color of Insertions</property>
@@ -101,11 +107,28 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="svxlo-SvxFontPrevWindow" id="insertedpreview:border">
+                  <object class="GtkScrolledWindow">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="hexpand">True</property>
-                    <property name="text" translatable="yes" context="optredlinepage|insertedpreview">Insert</property>
+                    <property name="vexpand">True</property>
+                    <property name="hscrollbar_policy">never</property>
+                    <property name="vscrollbar_policy">never</property>
+                    <property name="shadow_type">in</property>
+                    <child>
+                      <object class="GtkViewport">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <child>
+                          <object class="GtkDrawingArea" id="insertedpreview">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="hexpand">True</property>
+                            <property name="vexpand">True</property>
+                          </object>
+                        </child>
+                      </object>
+                    </child>
                   </object>
                   <packing>
                     <property name="left_attach">2</property>
@@ -196,10 +219,17 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="svxcorelo-SvxColorListBox" id="deletedcolor">
+                  <object class="GtkMenuButton" id="deletedcolor">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="valign">center</property>
+                    <property name="receives_default">False</property>
+                    <property name="hexpand">True</property>
+                    <property name="xalign">0</property>
+                    <property name="draw_indicator">True</property>
+                    <property name="label" translatable="no"></property>
+                    <child>
+                      <placeholder/>
+                    </child>
                     <child internal-child="accessible">
                       <object class="AtkObject" id="deletedcolor-atkobject">
                         <property name="AtkObject::accessible-name" translatable="yes" context="optredlinepage|deletedcolor-atkobject">Color of Deletions</property>
@@ -212,11 +242,28 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="svxlo-SvxFontPrevWindow" id="deletedpreview:border">
+                  <object class="GtkScrolledWindow">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="hexpand">True</property>
-                    <property name="text" translatable="yes" context="optredlinepage|deletedpreview">Delete</property>
+                    <property name="vexpand">True</property>
+                    <property name="hscrollbar_policy">never</property>
+                    <property name="vscrollbar_policy">never</property>
+                    <property name="shadow_type">in</property>
+                    <child>
+                      <object class="GtkViewport">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <child>
+                          <object class="GtkDrawingArea" id="deletedpreview">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="hexpand">True</property>
+                            <property name="vexpand">True</property>
+                          </object>
+                        </child>
+                      </object>
+                    </child>
                   </object>
                   <packing>
                     <property name="left_attach">2</property>
@@ -307,10 +354,17 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="svxcorelo-SvxColorListBox" id="changedcolor">
+                  <object class="GtkMenuButton" id="changedcolor">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="valign">center</property>
+                    <property name="receives_default">False</property>
+                    <property name="hexpand">True</property>
+                    <property name="xalign">0</property>
+                    <property name="draw_indicator">True</property>
+                    <property name="label" translatable="no"></property>
+                    <child>
+                      <placeholder/>
+                    </child>
                     <child internal-child="accessible">
                       <object class="AtkObject" id="changedcolor-atkobject">
                         <property name="AtkObject::accessible-name" translatable="yes" context="optredlinepage|changedcolor-atkobject">Color of Changed Attributes</property>
@@ -323,11 +377,28 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="svxlo-SvxFontPrevWindow" id="changedpreview:border">
+                  <object class="GtkScrolledWindow">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="hexpand">True</property>
-                    <property name="text" translatable="yes" context="optredlinepage|changedpreview">Attributes</property>
+                    <property name="vexpand">True</property>
+                    <property name="hscrollbar_policy">never</property>
+                    <property name="vscrollbar_policy">never</property>
+                    <property name="shadow_type">in</property>
+                    <child>
+                      <object class="GtkViewport">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <child>
+                          <object class="GtkDrawingArea" id="changedpreview">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="hexpand">True</property>
+                            <property name="vexpand">True</property>
+                          </object>
+                        </child>
+                      </object>
+                    </child>
                   </object>
                   <packing>
                     <property name="left_attach">2</property>
@@ -379,10 +450,17 @@
                 <property name="row_spacing">6</property>
                 <property name="column_spacing">12</property>
                 <child>
-                  <object class="svxcorelo-SvxColorListBox" id="markcolor">
+                  <object class="GtkMenuButton" id="markcolor">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="valign">center</property>
+                    <property name="receives_default">False</property>
+                    <property name="hexpand">True</property>
+                    <property name="xalign">0</property>
+                    <property name="draw_indicator">True</property>
+                    <property name="label" translatable="no"></property>
+                    <child>
+                      <placeholder/>
+                    </child>
                     <child internal-child="accessible">
                       <object class="AtkObject" id="markcolor-atkobject">
                         <property name="AtkObject::accessible-name" translatable="yes" context="optredlinepage|markcolor-atkobject">Color of Mark</property>
@@ -423,10 +501,28 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="swuilo-SwMarkPreview" id="markpreview">
+                  <object class="GtkScrolledWindow">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="hexpand">True</property>
+                    <property name="vexpand">True</property>
+                    <property name="hscrollbar_policy">never</property>
+                    <property name="vscrollbar_policy">never</property>
+                    <property name="shadow_type">in</property>
+                    <child>
+                      <object class="GtkViewport">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <child>
+                          <object class="GtkDrawingArea" id="markpreview">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="hexpand">True</property>
+                            <property name="vexpand">True</property>
+                          </object>
+                        </child>
+                      </object>
+                    </child>
                   </object>
                   <packing>
                     <property name="left_attach">2</property>


More information about the Libreoffice-commits mailing list