[Libreoffice-commits] core.git: 6 commits - cui/source cui/uiconfig officecfg/registry sw/inc sw/source

Stephan Bergmann sbergman at redhat.com
Tue Mar 31 03:33:47 PDT 2015


 cui/source/options/optinet2.cxx                                |   95 ++++++++++
 cui/source/options/optinet2.hxx                                |    1 
 cui/uiconfig/ui/optemailpage.ui                                |   52 +++++
 officecfg/registry/schema/org/openoffice/Office/Common.xcs     |    4 
 officecfg/registry/schema/org/openoffice/Office/Security.xcs   |   12 +
 officecfg/registry/schema/org/openoffice/Office/UI/Sidebar.xcs |    1 
 officecfg/registry/schema/org/openoffice/Office/Writer.xcs     |    1 
 sw/inc/docsh.hxx                                               |    4 
 sw/source/uibase/app/docsh2.cxx                                |   12 -
 sw/source/uibase/app/docshini.cxx                              |    9 
 10 files changed, 177 insertions(+), 14 deletions(-)

New commits:
commit 9a342f7e22ee9597ad6ac6b76d312015f2a14049
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Mar 31 12:32:31 2015 +0200

    Remove remaining handful of <author> tags
    
    Change-Id: I4f7b0cb8f5bc42f203fc4e7df39bb8de98f55d59

diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index b613d3f..0bc0dc8 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -6323,7 +6323,6 @@
       </prop>
       <prop oor:name="EdgeBlending" oor:type="xs:short">
         <info>
-          <author>ALG</author>
           <desc>
             Option to use EdgeBlending for previews in the UI (for ColorValueSet, ColorDropDown, FillStyle/LineStyle
             previews, etc...). EdgeBlending will visualize a one pixel border on the preview object with interpolated
@@ -6338,7 +6337,6 @@
       </prop>
       <prop oor:name="ListBoxMaximumLineCount" oor:type="xs:short">
         <info>
-          <author>ALG</author>
           <desc>
             This option controls how many lines of a ListBox will be shown as a maximum. If the ListBox has less lines,
             all lines will be shown when opening the drop down content. If it has more lines, the visible number of
@@ -6352,7 +6350,6 @@
       </prop>
       <prop oor:name="ColorValueSetColumnCount" oor:type="xs:short">
         <info>
-          <author>ALG</author>
           <desc>
             This option controls how many columns the ColorValueSets (the matrix-organized dialogs for color select)
             will have. The default is 12 and this is aligned with the layout of the standard color palette. thus, when you
@@ -6365,7 +6362,6 @@
       </prop>
       <prop oor:name="PreviewUsesCheckeredBackground" oor:type="xs:boolean">
         <info>
-          <author>ALG</author>
           <desc>
             This option allows to make previews (e.g. UI previews for object attributes) show the content with a checkered
             background to allow simple identification and better preview of transparent content, e.g. when a draw object
diff --git a/officecfg/registry/schema/org/openoffice/Office/Security.xcs b/officecfg/registry/schema/org/openoffice/Office/Security.xcs
index edb85fa..d99c569 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Security.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Security.xcs
@@ -51,7 +51,6 @@
     </group>
     <group oor:name="HiddenContent">
       <info>
-        <author>SH</author>
         <desc>Specifies whether to remove the hidden content when sending the document attached to an e-mail</desc>
       </info>
       <prop oor:name="RemoveHiddenContent" oor:type="xs:boolean"
diff --git a/officecfg/registry/schema/org/openoffice/Office/UI/Sidebar.xcs b/officecfg/registry/schema/org/openoffice/Office/UI/Sidebar.xcs
index 5496467..1039bec 100644
--- a/officecfg/registry/schema/org/openoffice/Office/UI/Sidebar.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/UI/Sidebar.xcs
@@ -19,7 +19,6 @@
 <!DOCTYPE oor:component-schema SYSTEM "../../../../../component-schema.dtd">
 <oor:component-schema xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" oor:name="Sidebar" oor:package="org.openoffice.Office.UI" xml:lang="en-US">
   <info>
-    <author>Andre Fischer</author>
     <desc>Specification of decks and content panels of the sidebar.</desc>
   </info>
   <templates>
diff --git a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
index b3dc942..7be5ca5 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
@@ -1256,7 +1256,6 @@
         <prop oor:name="ShowScrollBarTips" oor:type="xs:boolean">
           <!-- UIHints: Not accessible via user interface -->
           <info>
-            <author>arielch</author>
             <desc>Enables the user to prevent the display of help tips on the scrollbars programmatically.</desc>
             <label>Prevent scrollbars help tips</label>
           </info>
commit ee4a09d037628121a9376f4afbacc4dc0608d744
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Mar 31 12:31:26 2015 +0200

    Clean up indentation
    
    Change-Id: I447929714d0121d4b3e5ff90b54eff7700da819b

diff --git a/officecfg/registry/schema/org/openoffice/Office/Security.xcs b/officecfg/registry/schema/org/openoffice/Office/Security.xcs
index 9b4374a..edb85fa 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Security.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Security.xcs
@@ -50,16 +50,17 @@
       </prop>
     </group>
     <group oor:name="HiddenContent">
+      <info>
+        <author>SH</author>
+        <desc>Specifies whether to remove the hidden content when sending the document attached to an e-mail</desc>
+      </info>
+      <prop oor:name="RemoveHiddenContent" oor:type="xs:boolean"
+          oor:nillable="false">
         <info>
-            <author>SH</author>
-            <desc>Specifies whether to remove the hidden content when sending the document attached to an e-mail</desc>
+          <desc>Specify wheter hidden content should be removed when sending via email</desc>
         </info>
-        <prop oor:name="RemoveHiddenContent" oor:type="xs:boolean" oor:nillable="false">
-            <info>
-                <desc>Specify wheter hidden content should be removed when sending via email</desc>
-            </info>
         <value>true</value>
-        </prop>
+      </prop>
     </group>
   </component>
 </oor:component-schema>
commit 33f1e29cb91f70e52c1af6ae33491c667b5225a6
Author: Stefan Heinemann <stefan.heinemann at codedump.ch>
Date:   Wed Mar 11 15:10:04 2015 +0100

    tdf#87441: Adjustable hidden content removal in e-mails
    
    Possibility to adjust the hidden content behaviour in the send e-mail
    functionality via option under the e-mail program setting
    
    Signed-off-by: Stephan Bergmann <sbergman at redhat.com>, taking just the parts
    that store the configuration property within /org.openoffice.Office/Security
    (rather than /org.openoffice.Office/Common/ExternalMailer) and throwing away
    the parts overlapping with previously picked
    <https://gerrit.libreoffice.org/#/c/14994/> "fdo#87441-Send document as Email
    removes invisible content."  Plus making the configuration property
    non-nillable, -Werror,-Winconsistent-missing-override, loplugin:salbool, and
    removal of trailing whitespace.
    
    Conflicts:
    	cui/source/options/optinet2.cxx
    	cui/source/options/optinet2.hxx
    	cui/uiconfig/ui/optemailpage.ui
    	sw/source/uibase/app/docsh2.cxx
    
    Change-Id: I1fb70418c5fe8011a86a379c2e75eae9ad3e18c3

diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx
index b790381..782523d 100644
--- a/cui/source/options/optinet2.cxx
+++ b/cui/source/options/optinet2.cxx
@@ -931,6 +931,94 @@ 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;
@@ -938,7 +1026,6 @@ class MailerProgramCfg_Impl : public utl::ConfigItem
     OUString sProgram;
     // readonly states
     bool bROProgram;
-    bool bHidden;
 
     const Sequence<OUString> GetPropertyNames();
 
@@ -974,12 +1061,6 @@ MailerProgramCfg_Impl::MailerProgramCfg_Impl() :
                     bROProgram = pROStates[nProp];
                 }
                 break;
-                case 1 :
-                {
-                    pValues[nProp] >>= bHidden;;
-
-                }
-               break;
             }
         }
     }
@@ -995,10 +1076,9 @@ MailerProgramCfg_Impl::~MailerProgramCfg_Impl()
 
 const Sequence<OUString> MailerProgramCfg_Impl::GetPropertyNames()
 {
-    Sequence<OUString> aRet(2);
+    Sequence<OUString> aRet(1);
     OUString* pRet = aRet.getArray();
     pRet[0] = "Program";
-    pRet[1] = "Hidden";
     return aRet;
 }
 
@@ -1027,13 +1107,6 @@ void MailerProgramCfg_Impl::ImplCommit()
                 }
             }
             break;
-            case  1:
-            {
-                aNames[nRealCount] = aOrgNames[nProp];
-                aValues[nRealCount] <<= bHidden;;
-                ++nRealCount;
-            }
-            break;
         }
     }
 
@@ -1051,6 +1124,7 @@ void MailerProgramCfg_Impl::Notify( const com::sun::star::uno::Sequence< OUStrin
 struct SvxEMailTabPage_Impl
 {
     MailerProgramCfg_Impl aMailConfig;
+    RemoveHiddenContentCfg_Impl aHiddenContentConfig;
 };
 
 SvxEMailTabPage::SvxEMailTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
@@ -1085,15 +1159,17 @@ SfxTabPage*  SvxEMailTabPage::Create( vcl::Window* pParent, const SfxItemSet* rA
 bool SvxEMailTabPage::FillItemSet( SfxItemSet* )
 {
     bool bMailModified = false;
-    if((!pImpl->aMailConfig.bROProgram && m_pMailerURLED->IsValueChangedFromSaved()) || m_pSuppressHidden->IsValueChangedFromSaved())
+    if(!pImpl->aMailConfig.bROProgram && m_pMailerURLED->IsValueChangedFromSaved())
     {
         pImpl->aMailConfig.sProgram = m_pMailerURLED->GetText();
-        pImpl->aMailConfig.bHidden = m_pSuppressHidden->GetState();
         bMailModified = true;
     }
     if ( bMailModified )
         pImpl->aMailConfig.Commit();
 
+    pImpl->aHiddenContentConfig.bHideContent = m_pSuppressHidden->IsChecked();
+    pImpl->aHiddenContentConfig.Commit();
+
     return false;
 }
 
@@ -1110,13 +1186,9 @@ void SvxEMailTabPage::Reset( const SfxItemSet* )
     m_pMailerURLED->SetText(pImpl->aMailConfig.sProgram);
     m_pMailerURLED->SaveValue();
 
-    if(pImpl->aMailConfig.bHidden)
-        m_pSuppressHidden->SetState(TRISTATE_TRUE);
-    else
-        m_pSuppressHidden->SetState(TRISTATE_FALSE);
-    m_pSuppressHidden->SaveValue();
-
     m_pMailContainer->Enable(!pImpl->aMailConfig.bROProgram);
+
+    m_pSuppressHidden->Check(pImpl->aHiddenContentConfig.bHideContent);
 }
 
 /* -------------------------------------------------------------------------*/
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index abfa404..b613d3f 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -6394,12 +6394,6 @@
         </info>
         <value/>
       </prop>
-      <prop oor:name="Hidden" oor:type="xs:boolean" oor:nillable="false">
-        <info>
-          <desc>Specifies whether invisible content should be hidden or not.</desc>
-        </info>
-        <value>true</value>
-     </prop>
     </group>
     <group oor:name="I18N">
       <info>
diff --git a/officecfg/registry/schema/org/openoffice/Office/Security.xcs b/officecfg/registry/schema/org/openoffice/Office/Security.xcs
index 7fe78b9..9b4374a 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Security.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Security.xcs
@@ -49,5 +49,17 @@
         </info>
       </prop>
     </group>
+    <group oor:name="HiddenContent">
+        <info>
+            <author>SH</author>
+            <desc>Specifies whether to remove the hidden content when sending the document attached to an e-mail</desc>
+        </info>
+        <prop oor:name="RemoveHiddenContent" oor:type="xs:boolean" oor:nillable="false">
+            <info>
+                <desc>Specify wheter hidden content should be removed when sending via email</desc>
+            </info>
+        <value>true</value>
+        </prop>
+    </group>
   </component>
 </oor:component-schema>
diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx
index 75baf6c..f766cc6 100644
--- a/sw/source/uibase/app/docsh2.cxx
+++ b/sw/source/uibase/app/docsh2.cxx
@@ -115,7 +115,7 @@
 #include <com/sun/star/script/vba/VBAEventId.hpp>
 #include <editeng/acorrcfg.hxx>
 #include <SwStyleNameMapper.hxx>
-#include <officecfg/Office/Common.hxx>
+#include <officecfg/Office/Security.hxx>
 
 #include <sfx2/fcontnr.hxx>
 
@@ -838,7 +838,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
             mpDoc->getIDocumentLinksAdministration().EmbedAllLinks();
 
             mbRemovedInvisibleContent
-                = officecfg::Office::Common::ExternalMailer::Hidden::get();
+                = officecfg::Office::Security::HiddenContent::RemoveHiddenContent::get();
             if(mbRemovedInvisibleContent)
                 mpDoc->RemoveInvisibleContent();
             if(mpWrtShell)
commit bc1e32d6b8f5df9cf55a110bfcf3331a6756673e
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Mar 31 10:53:32 2015 +0200

    Better only call RestoreInvisibleContent if previously removed
    
    Change-Id: I229db9567771a4967065d81fa99fee2c23dbcb3e

diff --git a/sw/inc/docsh.hxx b/sw/inc/docsh.hxx
index 66084a4..52db867 100644
--- a/sw/inc/docsh.hxx
+++ b/sw/inc/docsh.hxx
@@ -80,6 +80,10 @@ class SW_DLLPUBLIC SwDocShell: public SfxObjectShell, public SfxListener
     sal_Int16               mnUpdateDocMode;    ///< contains the com::sun::star::document::UpdateDocMode
     bool                    bIsATemplate;      ///< prevent nested calls of UpdateFontList
 
+    bool mbRemovedInvisibleContent;
+        ///< whether SID_MAIL_PREPAREEXPORT removed content that
+        ///< SID_MAIL_EXPORT_FINISHED needs to restore
+
     /// Methods for access to doc.
     SAL_DLLPRIVATE void                  AddLink();
     SAL_DLLPRIVATE void                  RemoveLink();
diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx
index c974027..75baf6c 100644
--- a/sw/source/uibase/app/docsh2.cxx
+++ b/sw/source/uibase/app/docsh2.cxx
@@ -837,7 +837,9 @@ void SwDocShell::Execute(SfxRequest& rReq)
             mpDoc->getIDocumentFieldsAccess().UpdateFlds( NULL, false );
             mpDoc->getIDocumentLinksAdministration().EmbedAllLinks();
 
-            if(officecfg::Office::Common::ExternalMailer::Hidden::get())
+            mbRemovedInvisibleContent
+                = officecfg::Office::Common::ExternalMailer::Hidden::get();
+            if(mbRemovedInvisibleContent)
                 mpDoc->RemoveInvisibleContent();
             if(mpWrtShell)
                 mpWrtShell->EndAllAction();
@@ -848,8 +850,9 @@ void SwDocShell::Execute(SfxRequest& rReq)
         {
                 if(mpWrtShell)
                     mpWrtShell->StartAllAction();
-                //try to undo the removal of invisible content
-                mpDoc->RestoreInvisibleContent();
+                //try to undo any removal of invisible content
+                if(mbRemovedInvisibleContent)
+                    mpDoc->RestoreInvisibleContent();
                 if(mpWrtShell)
                     mpWrtShell->EndAllAction();
         }
diff --git a/sw/source/uibase/app/docshini.cxx b/sw/source/uibase/app/docshini.cxx
index ac75cce..cd5c682 100644
--- a/sw/source/uibase/app/docshini.cxx
+++ b/sw/source/uibase/app/docshini.cxx
@@ -328,7 +328,8 @@ SwDocShell::SwDocShell( SfxObjectCreateMode eMode ) :
     mpWrtShell( 0 ),
     mpOLEChildList( 0 ),
     mnUpdateDocMode(document::UpdateDocMode::ACCORDING_TO_CONFIG),
-    bIsATemplate(false)
+    bIsATemplate(false),
+    mbRemovedInvisibleContent(false)
 {
     Init_Impl();
 }
@@ -343,7 +344,8 @@ SwDocShell::SwDocShell( const sal_uInt64 i_nSfxCreationFlags ) :
     mpWrtShell( 0 ),
     mpOLEChildList( 0 ),
     mnUpdateDocMode(document::UpdateDocMode::ACCORDING_TO_CONFIG),
-    bIsATemplate(false)
+    bIsATemplate(false),
+    mbRemovedInvisibleContent(false)
 {
     Init_Impl();
 }
@@ -358,7 +360,8 @@ SwDocShell::SwDocShell( SwDoc *pD, SfxObjectCreateMode eMode ):
     mpWrtShell( 0 ),
     mpOLEChildList( 0 ),
     mnUpdateDocMode(document::UpdateDocMode::ACCORDING_TO_CONFIG),
-    bIsATemplate(false)
+    bIsATemplate(false),
+    mbRemovedInvisibleContent(false)
 {
     Init_Impl();
 }
commit 735616a6ddfe34c2ba4694c659c71a834f6935a1
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Mar 31 10:39:50 2015 +0200

    Use simplified configuration access
    
    Change-Id: I330c34aa6995817b4c2114e78f16b1aa8141e913

diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx
index c36bd1c..c974027 100644
--- a/sw/source/uibase/app/docsh2.cxx
+++ b/sw/source/uibase/app/docsh2.cxx
@@ -115,9 +115,7 @@
 #include <com/sun/star/script/vba/VBAEventId.hpp>
 #include <editeng/acorrcfg.hxx>
 #include <SwStyleNameMapper.hxx>
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/configuration/theDefaultProvider.hpp>
+#include <officecfg/Office/Common.hxx>
 
 #include <sfx2/fcontnr.hxx>
 
@@ -133,9 +131,6 @@ using namespace ::com::sun::star::lang;
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star;
 using namespace ::sfx2;
-using com::sun::star::container::XNameAccess;
-using com::sun::star::beans::PropertyValue;
-using namespace com::sun::star::configuration;
 
 // create DocInfo (virtual)
 SfxDocumentInfoDialog* SwDocShell::CreateDocumentInfoDialog(
@@ -841,25 +836,8 @@ void SwDocShell::Execute(SfxRequest& rReq)
                 mpWrtShell->StartAllAction();
             mpDoc->getIDocumentFieldsAccess().UpdateFlds( NULL, false );
             mpDoc->getIDocumentLinksAdministration().EmbedAllLinks();
-            OUString aConfigRoot = "org.openoffice.Office.Common/ExternalMailer";
-
-            PropertyValue aProperty;
-            aProperty.Name = "nodepath";
-            aProperty.Value = makeAny( aConfigRoot );
-
-            Sequence< Any > aArgumentList( 1 );
-            aArgumentList[0] = makeAny( aProperty );
-            uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
-            ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xConfigurationProvider;
-            m_xConfigurationProvider = theDefaultProvider::get(xContext);
-            Reference< XNameAccess > xNameAccess =
-            Reference< XNameAccess > (m_xConfigurationProvider->createInstanceWithArguments(
-                   OUString("com.sun.star.configuration.ConfigurationAccess"),
-                  aArgumentList ),
-                   UNO_QUERY );
-            bool bRemoveInvisible;
-            xNameAccess->getByName("Hidden") >>= bRemoveInvisible;
-            if(bRemoveInvisible)
+
+            if(officecfg::Office::Common::ExternalMailer::Hidden::get())
                 mpDoc->RemoveInvisibleContent();
             if(mpWrtShell)
                 mpWrtShell->EndAllAction();
commit 50a0ddb99d53f86b571acc0373f0d2b4ec6d611a
Author: Charu Tyagi <charu.tyagi at ericsson.com>
Date:   Wed Mar 25 10:13:35 2015 +0530

    fdo#87441-Send document as Email removes invisible content
    
    Signed-off-by: Stephan Bergmann <sbergman at redhat.com>, plus trivial
    modifications for -Werror,-Wlogical-op-parentheses and loplugin:bodynotinblock
    
    Change-Id: I149681b3743eaf96e98419bd568f88b451e9ba01

diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx
index c384de1..b790381 100644
--- a/cui/source/options/optinet2.cxx
+++ b/cui/source/options/optinet2.cxx
@@ -938,6 +938,7 @@ class MailerProgramCfg_Impl : public utl::ConfigItem
     OUString sProgram;
     // readonly states
     bool bROProgram;
+    bool bHidden;
 
     const Sequence<OUString> GetPropertyNames();
 
@@ -973,6 +974,12 @@ MailerProgramCfg_Impl::MailerProgramCfg_Impl() :
                     bROProgram = pROStates[nProp];
                 }
                 break;
+                case 1 :
+                {
+                    pValues[nProp] >>= bHidden;;
+
+                }
+               break;
             }
         }
     }
@@ -988,9 +995,10 @@ MailerProgramCfg_Impl::~MailerProgramCfg_Impl()
 
 const Sequence<OUString> MailerProgramCfg_Impl::GetPropertyNames()
 {
-    Sequence<OUString> aRet(1);
+    Sequence<OUString> aRet(2);
     OUString* pRet = aRet.getArray();
     pRet[0] = "Program";
+    pRet[1] = "Hidden";
     return aRet;
 }
 
@@ -1019,6 +1027,13 @@ void MailerProgramCfg_Impl::ImplCommit()
                 }
             }
             break;
+            case  1:
+            {
+                aNames[nRealCount] = aOrgNames[nProp];
+                aValues[nRealCount] <<= bHidden;;
+                ++nRealCount;
+            }
+            break;
         }
     }
 
@@ -1046,6 +1061,7 @@ SvxEMailTabPage::SvxEMailTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
     get(m_pMailerURLFI, "lockemail");
     get(m_pMailerURLED, "url");
     get(m_pMailerURLPB, "browse");
+    get(m_pSuppressHidden, "suppressHidden");
     m_sDefaultFilterName = get<FixedText>("browsetitle")->GetText();
     m_pMailerURLPB->SetClickHdl( LINK( this, SvxEMailTabPage, FileDialogHdl_Impl ) );
 }
@@ -1069,9 +1085,10 @@ SfxTabPage*  SvxEMailTabPage::Create( vcl::Window* pParent, const SfxItemSet* rA
 bool SvxEMailTabPage::FillItemSet( SfxItemSet* )
 {
     bool bMailModified = false;
-    if(!pImpl->aMailConfig.bROProgram && m_pMailerURLED->IsValueChangedFromSaved())
+    if((!pImpl->aMailConfig.bROProgram && m_pMailerURLED->IsValueChangedFromSaved()) || m_pSuppressHidden->IsValueChangedFromSaved())
     {
         pImpl->aMailConfig.sProgram = m_pMailerURLED->GetText();
+        pImpl->aMailConfig.bHidden = m_pSuppressHidden->GetState();
         bMailModified = true;
     }
     if ( bMailModified )
@@ -1093,6 +1110,12 @@ void SvxEMailTabPage::Reset( const SfxItemSet* )
     m_pMailerURLED->SetText(pImpl->aMailConfig.sProgram);
     m_pMailerURLED->SaveValue();
 
+    if(pImpl->aMailConfig.bHidden)
+        m_pSuppressHidden->SetState(TRISTATE_TRUE);
+    else
+        m_pSuppressHidden->SetState(TRISTATE_FALSE);
+    m_pSuppressHidden->SaveValue();
+
     m_pMailContainer->Enable(!pImpl->aMailConfig.bROProgram);
 }
 
diff --git a/cui/source/options/optinet2.hxx b/cui/source/options/optinet2.hxx
index 5bb9c05..0c5f713 100644
--- a/cui/source/options/optinet2.hxx
+++ b/cui/source/options/optinet2.hxx
@@ -186,6 +186,7 @@ class SvxEMailTabPage : public SfxTabPage
     FixedImage*   m_pMailerURLFI;
     Edit*         m_pMailerURLED;
     PushButton*   m_pMailerURLPB;
+    CheckBox*     m_pSuppressHidden;
 
     OUString      m_sDefaultFilterName;
 
diff --git a/cui/uiconfig/ui/optemailpage.ui b/cui/uiconfig/ui/optemailpage.ui
index 3a58341..3b07f09 100644
--- a/cui/uiconfig/ui/optemailpage.ui
+++ b/cui/uiconfig/ui/optemailpage.ui
@@ -1,7 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.3 -->
 <interface>
-  <requires lib="gtk+" version="3.0"/>
+  <!-- interface-requires gtk+ 3.0 -->
   <object class="GtkFrame" id="OptEmailPage">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
@@ -32,6 +31,8 @@
               <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>
@@ -46,19 +47,25 @@
               <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>
               <object class="GtkButton" id="browse">
                 <property name="label" translatable="yes">Browse...</property>
+                <property name="use_action_appearance">False</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="receives_default">True</property>
+                <property name="use_action_appearance">False</property>
                 <property name="use_underline">True</property>
               </object>
               <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>
@@ -72,6 +79,8 @@
               <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>
@@ -84,8 +93,47 @@
                 <property name="left_attach">0</property>
                 <property name="top_attach">1</property>
                 <property name="width">4</property>
+                <property name="height">1</property>
               </packing>
             </child>
+            <child>
+              <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">Suppress hidden elements of documents</property>
+                <property name="use_underline">True</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>
+              <object class="GtkCheckButton" id="suppressHidden">
+                <property name="use_action_appearance">False</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">False</property>
+                <property name="use_action_appearance">False</property>
+                <property name="xalign">0</property>
+                <property name="draw_indicator">True</property>
+              </object>
+              <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>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
           </object>
         </child>
       </object>
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index b613d3f..abfa404 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -6394,6 +6394,12 @@
         </info>
         <value/>
       </prop>
+      <prop oor:name="Hidden" oor:type="xs:boolean" oor:nillable="false">
+        <info>
+          <desc>Specifies whether invisible content should be hidden or not.</desc>
+        </info>
+        <value>true</value>
+     </prop>
     </group>
     <group oor:name="I18N">
       <info>
diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx
index f264775..c36bd1c 100644
--- a/sw/source/uibase/app/docsh2.cxx
+++ b/sw/source/uibase/app/docsh2.cxx
@@ -115,6 +115,9 @@
 #include <com/sun/star/script/vba/VBAEventId.hpp>
 #include <editeng/acorrcfg.hxx>
 #include <SwStyleNameMapper.hxx>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/configuration/theDefaultProvider.hpp>
 
 #include <sfx2/fcontnr.hxx>
 
@@ -130,6 +133,9 @@ using namespace ::com::sun::star::lang;
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star;
 using namespace ::sfx2;
+using com::sun::star::container::XNameAccess;
+using com::sun::star::beans::PropertyValue;
+using namespace com::sun::star::configuration;
 
 // create DocInfo (virtual)
 SfxDocumentInfoDialog* SwDocShell::CreateDocumentInfoDialog(
@@ -835,7 +841,26 @@ void SwDocShell::Execute(SfxRequest& rReq)
                 mpWrtShell->StartAllAction();
             mpDoc->getIDocumentFieldsAccess().UpdateFlds( NULL, false );
             mpDoc->getIDocumentLinksAdministration().EmbedAllLinks();
-            mpDoc->RemoveInvisibleContent();
+            OUString aConfigRoot = "org.openoffice.Office.Common/ExternalMailer";
+
+            PropertyValue aProperty;
+            aProperty.Name = "nodepath";
+            aProperty.Value = makeAny( aConfigRoot );
+
+            Sequence< Any > aArgumentList( 1 );
+            aArgumentList[0] = makeAny( aProperty );
+            uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
+            ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xConfigurationProvider;
+            m_xConfigurationProvider = theDefaultProvider::get(xContext);
+            Reference< XNameAccess > xNameAccess =
+            Reference< XNameAccess > (m_xConfigurationProvider->createInstanceWithArguments(
+                   OUString("com.sun.star.configuration.ConfigurationAccess"),
+                  aArgumentList ),
+                   UNO_QUERY );
+            bool bRemoveInvisible;
+            xNameAccess->getByName("Hidden") >>= bRemoveInvisible;
+            if(bRemoveInvisible)
+                mpDoc->RemoveInvisibleContent();
             if(mpWrtShell)
                 mpWrtShell->EndAllAction();
         }


More information about the Libreoffice-commits mailing list