summaryrefslogtreecommitdiff
path: root/sc/qa/unit/ucalc.cxx
diff options
context:
space:
mode:
authorslideon <adamkasztenny@gmail.com>2016-07-09 18:07:49 -0400
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-07-11 13:35:46 +0000
commit740771c506233732b2678562bb4d1c0d98cd6d0c (patch)
tree75263ef61e98da925c61751d6da728af0ed8c53e /sc/qa/unit/ucalc.cxx
parent9ade2ec1acfbeb8317a30edb85b6bb565be9a944 (diff)
Add test for empty Calc doc defaults
Checking boolean values of many properties for an empty Calc doc. Change-Id: I54ab4975e65600db4362d94f421f40f794643938 Reviewed-on: https://gerrit.libreoffice.org/27080 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'sc/qa/unit/ucalc.cxx')
-rw-r--r--sc/qa/unit/ucalc.cxx72
1 files changed, 72 insertions, 0 deletions
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 91c6b71d5811..6e3c30b0d985 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -5974,6 +5974,78 @@ void Test::testUndoDataAnchor()
m_pDoc->DeleteTab(0);
}
+
+void Test::testEmptyCalcDocDefaults()
+{
+ CPPUNIT_ASSERT_EQUAL( (sal_uLong) 0, m_pDoc->GetCellCount() );
+ CPPUNIT_ASSERT_EQUAL( (sal_uLong) 0, m_pDoc->GetFormulaGroupCount() );
+ CPPUNIT_ASSERT_EQUAL( (sal_uLong) 0, m_pDoc->GetCodeCount() );
+ CPPUNIT_ASSERT_EQUAL( (sal_uInt8) 0, m_pDoc->GetAsianCompression() );
+
+ CPPUNIT_ASSERT_EQUAL( false, m_pDoc->HasPrintRange() );
+ CPPUNIT_ASSERT_EQUAL( false, m_pDoc->IsInVBAMode() );
+ CPPUNIT_ASSERT_EQUAL( false, m_pDoc->HasNotes() );
+ CPPUNIT_ASSERT_EQUAL( false, m_pDoc->IsCutMode() );
+ CPPUNIT_ASSERT_EQUAL( true, m_pDoc->CheckMacroWarn() );
+
+ CPPUNIT_ASSERT_EQUAL( false, m_pDoc->IsUsingEmbededFonts() );
+ CPPUNIT_ASSERT_EQUAL( false, m_pDoc->IsEmbedded() );
+
+ CPPUNIT_ASSERT_EQUAL( true, m_pDoc->IsDocEditable() );
+ CPPUNIT_ASSERT_EQUAL( false, m_pDoc->IsDocProtected() );
+ CPPUNIT_ASSERT_EQUAL( false, m_pDoc->IsDocVisible() );
+ CPPUNIT_ASSERT_EQUAL( true, m_pDoc->IsUserInteractionEnabled() );
+
+ CPPUNIT_ASSERT_EQUAL( false, m_pDoc->HasAnyCalcNotification() );
+ CPPUNIT_ASSERT_EQUAL( false, m_pDoc->IsAutoCalcShellDisabled() );
+ CPPUNIT_ASSERT_EQUAL( false, m_pDoc->IsForcedFormulaPending() );
+ CPPUNIT_ASSERT_EQUAL( false, m_pDoc->IsCalculatingFormulaTree() );
+
+ CPPUNIT_ASSERT_EQUAL( false, m_pDoc->IsClipOrUndo() );
+ CPPUNIT_ASSERT_EQUAL( false, m_pDoc->IsClipboard() );
+ CPPUNIT_ASSERT_EQUAL( false, m_pDoc->IsUndo() );
+ CPPUNIT_ASSERT_EQUAL( true, m_pDoc->IsUndoEnabled() );
+ CPPUNIT_ASSERT_EQUAL( false, m_pDoc->IsCutMode() );
+ CPPUNIT_ASSERT_EQUAL( false, m_pDoc->IsClipboardSource() );
+ CPPUNIT_ASSERT_EQUAL( false, m_pDoc->IsInsertingFromOtherDoc() );
+ CPPUNIT_ASSERT_EQUAL( false, m_pDoc->PastingDrawFromOtherDoc() );
+
+ CPPUNIT_ASSERT_EQUAL( true, m_pDoc->IsAdjustHeightEnabled() );
+ CPPUNIT_ASSERT_EQUAL( true, m_pDoc->IsExecuteLinkEnabled() );
+ CPPUNIT_ASSERT_EQUAL( false, m_pDoc->IsChangeReadOnlyEnabled() );
+
+ CPPUNIT_ASSERT_EQUAL( false, m_pDoc->IdleCalcTextWidth() );
+ CPPUNIT_ASSERT_EQUAL( true, m_pDoc->IsIdleEnabled() );
+ CPPUNIT_ASSERT_EQUAL( false, m_pDoc->IsDetectiveDirty() );
+ CPPUNIT_ASSERT_EQUAL( false, m_pDoc->GetHasMacroFunc() );
+ CPPUNIT_ASSERT_EQUAL( false, m_pDoc->IsChartListenerCollectionNeedsUpdate() );
+
+ CPPUNIT_ASSERT_EQUAL( false, m_pDoc->HasRangeOverflow() );
+ CPPUNIT_ASSERT_EQUAL( false, m_pDoc->IsImportingXML() );
+ CPPUNIT_ASSERT_EQUAL( false, m_pDoc->IsCalcingAfterLoad() );
+ CPPUNIT_ASSERT_EQUAL( false, m_pDoc->GetNoListening() );
+
+ CPPUNIT_ASSERT_EQUAL( false, m_pDoc->IsValidAsianCompression() );
+ CPPUNIT_ASSERT_EQUAL( false, m_pDoc->GetAsianKerning() );
+ CPPUNIT_ASSERT_EQUAL( false, m_pDoc->IsValidAsianKerning() );
+
+ CPPUNIT_ASSERT_EQUAL( false, m_pDoc->IsInInterpreter() );
+ CPPUNIT_ASSERT_EQUAL( false, m_pDoc->IsInInterpreterTableOp() );
+ CPPUNIT_ASSERT_EQUAL( false, m_pDoc->IsInDtorClear() );
+ CPPUNIT_ASSERT_EQUAL( false, m_pDoc->IsExpandRefs() );
+ CPPUNIT_ASSERT_EQUAL( false, m_pDoc->IsInLinkUpdate() );
+
+ SCTAB tab = m_pDoc->GetVisibleTab();
+
+ CPPUNIT_ASSERT_EQUAL( false, m_pDoc->IsVisible(tab) );
+ CPPUNIT_ASSERT_EQUAL( true, m_pDoc->IsDefaultTabBgColor(tab) );
+ CPPUNIT_ASSERT_EQUAL( false, m_pDoc->HasTable(tab) );
+
+ CPPUNIT_ASSERT_EQUAL( false, m_pDoc->IsActiveScenario(tab) );
+ CPPUNIT_ASSERT_EQUAL( false, m_pDoc->HasCalcNotification(tab) );
+ CPPUNIT_ASSERT_EQUAL( false, m_pDoc->HasManualBreaks(tab) );
+}
+
ScDocShell* Test::findLoadedDocShellByName(const OUString& rName)
{
ScDocShell* pShell = static_cast<ScDocShell*>(SfxObjectShell::GetFirst(checkSfxObjectShell<ScDocShell>, false));