[Libreoffice-commits] core.git: 5 commits - comphelper/source configmgr/source cui/source cui/uiconfig include/comphelper offapi/com

Stephan Bergmann sbergman at redhat.com
Wed Apr 1 05:26:53 PDT 2015


 comphelper/source/misc/configuration.cxx               |   13 
 configmgr/source/readwriteaccess.cxx                   |   13 
 cui/source/options/optinet2.cxx                        |  249 ++---------------
 cui/source/options/optinet2.hxx                        |    2 
 cui/uiconfig/ui/optemailpage.ui                        |   42 ++
 include/comphelper/configuration.hxx                   |   25 +
 offapi/com/sun/star/configuration/XReadWriteAccess.idl |    4 
 7 files changed, 132 insertions(+), 216 deletions(-)

New commits:
commit bd23cf009a7e3c63a066794d41ae0c97589c8891
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Apr 1 14:25:56 2015 +0200

    tdf#87441: Check for read-only RemoveHiddenContent
    
    Change-Id: Ic67c368c63e598f727d81ebb566ff858a2c1dfcc

diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx
index 3d15501..4c61088 100644
--- a/cui/source/options/optinet2.cxx
+++ b/cui/source/options/optinet2.cxx
@@ -942,12 +942,15 @@ struct SvxEMailTabPage_Impl
         bROProgram(
             officecfg::Office::Common::ExternalMailer::Program::isReadOnly()),
         bHideContent(
-            officecfg::Office::Security::HiddenContent::RemoveHiddenContent::get())
+            officecfg::Office::Security::HiddenContent::RemoveHiddenContent::get()),
+        bROHideContent(
+            officecfg::Office::Security::HiddenContent::RemoveHiddenContent::isReadOnly())
     {}
 
     OUString sProgram;
     bool bROProgram;
     bool bHideContent;
+    bool bROHideContent;
 };
 
 SvxEMailTabPage::SvxEMailTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
@@ -958,6 +961,8 @@ SvxEMailTabPage::SvxEMailTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
     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 ) );
@@ -989,7 +994,8 @@ bool SvxEMailTabPage::FillItemSet( SfxItemSet* )
         officecfg::Office::Common::ExternalMailer::Program::set(
             pImpl->sProgram, batch);
     }
-    if (pImpl->bHideContent != m_pSuppressHidden->IsChecked())
+    if (!pImpl->bROHideContent
+        && pImpl->bHideContent != m_pSuppressHidden->IsChecked())
     {
         pImpl->bHideContent = m_pSuppressHidden->IsChecked();
         officecfg::Office::Security::HiddenContent::RemoveHiddenContent::set(
@@ -1014,7 +1020,12 @@ void SvxEMailTabPage::Reset( const SfxItemSet* )
 
     m_pMailContainer->Enable(!pImpl->bROProgram);
 
+    if (pImpl->bROHideContent)
+        m_pSuppressHiddenFI->Show();
+
     m_pSuppressHidden->Check(pImpl->bHideContent);
+
+    m_pSuppressHiddenContainer->Enable(!pImpl->bROHideContent);
 }
 
 /* -------------------------------------------------------------------------*/
diff --git a/cui/source/options/optinet2.hxx b/cui/source/options/optinet2.hxx
index 0c5f713..37c97c1 100644
--- a/cui/source/options/optinet2.hxx
+++ b/cui/source/options/optinet2.hxx
@@ -186,6 +186,8 @@ class SvxEMailTabPage : public SfxTabPage
     FixedImage*   m_pMailerURLFI;
     Edit*         m_pMailerURLED;
     PushButton*   m_pMailerURLPB;
+    VclContainer* m_pSuppressHiddenContainer;
+    FixedImage*   m_pSuppressHiddenFI;
     CheckBox*     m_pSuppressHidden;
 
     OUString      m_sDefaultFilterName;
diff --git a/cui/uiconfig/ui/optemailpage.ui b/cui/uiconfig/ui/optemailpage.ui
index 4a2a913..8906044 100644
--- a/cui/uiconfig/ui/optemailpage.ui
+++ b/cui/uiconfig/ui/optemailpage.ui
@@ -103,7 +103,7 @@
           </packing>
         </child>
         <child>
-          <object class="GtkGrid" id="grid2">
+          <object class="GtkGrid" id="suppressHiddenCont">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <property name="row_spacing">6</property>
@@ -141,10 +141,19 @@
               </packing>
             </child>
             <child>
-              <placeholder/>
-            </child>
-            <child>
-              <placeholder/>
+              <object class="GtkImage" id="lockSuppressHidden">
+                <property name="can_focus">False</property>
+                <property name="no_show_all">True</property>
+                <property name="halign">center</property>
+                <property name="valign">center</property>
+                <property name="pixbuf">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>
           </object>
           <packing>
commit 8701899950e0d0135ee7f66296714740406e4350
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Apr 1 14:12:15 2015 +0200

    Replace MailerProgramCfg_Impl with direct configuration access
    
    Change-Id: I25486b4f7455eab72dd831f0f30eb17595e07681

diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx
index 382480f..3d15501 100644
--- a/cui/source/options/optinet2.cxx
+++ b/cui/source/options/optinet2.cxx
@@ -19,6 +19,7 @@
 
 #include <sal/config.h>
 
+#include <officecfg/Office/Common.hxx>
 #include <officecfg/Office/Security.hxx>
 #include <tools/config.hxx>
 #include <vcl/msgbox.hxx>
@@ -934,116 +935,18 @@ void SvxSecurityTabPage::Reset( const SfxItemSet* )
 {
 }
 
-class MailerProgramCfg_Impl : public utl::ConfigItem
-{
-    friend class SvxEMailTabPage;
-    // variables
-    OUString sProgram;
-    // readonly states
-    bool bROProgram;
-
-    const Sequence<OUString> GetPropertyNames();
-
-    virtual void    ImplCommit() SAL_OVERRIDE;
-
-public:
-    MailerProgramCfg_Impl();
-    virtual ~MailerProgramCfg_Impl();
-
-    virtual void Notify( const com::sun::star::uno::Sequence< OUString >& _rPropertyNames) SAL_OVERRIDE;
-};
-
-/* -------------------------------------------------------------------------*/
-
-MailerProgramCfg_Impl::MailerProgramCfg_Impl() :
-    utl::ConfigItem("Office.Common/ExternalMailer"),
-    bROProgram(false)
-{
-    const Sequence< OUString > aNames = GetPropertyNames();
-    const Sequence< Any > aValues = GetProperties(aNames);
-    const Sequence< sal_Bool > aROStates = GetReadOnlyStates(aNames);
-    const Any* pValues = aValues.getConstArray();
-    const sal_Bool* pROStates = aROStates.getConstArray();
-    for(sal_Int32 nProp = 0; nProp < aValues.getLength(); nProp++)
-    {
-        if(pValues[nProp].hasValue())
-        {
-            switch(nProp)
-            {
-                case 0 :
-                {
-                    pValues[nProp] >>= sProgram;
-                    bROProgram = pROStates[nProp];
-                }
-                break;
-            }
-        }
-    }
-}
-
-/* -------------------------------------------------------------------------*/
-
-MailerProgramCfg_Impl::~MailerProgramCfg_Impl()
-{
-}
-
-/* -------------------------------------------------------------------------*/
-
-const Sequence<OUString> MailerProgramCfg_Impl::GetPropertyNames()
-{
-    Sequence<OUString> aRet(1);
-    OUString* pRet = aRet.getArray();
-    pRet[0] = "Program";
-    return aRet;
-}
-
-/* -------------------------------------------------------------------------*/
-
-void MailerProgramCfg_Impl::ImplCommit()
-{
-    const Sequence< OUString > aOrgNames = GetPropertyNames();
-    sal_Int32 nOrgCount = aOrgNames.getLength();
-
-    Sequence< OUString > aNames(nOrgCount);
-    Sequence< Any > aValues(nOrgCount);
-    sal_Int32 nRealCount = 0;
-
-    for(int nProp = 0; nProp < nOrgCount; nProp++)
-    {
-    switch(nProp)
-    {
-            case  0:
-            {
-                if (!bROProgram)
-                {
-                    aNames[nRealCount] = aOrgNames[nProp];
-                    aValues[nRealCount] <<= sProgram;
-                    ++nRealCount;
-                }
-            }
-            break;
-        }
-    }
-
-    aNames.realloc(nRealCount);
-    aValues.realloc(nRealCount);
-    PutProperties(aNames, aValues);
-}
-
-void MailerProgramCfg_Impl::Notify( const com::sun::star::uno::Sequence< OUString >& )
-{
-}
-
-/* -------------------------------------------------------------------------*/
-
 struct SvxEMailTabPage_Impl
 {
     SvxEMailTabPage_Impl():
+        sProgram(officecfg::Office::Common::ExternalMailer::Program::get()),
+        bROProgram(
+            officecfg::Office::Common::ExternalMailer::Program::isReadOnly()),
         bHideContent(
             officecfg::Office::Security::HiddenContent::RemoveHiddenContent::get())
     {}
 
-    MailerProgramCfg_Impl aMailConfig;
+    OUString sProgram;
+    bool bROProgram;
     bool bHideContent;
 };
 
@@ -1078,25 +981,21 @@ SfxTabPage*  SvxEMailTabPage::Create( vcl::Window* pParent, const SfxItemSet* rA
 
 bool SvxEMailTabPage::FillItemSet( SfxItemSet* )
 {
-    bool bMailModified = false;
-    if(!pImpl->aMailConfig.bROProgram && m_pMailerURLED->IsValueChangedFromSaved())
+    std::shared_ptr<comphelper::ConfigurationChanges> batch(
+        comphelper::ConfigurationChanges::create());
+    if (!pImpl->bROProgram && m_pMailerURLED->IsValueChangedFromSaved())
     {
-        pImpl->aMailConfig.sProgram = m_pMailerURLED->GetText();
-        bMailModified = true;
+        pImpl->sProgram = m_pMailerURLED->GetText();
+        officecfg::Office::Common::ExternalMailer::Program::set(
+            pImpl->sProgram, batch);
     }
-    if ( bMailModified )
-        pImpl->aMailConfig.Commit();
-
     if (pImpl->bHideContent != m_pSuppressHidden->IsChecked())
     {
         pImpl->bHideContent = m_pSuppressHidden->IsChecked();
-        std::shared_ptr<comphelper::ConfigurationChanges> batch(
-            comphelper::ConfigurationChanges::create());
         officecfg::Office::Security::HiddenContent::RemoveHiddenContent::set(
             pImpl->bHideContent, batch);
-        batch->commit();
     }
-
+    batch->commit();
     return false;
 }
 
@@ -1107,13 +1006,13 @@ void SvxEMailTabPage::Reset( const SfxItemSet* )
     m_pMailerURLED->Enable(true );
     m_pMailerURLPB->Enable(true );
 
-    if (pImpl->aMailConfig.bROProgram)
+    if (pImpl->bROProgram)
         m_pMailerURLFI->Show();
 
-    m_pMailerURLED->SetText(pImpl->aMailConfig.sProgram);
+    m_pMailerURLED->SetText(pImpl->sProgram);
     m_pMailerURLED->SaveValue();
 
-    m_pMailContainer->Enable(!pImpl->aMailConfig.bROProgram);
+    m_pMailContainer->Enable(!pImpl->bROProgram);
 
     m_pSuppressHidden->Check(pImpl->bHideContent);
 }
@@ -1122,7 +1021,7 @@ void SvxEMailTabPage::Reset( const SfxItemSet* )
 
 IMPL_LINK(  SvxEMailTabPage, FileDialogHdl_Impl, PushButton*, pButton )
 {
-    if (m_pMailerURLPB == pButton && !pImpl->aMailConfig.bROProgram)
+    if (m_pMailerURLPB == pButton && !pImpl->bROProgram)
     {
         FileDialogHelper aHelper(
             com::sun::star::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE,
commit 7bcf64c29a0f5d3d2d60fe98afadab6e48dbe8b3
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Apr 1 14:08:04 2015 +0200

    Add isReadOnly() support to simplified configuration access
    
    [API CHANGE]: extends the css.configuration.XReadWriteAccess in an incompatible
    way, but that is unpublished, has been commented as "still unpublished and
    unstable," and was specifically introduced for internal use by the simplified
    configuration access, so should not affect 3rd party code.
    
    Change-Id: I99ce045f5bd8c598e689d46fb0d3626dfaa6d0a0

diff --git a/comphelper/source/misc/configuration.cxx b/comphelper/source/misc/configuration.cxx
index 7468c55..371a515 100644
--- a/comphelper/source/misc/configuration.cxx
+++ b/comphelper/source/misc/configuration.cxx
@@ -12,6 +12,7 @@
 #include <cassert>
 #include <memory>
 
+#include <com/sun/star/beans/PropertyAttribute.hpp>
 #include <com/sun/star/configuration/ReadOnlyAccess.hpp>
 #include <com/sun/star/configuration/ReadWriteAccess.hpp>
 #include <com/sun/star/configuration/XReadWriteAccess.hpp>
@@ -116,11 +117,21 @@ comphelper::detail::ConfigurationWrapper::get(
 comphelper::detail::ConfigurationWrapper::ConfigurationWrapper(
     css::uno::Reference< css::uno::XComponentContext > const & context):
     context_(context),
-    access_(css::configuration::ReadOnlyAccess::create(context, "*"))
+    access_(css::configuration::ReadWriteAccess::create(context, "*"))
 {}
 
 comphelper::detail::ConfigurationWrapper::~ConfigurationWrapper() {}
 
+bool comphelper::detail::ConfigurationWrapper::isReadOnly(OUString const & path)
+    const
+{
+css::beans::Property SB(access_->getPropertyByHierarchicalName(path));
+    return
+        (access_->getPropertyByHierarchicalName(path).Attributes
+         & css::beans::PropertyAttribute::READONLY)
+        != 0;
+}
+
 css::uno::Any comphelper::detail::ConfigurationWrapper::getPropertyValue(
     OUString const & path) const
 {
diff --git a/configmgr/source/readwriteaccess.cxx b/configmgr/source/readwriteaccess.cxx
index e503d9d..19f0eb4 100644
--- a/configmgr/source/readwriteaccess.cxx
+++ b/configmgr/source/readwriteaccess.cxx
@@ -104,6 +104,19 @@ private:
         throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
     { return getRoot()->getPendingChanges(); }
 
+    css::beans::Property SAL_CALL getPropertyByHierarchicalName(
+        OUString const & aHierarchicalName)
+        throw (
+            css::beans::UnknownPropertyException, css::uno::RuntimeException,
+            std::exception)
+        SAL_OVERRIDE
+    { return getRoot()->getPropertyByHierarchicalName(aHierarchicalName); }
+
+    sal_Bool SAL_CALL hasPropertyByHierarchicalName(
+        OUString const & aHierarchicalName)
+        throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE
+    { return getRoot()->hasPropertyByHierarchicalName(aHierarchicalName); }
+
     rtl::Reference< RootAccess > getRoot();
 
     css::uno::Reference< css::uno::XComponentContext > context_;
diff --git a/include/comphelper/configuration.hxx b/include/comphelper/configuration.hxx
index 2a0a593..d4630c7 100644
--- a/include/comphelper/configuration.hxx
+++ b/include/comphelper/configuration.hxx
@@ -93,6 +93,8 @@ public:
 
     SAL_DLLPRIVATE ~ConfigurationWrapper();
 
+    bool isReadOnly(OUString const & path) const;
+
     com::sun::star::uno::Any getPropertyValue(OUString const & path) const;
 
     void setPropertyValue(
@@ -136,7 +138,11 @@ private:
         context_;
 
     com::sun::star::uno::Reference<
-        com::sun::star::container::XHierarchicalNameAccess > access_;
+        com::sun::star::configuration::XReadWriteAccess > access_;
+        // should really be an css.configuration.ReadOnlyAccess (with added
+        // css.beans.XHierarchicalPropertySetInfo), but then
+        // configmgr::Access::asProperty() would report all properties as
+        // READONLY, so isReadOnly() would not work
 };
 
 /// @internal
@@ -187,6 +193,15 @@ private:
 /// each given configuration property.
 template< typename T, typename U > struct ConfigurationProperty
 {
+    /// Get the read-only status of the given (non-localized) configuration
+    /// property.
+    static bool isReadOnly(
+        css::uno::Reference<css::uno::XComponentContext> const & context
+            = comphelper::getProcessComponentContext())
+    {
+        return detail::ConfigurationWrapper::get(context).isReadOnly(T::path());
+    }
+
     /// Get the value of the given (non-localized) configuration property.
     ///
     /// For nillable properties, U is of type boost::optional<U'>.
@@ -231,6 +246,14 @@ private:
 /// to access each given localized configuration property.
 template< typename T, typename U > struct ConfigurationLocalizedProperty
 {
+    /// Get the read-only status of the given localized configuration property.
+    static bool isReadOnly(
+        css::uno::Reference<css::uno::XComponentContext> const & context
+            = comphelper::getProcessComponentContext())
+    {
+        return detail::ConfigurationWrapper::get(context).isReadOnly(T::path());
+    }
+
     /// Get the value of the given localized configuration property, for the
     /// locale currently set at the
     /// com.sun.star.configuration.theDefaultProvider.
diff --git a/offapi/com/sun/star/configuration/XReadWriteAccess.idl b/offapi/com/sun/star/configuration/XReadWriteAccess.idl
index b9c4732..9e3f95c 100644
--- a/offapi/com/sun/star/configuration/XReadWriteAccess.idl
+++ b/offapi/com/sun/star/configuration/XReadWriteAccess.idl
@@ -10,6 +10,7 @@
 #ifndef _COM_SUN_STAR_CONFIGURATION_XREADWRITEACCESS_IDL
 #define _COM_SUN_STAR_CONFIGURATION_XREADWRITEACCESS_IDL
 
+#include <com/sun/star/beans/XHierarchicalPropertySetInfo.idl>
 #include <com/sun/star/container/XHierarchicalNameReplace.idl>
 #include <com/sun/star/util/XChangesBatch.idl>
 
@@ -25,6 +26,9 @@ interface XReadWriteAccess {
     interface com::sun::star::container::XHierarchicalNameReplace;
 
     interface com::sun::star::util::XChangesBatch;
+
+    // @since LibreOffice 4.5
+    interface com::sun::star::beans::XHierarchicalPropertySetInfo;
 };
 
 }; }; }; };
commit f14e4cffcc757a4fcf1875d638ef8df4acd5bc27
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Apr 1 12:05:46 2015 +0200

    Replace RemoveHiddenContentCfg_Impl with direct configuration access
    
    Change-Id: I422f6f3386419f4ea91c4b3d9c96e759e1361a3a

diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx
index 7ca7c27..382480f 100644
--- a/cui/source/options/optinet2.cxx
+++ b/cui/source/options/optinet2.cxx
@@ -17,6 +17,9 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <sal/config.h>
+
+#include <officecfg/Office/Security.hxx>
 #include <tools/config.hxx>
 #include <vcl/msgbox.hxx>
 #include <svl/intitem.hxx>
@@ -931,94 +934,6 @@ void SvxSecurityTabPage::Reset( const SfxItemSet* )
 {
 }
 
-/*--------------------------------------------------------------------*/
-
-class RemoveHiddenContentCfg_Impl : public utl::ConfigItem
-{
-    friend class SvxEMailTabPage;
-    bool bHideContent;
-
-    const Sequence<OUString> GetPropertyNames();
-
-    virtual void    ImplCommit() SAL_OVERRIDE;
-
-public:
-    RemoveHiddenContentCfg_Impl();
-
-    virtual void Notify( const com::sun::star::uno::Sequence< rtl::OUString >& _rPropertyNames) SAL_OVERRIDE;
-};
-
-/* -------------------------------------------------------------------------*/
-
-RemoveHiddenContentCfg_Impl::RemoveHiddenContentCfg_Impl() :
-    utl::ConfigItem("Office.Security/HiddenContent"),
-    bHideContent(true)
-{
-    const Sequence< OUString > aNames = GetPropertyNames();
-    const Sequence< Any > aValues = GetProperties(aNames);
-    const Any* pValues = aValues.getConstArray();
-    for(sal_Int32 nProp = 0; nProp < aValues.getLength(); nProp++)
-    {
-        if(pValues[nProp].hasValue())
-        {
-            switch(nProp)
-            {
-                case 0:
-                    {
-                        pValues[nProp] >>= bHideContent;
-                    }
-                    break;
-            }
-        }
-    }
-}
-
-/* -------------------------------------------------------------------------*/
-
-const Sequence<OUString> RemoveHiddenContentCfg_Impl::GetPropertyNames() {
-    Sequence<OUString> aRet(1);
-    OUString* pRet = aRet.getArray();
-    pRet[0] = "RemoveHiddenContent";
-    return aRet;
-}
-
-/* -------------------------------------------------------------------------*/
-
-void RemoveHiddenContentCfg_Impl::ImplCommit()
-{
-    const Sequence< OUString > aOrgNames = GetPropertyNames();
-    sal_Int32 nOrgCount = aOrgNames.getLength();
-
-    Sequence< OUString > aNames(nOrgCount);
-    Sequence< Any > aValues(nOrgCount);
-    sal_Int32 nRealCount = 0;
-
-    for(int nProp = 0; nProp < nOrgCount; nProp++)
-    {
-        switch(nProp)
-        {
-            case 0:
-            {
-                aNames[nRealCount] = aOrgNames[nProp];
-                aValues[nRealCount] <<= bHideContent;
-                ++nRealCount;
-            }
-            break;
-        }
-    }
-
-    aNames.realloc(nRealCount);
-    aValues.realloc(nRealCount);
-    PutProperties(aNames, aValues);
-}
-
-
-/* -------------------------------------------------------------------------*/
-
-void RemoveHiddenContentCfg_Impl::Notify( const com::sun::star::uno::Sequence< rtl::OUString >& )
-{
-}
-
 class MailerProgramCfg_Impl : public utl::ConfigItem
 {
     friend class SvxEMailTabPage;
@@ -1123,8 +1038,13 @@ void MailerProgramCfg_Impl::Notify( const com::sun::star::uno::Sequence< OUStrin
 
 struct SvxEMailTabPage_Impl
 {
+    SvxEMailTabPage_Impl():
+        bHideContent(
+            officecfg::Office::Security::HiddenContent::RemoveHiddenContent::get())
+    {}
+
     MailerProgramCfg_Impl aMailConfig;
-    RemoveHiddenContentCfg_Impl aHiddenContentConfig;
+    bool bHideContent;
 };
 
 SvxEMailTabPage::SvxEMailTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
@@ -1167,8 +1087,15 @@ bool SvxEMailTabPage::FillItemSet( SfxItemSet* )
     if ( bMailModified )
         pImpl->aMailConfig.Commit();
 
-    pImpl->aHiddenContentConfig.bHideContent = m_pSuppressHidden->IsChecked();
-    pImpl->aHiddenContentConfig.Commit();
+    if (pImpl->bHideContent != m_pSuppressHidden->IsChecked())
+    {
+        pImpl->bHideContent = m_pSuppressHidden->IsChecked();
+        std::shared_ptr<comphelper::ConfigurationChanges> batch(
+            comphelper::ConfigurationChanges::create());
+        officecfg::Office::Security::HiddenContent::RemoveHiddenContent::set(
+            pImpl->bHideContent, batch);
+        batch->commit();
+    }
 
     return false;
 }
@@ -1188,7 +1115,7 @@ void SvxEMailTabPage::Reset( const SfxItemSet* )
 
     m_pMailContainer->Enable(!pImpl->aMailConfig.bROProgram);
 
-    m_pSuppressHidden->Check(pImpl->aHiddenContentConfig.bHideContent);
+    m_pSuppressHidden->Check(pImpl->bHideContent);
 }
 
 /* -------------------------------------------------------------------------*/
commit c1a9f4434c2c00a643a8a6ad330138022f2b7701
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Apr 1 10:28:55 2015 +0200

    tdf#87441: RemoveHiddenContent is indep. of ExternalMailer/Program R/O state
    
    Change-Id: I7a479c85c2acbb750651b4c4211447bcb2a7346e

diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx
index 782523d..7ca7c27 100644
--- a/cui/source/options/optinet2.cxx
+++ b/cui/source/options/optinet2.cxx
@@ -1131,7 +1131,7 @@ SvxEMailTabPage::SvxEMailTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
     : SfxTabPage( pParent, "OptEmailPage", "cui/ui/optemailpage.ui", &rSet)
     , pImpl(new SvxEMailTabPage_Impl)
 {
-    get(m_pMailContainer, "OptEmailPage");
+    get(m_pMailContainer, "program");
     get(m_pMailerURLFI, "lockemail");
     get(m_pMailerURLED, "url");
     get(m_pMailerURLPB, "browse");
diff --git a/cui/uiconfig/ui/optemailpage.ui b/cui/uiconfig/ui/optemailpage.ui
index 3b07f09..4a2a913 100644
--- a/cui/uiconfig/ui/optemailpage.ui
+++ b/cui/uiconfig/ui/optemailpage.ui
@@ -9,13 +9,12 @@
     <property name="label_xalign">0</property>
     <property name="shadow_type">none</property>
     <child>
-      <object class="GtkAlignment" id="alignment1">
+      <object class="GtkBox" id="box1">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
-        <property name="top_padding">6</property>
-        <property name="left_padding">12</property>
+        <property name="orientation">vertical</property>
         <child>
-          <object class="GtkGrid" id="grid1">
+          <object class="GtkGrid" id="program">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <property name="row_spacing">6</property>
@@ -96,6 +95,19 @@
                 <property name="height">1</property>
               </packing>
             </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkGrid" id="grid2">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="row_spacing">6</property>
+            <property name="column_spacing">12</property>
             <child>
               <object class="GtkLabel" id="suppress">
                 <property name="visible">True</property>
@@ -135,6 +147,11 @@
               <placeholder/>
             </child>
           </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
         </child>
       </object>
     </child>


More information about the Libreoffice-commits mailing list