summaryrefslogtreecommitdiff
path: root/sw/source/uibase
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2016-11-18 22:41:13 +0300
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-11-21 15:29:24 +0000
commitefbf399e773c6fc04496331b6ff1efde54bd4f9e (patch)
tree7c21538c696b3b331ba85b0d395f287097f02eb9 /sw/source/uibase
parent6f8f053a22a9010b50e6142443909bd31d5501df (diff)
related: tdf#90362: remove option from Formatting Aids
The option to ignore protection breaks expected functionality (protection, including sections protected with password), and may cause problems mentioned in original bug. This only should be used in specific recovery situations. Moving it from user-visible page to Expert Configuration. (Previously, changing it in Expert Configuration hadn't effect.) Change-Id: Ice2f20200584acd6b476e002eb783820fa823611 Reviewed-on: https://gerrit.libreoffice.org/30968 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw/source/uibase')
-rw-r--r--sw/source/uibase/app/appopt.cxx7
-rw-r--r--sw/source/uibase/config/usrpref.cxx15
-rw-r--r--sw/source/uibase/config/viewopt.cxx17
-rw-r--r--sw/source/uibase/inc/optpage.hxx1
4 files changed, 24 insertions, 16 deletions
diff --git a/sw/source/uibase/app/appopt.cxx b/sw/source/uibase/app/appopt.cxx
index 7f9072119685..e30b2a4fb243 100644
--- a/sw/source/uibase/app/appopt.cxx
+++ b/sw/source/uibase/app/appopt.cxx
@@ -108,7 +108,6 @@ SfxItemSet* SwModule::CreateItemSet( sal_uInt16 nId )
SID_HTML_MODE, SID_HTML_MODE,
FN_PARAM_SHADOWCURSOR, FN_PARAM_SHADOWCURSOR,
FN_PARAM_CRSR_IN_PROTECTED, FN_PARAM_CRSR_IN_PROTECTED,
- FN_PARAM_IGNORE_PROTECTED, FN_PARAM_IGNORE_PROTECTED,
FN_HSCROLL_METRIC, FN_VSCROLL_METRIC,
SID_ATTR_LANGUAGE, SID_ATTR_LANGUAGE,
SID_ATTR_CHAR_CJK_LANGUAGE, SID_ATTR_CHAR_CJK_LANGUAGE,
@@ -124,7 +123,6 @@ SfxItemSet* SwModule::CreateItemSet( sal_uInt16 nId )
{
pRet->Put( SwShadowCursorItem( aViewOpt ));
pRet->Put( SfxBoolItem(FN_PARAM_CRSR_IN_PROTECTED, aViewOpt.IsCursorInProtectedArea()));
- pRet->Put(SfxBoolItem(FN_PARAM_IGNORE_PROTECTED, aViewOpt.IsIgnoreProtectedArea()));
}
if( pAppView )
@@ -413,10 +411,7 @@ void SwModule::ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet )
aViewOpt.SetCursorInProtectedArea(static_cast<const SfxBoolItem*>(pItem)->GetValue());
}
- if (rSet.GetItemState(FN_PARAM_IGNORE_PROTECTED, false, &pItem) == SfxItemState::SET)
- aViewOpt.SetIgnoreProtectedArea(static_cast<const SfxBoolItem*>(pItem)->GetValue());
-
- // set elements for the current view and shell
+ // set elements for the current view and shell
ApplyUsrPref( aViewOpt, pAppView, bTextDialog? SvViewOpt::DestText : SvViewOpt::DestWeb);
}
diff --git a/sw/source/uibase/config/usrpref.cxx b/sw/source/uibase/config/usrpref.cxx
index 81a1b785dc37..bd44eccaf8a5 100644
--- a/sw/source/uibase/config/usrpref.cxx
+++ b/sw/source/uibase/config/usrpref.cxx
@@ -468,7 +468,6 @@ Sequence<OUString> SwCursorConfig::GetPropertyNames()
"DirectCursor/UseDirectCursor", // 0
"DirectCursor/Insert", // 1
"Option/ProtectedArea", // 2
- "Option/IgnoreProtectedArea" // 3
};
const int nCount = SAL_N_ELEMENTS(aPropNames);
Sequence<OUString> aNames(nCount);
@@ -500,10 +499,9 @@ void SwCursorConfig::ImplCommit()
{
switch(nProp)
{
- case 0: pValues[nProp] <<= rParent.IsShadowCursor(); break;// "DirectCursor/UseDirectCursor",
- case 1: pValues[nProp] <<= (sal_Int32)rParent.GetShdwCursorFillMode(); break;// "DirectCursor/Insert",
- case 2: pValues[nProp] <<= rParent.IsCursorInProtectedArea(); break;// "Option/ProtectedArea"
- case 3: pValues[nProp] <<= rParent.IsIgnoreProtectedArea(); break; // "Option/IgnoreProtectedArea"
+ case 0: pValues[nProp] <<= rParent.IsShadowCursor(); break; // "DirectCursor/UseDirectCursor",
+ case 1: pValues[nProp] <<= (sal_Int32)rParent.GetShdwCursorFillMode(); break; // "DirectCursor/Insert",
+ case 2: pValues[nProp] <<= rParent.IsCursorInProtectedArea(); break; // "Option/ProtectedArea"
}
}
PutProperties(aNames, aValues);
@@ -530,10 +528,9 @@ void SwCursorConfig::Load()
pValues[nProp] >>= nSet;
switch(nProp)
{
- case 0: rParent.SetShadowCursor(bSet); break;// "DirectCursor/UseDirectCursor",
- case 1: rParent.SetShdwCursorFillMode((sal_uInt8)nSet); break;// "DirectCursor/Insert",
- case 2: rParent.SetCursorInProtectedArea(bSet); break;// "Option/ProtectedArea"
- case 3: rParent.SetIgnoreProtectedArea(bSet); break; // "Option/IgnoreProtectedArea"
+ case 0: rParent.SetShadowCursor(bSet); break; // "DirectCursor/UseDirectCursor",
+ case 1: rParent.SetShdwCursorFillMode((sal_uInt8)nSet); break; // "DirectCursor/Insert",
+ case 2: rParent.SetCursorInProtectedArea(bSet); break; // "Option/ProtectedArea"
}
}
}
diff --git a/sw/source/uibase/config/viewopt.cxx b/sw/source/uibase/config/viewopt.cxx
index 0be3a79bd01d..bbfe62092f80 100644
--- a/sw/source/uibase/config/viewopt.cxx
+++ b/sw/source/uibase/config/viewopt.cxx
@@ -40,6 +40,7 @@
#include <editeng/acorrcfg.hxx>
#include <comphelper/lok.hxx>
+#include <comphelper/configurationlistener.hxx>
#ifdef DBG_UTIL
bool SwViewOption::m_bTest9 = false; //DrawingLayerNotLoading
@@ -561,4 +562,20 @@ bool SwViewOption::IsAppearanceFlag(ViewOptFlags nFlag)
return bool(m_nAppearanceFlags & nFlag);
}
+namespace{
+rtl::Reference<comphelper::ConfigurationListener> const & getWCOptionListener()
+{
+ static rtl::Reference<comphelper::ConfigurationListener> xListener;
+ if (!xListener.is())
+ xListener.set(new comphelper::ConfigurationListener("/org.openoffice.Office.Writer/Cursor/Option"));
+ return xListener;
+}
+}
+
+bool SwViewOption::IsIgnoreProtectedArea()
+{
+ static comphelper::ConfigurationListenerProperty<bool> gIgnoreProtectedArea(getWCOptionListener(), "IgnoreProtectedArea");
+ return gIgnoreProtectedArea.get();
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/inc/optpage.hxx b/sw/source/uibase/inc/optpage.hxx
index cfc6bf16ecbd..a4022db8df4b 100644
--- a/sw/source/uibase/inc/optpage.hxx
+++ b/sw/source/uibase/inc/optpage.hxx
@@ -255,7 +255,6 @@ class SwShdwCursorOptionsTabPage : public SfxTabPage
VclPtr<VclFrame> m_pCursorProtFrame;
VclPtr<CheckBox> m_pCursorInProtCB;
- VclPtr<CheckBox> m_pIgnoreProtCB;
VclPtr<CheckBox> m_pMathBaselineAlignmentCB;