[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - 4 commits - cui/source sc/source sw/qa
Julien Nabet
serval2412 at yahoo.fr
Mon May 22 08:01:02 UTC 2017
cui/source/options/optaboutconfig.cxx | 6 +
sc/source/core/inc/interpre.hxx | 2
sc/source/core/tool/interpr1.cxx | 2
sc/source/ui/unoobj/condformatuno.cxx | 2
sw/qa/extras/uiwriter/uiwriter.cxx | 132 ++++++++++++++++++++++++++++++++++
5 files changed, 142 insertions(+), 2 deletions(-)
New commits:
commit 2ccf1f7ceb263e2bf92d513439e8d7695539ced7
Author: Julien Nabet <serval2412 at yahoo.fr>
Date: Sat May 13 12:03:48 2017 +0200
tdf#107811: expert config, deal no parent case
bt part:
3 0x00007ffff73c7ee2 in __GI___assert_fail (assertion=0x7ffff7ba5107 "false", file=0x7ffff7ba4ef8 "/home/julien/lo/libreoffice/sal/rtl/strtmpl.cxx", line=1399,
function=0x7ffff7ba6d00 <rtl_uString_newFromSubString::__PRETTY_FUNCTION__> "void rtl_uString_newFromSubString(rtl_uString**, const rtl_uString*, sal_Int32, sal_Int32)")
at assert.c:101
4 0x00007ffff7b6a28b in rtl_uString_newFromSubString (ppThis=0x7ffffffef1b0, pFrom=0x55555e122230, beginIndex=1, count=-2)
at /home/julien/lo/libreoffice/sal/rtl/strtmpl.cxx:1399
5 0x00007fffa6e69136 in rtl::OUString::copy (this=0x7ffffffef1f8, beginIndex=1, count=-2) at /home/julien/lo/libreoffice/include/rtl/ustring.hxx:2223
6 0x00007fffa6fed67b in CuiAboutConfigTabPage::InsertEntry (this=0x55555bda0b20, pEntry=0x55555e13eb40)
at /home/julien/lo/libreoffice/cui/source/options/optaboutconfig.cxx:874
7 0x00007fffa6fed415 in CuiAboutConfigTabPage::SearchHdl_Impl (this=0x55555bda0b20) at /home/julien/lo/libreoffice/cui/source/options/optaboutconfig.cxx:848
Change-Id: Id9d1003a0e5e52abb878229e710e3fd4612789a1
Reviewed-on: https://gerrit.libreoffice.org/37568
Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>
Tested-by: Julien Nabet <serval2412 at yahoo.fr>
(cherry picked from commit 8aee79e35208dd263928d7f5daa3f931fd3de99d)
Reviewed-on: https://gerrit.libreoffice.org/37570
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Katarina Behrens <Katarina.Behrens at cib.de>
(cherry picked from commit 24201323b6f25f62947d5e788e8444993920472c)
diff --git a/cui/source/options/optaboutconfig.cxx b/cui/source/options/optaboutconfig.cxx
index bacba9e98b78..b848e5da2615 100644
--- a/cui/source/options/optaboutconfig.cxx
+++ b/cui/source/options/optaboutconfig.cxx
@@ -871,6 +871,12 @@ void CuiAboutConfigTabPage::InsertEntry( SvTreeListEntry *pEntry)
{
int prevIndex = index;
index = sPath.indexOf("/", index+1);
+ // deal with no parent case (tdf#107811)
+ if (index < 0)
+ {
+ m_pPrefBox->Insert( pEntry, nullptr);
+ return;
+ }
OUString sParentName = sPath.copy(prevIndex+1, index - prevIndex - 1);
bool hasEntry = false;
commit 8336f5e0f994250be428ae490783063eb58358b5
Author: Julien Nabet <serval2412 at yahoo.fr>
Date: Thu May 18 00:03:32 2017 +0200
tdf#107920: Crash when using ScCompiler in condformat
Just call SetGrammar from ScCompiler object with grammar of document
See bt in https://bugs.documentfoundation.org/attachment.cgi?id=133382
Change-Id: Iedf4b88f2821bbcf728e4b1c023041fd6f10e5f3
Reviewed-on: https://gerrit.libreoffice.org/37739
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Eike Rathke <erack at redhat.com>
(cherry picked from commit 63843a97262ccfa38d838a9cbbc3faadba8290a6)
Reviewed-on: https://gerrit.libreoffice.org/37756
Tested-by: Eike Rathke <erack at redhat.com>
(cherry picked from commit 5756d3d5bd2175335ac302aaa806fd5f2277f564)
diff --git a/sc/source/ui/unoobj/condformatuno.cxx b/sc/source/ui/unoobj/condformatuno.cxx
index d64b71d9bedd..bfc003e94a05 100644
--- a/sc/source/ui/unoobj/condformatuno.cxx
+++ b/sc/source/ui/unoobj/condformatuno.cxx
@@ -745,6 +745,7 @@ void SAL_CALL ScConditionEntryObj::setPropertyValue(
if ((aValue >>= aFormula) && !aFormula.isEmpty())
{
ScCompiler aComp(&mpDocShell->GetDocument(), getCoreObject()->GetSrcPos());
+ aComp.SetGrammar(mpDocShell->GetDocument().GetGrammar());
std::unique_ptr<ScTokenArray> pArr(aComp.CompileString(aFormula));
getCoreObject()->SetFormula1(*pArr);
}
@@ -756,6 +757,7 @@ void SAL_CALL ScConditionEntryObj::setPropertyValue(
if ((aValue >>= aFormula) && !aFormula.isEmpty())
{
ScCompiler aComp(&mpDocShell->GetDocument(), getCoreObject()->GetSrcPos());
+ aComp.SetGrammar(mpDocShell->GetDocument().GetGrammar());
std::unique_ptr<ScTokenArray> pArr(aComp.CompileString(aFormula));
getCoreObject()->SetFormula2(*pArr);
}
commit b547e4f32c63c066f752e86f73deae9e13c38c3f
Author: Julien Nabet <serval2412 at yahoo.fr>
Date: Tue May 16 23:50:46 2017 +0200
tdf#107892: fix negative values case with maxifs
std::numeric_limits<double>::min() returns positive value for float/double
so use std::numeric_limits<double>::lowest()
(see http://stackoverflow.com/questions/17070351/why-does-numeric-limitsmin-return-a-negative-value-for-int-but-positive-values)
Change-Id: I0afce2d38c6936aeff26923182bcafd2f0008d9e
Reviewed-on: https://gerrit.libreoffice.org/37693
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Eike Rathke <erack at redhat.com>
(cherry picked from commit 20d3a60b41bda2513723c145d919f584840b1056)
Reviewed-on: https://gerrit.libreoffice.org/37730
(cherry picked from commit f6d7bd1f525d3930c48b61abb2e91418f2c66ca5)
diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx
index fe860eba7120..636f2ecd62d1 100644
--- a/sc/source/core/inc/interpre.hxx
+++ b/sc/source/core/inc/interpre.hxx
@@ -69,7 +69,7 @@ struct ParamIfsResult
double mfMem = 0.0;
double mfCount = 0.0;
double mfMin = std::numeric_limits<double>::max();
- double mfMax = std::numeric_limits<double>::min();
+ double mfMax = std::numeric_limits<double>::lowest();
};
}
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 9a02b624df22..f005b26e4635 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -5780,7 +5780,7 @@ void ScInterpreter::ScMaxIfs_MS()
sc::ParamIfsResult aRes;
IterateParametersIfs(aRes);
- PushDouble((aRes.mfMax > std::numeric_limits<double>::min()) ? aRes.mfMax : 0.0);
+ PushDouble((aRes.mfMax > std::numeric_limits<double>::lowest()) ? aRes.mfMax : 0.0);
}
void ScInterpreter::ScLookup()
commit 47fd47bf8c206cf9d60f9b872f2224a680e887e1
Author: Michael Stahl <mstahl at redhat.com>
Date: Wed May 10 17:45:14 2017 +0200
tdf#107512 sw: fix rollback of text attributes in SwUndoDelete
The problem is that in SwUndoDelete::UndoImpl(), first the formatting
attributes are restored via TmpRollback(), and then all footnote/fly
attributes are restored via Rollback(). This means that the SwHistory
doesn't actually store the original positions of the formatting hints;
ideally there wouldn't be 2 separate steps here, but that appears
difficult to change now given the plethora of calls to
DelContentIndex() ...
So work around the problem by adding a new SetAttrMode::NOHINTEXPAND
to prevent expanding the existing hints when the CH_TXTATR_BREAKWORD
are inserted from SwUndoDelLayFormat.
This fixes 2 problematic cases: at the start of the paragraph,
and if the hint ends at the position before the CH_TXTATR_BREAKWORD.
Let's hope this won't break anything anybody cares about.
(cherry picked from commit 771d85baf18e5b503eb6248e1f41928b00265d8d)
sw: CPPUNIT_ASSERT_EQUAL vs. integer FAIL
(cherry picked from commit 7f44ca113170a641a1aecc8a48e2b99860e1e2f7)
Change-Id: I557c4c9136f4225ca502019730fb9f0a9c03d23b
Reviewed-on: https://gerrit.libreoffice.org/37485
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
(cherry picked from commit 4820c9b981e060a55b3511272824dca7c2eb67d5)
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 4594b5ba4936..0818c701e8e3 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -3273,6 +3273,138 @@ void SwUiWriterTest::testUndoDelAsCharTdf107512()
query.ClearItem(RES_CHRATR_HIDDEN);
}
+void SwUiWriterTest::testUndoDelAsCharTdf107512()
+{
+ SwDoc * pDoc(createDoc());
+ sw::UndoManager & rUndoManager(pDoc->GetUndoManager());
+ IDocumentContentOperations & rIDCO(pDoc->getIDocumentContentOperations());
+ SwCursorShell * pShell(pDoc->GetEditShell());
+ SfxItemSet frameSet(pDoc->GetAttrPool(), RES_FRMATR_BEGIN, RES_FRMATR_END-1);
+ SfxItemSet grfSet(pDoc->GetAttrPool(), RES_GRFATR_BEGIN, RES_GRFATR_END-1);
+ rIDCO.InsertString(*pShell->GetCursor(), "foo");
+ pShell->ClearMark();
+ SwFormatAnchor anchor(RndStdIds::FLY_AS_CHAR);
+ frameSet.Put(anchor);
+ GraphicObject grf;
+ pShell->SttEndDoc(true);
+ CPPUNIT_ASSERT(rIDCO.Insert(*pShell->GetCursor(), grf, &frameSet, &grfSet, nullptr));
+ pShell->SttEndDoc(false);
+ CPPUNIT_ASSERT(rIDCO.Insert(*pShell->GetCursor(), grf, &frameSet, &grfSet, nullptr));
+ CPPUNIT_ASSERT_EQUAL(size_t(2), pDoc->GetFlyCount(FLYCNTTYPE_GRF));
+ SvxCharHiddenItem hidden(true, RES_CHRATR_HIDDEN);
+ pShell->SelectText(1, 4);
+ rIDCO.InsertPoolItem(*pShell->GetCursor(), hidden);
+ // now we have "\1foo\1" with the "foo" hidden
+ CPPUNIT_ASSERT(pShell->GetCursor()->GetNode().GetTextNode()->GetTextAttrForCharAt(0, RES_TXTATR_FLYCNT));
+ CPPUNIT_ASSERT(pShell->GetCursor()->GetNode().GetTextNode()->GetTextAttrForCharAt(4, RES_TXTATR_FLYCNT));
+ CPPUNIT_ASSERT_EQUAL(OUString(OUStringLiteral1(CH_TXTATR_BREAKWORD) + "foo" + OUStringLiteral1(CH_TXTATR_BREAKWORD)), pShell->GetCursor()->GetNode().GetTextNode()->GetText());
+ SfxPoolItem const* pItem;
+ SfxItemSet query(pDoc->GetAttrPool(), RES_CHRATR_HIDDEN, RES_CHRATR_HIDDEN);
+ pShell->GetCursor()->GetNode().GetTextNode()->GetAttr(query, 1, 4);
+// CPPUNIT_ASSERT_EQUAL(SfxItemState::SET, query.GetItemState(RES_CHRATR_HIDDEN, false, &pItem));
+ CPPUNIT_ASSERT(SfxItemState::SET == query.GetItemState(RES_CHRATR_HIDDEN, false, &pItem));
+ CPPUNIT_ASSERT(static_cast<SvxCharHiddenItem const*>(pItem)->GetValue());
+ query.ClearItem(RES_CHRATR_HIDDEN);
+
+ // delete from the start
+ pShell->SelectText(0, 4);
+ rIDCO.DeleteAndJoin(*pShell->GetCursor());
+ CPPUNIT_ASSERT(pShell->GetCursor()->GetNode().GetTextNode()->GetTextAttrForCharAt(0, RES_TXTATR_FLYCNT));
+ CPPUNIT_ASSERT_EQUAL(size_t(1), pDoc->GetFlyCount(FLYCNTTYPE_GRF));
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), pShell->GetCursor()->GetNode().GetTextNode()->Len());
+ pShell->GetCursor()->GetNode().GetTextNode()->GetAttr(query, 0, 1);
+// CPPUNIT_ASSERT_EQUAL(SfxItemState::DEFAULT, query.GetItemState(RES_CHRATR_HIDDEN, false, &pItem));
+ CPPUNIT_ASSERT(SfxItemState::DEFAULT == query.GetItemState(RES_CHRATR_HIDDEN, false, &pItem));
+ query.ClearItem(RES_CHRATR_HIDDEN);
+ rUndoManager.Undo();
+ CPPUNIT_ASSERT(pShell->GetCursor()->GetNode().GetTextNode()->GetTextAttrForCharAt(0, RES_TXTATR_FLYCNT));
+ CPPUNIT_ASSERT(pShell->GetCursor()->GetNode().GetTextNode()->GetTextAttrForCharAt(4, RES_TXTATR_FLYCNT));
+ CPPUNIT_ASSERT_EQUAL(size_t(2), pDoc->GetFlyCount(FLYCNTTYPE_GRF));
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(5), pShell->GetCursor()->GetNode().GetTextNode()->Len());
+ CPPUNIT_ASSERT_EQUAL(OUString(OUStringLiteral1(CH_TXTATR_BREAKWORD) + "foo" + OUStringLiteral1(CH_TXTATR_BREAKWORD)), pShell->GetCursor()->GetNode().GetTextNode()->GetText());
+ pShell->GetCursor()->GetNode().GetTextNode()->GetAttr(query, 0, 1);
+// CPPUNIT_ASSERT_EQUAL(SfxItemState::DEFAULT, query.GetItemState(RES_CHRATR_HIDDEN, false, &pItem));
+ CPPUNIT_ASSERT(SfxItemState::DEFAULT == query.GetItemState(RES_CHRATR_HIDDEN, false, &pItem));
+ query.ClearItem(RES_CHRATR_HIDDEN);
+ pShell->GetCursor()->GetNode().GetTextNode()->GetAttr(query, 1, 4);
+// CPPUNIT_ASSERT_EQUAL(SfxItemState::SET, query.GetItemState(RES_CHRATR_HIDDEN, false, &pItem));
+ CPPUNIT_ASSERT(SfxItemState::SET == query.GetItemState(RES_CHRATR_HIDDEN, false, &pItem));
+ CPPUNIT_ASSERT(static_cast<SvxCharHiddenItem const*>(pItem)->GetValue());
+ query.ClearItem(RES_CHRATR_HIDDEN);
+ rUndoManager.Redo();
+ CPPUNIT_ASSERT(pShell->GetCursor()->GetNode().GetTextNode()->GetTextAttrForCharAt(0, RES_TXTATR_FLYCNT));
+ CPPUNIT_ASSERT_EQUAL(size_t(1), pDoc->GetFlyCount(FLYCNTTYPE_GRF));
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), pShell->GetCursor()->GetNode().GetTextNode()->Len());
+ pShell->GetCursor()->GetNode().GetTextNode()->GetAttr(query, 0, 1);
+// CPPUNIT_ASSERT_EQUAL(SfxItemState::DEFAULT, query.GetItemState(RES_CHRATR_HIDDEN, false, &pItem));
+ CPPUNIT_ASSERT(SfxItemState::DEFAULT == query.GetItemState(RES_CHRATR_HIDDEN, false, &pItem));
+ query.ClearItem(RES_CHRATR_HIDDEN);
+ rUndoManager.Undo();
+ CPPUNIT_ASSERT(pShell->GetCursor()->GetNode().GetTextNode()->GetTextAttrForCharAt(0, RES_TXTATR_FLYCNT));
+ CPPUNIT_ASSERT(pShell->GetCursor()->GetNode().GetTextNode()->GetTextAttrForCharAt(4, RES_TXTATR_FLYCNT));
+ CPPUNIT_ASSERT_EQUAL(size_t(2), pDoc->GetFlyCount(FLYCNTTYPE_GRF));
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(5), pShell->GetCursor()->GetNode().GetTextNode()->Len());
+ CPPUNIT_ASSERT_EQUAL(OUString(OUStringLiteral1(CH_TXTATR_BREAKWORD) + "foo" + OUStringLiteral1(CH_TXTATR_BREAKWORD)), pShell->GetCursor()->GetNode().GetTextNode()->GetText());
+ pShell->GetCursor()->GetNode().GetTextNode()->GetAttr(query, 0, 1);
+// CPPUNIT_ASSERT_EQUAL(SfxItemState::DEFAULT, query.GetItemState(RES_CHRATR_HIDDEN, false, &pItem));
+ CPPUNIT_ASSERT(SfxItemState::DEFAULT == query.GetItemState(RES_CHRATR_HIDDEN, false, &pItem));
+ query.ClearItem(RES_CHRATR_HIDDEN);
+ pShell->GetCursor()->GetNode().GetTextNode()->GetAttr(query, 1, 4);
+// CPPUNIT_ASSERT_EQUAL(SfxItemState::SET, query.GetItemState(RES_CHRATR_HIDDEN, false, &pItem));
+ CPPUNIT_ASSERT(SfxItemState::SET == query.GetItemState(RES_CHRATR_HIDDEN, false, &pItem));
+ CPPUNIT_ASSERT(static_cast<SvxCharHiddenItem const*>(pItem)->GetValue());
+ query.ClearItem(RES_CHRATR_HIDDEN);
+
+ // delete from the end
+ pShell->SelectText(1, 5);
+ rIDCO.DeleteAndJoin(*pShell->GetCursor());
+ CPPUNIT_ASSERT(pShell->GetCursor()->GetNode().GetTextNode()->GetTextAttrForCharAt(0, RES_TXTATR_FLYCNT));
+ CPPUNIT_ASSERT_EQUAL(size_t(1), pDoc->GetFlyCount(FLYCNTTYPE_GRF));
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), pShell->GetCursor()->GetNode().GetTextNode()->Len());
+ pShell->GetCursor()->GetNode().GetTextNode()->GetAttr(query, 4, 5);
+// CPPUNIT_ASSERT_EQUAL(SfxItemState::DEFAULT, query.GetItemState(RES_CHRATR_HIDDEN, false, &pItem));
+ CPPUNIT_ASSERT(SfxItemState::DEFAULT == query.GetItemState(RES_CHRATR_HIDDEN, false, &pItem));
+ query.ClearItem(RES_CHRATR_HIDDEN);
+ rUndoManager.Undo();
+ CPPUNIT_ASSERT(pShell->GetCursor()->GetNode().GetTextNode()->GetTextAttrForCharAt(0, RES_TXTATR_FLYCNT));
+ CPPUNIT_ASSERT(pShell->GetCursor()->GetNode().GetTextNode()->GetTextAttrForCharAt(4, RES_TXTATR_FLYCNT));
+ CPPUNIT_ASSERT_EQUAL(size_t(2), pDoc->GetFlyCount(FLYCNTTYPE_GRF));
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(5), pShell->GetCursor()->GetNode().GetTextNode()->Len());
+ CPPUNIT_ASSERT_EQUAL(OUString(OUStringLiteral1(CH_TXTATR_BREAKWORD) + "foo" + OUStringLiteral1(CH_TXTATR_BREAKWORD)), pShell->GetCursor()->GetNode().GetTextNode()->GetText());
+ pShell->GetCursor()->GetNode().GetTextNode()->GetAttr(query, 4, 5);
+// CPPUNIT_ASSERT_EQUAL(SfxItemState::DEFAULT, query.GetItemState(RES_CHRATR_HIDDEN, false, &pItem));
+ CPPUNIT_ASSERT(SfxItemState::DEFAULT == query.GetItemState(RES_CHRATR_HIDDEN, false, &pItem));
+ query.ClearItem(RES_CHRATR_HIDDEN);
+ pShell->GetCursor()->GetNode().GetTextNode()->GetAttr(query, 1, 4);
+// CPPUNIT_ASSERT_EQUAL(SfxItemState::SET, query.GetItemState(RES_CHRATR_HIDDEN, false, &pItem));
+ CPPUNIT_ASSERT(SfxItemState::SET == query.GetItemState(RES_CHRATR_HIDDEN, false, &pItem));
+ CPPUNIT_ASSERT(static_cast<SvxCharHiddenItem const*>(pItem)->GetValue());
+ query.ClearItem(RES_CHRATR_HIDDEN);
+ rUndoManager.Redo();
+ CPPUNIT_ASSERT(pShell->GetCursor()->GetNode().GetTextNode()->GetTextAttrForCharAt(0, RES_TXTATR_FLYCNT));
+ CPPUNIT_ASSERT_EQUAL(size_t(1), pDoc->GetFlyCount(FLYCNTTYPE_GRF));
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), pShell->GetCursor()->GetNode().GetTextNode()->Len());
+ pShell->GetCursor()->GetNode().GetTextNode()->GetAttr(query, 4, 5);
+// CPPUNIT_ASSERT_EQUAL(SfxItemState::DEFAULT, query.GetItemState(RES_CHRATR_HIDDEN, false, &pItem));
+ CPPUNIT_ASSERT(SfxItemState::DEFAULT == query.GetItemState(RES_CHRATR_HIDDEN, false, &pItem));
+ query.ClearItem(RES_CHRATR_HIDDEN);
+ rUndoManager.Undo();
+ CPPUNIT_ASSERT(pShell->GetCursor()->GetNode().GetTextNode()->GetTextAttrForCharAt(0, RES_TXTATR_FLYCNT));
+ CPPUNIT_ASSERT(pShell->GetCursor()->GetNode().GetTextNode()->GetTextAttrForCharAt(4, RES_TXTATR_FLYCNT));
+ CPPUNIT_ASSERT_EQUAL(size_t(2), pDoc->GetFlyCount(FLYCNTTYPE_GRF));
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(5), pShell->GetCursor()->GetNode().GetTextNode()->Len());
+ CPPUNIT_ASSERT_EQUAL(OUString(OUStringLiteral1(CH_TXTATR_BREAKWORD) + "foo" + OUStringLiteral1(CH_TXTATR_BREAKWORD)), pShell->GetCursor()->GetNode().GetTextNode()->GetText());
+ pShell->GetCursor()->GetNode().GetTextNode()->GetAttr(query, 4, 5);
+// CPPUNIT_ASSERT_EQUAL(SfxItemState::DEFAULT, query.GetItemState(RES_CHRATR_HIDDEN, false, &pItem));
+ CPPUNIT_ASSERT(SfxItemState::DEFAULT == query.GetItemState(RES_CHRATR_HIDDEN, false, &pItem));
+ query.ClearItem(RES_CHRATR_HIDDEN);
+ pShell->GetCursor()->GetNode().GetTextNode()->GetAttr(query, 1, 4);
+// CPPUNIT_ASSERT_EQUAL(SfxItemState::SET, query.GetItemState(RES_CHRATR_HIDDEN, false, &pItem));
+ CPPUNIT_ASSERT(SfxItemState::SET == query.GetItemState(RES_CHRATR_HIDDEN, false, &pItem));
+ CPPUNIT_ASSERT(static_cast<SvxCharHiddenItem const*>(pItem)->GetValue());
+ query.ClearItem(RES_CHRATR_HIDDEN);
+}
+
void SwUiWriterTest::testUndoCharAttribute()
{
// Create a new empty Writer document
More information about the Libreoffice-commits
mailing list