summaryrefslogtreecommitdiff
path: root/sw/qa/extras
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2017-02-14 00:04:16 +1000
committerAndras Timar <andras.timar@collabora.com>2017-02-13 21:14:51 +0000
commita1bd94fc01641989e83ea177ac57ccdbacf43c8b (patch)
tree44da455a29f58f77796c340e2646838a96d53aaf /sw/qa/extras
parent22cbc1f5c73e3cb0297b387f9e1446ea3556ad2a (diff)
fix unit test
Change-Id: Id7ed11ae03da5e28a4c40fb4fa3019dd6fae89bf Reviewed-on: https://gerrit.libreoffice.org/34224 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'sw/qa/extras')
-rw-r--r--sw/qa/extras/uiwriter/uiwriter.cxx17
1 files changed, 5 insertions, 12 deletions
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index c50e26a5b4d1..f159d03e33da 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -93,6 +93,7 @@
#include <sfx2/viewfrm.hxx>
#include <sfx2/dispatch.hxx>
#include <comphelper/propertyvalue.hxx>
+#include <comphelper/configurationhelper.hxx>
#include <editeng/unolingu.hxx>
static const char* DATA_DIRECTORY = "/sw/qa/extras/uiwriter/data/";
@@ -2628,21 +2629,18 @@ void SwUiWriterTest::testTdf88899()
void SwUiWriterTest::testTdf90362()
{
+ // First check if the end of the second paragraph is indeed protected.
SwDoc* pDoc = createDoc("tdf90362.fodt");
SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
- uno::Reference<uno::XComponentContext> xComponentContext(comphelper::getProcessComponentContext());
- // Ensure correct initial setting
- comphelper::ConfigurationHelper::writeDirectKey(xComponentContext, "org.openoffice.Office.Writer/", "Cursor/Option", "IgnoreProtectedArea", css::uno::Any(false), comphelper::EConfigurationModes::Standard);
- // First check if the end of the second paragraph is indeed protected.
pWrtShell->EndPara();
pWrtShell->Down(/*bSelect=*/false);
CPPUNIT_ASSERT_EQUAL(true, pWrtShell->HasReadonlySel());
// Then enable ignoring of protected areas and make sure that this time the cursor is read-write.
- comphelper::ConfigurationHelper::writeDirectKey(xComponentContext, "org.openoffice.Office.Writer/", "Cursor/Option", "IgnoreProtectedArea", css::uno::Any(true), comphelper::EConfigurationModes::Standard);
+ SwViewOption aViewOptions(*pWrtShell->GetViewOptions());
+ aViewOptions.SetIgnoreProtectedArea(true);
+ pWrtShell->ApplyViewOptions(aViewOptions);
CPPUNIT_ASSERT_EQUAL(false, pWrtShell->HasReadonlySel());
- // Clean up, otherwise following tests will have that option set
- comphelper::ConfigurationHelper::writeDirectKey(xComponentContext, "org.openoffice.Office.Writer/", "Cursor/Option", "IgnoreProtectedArea", css::uno::Any(false), comphelper::EConfigurationModes::Standard);
}
void SwUiWriterTest::testUndoCharAttribute()
@@ -3564,11 +3562,6 @@ void SwUiWriterTest::testTdf105625()
{
SwDoc* pDoc = createDoc("tdf105625.fodt");
SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
- uno::Reference<uno::XComponentContext> xComponentContext(comphelper::getProcessComponentContext());
- // Ensure correct initial setting
- comphelper::ConfigurationHelper::writeDirectKey(xComponentContext,
- "org.openoffice.Office.Writer/", "Cursor/Option", "IgnoreProtectedArea",
- css::uno::Any(false), comphelper::EConfigurationModes::Standard);
// We should be able to edit at positions adjacent to fields.
// Check if the start and the end of the 1st paragraph are not protected
// (they are adjacent to FORMCHECKBOX)