[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - sc/Library_scui.mk sc/source

Aron Budea aron.budea at collabora.com
Fri May 19 11:06:59 UTC 2017


 sc/Library_scui.mk             |    4 ++++
 sc/source/ui/optdlg/tpcalc.cxx |   15 +++++++++++++++
 2 files changed, 19 insertions(+)

New commits:
commit 471c4ee91a3264556b787b970ab1a879910bff62
Author: Aron Budea <aron.budea at collabora.com>
Date:   Fri May 12 17:33:43 2017 +0200

    Respect read-only config items in Options/Calc/Calculate dialog
    
    Read-only state is now read except for settings in General
    Calculations (except Decimal places).
    
    Change-Id: Ia947f6657ae5638c414bf4e82fac314b5993f4c5
    Reviewed-on: https://gerrit.libreoffice.org/37546
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Eike Rathke <erack at redhat.com>
    (cherry picked from commit ab34329ce2c5d6c1e340155e1b2f6d65f5fb162b)
    Reviewed-on: https://gerrit.libreoffice.org/37799
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Tested-by: Andras Timar <andras.timar at collabora.com>

diff --git a/sc/Library_scui.mk b/sc/Library_scui.mk
index e694885aa13b..9957576571e1 100644
--- a/sc/Library_scui.mk
+++ b/sc/Library_scui.mk
@@ -20,6 +20,10 @@ $(eval $(call gb_Library_set_include,scui,\
 
 $(eval $(call gb_Library_set_precompiled_header,scui,$(SRCDIR)/sc/inc/pch/precompiled_scui))
 
+$(eval $(call gb_Library_use_custom_headers,scui,\
+    officecfg/registry \
+))
+
 $(eval $(call gb_Library_use_sdk_api,scui))
 
 $(eval $(call gb_Library_use_externals,scui,\
diff --git a/sc/source/ui/optdlg/tpcalc.cxx b/sc/source/ui/optdlg/tpcalc.cxx
index b259c3d20c4a..75f920abff60 100644
--- a/sc/source/ui/optdlg/tpcalc.cxx
+++ b/sc/source/ui/optdlg/tpcalc.cxx
@@ -30,6 +30,7 @@
 #include "docoptio.hxx"
 #include "scresid.hxx"
 #include "sc.hrc"
+#include <officecfg/Office/Calc.hxx>
 
 #include "tpcalc.hxx"
 
@@ -118,16 +119,30 @@ void ScTpCalcOptions::Reset( const SfxItemSet* /* rCoreAttrs */ )
     *pLocalOptions  = *pOldOptions;
 
     m_pBtnCase->Check( !pLocalOptions->IsIgnoreCase() );
+    m_pBtnCase->Enable( !officecfg::Office::Calc::Calculate::Other::CaseSensitive::isReadOnly() );
     m_pBtnCalc->Check( pLocalOptions->IsCalcAsShown() );
+    m_pBtnCalc->Enable( !officecfg::Office::Calc::Calculate::Other::Precision::isReadOnly() );
     m_pBtnMatch->Check( pLocalOptions->IsMatchWholeCell() );
+    m_pBtnMatch->Enable( !officecfg::Office::Calc::Calculate::Other::SearchCriteria::isReadOnly() );
     bool bWildcards = pLocalOptions->IsFormulaWildcardsEnabled();
     bool bRegex = pLocalOptions->IsFormulaRegexEnabled();
     if (bWildcards && bRegex)
         bRegex = false;
     m_pBtnWildcards->Check( bWildcards );
     m_pBtnRegex->Check( bRegex );
+    m_pBtnWildcards->Enable( !officecfg::Office::Calc::Calculate::Other::Wildcards::isReadOnly() );
+    m_pBtnRegex->Enable( !officecfg::Office::Calc::Calculate::Other::RegularExpressions::isReadOnly() );
     m_pBtnLiteral->Check( !bWildcards && !bRegex );
+    m_pBtnLiteral->Enable( m_pBtnWildcards->IsEnabled() || m_pBtnRegex->IsEnabled() );
+    // if either regex or wildcards radio button is set and read-only, disable all three
+    if ( (!m_pBtnWildcards->IsEnabled() && bWildcards) || (!m_pBtnRegex->IsEnabled() && bRegex) )
+    {
+        m_pBtnWildcards->Enable( false );
+        m_pBtnRegex->Enable( false );
+        m_pBtnLiteral->Enable( false );
+    }
     m_pBtnLookUp->Check( pLocalOptions->IsLookUpColRowNames() );
+    m_pBtnLookUp->Enable( !officecfg::Office::Calc::Calculate::Other::FindLabel::isReadOnly() );
     m_pBtnIterate->Check( pLocalOptions->IsIter() );
     m_pEdSteps->SetValue( pLocalOptions->GetIterCount() );
     m_pEdEps->SetValue( pLocalOptions->GetIterEps(), 6 );


More information about the Libreoffice-commits mailing list